Spikes in Energy Dashboard for Z-Wave Devices

Hi,

I have several Z-Wave switches that record among other things kWh for the attached appliances and I am finding I am getting more and more large spikes of kWh readings in the Energy Dashboard making it useless.

Here is an example for today:

When I check the history for the devices everything appears fine and the large kWh is not recorded, eg: for today:

Here is yesterday, again all 3 readings are way out:

Any ideas what is causing this and how to prevent it?

Thanks!

1 Like

Just a question : Which z-wave device (Brand and model) is this coming from ?

So far all of them with this issue are Aeon ZW075-C

I just ran into a similar baffeling issue. The history looks right, but the energy dashboard is crazy.


I did have issues with my Aeotec energy meter before, but there were spikes in the sensor data at the time. I now filter that data and have not had a weird spike in 5 months

# Aeotec power filter (get rid of nonsense spikes)
- platform: filter
  name: "phase 1 power filtered"
  entity_id: sensor.home_energy_meter_g2_electric_consumption_w_2
  filters:
    - filter: outlier
      window_size: 4
      radius: 10.0
- platform: filter
  name: "phase 2 power filtered"
  entity_id: sensor.home_energy_meter_g2_electric_consumption_w_2_2
  filters:
    - filter: outlier
      window_size: 4
      radius: 10.0
- platform: filter
  name: "phase 3 power filtered"
  entity_id: sensor.home_energy_meter_g2_electric_consumption_w_3
  filters:
    - filter: outlier
      window_size: 4
      radius: 10.0

Moreover solar consumed is more than what is generated and logged in the energy display (and that comes straight from my SMA inverter).

I also don’t know how to fix the energy meter reading, except maybe through some messing with the db. I don’t really care but I am at a loss on how to avoid this repeating in the future.

1 Like

This is because HA can’t connect to the device and HA records the value at 0. Then when it reconnects, it records the current kWh which is the total since birth which could be a lot. You can search for some code fixes and db fixes but it gets complicated. This needs to be fixed in HA as a bug. Any response HA?

Yep that seems to be it. Got it again today, at the same time for some reason. And now I have exactly what you mention in one of my sensors. The curve goes up nicely, until suddenly it starts at 0 again.

Yea I get this at least once or twice a week on random plugs. Twice this week alone. Is there any fix?

Still going on for me. I removed all individual devices from the dashboard and added them back one by one, was OK for a few weeks but now I have a few devices in there again the issue has re-started.

I am seeing a spike against the individual device now in it’s history, so that explains the energy graph.

No idea why these spikes occur (Z-Wave issue?) …

I would love to know how to fix this. Anyone?

I have a lot of the Zooz zen15s that show this. Discussed on Reddit a few months ago and opened a support ticket with Zooz but they didn’t have an answer aside from it being HA a fault.

I have opened a ticket if anyone wants to add to it, wasn’t sure if it should be logged under the front end / core.

I’ve been having the same issue

Having the same issues… the more devices on zwave network the more spikes i see. Very annoying

would something like this work? so far home assistant didn’t fuss when I restarted.

homeassistant:
  customize:
    sensor.ups1_electric_consumption_kwh:
      state_class: total_increasing
      filters:
        - filter: outlier
          window_size: 10
          radius: 5
      value_template: >
        {% if states('sensor.ups1_electric_consumption_kwh') | float == 0 %}
          unavailable
        {% else %}
          {{ states('sensor.ups1_electric_consumption_kwh') }}
        {% endif %}

(have to wait a day to see if it goes away… )


So far this is promising. This device had a jump before I added this code, but hasn’t again yet.

Changed the filters to be more reasonable based on a 15 amp circuit. Also set a filter on my whole house power. My settings are based on 5 minute report intervals and roughly estimating across 2hours.

I had one device that continues to spike negative and positive. I’m removing the ‘total_increasing’ override to see if that fixes it.

homeassistant:
  customize:
    sensor.garage_freezer_electric_consumption_kwh:
      state_class: total_increasing
      filters:
        - filter: outlier
          window_size: 24
          radius: 0.03
      value_template: >
        {% if states('sensor.garage_freezer_electric_consumption_kwh') | float == 0 %}
          unavailable
        {% else %}
          {{ states('sensor.garage_freezer_electric_consumption_kwh') }}
        {% endif %}
    sensor.garage_freezer2_electric_consumption_kwh:
      # state_class: total_increasing
      filters:
        - filter: outlier
          window_size: 24
          radius: 0.03
      value_template: >
        {% if states('sensor.garage_freezer2_electric_consumption_kwh') | float == 0 %}
          unavailable
        {% else %}
          {{ states('sensor.garage_freezer2_electric_consumption_kwh') }}
        {% endif %}
    sensor.home_power_electric_consumption_kwh:
      state_class: total_increasing
      filters:
        - filter: outlier
          window_size: 24
          radius: 0.15
    sensor.home_power_electric_consumption_kwh_1:
      state_class: total_increasing
      filters:
        - filter: outlier
          window_size: 24
          radius: 0.10
    sensor.home_power_electric_consumption_kwh_2:
      state_class: total_increasing
      filters:
        - filter: outlier
          window_size: 24
          radius: 0.10

Can you talk us through how you came up with the window_size and radius values?

Placing value_template in the customize: section has no effect.
I wasn’t sure so I posted a question here: Discord
I then validated that it does not work by putting a silly value in a value_template in there (i.e. go unavailable unless value is over 1,000,000), and it does not do anything (after validating that the template used does work in Dev Tools).