Is there a way of plotting inferred data?

I collect data from a battery powered light sensor.
To maximize battery life, the device only sends data when there is a change in the light level instead of on a regular schedule. If the light level is constant, for example during the middle of a cloudy day, then it may not send any data for an hour or more.

If I have a plot that is only looking at the last 30 minutes then sometimes Grafana shows nothing because no data has been received in that 30 minute window, whereas in reality the current light level can be inferred by looking at the last reported value, even if that value was received hours ago.

Does Grafana have a way of displaying the current inferred value using the last known value even if it’s outside the current window?

As far as I can tell the only alternative is to write a program that sits in between the sensor and Grafana that remembers the last received value and periodically generates fake data points. This wastes storage space and makes Grafana slower.

What is your datasource? can you post your query here?


SELECT distinct(“value”) FROM “light_sensor” WHERE $timeFilter GROUP BY time($__interval) fill(null)

That’s the generated code from the GUI query builder.

It’s been a while since I used InfluxQL, but maybe some ideas here or here.