In the UK we are in a bit of an energy crisis - 7 or 8 electricity providers have gone bust in the last 3 weeks. When this happens the Energy Regulator transfers the customers of the bust business to another provider - supply is uninterrupted but the rates are very different. I was on 12.7 pence/kWH three days ago, now it is around 22 pence (they haven’t confirmed the exact rate yet).
To encourage the sproglets (and wife) to be a bit more conscious I thought I would update our Grafana dashboard to show current cost per hour along with suitable daily, weekly and monthly info.
I think that the integral function of InfluxDB as a continuous query each hour (for hourly data) and daily (for daily data) should provide the kWH info but I can’t get the syntax to work properly.
Does anyone have IotaWatt → InflusDB → Grafana working to show cost? If so, please could you share your query/setup.
I think the query goes something like this:
CREATE CONTINUOUS QUERY kwh ON ilcibne RESAMPLE EVERY 1d FOR 30d BEGIN SELECT integral(Watts, 1000h) AS kwh INTO ilcibne.autogen.energy FROM ilcibne.autogen.iotawatt WHERE units = ‘Watts’ GROUP BY time(1h), ct, device fill(0) END
This comes from here: Iotawatt: Single Tenant InfluxDB and Grafana Setup – Brett Beeson it uses his database and measurement names - I suspect it is the syntax with the autogen retention policy that is the problem - but it might be something more basic.
Looking at the bright side of the energy price increase, the payback on the solar array will improve - every kWH that I generate and use in the house is saving me twice as much this week as last week.
The end goal is a Grafana type dashboard - there might be a better way than using InfluxDB
Thanks for your help.