When you are planning to switch to a rooftop solar system it isn't easy, even with a specialist at hand. You need details of your power consumption, typical usage hours, or distribution over a year. Collecting consumption data at the granularity of a few seconds is key to finding all the answers for more precision. This tutorial uses energy consumption data from a typical household for over a year. Because nearly all of this data is time-series data, proper analysis requires a purpose-built time-series database, like Timescale.
In this tutorial you can construct queries that look at how many watts were consumed, and when. Additionally, you can visualize the energy consumption data in Grafana.
Before you begin, make sure you have:
- Signed up for a free Timescale account.
- Optional Signed up for a Grafana account to graph queries.
This tutorial covers:
- Setting up your dataset: Set up and connect to a
Timescale service, and load data into the database using
psql
. - Querying your dataset: Analyze a dataset containing energy consumption data using Timescale and PostgreSQL, and visualize the results in Grafana.
- Bonus: Store data efficiently: Learn how to store and query your energy consumption data more efficiently using compression feature of Timescale.
This tutorial uses sample energy consumption data to show you how to construct queries for time-series data. The analysis you do in this tutorial is similar to the kind of analysis households might use to do things like plan their solar installation, or optimize their energy use over time.
It starts by teaching you how to set up and connect to a Timescale database,
create tables, and load data into the tables using psql
.
You then learn how to conduct analysis and monitoring on your dataset. It also walks you through the steps to visualize the results in Grafana.
Keywords
Found an issue on this page?Report an issue or Edit this page in GitHub.