I have created a dashboard that receives data from a sensor. Sends this data via MQTT to a database, which is then read by Grafana.
My question is…
Is it possible to add a button to Grafana. That can send a simple MQTT command to the sensor to either switch an LED on or Reset the device?
This could be a great idea to developers, allowing users to interact with the actuators…
EDIT:
This could help you…
But you have to make a request parser and convert it to a MQTT message. It is not difficult, but at the moment this is what’s available at the moment.
.
.
.
.
EDIT 2:
I found this awesome panel, but I did not try it.
I think it is what you are looking for:
i am also at the quest to find a button for Grafana, the plugin geeks-r-us/mqtt-panel , it does not connect with the brocker and i dont know where else to look.
Assuming the Button Panel still works, you could set that up to send a JSON payload carrying the MQTT command to the sensor (which then populates the database, which is then read by Grafana). I think you could set up a simple flow in Node-RED to accomplish this. Check out their forum for ideas.
Thanks, I already know and use node-red. From Grafana side, this Button Panel I see it supports GET and POST HTTP. I would try to install this MQTT panel geeks-r-us/mqtt-panel. But I don’t understand how to do it.
The problem is that I need to run Grafana on a server and then use mqtt since my device LAN is under NAT and not reachable from outside
In case if you are still looking for how to install this MQTT plugin.
This is what I did.
Using ‘wget’ download this (geeksrus-mqtt-panel-1.0.7.zip) zip file.
Unzip it.
place it in the designated plugin folder. For linux it is: /var/lib/grafana/plugins/
As it is an unsigned plugin, you have to set the config file to allow it.
Open the /etc/grafana/grafana.ini file. Then find [plugins]. Under it change as
I haven’t still reached that far yet. Just installed the plugin. I am also new in this area. May need to use WebSocket as someone suggested elsewhere.
From this page it seems that live-data can be visualized in Grafana (version 8) on the fly. But I haven’t tried it. It needs some additional installation which I haven’t done yet.
Could you please share here if you progress in this matter?
Till now I have used MySQL with pseudo data to see how Grafana works basically.
Thanks, I was able to install and place a button on my dashboard, however the parameters are not clear. I was never able to send anything to my MQTT broker on the same network.
And, the design of the button is “limited” to say at least
I was able to do it the Node-Red-way, however the integration of a node.red action onto a Grafana button is not possible, or did I miss something? I added an iframe containing a node-red-panel. A rather brutal way