Format Battery as Percent

78 views
Skip to first unread message

Wiggytoo

unread,
Jul 9, 2024, 6:58:27 AM7/9/24
to weewx-user
Hi - I've had a good look for this but not found how to do it, I have added the following observations from the Netatmo driver to my site (skin is Belchertown).

"rainBatteryStatus", "windBatteryStatus", "outTempBatteryStatus"

I'd like to format them as % but can't work out how to do it, any help apprecaited.

Site is here


Items are here:

Screenshot 2024-07-09 115746.png

Thanks in advance.
Gav

Tom Keffer

unread,
Jul 9, 2024, 10:00:18 AM7/9/24
to weewx...@googlegroups.com
See the section Assigning a unit group in the Customization Guide. 

You will want to assign your new observation types to group "group_percent".

--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/0f555f15-094b-4ca7-b1ad-b7ea688ebec8n%40googlegroups.com.

Wiggytoo

unread,
Jul 9, 2024, 10:13:05 AM7/9/24
to weewx-user
Many thanks - will take a look in more detail, for observation types that come directly from the Netatmo driver (i.e. I don't have an equivalent  user/electricity.py would I just assign the main skin.py file?

Regards,
Gav

Wiggytoo

unread,
Jul 9, 2024, 10:35:01 AM7/9/24
to weewx-user
Ignore that question - I worked it out from the advice you gave and added it to the main belchertown.py script as below.

Many thanks for your help and swift response.

#Extend dictionary for battery percent observations
weewx.units.obs_group_dict['rainBatteryStatus'] = 'group_percent'
weewx.units.obs_group_dict['windBatteryStatus'] = 'group_percent'
weewx.units.obs_group_dict['outTempBatteryStatus'] = 'group_percent'
#end

Gav
Reply all
Reply to author
Forward
0 new messages