On Friday, 26 April 2019 23:39:46 UTC+10, wysiwyg wrote:
>
> Then, a question comme to my mind...
> I guess weewx expect then "amp" values in database, while my existing 
> records (uptonow unitless) have records in mA.
> For example, if my database contains 120  (that I expect to be 120mA), 
> weewx may display 120000mA 
>
> Can I redefine the default database unit ?
> Maybe it's not recommended and I could create a full new group, for 
> example "group_current" 
>

Correct, WeeWX will expect amps. There are two things you can do. First you 
could modify your code so that amps are ingested by WeeWX rather than 
milliamps (depending on your setup this could be done in WeeWX code or some 
external code). You could then stop WeeWX, run a simple SQL query to divide 
all current fields by 1000 and then restart WeeWX.

The second approach (untested) would involve changing the group_current 
setting to 'milliamp' for the unit system you use in your database, for 
example if you use the default US customary units you would need to use the 
following line:

weewx.units.USUnits['group_resistance'] = 'milliamp'

or if you use a Metric database you would change MetricUnits and so on. 
This approach should not require any change to your database or any other 
code.

If it were me I would try to use the first approach if possible. In my 
experience the more often you deviate from a 'standard' WeeWX install the 
more likely you are to run into issues during upgrades, reinstalls etc in 
the future. Don't get me wrong either way will work fine, it is just the 
second approach might cause the odd minor issue or two into the future.

Gary



-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to