Garage open/closed via mqtt to node-red and grafana


I want to visualize the state of my garage. There is a sensor which can send a individual mqtt message to node-red. In the past, I was using an other system so I just sent "open" and "closed".
Now I have node-red with grafana (and influxdb). I am using it by sending mqtt-messages in json format (temp, hum, voltage of battery driven devices) and visualize it in grafana.
Now I would like to do something similar for the garage door.
What would be a good way to make this work?
I could not find an example yet.
Maybe someone can help me.

Thank you very much.

What don't you know how to do? Have you got the door sensor sending it's state to node-red?

yes I have.
but for example shall I send 1 and 0 instead of open and closed? is a kind of json string needed or not and do I have to store the state in influxdb? I think not.
And how can i visualize it in grafana?
Maybe a kind of "table cell" which could change the color from green to red and containing a text (open/closed)

It is possible to display current values from MQTT in grafana, I haven't got a link at the moment but I expect Google will find it. Otherwise put it in influx and display it from there using whatever grafana panel type you like. Decide what you want to show in grafana, then work back from there to see what to put in influx, and send that from the sensor.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.