THIS IS A WORK IN PROGRESS
It's far from complete and this far not usable at all.
I was looking for a decent way to long-term log my energy usage for some outlets. Charting wasn't the most important part, but seeing exact values of kWh used per month several years back was important. Since I didn't find a complete solution for that I started writing this.
This should run as a daemon and will then read data from a MQTT Broker to which energy usage is sent. The read data will then be stored into a database (SQLite). Only changes will be written and on an hourly basis it will aggregate energy usage into daily values. Detailed (raw) data entries will be deleted after a defined number of days.
- Log data to SQLite.
- Handle counters from hardware that resets the value from time to time (Shelly for example).
- Add HTTP support to view the data.
- Aggregate hourly data into another database table.
- Aggregate daily data into another database table.
- Remove detailed (raw) data after X number of days.
- Remove data from hourly/daily as well.
- Get all last values on startup instead.
- Add daily data chart
- Add real-time chart using table raw_data.