More specifically, I need to calculate a difference between current and last value and divide it by the time delta and get hold of this data in Grafana. I'm using the Grafana Home Dashboard plugin.
Why do I need this?
I want to plot accurate power consumption charts (W), but:
1. The Aeotec reports accumulated energy (kWh) and momentary power (W). Unfortunately, the W readings are not averaged since last reading,
i.e they are essentially unusable for charts.
2. InfluxDB does not seem to have functions for making this calculation (surprisingly)
- Code: Select all
Data reported from Aeotec HEM
| energyAccumTimeDelta | energyAccumTotal | energyCurrLevel |
| 0.50 hours | 1 kWh | unusable value |
| 1.4 hour | 4 kWh | unusable value |
Instead I want to feed the following to InfluxDB via the Grafana plugin:
| energyAccumTimeDelta | energyAccumTotal | averagePower |
| 0.50 hours | 1 kWh | |
| 1.4 hour | 4 kWh | (4-1) / 1.4 = 2.14 kW |