HA Energy Feature

Hi guys

i been noticing something not good when using the energy feature of HA

i’m finding the readings inconsistent.

i have power monitoring plugs throughout the house they are tuya plugs rebranded to Brilliant lights and Arlec here in Australia

i have setup them up with local tuya and then added additional sensor inputs in HA as below.

- platform: integration
  source: sensor.lounge_switch_tv_watts
  name: lounge_tv_energy_spent
  unit_prefix: k
  round: 2
- platform: integration
  source: sensor.lounge_switch_aircon_watts
  name: lounge_aircon_energy_spent
  unit_prefix: k
  round: 2
- platform: integration
  source: sensor.server_rack_switch_watts
  name: server_rack_energy_spent
  unit_prefix: k
  round: 2

when i compare the readings of the plugs to HA they can range from 200w more in HA or in one case 3kws more in HA then what the plug records, in 1 day.

not good when this happens

Any ideas what could be causing this?

regards
Jeremy

Change Rieman sum mentod to “left” by adding this to each integration:
method: left

without it, sensor being 0 (switched off, no power used) for long time causes a jump in energy because of how default method handles calculation.

thanks i’ll try this out

Hey Bigfoot

I tried what you said its better still a litle out
server rack HA 10.16kw Plug: 10.5 Diff: -390w
Aircon HA 10.13kw Plug: 10.81 diff -680w

would you have any ideas?

regards
Jeremy

First: Suggestion to use “left” is also mentioned in “Integration” platform documentation:
image

There is also link to Riemann sum on that page, you may want to read that. It is not exact measurement, but approximation, so expected to be off a bit. Maybe not for 5% as you have, but this could be result of using “left” method and long update interval (how often HA gets current power reading from plug).

When consumption is “spiky” enough (goes up and down a lot) and update interval is not frequent enough… on the other hand it should average out the difference in the long run.

And be sure not to confuse power (measured in kW/W at specific instant) with energy consumed (measured in kW/h for specific interval).

hi bigfoot

i understand that. just not used to it being so far out. as i developed a solar invert and house inverter software in the past that was fairly accurate.

as for the plugs i have them updating almost every second. sometimes theres a delay but no more then 7 seconds.