homeassistant-powercalc icon indicating copy to clipboard operation
homeassistant-powercalc copied to clipboard

Spikes in Energy causes extreme measurements

Open suneworld opened this issue 1 year ago • 7 comments

Hi! My Heatit floor sensors have a weird dropout from time to time which results in a peak really messing up my energy meters. Is there any way I can fix this? Maybe by not using the energy meter from the device but letting powercalc creating one from the power usage?

See the image below. image

suneworld avatar Sep 21 '22 10:09 suneworld

Hi, what do you mean with dropout? They report 0 values or unavailable or something like that?

bramstroker avatar Sep 21 '22 11:09 bramstroker

I am uncertain. But - this is something I experienced before I started using Powercalc, but I was hoping the wonderful Powercalc would deal with it :)

Here is a screenshot from Grafana: image

suneworld avatar Sep 21 '22 12:09 suneworld

Does this hppen during startup / restarts of HA or just during runtime?

bramstroker avatar Sep 21 '22 12:09 bramstroker

During runtime!

suneworld avatar Sep 21 '22 16:09 suneworld

Ah I read your question again and I see it's not about a group powercalc sensor. There were similar issues with the group sensors and I made a lot of improvements and fixed for that, so I thought this was related.

The issue you have is the energy sensor reporting 0 values causing the utility meter to spike.

Currently did you make the utility_meters with the built-in HA helpers or did you create them using Powercalc?

bramstroker avatar Sep 22 '22 08:09 bramstroker

The Utility meters are generated by Powercalc! But they are based on the energy meter reported by the device.

tor. 22. sep. 2022 kl. 10:04 skrev Bram Gerritsen @.***

:

Ah I read your question again and I see it's not about a group powercalc sensor. There were similar issues with the group sensors and I made a lot of improvements and fixed for that, so I thought this was related.

The issue you have is the energy sensor reporting 0 values causing the utility meter to spike.

Currently did you make the utility_meters with the built-in HA helpers or did you create them using Powercalc?

— Reply to this email directly, view it on GitHub https://github.com/bramstroker/homeassistant-powercalc/issues/1105#issuecomment-1254670809, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR2OHLMV7EUDNMJAQZDHNULV7QHINANCNFSM6AAAAAAQR6IVHU . You are receiving this because you authored the thread.Message ID: @.***>

--

Sune Alexandersen Narud Øvre Måsan 26 1385 Asker Tlf 924 88 111 www.sunenarud.no www.suneworld.com

suneworld avatar Sep 22 '22 08:09 suneworld

Powercalc uses same underlying code for the utility_meter. It's exactly the same logic as the HA helpers use. So when your energy meter glitches making the utility meter misbehave your best option would be to integrate the power sensor in a new energy meter as you already indicated as a possible solution.

How did you currently setup the powercalc configuration?

bramstroker avatar Sep 22 '22 08:09 bramstroker

Thank you very much Bram! This is my current setup: - platform: powercalc entity_id: climate.varmekabler_bad_1etg power_sensor_id: sensor.varmekabler_bad_1etg_power and this results in the following device info: image

Powercalc automatically finds the energy meter of the device. How do I force it to use the power_sensor? (I actually thought that was what I had done with the above code:))

suneworld avatar Sep 22 '22 18:09 suneworld

Yes this is by design, when the same device of the power sensor already has an energy sensor powercalc will use that one.

You could do the following.

  1. Create a new energy sensor for your power sensor sensor.varmekabler_bad_1etg_power using the Riemann sum helper (Devices & Services -> Helpers).

2a) Use energy_sensor_id option to also refer to energy sensor.

- platform: powercalc
  entity_id: climate.varmekabler_bad_1etg
  power_sensor_id: sensor.varmekabler_bad_1etg_power
  energy_sensor_id: sensor.varmekabler_bad_1etg_energy2 # This is the new energy sensor you created

Now powercalc should create the utility meters

2b) Just create the utility meters using the HA helpers (Devices & Services -> Helpers)

So you need to do one of 2a or 2b.

bramstroker avatar Sep 22 '22 18:09 bramstroker

Thanks again!! If i choose to disable the sensor.varmekabler_bad_1etg_energy entiy (the energy meter from the device) will powercalc actually create the energy and utility meters based on the _power entity alone?

suneworld avatar Sep 22 '22 20:09 suneworld

Yes that should also work.

bramstroker avatar Sep 22 '22 21:09 bramstroker

Thank you so much and thank you for this amazing piece of code. It is the best integration I've found so far!!

suneworld avatar Sep 23 '22 08:09 suneworld

Thank you so much and thank you for this amazing piece of code. It is the best integration I've found so far!!

Thanks a lot for your compliments. Good to hear people enjoy using it.

bramstroker avatar Sep 23 '22 09:09 bramstroker