I’m using Grafana with InfluxDb on homeassistant and I’ve managed to create some great visualisations so far.
The one I’m struggling with at the moment is to compute my power usage per time of use (I pay for electricity at different rates depending on the hour of the day).
I have power usage as kW consumed/exported, and I know how to query for the integral per hours:
SELECT integral("value", 1h) FROM "kW" WHERE ("entity_id" = 'powerwall_site_now') AND $timeFilter GROUP BY time(1h) fill(null)
which basically gives me power usage for each hour slot. But I’m not sure then how to filter and sum up in 4 slots:
- from 00h to 15h
- from 15h to 16h
- from 16h to 21h
- from 21h to 24h
Any pointers? Thanks a lot!