Hi.
I am a newbie, trying to use Grafana.
I am collecting temp/humidity data from several sensors with NodeRed and storing them in InfluxDB.
When I plot them using Grafana, the following sentences gives an empty graph:
SELECT mean(“temp”) FROM “autogen”.“sensors” WHERE (“sensorID” = ‘1’) GROUP BY time($__interval) fill(null)
while this works:
SELECT mean(“temp”) FROM “autogen”.“sensors” WHERE GROUP BY time($__interval) fill(null)
When I catch the mqtt on NodeRed, I receive a JSonFormat, like {“sensorID”:99,“temp”:23.25919,“hum”:54.15326,“pressure”:101.0474,“illuminance”:33.87097,“uva”:0,“uvb”:0,“uvIndex”:0}
Then I parse it to a JsonObject, and send it to the InfluxDB Data-Base, as InfluxDB adds automatically a timestep.
My problem is, I have several sensors (tag: sensorID, and value 1, 2, 3, …). And I would like to print the temperatura stuff for each sensor independently.
Did I build the DB the wrong way?
Should the sensorID be a string, like “sens1”, “sens2”,…
Because, if I use:
SELECT mean(“temp”) FROM “sensors” WHERE (“sensorID” > 1) AND $timeFilter GROUP BY time(5m) fill(null)
it works.
Thanks.
Ardweb.