Grafana Dashboard

Assignment

Use Grafana to create a dashboard with data from InfluxDB and/or TimescaleDB. Write a blog post. Include an explanation of what you built along with screenshots of the graphs and the queries used to build them. You can use the Grafana instance from class or a version installed on your laptop.

Approach

I imagined that I am comparing the averages of my plant to other plants and that I mostly care about temperature, illuminance, and humidity. I also emphasize the consistency of my sensor’s data collection and whether or not the led was on.

Average Temperature

SELECT "value" FROM "temperature" WHERE ("device" = 'device_16') AND $timeFilter
SELECT mean("value") FROM "temperature" WHERE ("device" = 'device_XX') AND $timeFilter GROUP BY time($__interval) fill(null)

Average Lux

SELECT "value" FROM "illuminance" WHERE ("device" = 'device_16') AND $timeFilter
SELECT mean("value") FROM "illuminance" WHERE ("device" = 'device_XX') AND $timeFilter GROUP BY time($__interval) fill(null)

Average Humidity

SELECT "value" FROM "humidity" WHERE ("device" = 'device_16') AND $timeFilter
SELECT mean("value") FROM "humidity" WHERE ("device" = 'device_XX') AND $timeFilter GROUP BY time($__interval) fill(null)

Consistency

SELECT count("value") FROM "temperature" WHERE ("device" = 'device_16') AND $timeFilter GROUP BY time(1h) fill(null)

Challenges & Conclusion

All of these queries were run through InfluxDB. Timescale did not want to play along with me for whatever reason. One time I got Timescale to display averages of every measurement automatically, but then I clicked something and it disappeared. I should have saved the queries. That’s the issue, that it takes the attention away from typing queries to clicking that you forget what you have changed, whereas when you type it out you know exactly what you are doing.

I liked all the different type of graphs and gauges and the versatility of the program/application, but I think I will need some more time familiarizing myself with the UI. Kind of wish it had the versatile query tool of pgAdmin 4.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s