bramstroker / homeassistant-powercalc

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

Automatic Power Sensor Configuration Not Working #715

Closed IIAIronWolf closed 2 years ago

IIAIronWolf commented 2 years ago

I had no luck with this integration in the past and decided to start from scratch today. After reinstalling powrcalc, I noticed all of the lights being auto discovered in the logs, but the automatic power sensor function has never worked on old or new versions of the integration. I did noticed an error on a single light about setting up the power sensor, and I am wondering if the code is failing when it finds the first automatic power sensor setup failure.

Power sensor setup failure: 2022-05-08 00:50:46 ERROR (MainThread) [custom_components.powercalc.sensors.power] Skipping sensor setup light.living_room_light: ('No lookup file found for mode', 'color_temp')

Full Log:

2022-05-08 00:50:24 WARNING (SyncWorker_2) [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
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc] Start auto discovering entities
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc.model_discovery] light.living_room_light: Auto discovered model (manufacturer=LIFX, model=LIFX Mini Color)
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc.light_model] Loading /config/custom_components/powercalc/data/lifx/LIFX Mini Color/model.json
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc.model_discovery] light.wled_light: Auto discovered model (manufacturer=WLED, model=FOSS)
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc] light.wled_light: Model not found in library, skipping auto configuration
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc.model_discovery] light.entry_light: Auto discovered model (manufacturer=Signify Netherlands B.V., model=LWB014)
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc] light.entry_light: Model not found in library, skipping auto configuration
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc.model_discovery] light.kitchen_center_right: Auto discovered model (manufacturer=Signify Netherlands B.V., model=LCA003)
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc] light.kitchen_center_right: Model not found in library, skipping auto configuration
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc.model_discovery] light.kitchen_center_left: Auto discovered model (manufacturer=Signify Netherlands B.V., model=LCA003)
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc] light.kitchen_center_left: Model not found in library, skipping auto configuration
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc.model_discovery] light.kitchen_left: Auto discovered model (manufacturer=Signify Netherlands B.V., model=LCA003)
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc] light.kitchen_left: Model not found in library, skipping auto configuration
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc.model_discovery] light.kitchen_right: Auto discovered model (manufacturer=Signify Netherlands B.V., model=LCT014)
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc] light.kitchen_right: Model not found in library, skipping auto configuration
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc.model_discovery] light.laundry: Auto discovered model (manufacturer=Signify Netherlands B.V., model=LWB014)
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc] light.laundry: Model not found in library, skipping auto configuration
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc.model_discovery] light.plate01_backlight_2: Auto discovered model (manufacturer=HASwitchPlate, model=HASPone v1.0.0)
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc] light.plate01_backlight_2: Model not found in library, skipping auto configuration
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc.model_discovery] light.plate01_selected_foreground_color: Auto discovered model (manufacturer=HASwitchPlate, model=HASPone v1.0.0)
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc] light.plate01_selected_foreground_color: Model not found in library, skipping auto configuration
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc.model_discovery] light.plate01_selected_background_color: Auto discovered model (manufacturer=HASwitchPlate, model=HASPone v1.0.0)
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc] light.plate01_selected_background_color: Model not found in library, skipping auto configuration
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc.model_discovery] light.plate01_unselected_foreground_color: Auto discovered model (manufacturer=HASwitchPlate, model=HASPone v1.0.0)
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc] light.plate01_unselected_foreground_color: Model not found in library, skipping auto configuration
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc.model_discovery] light.plate01_unselected_background_color: Auto discovered model (manufacturer=HASwitchPlate, model=HASPone v1.0.0)
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc] light.plate01_unselected_background_color: Model not found in library, skipping auto configuration
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc.model_discovery] light.light_panels_58_24_c5: Auto discovered model (manufacturer=Nanoleaf, model=NL22)
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc] light.light_panels_58_24_c5: Model not found in library, skipping auto configuration
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc.model_discovery] light.fridge: Auto discovered model (manufacturer=Signify Netherlands B.V., model=LCA002)
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc] light.fridge: Model not found in library, skipping auto configuration
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc.model_discovery] light.bedroom_austin: Auto discovered model (manufacturer=Signify Netherlands B.V., model=LCA003)
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc] light.bedroom_austin: Model not found in library, skipping auto configuration
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc.model_discovery] light.bedroom_tv: Auto discovered model (manufacturer=Signify Netherlands B.V., model=LCA003)
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc] light.bedroom_tv: Model not found in library, skipping auto configuration
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc.model_discovery] light.bedroom_eric: Auto discovered model (manufacturer=Signify Netherlands B.V., model=LCA003)
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc] light.bedroom_eric: Model not found in library, skipping auto configuration
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc.model_discovery] light.tv_lights: Auto discovered model (manufacturer=Govee, model=H6199)
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc] light.tv_lights: Model not found in library, skipping auto configuration
2022-05-08 00:50:45 DEBUG (MainThread) [custom_components.powercalc] Done auto discovering entities
2022-05-08 00:50:46 ERROR (MainThread) [custom_components.powercalc.sensors.power] Skipping sensor setup light.living_room_light: ('No lookup file found for mode', 'color_temp')
bramstroker commented 2 years ago

It works as follows. Powercalc tries to find all light entities in your installation and their respective manufacturer and models. This is the log line starting with "Auto discovered model". Next it tries to find the corresponding LUT file in the library. When the model is not supported it will say "Model not found in library", which is the case for almost all your lights. When your light is supported you'll see "Loading xxxxx.json" in the logs. So you should have a power sensor for your LIFX mini. You can see the supported lights here. LCA002, LCA003, LCT014 and LWB014 are not on the list yet unfortunately. You could have a look into providing measurements for these lights yourself (https://github.com/bramstroker/homeassistant-powercalc/wiki/Contributing-new-lights). Or wait till someone else provides it.

IIAIronWolf commented 2 years ago

Whoops, I guess I missed that. Thanks for the info! Do you know why the power sensor creation would have been 'skipped' for the LIFX bulb? It didn't create one for some reason.

bramstroker commented 2 years ago

@IIAIronWolf That's because of the error you mentioned: light.living_room_light: ('No lookup file found for mode', 'color_temp'). That light has been added 9 days ago, but color_temp.csv is missing. I have asked the contributor if he could measure the light in color_temp mode and submit the csv which should resolve this error.

jacobdonenfeld commented 2 years ago

I have asked the contributor if he could measure the light in color_temp mode and submit the csv which should resolve this error.

Will do :)

jacobdonenfeld commented 2 years ago

The fix is merged in from #726, let me know if you have any issues @IIAIronWolf

bramstroker commented 2 years ago

Thanks for fixing @jacobdonenfeld