Managing a boolean variable with weewx

101 views
Skip to first unread message

Remy Lavabre

unread,
Nov 5, 2023, 4:44:33 AM11/5/23
to weewx-user
Good morning,
A "simple" question (apparently): I have a boolean type variable in my WeeWX database (ON/Off state).
Is it possible to show this state in a diagram? For example, draw the curve of an indoor temperature and at the same time on the graph the "ON" or "OFF" state of the Boolean variable?
If yes, how... ?? ;-)
Thank you so much...

Tom Keffer

unread,
Nov 5, 2023, 6:46:38 AM11/5/23
to weewx...@googlegroups.com
Unfortunately, the plotting library in WeeWX is capable of using only one y-axis scale. A limitation, to be sure.

--
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/d04ae7c5-7f56-4444-b60c-7cadffda172cn%40googlegroups.com.

Remy LAVABRE

unread,
Nov 5, 2023, 8:12:09 AM11/5/23
to weewx...@googlegroups.com
OK thanks. but would you have an idea about visualizing the on/off state on a graph? Is it better to record the values ​​0 and 1 instead of true false to ultimately visualize this data in a graph?
Thank you Tom


Message has been deleted

Tom Keffer

unread,
Nov 5, 2023, 9:46:15 AM11/5/23
to weewx...@googlegroups.com
You could create such a variable. Say your boolean value is "heater". Then put in [[Corrections]]

heater_value = 1 if heater else 0

Then plot "heater_value".

If you really want it in the same plot as inside temperature, but you don't care what the actual value is, you could do something like

    heater_value = 69 if heater else 68

This is assuming US Units. Then you could plot inTemp and heater_value together.

Remy Lavabre

unread,
Nov 5, 2023, 11:20:56 AM11/5/23
to weewx-user

Thank you Tom for this suggestion which I will follow...

One last quick question:

- My boolean variable in the weewx.sdb database is heater -> OK
- For example, I add a "heater_value" variable in the [[Corrections]] section of the weewx.conf file -> OK

My question: Should I declare the "heater_value" variable elsewhere to be able to use it in the graphics or is that enough?

Thanks Tom for your idea! ;-)

michael.k...@gmx.at

unread,
Nov 5, 2023, 11:33:31 PM11/5/23
to weewx-user
Two other thoughts:

1. Use a skin that supports charts with multiple y-Axis.
2. I don't know if this is manageable with weewx currently: make the chart show a different background color, when the variable is true/false. Just like the day/night background.

Reply all
Reply to author
Forward
0 new messages