bramstroker / homeassistant-powercalc

Custom component to calculate estimated power consumption of lights and other appliances
MIT License
969 stars 257 forks source link

Group calculations are not working correctly #1920

Closed KlaraJa closed 9 months ago

KlaraJa commented 11 months ago

System Health details

System Information

version core-2023.11.2
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.11.6
os_name Linux
os_version 6.1.21-v8
arch aarch64
timezone Europe/Berlin
config_dir /config
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 | 22
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home 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 | storage
Recorder 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.2

Checklist

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

  1. Install Version 1.9.7
  2. Create a group of devices in Powercalc integration
  3. Turn some devices on and off randomly

Debug logs

2023-11-20 01:03:29.561 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration favicon which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-11-20 01:03:29.564 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration better_thermostat which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-11-20 01:03:29.566 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hpprinter which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-11-20 01:03:29.567 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration worldtidesinfocustom which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-11-20 01:03:29.569 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration thermal_comfort which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-11-20 01:03:29.570 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration powercalc which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-11-20 01:03:29.572 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration stadtreinigung_hamburg which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-11-20 01:03:29.573 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration watchman which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-11-20 01:03:29.575 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-11-20 01:04:28.444 WARNING (MainThread) [zigpy.application] Zigbee channel 25 utilization is 99.18%!
2023-11-20 01:04:28.445 WARNING (MainThread) [zigpy.application] If you are having problems joining new devices, are missing sensor updates, or have issues keeping devices joined, ensure your coordinator is away from interference sources such as USB 3.0 devices, SSDs, WiFi routers, etc.
2023-11-20 01:04:53.323 WARNING (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x320E:1:0x0300]: async_initialize: all attempts have failed: [DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>'), DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>'), DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>'), DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>')]
2023-11-20 01:04:53.609 WARNING (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x320E:1:0x0006]: async_initialize: all attempts have failed: [DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>'), DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>'), DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>'), DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>')]
2023-11-20 01:04:53.850 WARNING (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x320E:1:0x0008]: async_initialize: all attempts have failed: [DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>'), DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>'), DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>'), DeliveryError('Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102>')]
2023-11-20 01:04:58.081 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: season
2023-11-20 01:04:59.896 DEBUG (MainThread) [custom_components.powercalc.discovery] Start auto discovering entities
2023-11-20 01:04:59.897 DEBUG (MainThread) [custom_components.powercalc.discovery] media_player.fernseher: Auto discovered model (manufacturer=Sonos, model=Beam)
2023-11-20 01:04:59.905 DEBUG (MainThread) [custom_components.powercalc.discovery] media_player.fernseher: Model not found in library, skipping discovery
2023-11-20 01:04:59.905 DEBUG (MainThread) [custom_components.powercalc.discovery] media_player.badezimmer_homepod_mini: Auto discovered model (manufacturer=Apple, model=HomePod Mini)
2023-11-20 01:04:59.908 DEBUG (MainThread) [custom_components.powercalc.discovery] media_player.badezimmer_homepod_mini: Already setup with discovery, skipping new discovery
2023-11-20 01:04:59.908 DEBUG (MainThread) [custom_components.powercalc.discovery] binary_sensor.dishwasher_door: Auto discovered model (manufacturer=Siemens, model=SN65EX57CE)
2023-11-20 01:04:59.909 DEBUG (MainThread) [custom_components.powercalc.discovery] binary_sensor.dishwasher_door: Model not found in library, skipping discovery
2023-11-20 01:04:59.909 DEBUG (MainThread) [custom_components.powercalc.discovery] binary_sensor.dishwasher_remote_control: Auto discovered model (manufacturer=Siemens, model=SN65EX57CE)
2023-11-20 01:04:59.909 DEBUG (MainThread) [custom_components.powercalc.discovery] binary_sensor.dishwasher_remote_control: Model not found in library, skipping discovery
2023-11-20 01:04:59.909 DEBUG (MainThread) [custom_components.powercalc.discovery] binary_sensor.dishwasher_remote_start: Auto discovered model (manufacturer=Siemens, model=SN65EX57CE)
2023-11-20 01:04:59.910 DEBUG (MainThread) [custom_components.powercalc.discovery] binary_sensor.dishwasher_remote_start: Model not found in library, skipping discovery
2023-11-20 01:04:59.910 DEBUG (MainThread) [custom_components.powercalc.discovery] switch.dishwasher_power: Auto discovered model (manufacturer=Siemens, model=SN65EX57CE)
2023-11-20 01:04:59.910 DEBUG (MainThread) [custom_components.powercalc.discovery] switch.dishwasher_power: Model not found in library, skipping discovery
2023-11-20 01:04:59.910 DEBUG (MainThread) [custom_components.powercalc.discovery] binary_sensor.klaras_drucker_connectivity: Auto discovered model (manufacturer=HP, model=ENVY 5000 All-in-One Printer series)
2023-11-20 01:04:59.910 DEBUG (MainThread) [custom_components.powercalc.discovery] binary_sensor.klaras_drucker_connectivity: Model not found in library, skipping discovery
2023-11-20 01:04:59.910 DEBUG (MainThread) [custom_components.powercalc.discovery] media_player.mitv: Auto discovered model (manufacturer=Aqara, model=MiTV-MSSP3)
2023-11-20 01:04:59.913 DEBUG (MainThread) [custom_components.powercalc.discovery] media_player.mitv: Model not found in library, skipping discovery
2023-11-20 01:04:59.914 DEBUG (MainThread) [custom_components.powercalc.discovery] binary_sensor.workday_sensor: Auto discovered model (manufacturer=python-holidays, model=0.35)
2023-11-20 01:04:59.914 DEBUG (MainThread) [custom_components.powercalc.discovery] binary_sensor.workday_sensor: Model not found in library, skipping discovery
2023-11-20 01:04:59.914 DEBUG (MainThread) [custom_components.powercalc.discovery] binary_sensor.ib2003244288_connection_state: Auto discovered model (manufacturer=Tado, model=IB01)
2023-11-20 01:04:59.915 DEBUG (MainThread) [custom_components.powercalc.discovery] binary_sensor.ib2003244288_connection_state: Model not found in library, skipping discovery
2023-11-20 01:04:59.915 DEBUG (MainThread) [custom_components.powercalc.discovery] binary_sensor.kuche_connectivity: Auto discovered model (manufacturer=Tado, model=Zone)
2023-11-20 01:04:59.916 DEBUG (MainThread) [custom_components.powercalc.discovery] binary_sensor.kuche_connectivity: Model not found in library, skipping discovery
2023-11-20 01:04:59.916 DEBUG (MainThread) [custom_components.powercalc.discovery] camera.tides_hamburg_curve_picture: Auto discovered model (manufacturer=WorldTidesInfo, model=WorldTidesInfoAPI)
2023-11-20 01:04:59.916 DEBUG (MainThread) [custom_components.powercalc.discovery] camera.tides_hamburg_curve_picture: Model not found in library, skipping discovery
2023-11-20 01:04:59.916 DEBUG (MainThread) [custom_components.powercalc.discovery] camera.tides_hamburg_plot_picture: Auto discovered model (manufacturer=WorldTidesInfo, model=WorldTidesInfoAPI)
2023-11-20 01:04:59.916 DEBUG (MainThread) [custom_components.powercalc.discovery] camera.tides_hamburg_plot_picture: Model not found in library, skipping discovery
2023-11-20 01:04:59.917 DEBUG (MainThread) [custom_components.powercalc.discovery] camera.tides_hamburg_long_plot_picture: Auto discovered model (manufacturer=WorldTidesInfo, model=WorldTidesInfoAPI)
2023-11-20 01:04:59.917 DEBUG (MainThread) [custom_components.powercalc.discovery] camera.tides_hamburg_long_plot_picture: Model not found in library, skipping discovery
2023-11-20 01:04:59.917 DEBUG (MainThread) [custom_components.powercalc.discovery] binary_sensor.balcony_door: Auto discovered model (manufacturer=eWeLink, model=DS01)
2023-11-20 01:04:59.917 DEBUG (MainThread) [custom_components.powercalc.discovery] binary_sensor.balcony_door: Model not found in library, skipping discovery
2023-11-20 01:04:59.918 DEBUG (MainThread) [custom_components.powercalc.discovery] binary_sensor.living_room_small_window: Auto discovered model (manufacturer=eWeLink, model=DS01)
2023-11-20 01:04:59.918 DEBUG (MainThread) [custom_components.powercalc.discovery] binary_sensor.living_room_small_window: Model not found in library, skipping discovery
2023-11-20 01:04:59.918 DEBUG (MainThread) [custom_components.powercalc.discovery] light.bathroom_ceiling_light: Auto discovered model (manufacturer=IKEA of Sweden, model=TRADFRIbulbE27WSglobeopal1055lm)
2023-11-20 01:04:59.944 DEBUG (MainThread) [custom_components.powercalc.discovery] light.bathroom_ceiling_light: Already setup with discovery, skipping new discovery
2023-11-20 01:04:59.944 DEBUG (MainThread) [custom_components.powercalc.discovery] light.hall_ceiling_light: Auto discovered model (manufacturer=IKEA of Sweden, model=TRADFRIbulbE27WSglobeopal1055lm)
2023-11-20 01:04:59.945 DEBUG (MainThread) [custom_components.powercalc.discovery] light.hall_ceiling_light: Already setup with discovery, skipping new discovery
2023-11-20 01:04:59.945 DEBUG (MainThread) [custom_components.powercalc.discovery] light.living_room_ceiling_lamp_1: Auto discovered model (manufacturer=Signify Netherlands B.V., model=LTG002)
2023-11-20 01:04:59.967 DEBUG (MainThread) [custom_components.powercalc.discovery] light.living_room_ceiling_lamp_1: Already setup with discovery, skipping new discovery
2023-11-20 01:04:59.968 DEBUG (MainThread) [custom_components.powercalc.discovery] light.living_room_ceiling_lamp_2: Auto discovered model (manufacturer=Signify Netherlands B.V., model=LTG002)
2023-11-20 01:04:59.968 DEBUG (MainThread) [custom_components.powercalc.discovery] light.living_room_ceiling_lamp_2: Already setup with discovery, skipping new discovery
2023-11-20 01:04:59.968 DEBUG (MainThread) [custom_components.powercalc.discovery] light.living_room_ceiling_lamp_3: Auto discovered model (manufacturer=Signify Netherlands B.V., model=LTG002)
2023-11-20 01:04:59.969 DEBUG (MainThread) [custom_components.powercalc.discovery] light.living_room_ceiling_lamp_3: Already setup with discovery, skipping new discovery
2023-11-20 01:04:59.969 DEBUG (MainThread) [custom_components.powercalc.discovery] light.living_room_ceiling_lamp_4: Auto discovered model (manufacturer=Signify Netherlands B.V., model=LTG002)
2023-11-20 01:04:59.969 DEBUG (MainThread) [custom_components.powercalc.discovery] light.living_room_ceiling_lamp_4: Already setup with discovery, skipping new discovery
2023-11-20 01:04:59.969 DEBUG (MainThread) [custom_components.powercalc.discovery] light.couchlight: Auto discovered model (manufacturer=Signify Netherlands B.V., model=LLC010)
2023-11-20 01:04:59.969 DEBUG (MainThread) [custom_components.powercalc.discovery] light.couchlight: Already setup with discovery, skipping new discovery
2023-11-20 01:04:59.969 DEBUG (MainThread) [custom_components.powercalc.discovery] light.silicon_labs_ezsp_living_room_ceiling_lamp_button_group: Auto discovered model (manufacturer=Silicon Labs, model=EZSP)
2023-11-20 01:04:59.970 DEBUG (MainThread) [custom_components.powercalc.discovery] light.silicon_labs_ezsp_living_room_ceiling_lamp_button_group: Model not found in library, skipping discovery
2023-11-20 01:04:59.971 DEBUG (MainThread) [custom_components.powercalc.discovery] binary_sensor.bed_switch_binary_input: Auto discovered model (manufacturer=Signify Netherlands B.V., model=RWL021)
2023-11-20 01:04:59.972 DEBUG (MainThread) [custom_components.powercalc.discovery] binary_sensor.bed_switch_binary_input: Model not found in library, skipping discovery
2023-11-20 01:04:59.972 DEBUG (MainThread) [custom_components.powercalc.discovery] light.silicon_labs_ezsp_living_room_bed_button_group: Auto discovered model (manufacturer=Silicon Labs, model=EZSP)
2023-11-20 01:04:59.972 DEBUG (MainThread) [custom_components.powercalc.discovery] light.silicon_labs_ezsp_living_room_bed_button_group: Model not found in library, skipping discovery
2023-11-20 01:04:59.972 DEBUG (MainThread) [custom_components.powercalc.discovery] light.wardrobe_light: Auto discovered model (manufacturer=IKEA of Sweden, model=TRADFRI Driver 10W)
2023-11-20 01:04:59.973 DEBUG (MainThread) [custom_components.powercalc.discovery] light.wardrobe_light: Model not found in library, skipping discovery
2023-11-20 01:04:59.973 DEBUG (MainThread) [custom_components.powercalc.discovery] light.kitchen_ceiling_light: Auto discovered model (manufacturer=IKEA of Sweden, model=TRADFRIbulbE27WSglobeopal1055lm)
2023-11-20 01:04:59.973 DEBUG (MainThread) [custom_components.powercalc.discovery] light.kitchen_ceiling_light: Already setup with discovery, skipping new discovery
2023-11-20 01:04:59.974 DEBUG (MainThread) [custom_components.powercalc.discovery] Done auto discovering entities
2023-11-20 01:05:01.497 DEBUG (MainThread) [custom_components.powercalc.discovery] media_player.badezimmer_homepod_mini: Auto discovered model (manufacturer=Apple, model=HomePod Mini)
2023-11-20 01:05:01.497 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=media_player.badezimmer_homepod_mini entity_category=None, sensor_name=Badezimmer HomePod Mini power strategy=linear manufacturer=apple model=HomePod Mini unique_id=pc_E0:2B:96:AB:B6:F3)
2023-11-20 01:05:01.497 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: Badezimmer HomePod Mini energy
2023-11-20 01:05:01.498 DEBUG (MainThread) [custom_components.powercalc.sensors.group] Creating grouped power sensor: All_powercalc power (entity_id=sensor.all_powercalc_sensor_power)
2023-11-20 01:05:01.498 DEBUG (MainThread) [custom_components.powercalc.sensors.group] Creating grouped energy sensor: All_powercalc energy (entity_id=sensor.all_powercalc_sensor_energy)
2023-11-20 01:05:01.502 DEBUG (MainThread) [custom_components.powercalc.discovery] light.bathroom_ceiling_light: Auto discovered model (manufacturer=IKEA of Sweden, model=TRADFRIbulbE27WSglobeopal1055lm)
2023-11-20 01:05:01.502 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=light.bathroom_ceiling_light entity_category=None, sensor_name=Bathroom Ceiling Light power strategy=lut manufacturer=ikea model=LED2003G10 unique_id=pc_6c:5c:b1:ff:fe:a3:0a:8f-1)
2023-11-20 01:05:01.503 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] Loading LUT data file: /config/custom_components/powercalc/power_profile/../data/ikea/LED2003G10/color_temp.csv.gz
2023-11-20 01:05:01.513 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] LUT file loaded: 1144 lines
2023-11-20 01:05:01.513 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: Bathroom Ceiling Light energy
2023-11-20 01:05:01.515 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.badezimmer_homepod_mini_power to device f045e399c95f19adc976af9baa6b9286
2023-11-20 01:05:01.517 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.badezimmer_homepod_mini_energy to device f045e399c95f19adc976af9baa6b9286
2023-11-20 01:05:01.519 DEBUG (MainThread) [custom_components.powercalc.discovery] light.hall_ceiling_light: Auto discovered model (manufacturer=IKEA of Sweden, model=TRADFRIbulbE27WSglobeopal1055lm)
2023-11-20 01:05:01.520 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=light.hall_ceiling_light entity_category=None, sensor_name=Hall Ceiling Light power strategy=lut manufacturer=ikea model=LED2003G10 unique_id=pc_bc:02:6e:ff:fe:62:c1:4a-1)
2023-11-20 01:05:01.520 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: Hall Ceiling Light energy
2023-11-20 01:05:01.521 DEBUG (MainThread) [custom_components.powercalc.sensors.group] Load previous energy sensor states from store
2023-11-20 01:05:01.521 DEBUG (MainThread) [custom_components.powercalc.sensors.group] sensor.all_powercalc_sensor_energy: Restoring state: 4.7168
2023-11-20 01:05:01.527 DEBUG (MainThread) [custom_components.powercalc.discovery] light.couchlight: Auto discovered model (manufacturer=Signify Netherlands B.V., model=LLC010)
2023-11-20 01:05:01.527 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=light.couchlight entity_category=None, sensor_name=Couchlight power strategy=lut manufacturer=signify model=LLC010 unique_id=pc_00:17:88:01:00:1f:a6:91-11)
2023-11-20 01:05:01.527 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: Couchlight energy
2023-11-20 01:05:01.529 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.bathroom_ceiling_light_power to device 5a123f5feb51d69087d7c76c5ba44c7a
2023-11-20 01:05:01.530 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.bathroom_ceiling_light_energy to device 5a123f5feb51d69087d7c76c5ba44c7a
2023-11-20 01:05:01.540 DEBUG (MainThread) [custom_components.powercalc.discovery] light.living_room_ceiling_lamp_4: Auto discovered model (manufacturer=Signify Netherlands B.V., model=LTG002)
2023-11-20 01:05:01.540 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=light.living_room_ceiling_lamp_4 entity_category=None, sensor_name=Living Room Ceiling Lamp 4 power strategy=lut manufacturer=signify model=LTG002 unique_id=pc_00:17:88:01:09:6e:00:f0-11)
2023-11-20 01:05:01.541 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] Loading LUT data file: /config/custom_components/powercalc/power_profile/../data/signify/LTG002/color_temp.csv.gz
2023-11-20 01:05:01.556 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] LUT file loaded: 1664 lines
2023-11-20 01:05:01.556 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: Living Room Ceiling Lamp 4 energy
2023-11-20 01:05:01.557 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.hall_ceiling_light_power to device 8ba4f452ac428a35f0be48884b0fe82c
2023-11-20 01:05:01.559 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.hall_ceiling_light_energy to device 8ba4f452ac428a35f0be48884b0fe82c
2023-11-20 01:05:01.564 DEBUG (MainThread) [custom_components.powercalc.discovery] light.living_room_ceiling_lamp_3: Auto discovered model (manufacturer=Signify Netherlands B.V., model=LTG002)
2023-11-20 01:05:01.564 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=light.living_room_ceiling_lamp_3 entity_category=None, sensor_name=Living Room Ceiling Lamp 3 power strategy=lut manufacturer=signify model=LTG002 unique_id=pc_00:17:88:01:09:74:0f:27-11)
2023-11-20 01:05:01.565 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: Living Room Ceiling Lamp 3 energy
2023-11-20 01:05:01.566 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.couchlight_power to device e8938c175a720433003b3ffbdb2ba13e
2023-11-20 01:05:01.567 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.couchlight_energy to device e8938c175a720433003b3ffbdb2ba13e
2023-11-20 01:05:01.584 DEBUG (MainThread) [custom_components.powercalc.discovery] light.living_room_ceiling_lamp_2: Auto discovered model (manufacturer=Signify Netherlands B.V., model=LTG002)
2023-11-20 01:05:01.584 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=light.living_room_ceiling_lamp_2 entity_category=None, sensor_name=Living Room Ceiling Lamp 2 power strategy=lut manufacturer=signify model=LTG002 unique_id=pc_00:17:88:01:09:6e:0f:9c-11)
2023-11-20 01:05:01.585 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: Living Room Ceiling Lamp 2 energy
2023-11-20 01:05:01.586 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.living_room_ceiling_lamp_4_power to device 92da14b41c8698f79d15a8b3dcee8a5a
2023-11-20 01:05:01.588 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.living_room_ceiling_lamp_4_energy to device 92da14b41c8698f79d15a8b3dcee8a5a
2023-11-20 01:05:01.636 DEBUG (MainThread) [custom_components.powercalc.discovery] light.living_room_ceiling_lamp_1: Auto discovered model (manufacturer=Signify Netherlands B.V., model=LTG002)
2023-11-20 01:05:01.637 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=light.living_room_ceiling_lamp_1 entity_category=None, sensor_name=Living Room Ceiling Lamp 1 power strategy=lut manufacturer=signify model=LTG002 unique_id=pc_00:17:88:01:09:6d:f0:0f-11)
2023-11-20 01:05:01.637 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: Living Room Ceiling Lamp 1 energy
2023-11-20 01:05:01.639 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.living_room_ceiling_lamp_3_power to device 4be9a0eacc57221166ff8c9cae38dc68
2023-11-20 01:05:01.641 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.living_room_ceiling_lamp_3_energy to device 4be9a0eacc57221166ff8c9cae38dc68
2023-11-20 01:05:01.648 DEBUG (MainThread) [custom_components.powercalc.sensors.group] Creating grouped power sensor: Ceiling Light power (entity_id=sensor.ceiling_light_power)
2023-11-20 01:05:01.649 DEBUG (MainThread) [custom_components.powercalc.sensors.group] Creating grouped energy sensor: Ceiling Light energy (entity_id=sensor.ceiling_light_energy)
2023-11-20 01:05:01.650 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.living_room_ceiling_lamp_2_power to device 25f34e25978a5a7d94a942e7ff1479df
2023-11-20 01:05:01.652 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.living_room_ceiling_lamp_2_energy to device 25f34e25978a5a7d94a942e7ff1479df
2023-11-20 01:05:01.658 DEBUG (MainThread) [custom_components.powercalc.discovery] light.kitchen_ceiling_light: Auto discovered model (manufacturer=IKEA of Sweden, model=TRADFRIbulbE27WSglobeopal1055lm)
2023-11-20 01:05:01.658 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=light.kitchen_ceiling_light entity_category=None, sensor_name=Kitchen Ceiling Light power strategy=lut manufacturer=ikea model=LED2003G10 unique_id=pc_6c:5c:b1:ff:fe:68:f6:52-1)
2023-11-20 01:05:01.658 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: Kitchen Ceiling Light energy
2023-11-20 01:05:01.660 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.living_room_ceiling_lamp_1_power to device 4304110b5d0d63938a017cb54689f429
2023-11-20 01:05:01.661 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.living_room_ceiling_lamp_1_energy to device 4304110b5d0d63938a017cb54689f429
2023-11-20 01:05:01.675 DEBUG (MainThread) [custom_components.powercalc.sensors.group] Creating grouped power sensor: All Powercalc Lights power (entity_id=sensor.all_powercalc_lights_power)
2023-11-20 01:05:01.675 DEBUG (MainThread) [custom_components.powercalc.sensors.group] Creating grouped energy sensor: All Powercalc Lights energy (entity_id=sensor.all_powercalc_lights_energy)
2023-11-20 01:05:01.678 DEBUG (MainThread) [custom_components.powercalc.sensors.group] sensor.ceiling_light_energy: Restoring state: 0.5017
2023-11-20 01:05:01.689 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.kitchen_ceiling_light_power to device 0fed5527ed9262b009d2aa467e0beb01
2023-11-20 01:05:01.691 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.kitchen_ceiling_light_energy to device 0fed5527ed9262b009d2aa467e0beb01
2023-11-20 01:05:01.701 DEBUG (MainThread) [custom_components.powercalc.sensors.group] sensor.all_powercalc_lights_energy: Restoring state: 1.2961
2023-11-20 01:05:03.957 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template<template=({{ '%0.2f' | format(states('sensor.living_room_absolute_humidity') | float - 
states('sensor.outside_absolute_humidity') | float) }}) renders=2>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1925, in forgiving_float_filter
    return float(value)
           ^^^^^^^^^^^^
ValueError: could not convert string to float: 'unknown'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 568, in async_render
    render_result = _render_with_context(self.template, compiled, **kwargs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2231, in _render_with_context
    return template.render(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.11/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 1, in top-level template code
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1928, in forgiving_float_filter
    raise_no_default("float", value)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1626, in raise_no_default
    raise ValueError(
ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ '%0.2f' | format(states('sensor.living_room_absolute_humidity') | float - 
states('sensor.outside_absolute_humidity') | float) }}' but no default was specified

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 694, in async_render_to_info
    render_info._result = self.async_render(
                          ^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 570, in async_render
    raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ '%0.2f' | format(states('sensor.living_room_absolute_humidity') | float - 
states('sensor.outside_absolute_humidity') | float) }}' but no default was specified
2023-11-20 01:05:03.971 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ '%0.2f' | format(states('sensor.living_room_absolute_humidity') | float - 
states('sensor.outside_absolute_humidity') | float) }}' but no default was specified') while processing template 'Template<template=({{ '%0.2f' | format(states('sensor.living_room_absolute_humidity') | float - 
states('sensor.outside_absolute_humidity') | float) }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.difference_absolute_humidity_living_room'
2023-11-20 01:05:03.972 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template<template=({{ '%0.2f' | format(states('sensor.kitchen_absolute_humidity') | float - 
states('sensor.outside_absolute_humidity') | float) }}) renders=2>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1925, in forgiving_float_filter
    return float(value)
           ^^^^^^^^^^^^
ValueError: could not convert string to float: 'unknown'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 568, in async_render
    render_result = _render_with_context(self.template, compiled, **kwargs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2231, in _render_with_context
    return template.render(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.11/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 1, in top-level template code
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1928, in forgiving_float_filter
    raise_no_default("float", value)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1626, in raise_no_default
    raise ValueError(
ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ '%0.2f' | format(states('sensor.kitchen_absolute_humidity') | float - 
states('sensor.outside_absolute_humidity') | float) }}' but no default was specified

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 694, in async_render_to_info
    render_info._result = self.async_render(
                          ^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 570, in async_render
    raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ '%0.2f' | format(states('sensor.kitchen_absolute_humidity') | float - 
states('sensor.outside_absolute_humidity') | float) }}' but no default was specified
2023-11-20 01:05:03.982 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ '%0.2f' | format(states('sensor.kitchen_absolute_humidity') | float - 
states('sensor.outside_absolute_humidity') | float) }}' but no default was specified') while processing template 'Template<template=({{ '%0.2f' | format(states('sensor.kitchen_absolute_humidity') | float - 
states('sensor.outside_absolute_humidity') | float) }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.difference_absolute_humidity_kitchen'
2023-11-20 01:05:03.995 DEBUG (MainThread) [custom_components.powercalc.sensors.power] media_player.badezimmer_homepod_mini: State changed to "idle". Power:0.65
2023-11-20 01:05:03.996 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.bathroom_ceiling_light: Looking up power usage for bri:254 mired:357
2023-11-20 01:05:03.996 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.bathroom_ceiling_light: Calculated power:9.464999999999999857891452847979962825775146484375
2023-11-20 01:05:03.996 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.bathroom_ceiling_light: State changed to "on". Power:9.46
2023-11-20 01:05:03.997 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.hall_ceiling_light: State changed to "unavailable". Power:0.00
2023-11-20 01:05:03.997 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.couchlight: State changed to "off". Power:0.40
2023-11-20 01:05:03.998 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.living_room_ceiling_lamp_4: Looking up power usage for bri:254 mired:366
2023-11-20 01:05:03.998 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.living_room_ceiling_lamp_4: Calculated power:3.564999999999999946709294817992486059665679931640625
2023-11-20 01:05:03.998 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.living_room_ceiling_lamp_4: State changed to "on". Power:3.56
2023-11-20 01:05:03.998 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.living_room_ceiling_lamp_3: Looking up power usage for bri:254 mired:366
2023-11-20 01:05:03.999 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.living_room_ceiling_lamp_3: Calculated power:3.564999999999999946709294817992486059665679931640625
2023-11-20 01:05:03.999 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.living_room_ceiling_lamp_3: State changed to "on". Power:3.56
2023-11-20 01:05:03.999 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.living_room_ceiling_lamp_2: Looking up power usage for bri:254 mired:366
2023-11-20 01:05:04.000 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.living_room_ceiling_lamp_2: Calculated power:3.564999999999999946709294817992486059665679931640625
2023-11-20 01:05:04.000 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.living_room_ceiling_lamp_2: State changed to "on". Power:3.56
2023-11-20 01:05:04.002 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.living_room_ceiling_lamp_1: Looking up power usage for bri:254 mired:366
2023-11-20 01:05:04.002 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.living_room_ceiling_lamp_1: Calculated power:3.564999999999999946709294817992486059665679931640625
2023-11-20 01:05:04.002 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.living_room_ceiling_lamp_1: State changed to "on". Power:3.56
2023-11-20 01:05:04.003 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.kitchen_ceiling_light: State changed to "off". Power:0.17
2023-11-20 01:05:04.631 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: All standby energy
2023-11-20 01:05:04.727 ERROR (MainThread) [homeassistant.components.homekit.type_thermostats] climate.bt_kitchen: Received invalid HVAC mode: unavailable
2023-11-20 01:05:04.728 ERROR (MainThread) [homeassistant.components.homekit.type_thermostats] climate.bt_living_room: Received invalid HVAC mode: unavailable
2023-11-20 01:05:22.629 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.living_room_ceiling_lamp_3: State changed to "off". Power:0.30
2023-11-20 01:05:22.668 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.living_room_ceiling_lamp_1: State changed to "off". Power:0.30
2023-11-20 01:05:22.675 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.living_room_ceiling_lamp_4: State changed to "off". Power:0.30
2023-11-20 01:05:22.690 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.living_room_ceiling_lamp_2: State changed to "off". Power:0.30
2023-11-20 01:05:24.237 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.living_room_ceiling_lamp_3: Looking up power usage for bri:254 mired:366
2023-11-20 01:05:24.239 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.living_room_ceiling_lamp_3: Calculated power:3.564999999999999946709294817992486059665679931640625
2023-11-20 01:05:24.240 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.living_room_ceiling_lamp_3: State changed to "on". Power:3.56
2023-11-20 01:05:24.261 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.living_room_ceiling_lamp_4: Looking up power usage for bri:254 mired:366
2023-11-20 01:05:24.261 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.living_room_ceiling_lamp_4: Calculated power:3.564999999999999946709294817992486059665679931640625
2023-11-20 01:05:24.262 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.living_room_ceiling_lamp_4: State changed to "on". Power:3.56
2023-11-20 01:05:24.279 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.living_room_ceiling_lamp_2: Looking up power usage for bri:254 mired:366
2023-11-20 01:05:24.280 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.living_room_ceiling_lamp_2: Calculated power:3.564999999999999946709294817992486059665679931640625
2023-11-20 01:05:24.280 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.living_room_ceiling_lamp_2: State changed to "on". Power:3.56
2023-11-20 01:05:24.294 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.living_room_ceiling_lamp_1: Looking up power usage for bri:254 mired:366
2023-11-20 01:05:24.294 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.living_room_ceiling_lamp_1: Calculated power:3.564999999999999946709294817992486059665679931640625
2023-11-20 01:05:24.294 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.living_room_ceiling_lamp_1: State changed to "on". Power:3.56
2023-11-20 01:05:25.794 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.living_room_ceiling_lamp_3: State changed to "off". Power:0.30
2023-11-20 01:05:25.810 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.living_room_ceiling_lamp_1: State changed to "off". Power:0.30
2023-11-20 01:05:25.825 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.living_room_ceiling_lamp_4: State changed to "off". Power:0.30
2023-11-20 01:05:25.840 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.living_room_ceiling_lamp_2: State changed to "off". Power:0.30
2023-11-20 01:05:27.740 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] Loading LUT data file: /config/custom_components/powercalc/power_profile/../data/signify/LLC010/hs.csv.gz
2023-11-20 01:05:27.871 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] LUT file loaded: 24786 lines
2023-11-20 01:05:27.873 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/powercalc/sensors/power.py", line 387, in appliance_state_listener
    await self._handle_source_entity_state_change(
  File "/config/custom_components/powercalc/sensors/power.py", line 490, in _handle_source_entity_state_change
    self._power = await self.calculate_power(state)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/powercalc/sensors/power.py", line 549, in calculate_power
    power = await self._strategy_instance.calculate(entity_state)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/powercalc/strategy/lut.py", line 148, in calculate
    light_setting.hue = int(hs[0] / 360 * 65535)
                            ~~^^^
TypeError: 'NoneType' object is not subscriptable
2023-11-20 01:05:28.880 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.living_room_ceiling_lamp_3: Looking up power usage for bri:254 mired:366
2023-11-20 01:05:28.880 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.living_room_ceiling_lamp_3: Calculated power:3.564999999999999946709294817992486059665679931640625
2023-11-20 01:05:28.880 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.living_room_ceiling_lamp_3: State changed to "on". Power:3.56
2023-11-20 01:05:28.909 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.living_room_ceiling_lamp_1: Looking up power usage for bri:254 mired:366
2023-11-20 01:05:28.909 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.living_room_ceiling_lamp_1: Calculated power:3.564999999999999946709294817992486059665679931640625
2023-11-20 01:05:28.909 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.living_room_ceiling_lamp_1: State changed to "on". Power:3.56
2023-11-20 01:05:28.925 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.living_room_ceiling_lamp_4: Looking up power usage for bri:254 mired:366
2023-11-20 01:05:28.926 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.living_room_ceiling_lamp_4: Calculated power:3.564999999999999946709294817992486059665679931640625
2023-11-20 01:05:28.926 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.living_room_ceiling_lamp_4: State changed to "on". Power:3.56
2023-11-20 01:05:28.935 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.living_room_ceiling_lamp_2: Looking up power usage for bri:254 mired:366
2023-11-20 01:05:28.936 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.living_room_ceiling_lamp_2: Calculated power:3.564999999999999946709294817992486059665679931640625
2023-11-20 01:05:28.936 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.living_room_ceiling_lamp_2: State changed to "on". Power:3.56
2023-11-20 01:05:30.253 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.couchlight: State changed to "off". Power:0.40
2023-11-20 01:05:32.399 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.living_room_ceiling_lamp_3: State changed to "off". Power:0.30
2023-11-20 01:05:32.415 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.living_room_ceiling_lamp_1: State changed to "off". Power:0.30
2023-11-20 01:05:32.429 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.living_room_ceiling_lamp_4: State changed to "off". Power:0.30
2023-11-20 01:05:32.444 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.living_room_ceiling_lamp_2: State changed to "off". Power:0.30

Diagnostics dump or YAML config

No response

bramstroker commented 11 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

KlaraJa commented 11 months ago

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.

codicusmaximus commented 11 months ago

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.

bramstroker commented 11 months ago

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.

RoSche2001 commented 10 months ago

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.

KlaraJa commented 10 months ago

@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.

Mariusthvdb commented 10 months ago

didnt want to crosspost: https://github.com/bramstroker/homeassistant-powercalc/issues/1953#issue-2046727469

downgrading to 1.9.9. solves that 'misbehaving' issue too

bramstroker commented 9 months ago

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.