Hi All,
i want to transmit data to Grafana by Influxdb :
This is the msg.payload :
[{"channel":89,"type":"counter","unit":"null","value":435,"name":"hoursCell89"},{"channel":16,"type":"voltage","unit":"v","value":5.5,"name":"voltCell16"},{"channel":17,"type":"current","unit":"a","value":0.2,"name":"ampCell17"},{"channel":25,"type":"temp","unit":"c","value":29.4,"name":"tempTDS25"}]
This is the same in the Debug :
You can see in this example the mqtt CAYENNE protocole:
- each object got : "channel" , "type", "unit", "value" , "name". Each channel corresponding to a sensor/data. The order of these channels is completely random.
- there is 4 objects in this array . It's depend on changing values : sometimes only 1 object, sometimes 6 objects.
This is the SELECT* FROM stations
result in Influxdb :
The last line is the example above result : We can see
channel:89
, channel_1:16
.... but not all 4 objects !
inevitably, in Grafana the channel:25
named tempTDS25
, does not work:
The channel:89
named hoursCell89
is working because it is often on the first object :
Does anyone know how influxdb can handle multiple objects so that I can display each sensor / data in Grafana with its name and value?
Ideally, do not touch the msg.payload ...