Hi All,
i have a strange issue specifically when it comes to to energy (kWh) on Sonoff devices using the Sonoff LAN plugin. I am hoping to get this one resolved.
I have 2 scenarios where the same thing seems to happen.
- Integral sensor calculating the energy over time.
- Feeding the raw data to InlfuxDB and use grafana to the integral.
From the Sensors.yaml i have the following
- platform: integration
name: “Geyser 63A Energy”
unique_id: “geyser_energy”
source: sensor.sonoff_1001d9505f_power
unit_prefix: k
round: 3
By looking at the image below, from 2 to 3 the Geyser consumed 18kWh, which is physically not possible, as this is a 3kW element
By looking at the raw graph of power over time, you can see the geyser ran just under an hour.
At this timeframe from Grafana this shows 2.97kWh, which is perfect.
Looking at the second time at 14:30 the geyser switched on you can see the the geyser power is incorrect again. But this time Grafanas data is also incorrect, this made me dig a little deeper.
In Grafana i have this query SELECT integral(“value”)/3600000 FROM “W” WHERE (“entity_id”::tag = ‘sonoff_1001d9505f_power’) AND $timeFilter GROUP BY time(1h) fill(0)
This works well with non Sonoff plugin devices. but looking below from grafana at grouped data, you can see at 14:00, there is an incorrect calculation.
Grouping this by minute. I saw something interesting.
- There is a big gap in data, there seem to be no data when the unit is in the off state.
- The moment the unit switches on, it is asif the integral just goes wack and sends wack data (14:30 : 9.60 kWh).
Is there a way around this, from grafana i even tried forcing the missing data as 0 values to try and force this, but no success.
This seems to be an integral issue with missing blocks of data or possibly a sonoff plugin that might be causing issues.
apologies for the lack of images, can only embed one 1 image