IngoS11 / ha-schluter

An alternative to the default Schluter integration in Homeassistant
MIT License
9 stars 6 forks source link

Energy Sensor not accurate/true total power usage #10

Closed squirtbrnr closed 1 year ago

squirtbrnr commented 1 year ago

The power sensor is correct and shows the amount of power being used at the moment it is read. However the energy sensor stop incrementing even when the power sensor shows power being used and it also slowly drops to 0 over time. Both of these situations appear to be caused by the energy sensor being an average of the last 60 readings of the power sesnor. This causes the energy dashboard to stop showing power being used when the thermostat has been heating for a period of time and is still heating and also show a negative power draw and shows power being returned to the grid when the thermostat has been off for a period of time. This is wrong. How can a heated floor return power to the grid? The energy sensor should only increment until reset to zero manually and should be an accumulated total of the power sensor. image image image

squirtbrnr commented 1 year ago

I created a Riemann sum helper that’s left adjusted. It takes the power sensor entity as input, time base of 60 (one reading per minute for a total of 60 minutes or 1 hour), and prefix of ‘k’ for kilo and it outputs the kilowatt-hour usages correctly. This can then be used in the energy dashboard to properly track and monitor energy usage and cost. The energy sensor in this integration appears to be the trapezoid method (average of last 60 readings) which is incorrect.