I defined a new aggregation type called 'energy_integral' for the 
observation type 'radiation'. And I added new unit groups to reflect the 
unit of the result:

weewx.units.agg_group.setdefault('energy_integral','group_radiation_energy') 

weewx.units.USUnits.setdefault('group_radiation_energy','watt_hour_per_meter_squared')
 

weewx.units.MetricUnits.setdefault('group_radiation_energy','watt_hour_per_meter_squared')
 

weewx.units.MetricWXUnits.setdefault('group_radiation_energy','watt_hour_per_meter_squared')
 

weewx.units.default_unit_format_dict.setdefault('watt_hour_per_meter_squared',"%.0f")
 

weewx.units.default_unit_label_dict.setdefault('watt_hour_per_meter_squared',u" 
Wh/m²") 

Then I defined a get_aggregate() function that returns the value.

If I use a tag like $yesterday.radiation.energy_integral then I get the 
right unit Wh/m^2.

But the graph is labelled with the unit label of the original value. That 
is W/m^2 (without h) instead of Wh/m^2.

I wonder what I could do to have the correct unit label in graphs, too?

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-development/15a59830-708a-4888-a04f-46f4a802aeb2n%40googlegroups.com.

Reply via email to