Jumps in Utility Meter

Using HA 0.110.7 and an AEOTEC Home Energy Monitor 3 phase ZWave device. Also using the following configuration for Utility Meter on this device:

utility_meter:
  monthly_home_energy:
    source: sensor.aeon_hem_energy
    cycle: monthly
    offset:
      days: 5

Every once in a while, the readings for the utility meter have jumps; like from 300 kWh to 9.000 kWh or more instantly! This is the Grafana graph and table for the “monthly_home_energy” utility meter:

And in the following graph you can see the spike on “sensor.aeon_hem_energy” which causes this jump:

And the corresponding table to the last graph:

As you can see; the total consumption value jumped from 23.006 to 23.287 and then goes back to 23.006. But that negative increase causes a huge jump in utility meter.

As i understand most of the people who are using ZWave power units are having this problem. Is there a way to correct this issue, like if the increase in consumption is negative, just discard it; except when utility_meter.calibrate is used or utility meter resets the value on cycle?

You could use a filter to reject the spurious readings. I suggest the outlier filter:

Then feed that filtered sensor to your utility meter instead.

1 Like

Thanks, that is an elegant solution…

1 Like

I had this problem again unfortunately, even with the filter sensor.

  - platform: filter
    name: "Aeon Hem Energy Filter"
    entity_id: sensor.aeon_hem_energy
    filters:
      - filter: outlier
        window_size: 4
        radius: 4.0

Gets the data directly from sensor.aeon_hem_energy of zwave device. This is the spike from the sensor.aeon_hem_energy:

And this is the filter sensor:

According to my understanding, the filter sensor should have prevent this spike. What am i doing wrong?

Not really sure. It might have been rejecting all the values because your radius is too small. Try

     filters:
      - filter: outlier
        window_size: 4
        radius: 100

I’m still seeing spikes after setting my window size to 4 and a radius of 100.
The documentation on outlier filter doesn’t really explain (to me) how radius and window size work together.


What settings are working well? The Rainforest updates every minute and we have 200 A * 240 V service, so we should never be able to consume more than 48 kW (solar / generate is 12.5 kW).

I have windows size 10, radius 5.0 which works well for me now.

2 Likes

The window is how many samples to use to create an average (mean).

The radius is the distance from that average (+ or -) to use in determining if the new value should be accepted.

if abs(new value - average) > radius, then reject the new value
if abs(new value - average) <= radius, then accept the new value

the function abs() returns the absolute value, i.e. transforms negative numbers to positive.

I’ve had the jumping problem too. I use the Shelly EM meter. With the following in the sensor I have not had more jumping problems.

availability_template: "{{ states('sensor.analizador_channel_1_energy') not in ['unknown', 'unavailable', 'none'] }}"