Comments in-line below
<https://github.com/glennmckechnie/rorpi-raspberrypi>

On 6 December 2016 at 01:06, 'Björn Baldus' via weewx-user <
weewx-user@googlegroups.com> wrote:

> okay it works great...
>
> an additional question...
> i am editing the config.json right now...
> can you help me with the correct units please?
>
>
> // The table columns to expose and their definitions. Only the columns
> listed here
>
[...]

>             // is defined in 'include/Unit.class.php'.
>

Have a look in that file for the units that mesowx knows about and use
those. If what you want is missing from there then it gets complicated as
you'll need to add them and mesowx is sulky silent when reporting error
messages. That is, you'll most likely be met with nothing but a blank
screen in your browser if you get something wrong.
The only workaround to the silent treatment (for me anyway) is to make
small changes, ones that are easily reversed when experimenting. When you
get a working version save it as a milestone, you'll probably need to
revert to it at some point.



>             //
>             // Note: it's not currently not possible to define custom
> units/unit conversions, but
>             //       this feature is planned for a future release.
>             //
>             "columns" : {
>                 "dateTime" :     {"type" : "number", "unit" : "s"},
>                 "interval" :     {},
>                 "barometer" :   {"unit" : "mmHg"},
> "pressure" : {"unit" : "mmHg"},
> "altimeter" : {"unit" : "m"},
>                 "inTemp" :       {"unit" : "c"},
>                 "outTemp" :     {"unit" : "c"},
>                 "inHumidity" :   {"unit" : "perc"},
>                 "outHumidity" : {"unit" : "perc"},
>                 "windSpeed" :   {"unit" : "kph"},
>                 "windDir" :     {"unit" : "deg"},
>                 "windGust" :     {"unit" : "kph"},
>                 "windGustDir" : {"unit" : "deg"},
>                 "rainRate" :     {"unit" : "mmHr"},
>                 "rain" :         {"unit" : "mm"},
>                 "dewpoint" :     {"unit" : "c"},
>                 "windchill" :   {"unit" : "c"},
>                 "heatindex" :   {"unit" : "c"},
>

I'd be careful of changing indents within these files, they can be extra
sensitive to changes in whitespace (and commas, and colns, and...). What
follows appears to have an extra tab spacing - I'd remove that and continue
as the original has it formatted.


> "extraTemp1" : {"unit" : "c"},
> "extraTemp2" : {"unit" : "c"},
> "extraTemp3" : {"unit" : "c"},
> "soilTemp1" : {"unit" : "c"},
> "soilTemp2" : {"unit" : "c"},
> "soilTemp3" : {"unit" : "c"},
> "soilTemp4" : {"unit" : "c"},
> "leafTemp1" : {"unit" : "c"},
> "leafTemp2" : {"unit" : "c"},
> "extraHumid1" :   {"unit" : "perc"},
> "extraHumid2" : {"unit" : "perc"},
> "soilMoist1" :   {"unit" : "perc"},
> "soilMoist2" :   {"unit" : "perc"},
> "soilMoist3" :   {"unit" : "perc"},
> "soilMoist4" :   {"unit" : "perc"},
> "leafWet1" :   {"unit" : "perc"},
> "leafWet2" :   {"unit" : "perc"},
> "rxCheckPercent" :   {"unit" : "perc"},
> "txBatteryStatus" :   {"unit" : "perc"},
> "consBatteryVoltage" :   {"unit" : "perc"},
> "hail" :   {"unit" : "perc"},
> "hailRate" :   {"unit" : "perc"},
> "heatingTemp" :   {"unit" : "c"},
> "heatingVoltage" :   {"unit" : "perc"},
> "supplyVoltage" :   {"unit" : "perc"},
> "referenceVoltage" :   {"unit" : "perc"},
> "windBatteryStatus" :   {"unit" : "perc"},
> "rainBatteryStatus" : {"unit" : "perc"},
> "outTempBatteryStatus" : {"unit" : "perc"},
> "inTempBatteryStatus" : {"unit" : "perc"},
> "ET" : {"unit" : "perc"}
>
>
>
> ??? How should the correct congig.js look like?
>

The units you've added above; do they tally with how weewx describes them?
Have a look within the file weewx/units.py where you'll find, for example...

obs_group_dict = ListOfDicts(
[...]
"soilMoist1"         : "group_moisture",
[...]
which leads to...
MetricUnits = ListOfDicts({
[...]
"group_moisture"    : "centibar",
[...]

Not percent as you have it described above
"soilMoist1" :   {"unit" : "perc"}

Similarily with...
"heatingVoltage"     : "group_volt",
leads to...
"group_volt"        : "volt",
again, not perc(ent)

As a working example, I had to add "volt" to my Mesowx installation.
I did that within js/mesowx.js by adding that unit , as follows...

mesowx.Unit = (function() {

    var Unit = {
[...]
        volt : new meso.UnitDef("volt", 'V') // volt
    };

 Also adding to include/Unit.class.php (and note the comment, it meant
something to me at the time :-)
class Unit {
[...]
 const volt = "volt"; // volt - not registering??
}

Doing the above I'm able to use volt within js/Config.js without getting
errors in the browser output... or at least the silent treatment. (And
ignore my database field names - I co-opted those fields and never went
back and created new, specific - ie: nonconfusing - fields)

js/Config.js
 Config.fieldDefaults = {
[...]
'inTempBatteryStatus':  new meso.FieldDef('inTempBatteryStatus',
mesowx.Unit.volt, 2,     meso.Agg.avg,   'InHumidity voltage'),
'outTempBatteryStatus': new meso.FieldDef('outTempBatteryStatus',
mesowx.Unit.volt, 2,     meso.Agg.avg,   'outHumidity voltage'),
'windBatteryStatus':    new meso.FieldDef('windBatteryStatus',
mesowx.Unit.volt, 2,     meso.Agg.avg,   'Vane voltage'),
'rainBatteryStatus':    new meso.FieldDef('rainBatteryStatus',
mesowx.Unit.volt, 2,     meso.Agg.avg,   'Barometer voltage')
};

also within include/config.json
"columns" : {
[...]
"inTempBatteryStatus" : {"unit" : "volt"},
"outTempBatteryStatus" : {"unit" : "volt"},
"rainBatteryStatus" : {"unit" : "volt"},
"windBatteryStatus" : {"unit" : "volt"}
   },

To recap. With mesowx, make small changes at a time. Once you get the hang
of its quirks perhaps you'll be able to wade in and do them all as a batch
but do start small.


Cheers
 Glenn

rorpi - read only raspberry pi + weewx: now with scripts
<https://github.com/glennmckechnie/rorpi-raspberrypi>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to