bramstroker / homeassistant-powercalc

Custom component to calculate estimated power consumption of lights and other appliances
MIT License
1.03k stars 264 forks source link

Wrong calculated value for IKEA LED1624G9 in power on state #2047

Closed McWuragu closed 7 months ago

McWuragu commented 9 months ago

System Health details

System Information

version core-2024.2.1
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.1
os_name Linux
os_version 6.1.74-haos
arch x86_64
timezone Europe/Berlin
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 5000 Installed Version | 1.34.0 Stage | running Available Repositories | 1393 Downloaded Repositories | 16
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.5 -- | -- update_channel | stable supervisor_version | supervisor-2024.01.1 agent_version | 1.6.0 docker_version | 24.0.7 disk_total | 30.8 GB disk_used | 11.1 GB healthy | true supported | true board | ova supervisor_api | ok version_api | ok installed_addons | File editor (5.8.0), Terminal & SSH (9.9.0), Node-RED (17.0.6), Mosquitto broker (6.4.0), Zigbee2MQTT (1.35.3-1), Matter Server (5.1.2), Log Viewer (0.17.0), MariaDB (2.6.1), ESPHome (2023.12.9)
Dashboards dashboards | 4 -- | -- resources | 3 views | 23 mode | storage
Recorder oldest_recorder_run | 1. Februar 2024 um 22:17 -- | -- current_recorder_run | 10. Februar 2024 um 00:54 estimated_db_size | 687.64 MiB database_engine | mysql database_version | 10.6.12
Xiaomi Miot Auto component_version | 0.7.15 -- | -- can_reach_server | ok can_reach_spec | ok logged_accounts | 0 total_devices | 0

Checklist

Describe the issue

My TRADFRI bulb E27 CWS opal 600lm (LED1624G9) reports power 0.40W in the off mode and if i switch this device on then the entity reports power 0.01w

Reproduction steps

  1. create the integration by using virtual power (library) at GUI and use default values
  2. switch the device on (70% )and power sensor reports 0.01W (color h: 27 hue: 27 s: 92 saturation: 92 x: 0.5056 'y': 0.4152)
  3. switch the device off and power sensor reports 0.48W ...

Debug logs

2024-02-11 21:43:05.643 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.deckenlampe_kl2: State changed to "off". Power:0.48
2024-02-11 21:43:12.362 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.deckenlampe_kl2: Looking up power usage for bri:178 mired:454
2024-02-11 21:43:12.363 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.deckenlampe_kl2: Calculated power:0.01000000000000000020816681711721685132943093776702880859375
2024-02-11 21:43:12.363 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.deckenlampe_kl2: State changed to "on". Power:0.01
2024-02-11 21:43:12.795 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.deckenlampe_kl2: Looking up power usage for bri:178 mired:454
2024-02-11 21:43:12.795 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.deckenlampe_kl2: Calculated power:0.01000000000000000020816681711721685132943093776702880859375
2024-02-11 21:43:12.795 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.deckenlampe_kl2: State changed to "on". Power:0.01

Diagnostics dump or YAML config

No response

bramstroker commented 9 months ago

I did have a quick look but the LUT file for color temp does not have any data. Only 2 rows which do both have a 0.01 measurement.

bri,mired,watt
1,153,0.01
255,500,0.01

Found the PR which was issued in 2021 https://github.com/bramstroker/homeassistant-powercalc/pull/451. There is an explanation why no color_temp.csv was provided, because at that time the light was not doing anything for the user when set to color_temp. Could be a bug at that time which was resolved now.

To fix the issue measurements needs to be provided for the color_temp mode of the light. Are you able to do that following the instructions here: https://homeassistant-powercalc.readthedocs.io/en/latest/contributing/measure.html. When you are unable we need to ping the initial contributor and hopefully he will be able to.

McWuragu commented 9 months ago

Thank you for the response. I want to try, but actual I haven't the necessary equipment for the measurements.

bramstroker commented 8 months ago

I have asked original contributor if he can do the measurements. But not sure he is still around.

Here are the instructions to do the measurements yourself: https://homeassistant-powercalc.readthedocs.io/en/latest/contributing/measure.html It doesn't take any expensive equipment. And also doesn't take that much time. Shelly Plug S or Tapo P100 plugs are recommended. But lots of other smartplugs can be used as well.

github-actions[bot] commented 7 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

bramstroker commented 7 months ago

not stale

bramstroker commented 7 months ago

Measurements have been added by @marthubner, thanks a lot mate. #2221 So this issue will be resolved in next release.