Ecowitt Gate Driver - are "weekRain" and "p_rainRate" missing in default_groups?

58 views
Skip to first unread message

michael.k...@gmx.at

unread,
Jun 15, 2023, 3:27:25 PM6/15/23
to weewx-user
Version of driver used: v0.5.0b5

In default_groups:

Shouldn't there be values for "weekRain" and "p_rainRate"? Without them specified I have issues with the unit.

default_groups = {'extraTemp9': 'group_temperature',
'extraTemp10': 'group_temperature',
'extraTemp11': 'group_temperature',
'extraTemp12': 'group_temperature',
'extraTemp13': 'group_temperature',
'extraTemp14': 'group_temperature',
'extraTemp15': 'group_temperature',
'extraTemp16': 'group_temperature',
'extraTemp17': 'group_temperature',
'weekRain': 'group_rain',
'p_rain': 'group_rain',
'p_rainRate': 'group_rainrate',
'p_stormRain': 'group_rain',
'p_dayRain': 'group_rain',
'p_weekRain': 'group_rain',
'p_monthRain': 'group_rain',
'p_yearRain': 'group_rain'}


gjr80

unread,
Jun 15, 2023, 3:56:37 PM6/15/23
to weewx-user
Yes they should be included, and to take it further so should dayRain, monthRain , yearRain, totalRain and stormRain.

To be fixed in the next release. In the interim the following code added to user/extensions.py will achieve the same end:

import weewx.units
weewx.units.obs_group_dict['dayRain'] = 'group_rain'
weewx.units.obs_group_dict['weekRain'] = 'group_rain'
weewx.units.obs_group_dict['monthRain'] = 'group_rain'
weewx.units.obs_group_dict['yearRain'] = 'group_rain'
weewx.units.obs_group_dict['totalRain'] = 'group_rain'
weewx.units.obs_group_dict['stormRain'] = 'group_rain'
weewx.units.obs_group_dict['p_rainRate'] = 'group_rainrate

Gary

michael.k...@gmx.at

unread,
Jun 16, 2023, 2:50:00 AM6/16/23
to weewx-user
Thanks for confirming. Since you've already identified more fields than I did and they are already in the master, there's no need for a pull request :)
Interestingly, for dayRainmonthRain , yearRain, and stormRain I already have a mapping. Maybe I should take a closer look, where these mapping are coming from, on my installation, if they are not weewx standard.

Btw.: I'm new to the "Ecowitt universe" and really appreciate your work on the driver. The variety of supported hardware is imho one of the key factors for weewx' success.

gjr80

unread,
Jun 16, 2023, 3:13:36 AM6/16/23
to weewx-user
The approach I took when writing the driver was to pass through all of the available Ecowitt fields, whether or not they are used by WeeWX, so the user can make use of them if they wish (eg WeeWX does not need/use day rain, week rain, month rain etc fields but the driver uses one of them to derive WeeWX field rain, but the driver already knows what units these cumulative rain fields use so the driver does not need a unit group). What I did was apply unit groups to all of the Ecowitt fields that equate to fields in the WeeWX extended schema. This was the wrong approach, as invariably there will users wishing to use these additional fields (and they are not just rain based, off the top of my head there is a UV based one as well) and without a unit group they will cause errors for anyone wanting to display/use them outside of their native (Ecowitt) units. So if an Ecowitt field is being passed through by the driver it should come with a unit group assigned if one exists, this is the approach that will be taken in the next driver release.

In terms of mapping, yes you should have a mapping for all available Ecowitt fields the driver does this by default, it is just the unit group that is missing from some.

Gary

michael.k...@gmx.at

unread,
Jun 16, 2023, 3:30:36 AM6/16/23
to weewx-user
That is what I meant before: for  dayRainmonthRain , yearRain, and stormRain I already have a unit group assigned, without knowing where this assignment occurs. 

To illustrate: I have MQTT (https://github.com/matthewwall/weewx-mqtt) enabled and bound to "loop": 

dayRain is emitted as dayRain_mm, (also without the fix in the latest Driver version) and 
stormRain is emitted as stormRain_mm, (also without the fix in the latest Driver version) while
weekRain is emitted as  weekRain,  without the unit (fixed with assignment in the new Driver version) and
p_rainRate is emitted as p_rainRate, without the unit (fixed with assignment in the new Driver version).

And that was how and where I found out, that something is missing. I don't know by yet if these unit group assignments are done by weewx or a weewx-shipped standard driver or if this is something I manually did on my installation and can't remember.
Reply all
Reply to author
Forward
0 new messages