I built the MySensors Weather Station and have a rain sensor in it.
This sensor presents a “0” or “1”.
When looking at the historic values in the Graph function of Pimatic I would expect to to see a steep change from on to off (like with PIR’s) but see diagonal lines from the last moment with switching to “off” status to the new moment when switching on “on” status and vise versa.
How can I represent this sensor like the PIR in the historic Graph having vertical lines at moments of status change?
-
Presentation Graph of boolean values
-
It seems your data format is wrong. On the right of your picture i see the format is °C.
Please show your config. -
Hi @Flop2006,
You see the temperature unit because it is a weather station having multiple sensors in it with each their own units.
Units stay visible in the graph even when the related sensor is deselected.
The config for this sensor, where “Regen” is the rain sensor (sensorid = 5):{ "id": "weerstation", "name": "Weerstation", "class": "MySensorsMulti", "attributes": [ { "name": "Luchtvochtigheid", "nodeid": 38, "sensorid": 0, "sensortype": 1, "type": "float", "booleanlabels": [ true, false ], "acronym": "RH", "unit": "%" }, { "name": "Temperatuur", "nodeid": 38, "sensorid": 1, "sensortype": 0, "type": "float", "booleanlabels": [ true, false ], "acronym": "T(h)", "unit": "°C" }, { "name": "Licht", "nodeid": 38, "sensorid": 2, "sensortype": 23, "type": "integer", "booleanlabels": [ true, false ], "acronym": "Licht", "unit": "lux" }, { "name": "Barometer", "nodeid": 38, "sensorid": 3, "sensortype": 4, "type": "float", "booleanlabels": [ true, false ], "acronym": "P", "unit": "mbar" }, { "name": "Temperatuur (b)", "nodeid": 38, "sensorid": 4, "sensortype": 0, "type": "float", "booleanlabels": [ true, false ], "acronym": "T(b)", "unit": "°C" }, { "name": "Regen", "nodeid": 38, "sensorid": 5, "sensortype": 16, "type": "integer", "booleanlabels": [ true, false ], "acronym": "Regen" }, { "name": "Battery", "nodeid": 38, "sensortype": 3, "type": "battery", "acronym": "Bat", "unit": "%", "booleanlabels": [ true, false ] } ], "xAttributeOptions": [] }
-
The problem is that the “Regen” attribute is of type “integer” not a “boolean”. You seem to have defined “booleanlabels” for it which might be a decoration for pimatic-sensor to present it as an boolean value, however, the graph facility is a core component and only recognizes the given data type.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig thank you for the response.
I thought it might be something like that.
The Rain Drop sensor is sending “0” or “1” as value.
Can I manipulate the config to handle these values as boolean? -
@Petjepet I am not 100% sure but from looking at the code I think this will work. Note beyond, the property “booleanlabels” only seems to be applied if the attribute “type” is boolean.
{ "name": "Regen", "nodeid": 38, "sensorid": 5, "sensortype": 16, "type": "boolean", "booleanlabels": [ true, false ], "acronym": "Regen" },
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig this seems to work
I now see in the graph the dashed line for “Regen”.
But now the order of the items to show have switched: In the legend of the graph “Battery” was last item before (also in definition of weather station it is) but now the “Regen” sensor took last place. So they switched position, but only in the graph view.
Can one have influence on that? -
@Petjepet said in Presentation Graph of boolean values:
Can one have influence on that?
I guess this is because a new data object has been created for “Regen” in the database and pimatic fetches data objects from the database without any sorting applied. I don’t think there is an easy way of changing this.
What you can try:
- make a copy of the device config to be able to add it easily later on
- remove the device from the config (you can use the device editor for this)
- open the Database view of the frontend and delete the corresponding entries listed under “Problems”
- add the device again (you may use the configuration editor to insert the device configuration snippet)
- restart
Now, you should see the graph items in the right order
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig that didn’t work.
Thanks anyway for trying to help.