Data in Influxdb but not able to see it in Grafana

hi hi, looking for someone that knows this combo…

Insertting data into a influxdb… db: watertank_levels , measurements: WaterTankLevels
I can log in via the cli and query the measurements and I got the below coming back.

> SELECT * FROM "WaterTankLevels" WHERE ("tank" = 'CouncilWaterTank1') AND time >= now() - 60

2022-05-14T12:30:55Z 0.6             CouncilWaterTank1 0.3         30
2022-05-14T12:31:16Z 0.6             CouncilWaterTank1 0.3         30
2022-05-14T12:31:36Z 0.6             CouncilWaterTank1 0.3         30
2022-05-14T12:31:57Z 0.6             CouncilWaterTank1 0.3         30
2022-05-14T12:32:17Z 0.6             CouncilWaterTank1 0.3         30
2022-05-14T12:32:37Z 0.6             CouncilWaterTank1 0.3         30
2022-05-14T12:32:58Z 0.6             CouncilWaterTank1 0.3         30
2022-05-14T12:33:18Z 0.6             CouncilWaterTank1 0.3         30
2022-05-14T12:33:39Z 0.6             CouncilWaterTank1 0.3         30
2022-05-14T12:33:59Z 0.6             CouncilWaterTank1 0.3         30
2022-05-14T12:34:20Z 0.6             CouncilWaterTank1 0.3         30
2022-05-14T12:34:40Z 0.6             CouncilWaterTank1 0.3         30
2022-05-14T12:35:01Z 0.6             CouncilWaterTank1 0.3         30
2022-05-14T12:35:21Z 0.6             CouncilWaterTank1 0.3         30
2022-05-14T12:35:41Z 0.6             CouncilWaterTank1 0.3         30
2022-05-14T12:36:02Z 0.6             CouncilWaterTank1 0.3         30
2022-05-14T12:36:22Z 0.6             CouncilWaterTank1 0.3         30
2022-05-14T12:36:43Z 0.6             CouncilWaterTank1 0.3         30
2022-05-14T12:37:03Z 0.6             CouncilWaterTank1 0.3         30
2022-05-14T12:37:24Z 0.6             CouncilWaterTank1 0.3         30
2022-05-14T12:37:44Z 0.6             CouncilWaterTank1 0.3         30
2022-05-14T12:38:05Z 0.6             CouncilWaterTank1 0.3         30
2022-05-14T12:38:25Z 0.6             CouncilWaterTank1 0.3         30
2022-05-14T12:38:45Z 0.6             CouncilWaterTank1 0.3         30
2022-05-14T12:39:06Z 0.6             CouncilWaterTank1 0.3         30
2022-05-14T12:39:26Z 0.6             CouncilWaterTank1 0.3         30

but when I query / build dashboard in Grafana I see no data (although I have 6 data points hour ago)

ps: code is @ GitHub - georgelza/watertak_level: Python script to ensure water level in tank, push output via NodeRed to to InfluxDB

G

well it seems Grafana decided to show my values.

Anyone gave a good suggestion, how to show/display 2 water tanks, and then display them percentage full,

G

My guess would be to add a second query and then SELECT value + math to get % the under i think standard options select unit to %

Two thoughts , the “easy” would be to add a Gauge where the Max value is the max output of your sensor. Visually you will then see where the level is at. (That is I assume , you want to display in Grafana)

The other would be to either do the math at the sensor or at the program before you send the data to Grafana.

Side question , how do you prevent the sensor from going belly up due the the condensation from the water?

1 Like

going to circle back, so figure out that with Grafana gage you can set min and max… so sort of answering that question, but north actual use case is to show the size/fill % of water tanks, and realised I actually wanna do this inside Home Assistant, so back to the HA forum… sure HA can do it. :slight_smile:

have a the graphic consume levels from a mqtt topic.

G

side answer, has not figured the side question out, make that have not even thought about it…
but on the HA forum I keep doing across the following sensor, (Waterproof Ultrasonic Sensor with Separate Probe-DFRobot), so V2 of this might be redone with this sensor eventually.
I’d still stay with the RPi boards, like the easy coding of it… or make that jsut very familiar with them… side answer 2… if we can bl00dy find stock…
need to see if i can order some from UK shop and have them shipped to a mate that side, SA has f’all avail.
G

Ah , cool didn’t realize that you got those in waterproof. Thanks !
I played with water levels at one stage but the distance sensor packed up after about a month, the board was corroded , so I assumed that it must come from the condensation.
I am now playing with a optical encoder to sense the level.

1 Like

The little secondary experience I have with InfluxDB makes me hate it almost as much as I hate MySQL. Unlike MySQL though, it is actually fast in its intended purpose, while MySQL just fosters the writing of bad SQL :slight_smile:

1 Like

I’m finding it convenient, thats about all…
I will primarily in HA be showing current tank level (and thats the primary interface)… which I will simply consume from mqtt.

the data going into InfluxDB is just there for history purposes which I can display via Grafana.

G

My V1 also started out with the regular ultrasonic sensor but as Paul pointed out, these corrode and eventually pack up.

My V2 now uses the waterproof ultrasonic sensor you link to which doesn’t corrode but is affected by condensation and temperature, I get erratic spikes and you’ll also note from the image below that based on time of day as the temperature increases the sensor reports higher water levels (variance ~10%).

I have another software sensors that smooths out this data but its still far from perfect, I’m not too worried as the levels are not critical for me but if you need accurate data you need to look at other options. There are pressure sensors that apparently work very well but I think they are expensive.

Communica have stock BTW

also been looking at information which implies those pressure sensors are a much better solution.
Just need to find a good one at a “ok” price.

G

funky… Victron GX Tank 140 now Accepts Voltage based Sensors - YouTube

are they available to connect to a multiples 2?
if yes:
whats the max distance between a MP2 and the Tank140 ?

G

Hi have the GX Tank and 1 sensor.
I bought sensor and then extended the 5m sensor cable to 10 and I think it can be extended a lot further.
GX Tank has a 5m USB cable to the CerboGX.
Works a treat and has 4x sensor “slots”
I then send the MQTT data from the Cerbo to Node Red.

Just plaing with idea, I’m already streaming data from my Victron to my Home Assistant.
idea to rather do this later, use this, get data into Victron, then push it using mqtt to HA.

G

VRM view:

image

1 Like