How to use own MQTT broker with Grafana Live

Hi, I’m facing this problem. I need to use mqtt messages different from the standard ones as requested from the available plugins (especially not just numbers). So I need to fin d a different solution. I know about grafana live

I even read several docs but I’m not able to understand how to set and use it. Could you please give me some tip?
Pratically what I need is:

  • use my mosquitto broker installed on the same linux system where grafana runs
  • be able to get data from mosquitto to grafana

I will use html panel so, once I get the mqtt message I can arrange it as I need.

Have you installed the MQTT data source plugin?

Yes, the problem with the MQTT data source plugin is that it can only manage numbers. I even need strings as payload.
There is this request in progress labeled as enhancement Support complex MQTT Payloads · Issue #8 · grafana/mqtt-datasource · GitHub but it’s stuck since a while. So, for what I see, at the moment this plugin works only with simple numerical payload like

{
    'value1': 1.0,
    'value2': 2,
    'value3': 3.33,
}

So, any help on how to use my Mosquitto broker with Grafana live?

@donatod

Sorry for not getting back to you on this. I have never used Grafana live, but it apparently uses a regular websocket.

If your MQTT topics are strings, then I would use Node-RED to do the handoff from MQTT to Websocket. In a nutshell…

  1. install both Mosquitto and Node-RED on the same machine that is running Grafana
  2. configure an MQTT In node to subscribe to the topic(s) you want, massage the data if needed using change nodes, etc. and then pass the message to the Websocket node so that Grafana live can view this.

I do not have access to my system until tonight, but could cobble together a quick proof of concept test then.

Thanks @grant2 yes I would like to do something like this but I have no idea how to do it. I already have node-red installed. My problem is your point 2, regarding Websocket and Grafana live