Improved BatteryStatus plot

125 views
Skip to first unread message

Luc Heijst

unread,
Feb 18, 2017, 8:03:31 AM2/18/17
to weewx-user
I have got several devices which produce a bad battery status with value=1 when bad. These tags were combined in one plot to save space on my web page.
Originally I created line plots varying from 0 (batt. ok) to 1 (batt. low). The disadvantage of this plot type is that only one low battery status is shown. The other low battery line plots (when they exists) are overwritten by the first one.
So I searched a way to overcome this problem. The solution is to use the sum value for each plot with each a unique aggregate_interval.
See the code below of my skin.conf file and the attached plots of the old and new presentation.

        [[[weekbattery]]]
            image_height = 140
            # Make the y-axis increment at least 0.02 for the battery plot:
            yscale                   = None, None, 0.02
            plot_type                = bar
            [[[[txBatteryStatusSum]]]]
                label = Battery status Davis tx
                data_binding = vpro_binding
                data_type            = txBatteryStatus
                aggregate_type       = sum
                aggregate_interval   = 1200    # == 20 minutes
            [[[[inTempBatteryStatusSum]]]]
                label = Opus console
                data_binding = ws28_binding
                data_type            = inTempBatteryStatus
                aggregate_type       = sum
                aggregate_interval   = 1800    # == 30 minutes
            [[[[outTempBatteryStatusSum]]]]
                label = tmp/hum
                data_binding = ws28_binding
                data_type            = outTempBatteryStatus
                aggregate_type       = sum
                aggregate_interval   = 2400    # == 40 minutes 
            [[[[windBatteryStatusSum]]]]
                label = wind
                data_binding = ws28_binding
                data_type            = windBatteryStatus
                aggregate_type       = sum
                aggregate_interval   = 3000    # == 50 minutes
            [[[[rainBatteryStatusSum]]]]
                label = rain
                data_binding = ws28_binding
                data_type            = rainBatteryStatus
                aggregate_type       = sum
                aggregate_interval   = 3600    # == 60 minutes
                
Cheers,
Luc
weekbattery.png
monthbattery.png
yearbattery.png
weekbattery.png
monthbattery.png
yearbattery.png

Jerry Simonowits

unread,
Feb 22, 2017, 9:43:46 AM2/22/17
to weewx-user
Do you know if this data is available from the Accurate line of sensors ? If so, where does this code go ?

Jerry, KB2GCG

mwall

unread,
Feb 22, 2017, 10:01:04 AM2/22/17
to weewx-user
On Wednesday, February 22, 2017 at 9:43:46 AM UTC-5, Jerry Simonowits wrote:
Do you know if this data is available from the Accurate line of sensors ? If so, where does this code go ?

acurite hardware reports only one battery status:

http://weewx.com/docs/hardware.htm#acurite_notes

use the outTempBatteryStatus variable in your templates.

m

Jerry Simonowits

unread,
Feb 23, 2017, 2:21:18 PM2/23/17
to weewx...@googlegroups.com
Thanks much. All of the code I see for battery information seems to be for an alarm. I’m more looking for a graph to add that would show the state of the battery over time. Any clues ?

Jerry

--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/_-k3DLeJk6Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jerry

Gerald (Jerry) Simonowits CISM, CISSP, CRISC

Andrew Milner

unread,
Feb 23, 2017, 9:53:34 PM2/23/17
to weewx-user
What does your database contain in the outTempBatteryStatus field?  If it contains varying values then you just need to add the plots of outTempBatteryStatus to your skin to get your graph.
Reply all
Reply to author
Forward
0 new messages