Unit override

40 views
Skip to first unread message

Tarmo

unread,
Dec 21, 2019, 3:04:49 PM12/21/19
to weewx-user
I wrote a new service reading energy production from heatpump. I would like to store the value in "soilTemp1" since it is unused for me.

The question is, how I can override the "degree_C" with "watt_hour" or anything which is not converted from Fahrenheit to Celsius? (I am using metric units).

In skin.conf I have 
        [[[dayenergy]]]
            y_label
= "kWh"
            yscale
= None, None, 0.1
            plot_type
= bar
           
[[[[soilTemp3]]]]
                aggregate_type
= sum
                aggregate_interval
= 3600
                label
= Energy (hourly total)



The image y-axis has kWh values which are treated like temperatures in Fahrenheit converted to Celsius.  

dayenergy.png



Thank you very much!

gjr80

unread,
Dec 21, 2019, 3:52:08 PM12/21/19
to weewx-user
Hi,

You need to assign a different unit group to the field soilTemp1, the clue is in the ‘Assigning a unit group’ section (http://weewx.com/docs/customizing.htm#Assigning_a_unit_group) in the Customization Guide. Try adding the following to /home/weewx/bin/user/extensions.py (untested):

import weewx.units
weewx.units.obs_group_dict['soilTemp1'] = 'group_energy’

Save then restart WeeWX, you should then be able to use soilTemp1 in reports and plots as watt_hour.

Gary

Tarmo

unread,
Dec 21, 2019, 4:17:14 PM12/21/19
to weewx-user
Gary, thank you very much. 
Happy holidays! :) 
Reply all
Reply to author
Forward
0 new messages