Best way to display open/closed for doors and windows

Hello,
I have problems finding an example of some kind of Implementation of door or window state. I just want to display somehow If the garage is open or closed.
I have
Grafana
Influxdb (there is no need to save the values of the doors)
Node-red

I can send the values via mqtt. I could send 1/0 or open/closed. I could do that as simple string or in json format.

Can anyone help me doing that? Or link an example? Or at least the correct plugin?

Thank you so much.
Greetings
Sven

This should be pretty straightforward to set up and test…

  1. Node red (using sensors or MQTT or such) to determine open / closed status of door, outputting the payload as 1 or 0 into an Influx node, logged every 5 seconds or whatever interval you wish.
  2. Grafana pointed at the InfluxDB as the datasource
  3. Create Stat Panel in Grafana with query to read 0 or 1 status and display as Open or Closed in the Stat panel.

PS: See this video for a good intro to Node-RED + Influx + Grafana: https://youtu.be/JdV4x925au0 Not sure if you have seen it before or if it would be helpful, but it was for me.

Thank you very much. I did it excatly like that and it works pretty good.
Thank you!

Hello,
i also used a window/door sensor for the first time but figured out another solution. By using the standard Stat Panel as Visualisazion you can just map the values of your measurement. My sensor sends the value 17 (no contact, open) or the value 85 (contact, closed). So i just use the value mapping as shown in the screenshot (german). I also use an InfluxDB as datasource.

Greetings
VGE

And here’s another way…if your sensor transmits Boolean values, use a State Timeline like this:

This topic was automatically closed after 365 days. New replies are no longer allowed.