Closed KlaraJa closed 9 months ago
Thanks for reporting. Think it's due to changes I did in throtteling the amount of updates on power sensors to once each 5 seconds. Think I might revert that change. Will have a look tomorrow or wednesday
Maybe that isn't that bad, but powergroups need to be handled differently especially, if you have groups in groups.
And the use case when more lights are changed simultaneously. My ceiling light for example are 4 lights that i put into a group and added those to another group for the room and this also to a group for every powercalc sensor.
I immediately noticed this issue after updating and went to "Issues" to see if anyone else has reported it and sure enough here's the thread!
Yeah this is a major problem, basically what ends up happening is that the group's power state ends up being stale. In most cases, I turn off the light group (of 4 ceiling lights) and the groups wattage is now what it was when all the lights were on and summed. Then, I turn them on, and now it shows almost 0 watts from when they were off. If I turn off 1 light at a time in the group of 4 you can see that the group's total ends up being the previous state (so if I turn on all 4, then I turn off one by one, when I am at 2 lights on, the group's total wattage is as if 3 lights were on, and when I am at 1 light on, the group's total is as if 2 lights were on). This behavior isn't completely consistent sometimes it gets more than 1 state change behind and I'm guessing that's depending on the rate limiting / how fast things are modified.
This issue makes the integration unusable so I had to revert to 1.9.6 as well. Please consider making this kind of feature be an option in the future if you decide to keep it instead of having no choice. Or maybe it should be applicable on a case-by-case basis to each group? There are times where I want highest accuracy of power measurement and times where performance needs to be focused on possibly -- just speculating.
Thanks for reporting. I see the problem and the power sensor can get stale. Did not foresee that when implementing the rate limiting on power sensors, but it's quite obvious to me now this cases can happen and is unwanted.
I did add the rate limiting for issue #1916, however the real reason this person had problems was not the amount of updates of the group sensor, but the group sensors being included in itself causing constant infinite amount of updates.
So I just remove the rate limiting now, as the power sensor is an instantaneous value which should not be limited on updates.
Will release 1.9.8 with the fix shortly.
Hi, I was on 1.9.9 but still had the wrong group calculation for energy. Did the problem went away for others after 1.9.8? Thanks a lot.
@bramstroker At my side it was fixed. But I upgraded from 1.9.7 --> 1.9.9 (skipped 1.9.8). Maybe try to redownload the 1.9.9 through HACS, sometimes that helps with broken extensions.
didnt want to crosspost: https://github.com/bramstroker/homeassistant-powercalc/issues/1953#issue-2046727469
downgrading to 1.9.9. solves that 'misbehaving' issue too
Closing this issue as there were multiple fixes for group calculations lately, last month(s). @RoSche2001 When you still experience issues with latest version of powercalc please open a new issue with detailed information about your situation.
System Health details
System Information
Home Assistant Community Store
GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4409 Installed Version | 1.33.0 Stage | running Available Repositories | 1413 Downloaded Repositories | 22Home Assistant Cloud
logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | okHome Assistant Supervisor
host_os | Home Assistant OS 11.1 -- | -- update_channel | stable supervisor_version | supervisor-2023.11.3 agent_version | 1.6.0 docker_version | 24.0.6 disk_total | 57.8 GB disk_used | 9.1 GB healthy | true supported | true board | rpi4-64 supervisor_api | ok version_api | ok installed_addons | Let's Encrypt (4.12.9), AirCast (4.0.1), WireGuard (0.9.0), Matter Server (4.10.2), Mosquitto broker (6.3.1), Studio Code Server (5.14.2), AppDaemon (0.15.2), Advanced SSH & Web Terminal (16.0.1), Home Assistant Google Drive Backup (0.111.1), Samba NAS (12.1.0-nas), InfluxDB (4.8.0), Grafana (9.1.1)Dashboards
dashboards | 4 -- | -- resources | 11 views | 8 mode | storageRecorder
oldest_recorder_run | November 9, 2023 at 14:16 -- | -- current_recorder_run | November 20, 2023 at 00:53 estimated_db_size | 271.17 MiB database_engine | sqlite database_version | 3.41.2Checklist
Describe the issue
With the newest version 1.9.7, some calculations are wrong in groups and sometimes when I turn on a light the total power decreases and increases when I turn the device back off.
My only solution was to downgrade back to 1.9.6.
Reproduction steps
Debug logs
Diagnostics dump or YAML config
No response