homeassistant-powercalc: "Lookup table not found" error

According to discussion.

HA Core log shows

ERROR (MainThread) [custom_components.powercalc.strategy_lut] Lookup table not found

Usually few errors in a row (2-6)

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 27 (27 by maintainers)

Most upvoted comments

@QbaF I can’t show examples similar to your installation, because they don’t exist in my house, but I’ve spent lots of time on this subject and I just know about few things, like: light characteristic corrections used by some manufactures but not all, driver hardware differs between generations and between manufacturers is also different, so use of LUT file from different manufacturer is not the best way…

familiar sounding names;)

hehe I’m also from Poland (better known as szopen ;P)

Much better:)

  1. It is in NodeRed. Would you like the flow export or just a data part of service light.turn_on? You can safely ignore the error "Lookup table not found" in this case. So if it is unimportant, is there possibility to have it not as an ERROR? Or some other way to not spoil the log?

Color mode unknown is checked for now, and results in a debug log entry, not an error anymore. This is on the master branch now.

  1. Ok, understand. In that case we can not be sure if Lookup table not found occur for state changed to on or to off. At least unless we isolate the event. And 2021-11-03 14:58:22 DEBUG (MainThread) [custom_components.powercalc.strategy_lut] Power:3.3 brings not too much info when not connected with entity.

This line will only be shown when state goes to “on”, not for “off”, because the LUT table is only read when the light is actually on. I have added the entity id to every log line so things will be more clear.

Waiting for that @bramstroker debug extra info version.

Extra debug information is already implemented in master branch. You can install this branch with HACS. Just click reinstall and you can select master.

Problem is with light.witryna_1_4c but log is probably not “fresh after restart HA” (I can’t find initialization sensor related to light.witryna_1_4c).

It seems like faulty LUT file (maybe created for another light model? because this light seems to have parameters out of measured range). But going deeper - it is interesting, as the same values worked earlier (before error).

# initialization should be there or up?
2021-11-02 15:37:28 DEBUG (MainThread) [custom_components.powercalc.sensors.utility_meter] Creating utility_meter sensor: Witryna 2/4c kWh yearly
2021-11-02 15:37:28 DEBUG (MainThread) [custom_components.powercalc.light_model] Loading /config/powercalc-custom-models/gledopto-qba/LCT003/model.json
2021-11-02 15:37:28 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=light.witryna_3_4c sensor_name=Witryna 3/4c W strategy=LutStrategy manufacturer=gledopto-qba model=LCT003 standby_power=0 unique_id=00:12:4b:00:1b:d8:ae:15-0b)
2021-11-02 15:37:28 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: Witryna 3/4c kWh
2021-11-02 15:37:28 DEBUG (MainThread) [custom_components.powercalc.sensors.utility_meter] Creating utility_meter sensor: Witryna 3/4c kWh daily
2021-11-02 15:37:28 DEBUG (MainThread) [custom_components.powercalc.sensors.utility_meter] Creating utility_meter sensor: Witryna 3/4c kWh monthly
2021-11-02 15:37:28 DEBUG (MainThread) [custom_components.powercalc.sensors.utility_meter] Creating utility_meter sensor: Witryna 3/4c kWh yearly
2021-11-02 15:37:28 DEBUG (MainThread) [custom_components.powercalc.light_model] Loading /config/powercalc-custom-models/gledopto-qba/LCT003/model.json
2021-11-02 15:37:28 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=light.witryna_4_4c sensor_name=Witryna 4/4c W strategy=LutStrategy manufacturer=gledopto-qba model=LCT003 standby_power=0 unique_id=00:12:4b:00:1b:92:2d:28-0b)
2021-11-02 15:37:28 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: Witryna 4/4c kWh
2021-11-02 15:37:28 DEBUG (MainThread) [custom_components.powercalc.sensors.utility_meter] Creating utility_meter sensor: Witryna 4/4c kWh daily
2021-11-02 15:37:28 DEBUG (MainThread) [custom_components.powercalc.sensors.utility_meter] Creating utility_meter sensor: Witryna 4/4c kWh monthly
2021-11-02 15:37:28 DEBUG (MainThread) [custom_components.powercalc.sensors.utility_meter] Creating utility_meter sensor: Witryna 4/4c kWh yearly
2021-11-02 15:37:28 DEBUG (MainThread) [custom_components.powercalc.light_model] Loading /config/powercalc-custom-models/gledopto-qba/LCT003w/model.json
2021-11-02 15:37:28 DEBUG (MainThread) [custom_components.powercalc.strategy_lut] Loading data file: /config/powercalc-custom-models/gledopto-qba/LCT003w/color_temp.csv.gz
[… no errors]
2021-11-02 15:37:39 DEBUG (MainThread) [custom_components.powercalc.strategy_lut] Looking up power usage for bri:51 mired:454
2021-11-02 15:37:39 DEBUG (MainThread) [custom_components.powercalc.strategy_lut] Power:1.2
2021-11-02 15:37:39 DEBUG (MainThread) [custom_components.powercalc.sensors.power] State changed to "on" for entity "light.witryna_1_4c". Power:1.2
[… error]
2021-11-02 15:42:45 DEBUG (MainThread) [custom_components.powercalc.sensors.power] State changed to "on" for entity "light.witryna_1_4c". Power:1.2
2021-11-02 15:42:45 DEBUG (MainThread) [custom_components.powercalc.strategy_lut] Looking up power usage for bri:51 mired:454
2021-11-02 15:42:45 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 204, in appliance_state_listener
    await self._update_power_sensor(new_state)
  File "/config/custom_components/powercalc/sensors/power.py", line 244, in _update_power_sensor
    self._power = await self._power_calculator.calculate(state)
  File "/config/custom_components/powercalc/strategy_lut.py", line 139, in calculate
    power = self.lookup_power(lookup_table, light_setting)
  File "/config/custom_components/powercalc/strategy_lut.py", line 153, in lookup_power
    self.get_nearest_lower_brightness(lookup_table, brightness),
  File "/config/custom_components/powercalc/strategy_lut.py", line 185, in get_nearest_lower_brightness
    last_key = [*keys][-1]
IndexError: list index out of range

Set logger related to powercalc to debug mode (this is part of configuration.yaml)

logger:
  default: warning
  logs:
    custom_components.powercalc: debug

and restart HA and provide log entries (related to powercalc) from the beginning - it should help with identifying problematic entity. Something like this (I’ve included last line from other integration not related to powercalc) - it is just example (I do not have similar errors)

2021-11-02 11:35:15 WARNING (MainThread) [homeassistant.config_entries] Config entry 'HP LaserJet M203dn (5E2512)' for ipp integration not ready yet: Invalid response from API: Error occurred while communicating with IPP server.; Retrying in background
2021-11-02 11:35:18 DEBUG (MainThread) [custom_components.powercalc.model_discovery] Auto discovered Hue model for entity light.hue_white_e14: (manufacturer=Signify Netherlands B.V., model=LWU001)
2021-11-02 11:35:18 ERROR (MainThread) [custom_components.powercalc.sensors.power] Skipping sensor setup light.hue_white_e14: Model not found in library (manufacturer: Signify Netherlands B.V., model: LWU001)
2021-11-02 11:35:18 ERROR (MainThread) [custom_components.powercalc.sensors.power] Skipping sensor setup light.dimmable_light_12: Cannot select a mode (LINEAR, FIXED or LUT), supply it in the config
2021-11-02 11:35:18 ERROR (MainThread) [custom_components.powercalc.sensors.power] Skipping sensor setup light.extended_color_light_1: Cannot select a mode (LINEAR, FIXED or LUT), supply it in the config
2021-11-02 11:35:18 ERROR (MainThread) [custom_components.powercalc.sensors.power] Skipping sensor setup light.ledvance_tibea_2: Cannot select a mode (LINEAR, FIXED or LUT), supply it in the config
2021-11-02 11:35:18 ERROR (MainThread) [custom_components.powercalc.sensors.power] Skipping sensor setup light.color_temperature_light_1_upd: Cannot select a mode (LINEAR, FIXED or LUT), supply it in the config
2021-11-02 11:35:18 ERROR (MainThread) [custom_components.powercalc.sensors.power] Skipping sensor setup light.color_temperature_light_2: Cannot select a mode (LINEAR, FIXED or LUT), supply it in the config
2021-11-02 11:35:18 ERROR (MainThread) [custom_components.powercalc.sensors.power] Skipping sensor setup light.color_light_2: Cannot select a mode (LINEAR, FIXED or LUT), supply it in the config
2021-11-02 11:35:18 DEBUG (MainThread) [custom_components.powercalc.model_discovery] Auto discovered Hue model for entity light.sufit_jiawen: (manufacturer=Feibit Inc co.  , model=FB56-ZCW08KU1.1)
2021-11-02 11:35:18 ERROR (MainThread) [custom_components.powercalc.sensors.power] Skipping sensor setup light.sufit_jiawen: Model not found in library (manufacturer: Feibit Inc co.  , model: FB56-ZCW08KU1.1)
2021-11-02 11:35:18 DEBUG (MainThread) [custom_components.powercalc.model_discovery] Auto discovered Hue model for entity light.lampka_z_ladowarka_ct: (manufacturer=IKEA of Sweden, model=TRADFRI bulb E27 WS clear 950lm)
2021-11-02 11:35:18 DEBUG (MainThread) [custom_components.powercalc.light_model] Loading /config/custom_components/powercalc/data/ikea/LED1546G12/model.json
2021-11-02 11:35:18 DEBUG (MainThread) [custom_components.powercalc.strategy_lut] Loading data file: /config/custom_components/powercalc/data/ikea/LED1546G12/color_temp.csv.gz
2021-11-02 11:35:18 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=light.lampka_z_ladowarka_ct sensor_name=Lampka z ładowarką CT power strategy=LutStrategy manufacturer=IKEA of Sweden model=TRADFRI bulb E27 WS clear 950lm standby_power=0.43 unique_id=00:0b:57:ff:fe:4a:08:3b-01)
2021-11-02 11:35:18 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: Lampka z ładowarką CT energy
2021-11-02 11:35:18 DEBUG (MainThread) [custom_components.powercalc.model_discovery] Auto discovered Hue model for entity light.kuchnia2: (manufacturer=IKEA of Sweden, model=TRADFRI bulb E27 WS opal 1000lm)
2021-11-02 11:35:18 DEBUG (MainThread) [custom_components.powercalc.light_model] Loading /config/custom_components/powercalc/data/ikea/LED1732G11/model.json
2021-11-02 11:35:18 DEBUG (MainThread) [custom_components.powercalc.strategy_lut] Loading data file: /config/custom_components/powercalc/data/ikea/LED1732G11/color_temp.csv.gz
2021-11-02 11:35:18 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=light.kuchnia2 sensor_name=Kuchnia2 power strategy=LutStrategy manufacturer=IKEA of Sweden model=TRADFRI bulb E27 WS opal 1000lm standby_power=0.26 unique_id=00:0d:6f:ff:fe:19:ee:21-01)
2021-11-02 11:35:18 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: Kuchnia2 energy
2021-11-02 11:35:18 DEBUG (MainThread) [custom_components.powercalc.model_discovery] Auto discovered Hue model for entity light.ct_kulka_e14: (manufacturer=IKEA of Sweden, model=TRADFRI bulb E14 WS opal 400lm)
2021-11-02 11:35:18 DEBUG (MainThread) [custom_components.powercalc.light_model] Loading /config/custom_components/powercalc/data/ikea/LED1536G5/model.json
2021-11-02 11:35:18 DEBUG (MainThread) [custom_components.powercalc.strategy_lut] Loading data file: /config/custom_components/powercalc/data/ikea/LED1536G5/color_temp.csv.gz
2021-11-02 11:35:18 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=light.ct_kulka_e14 sensor_name=CT kulka E14 power strategy=LutStrategy manufacturer=IKEA of Sweden model=TRADFRI bulb E14 WS opal 400lm standby_power=0.44 unique_id=90:fd:9f:ff:fe:93:bd:ac-01)
2021-11-02 11:35:18 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: CT kulka E14 energy