bramstroker / homeassistant-powercalc

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

Detect devices as well, if not native integration but mqtt device #1608

Closed stefanschaedeli closed 1 year ago

stefanschaedeli commented 1 year ago

Checklist

Is your feature request related to a problem? Please describe.

I'm using zigbee2mqtt and zwave2mqtt and hence my devices are all in HA but not using ZHA for example. I have enabled the "discovery" but somehow its not detecting any of the devices, even the integration is adding all the device details also with the mqtt in between

Describe the solution you'd like

Detect devices as you do in ZHA

Describe alternatives you've considered

manually entering all the values, but yeah, thats kind of sad

Additional context

not much more to add

bramstroker commented 1 year ago

zigbee communicates different model id's generally which could not be known to powercalc yet.

You can enable debug logging for powercalc, and then you should get some lines saying Auto discovered model. Look at the manufacturer and model there and share the models which should be discovered (because of supported models list) and are currently not.

stefanschaedeli commented 1 year ago

For example this hue device
https://www.philips-hue.com/de-de/p/hue-white-ambiance-aurelle-rechteckige-panelleuchte/8719514382664

is listed for automatic metering: https://github.com/bramstroker/homeassistant-powercalc/blob/master/docs/supported_models.md

and will be detected nicely as such with similar ids over mqtt:

Bildschirm­foto 2023-04-04 um 18 35 54

(manufacturer: Philips model: Hue white ambiance Aurelle rectangle panel light (929003099101) name: ug_werkstatt_werkbanklicht sw_version: 1.101.5)

bramstroker commented 1 year ago

That model id may be added as an alias to https://github.com/bramstroker/homeassistant-powercalc/blob/master/custom_components/powercalc/data/signify/3216331P6/model.json#L12. That will make auto discovery work correctly.

See for example. https://github.com/bramstroker/homeassistant-powercalc/blob/master/custom_components/powercalc/data/signify/LCT024/model.json#L8

You can go forward and create a PR for this if you want and know how to. Also you can add other missing aliases when you find some.

stefanschaedeli commented 1 year ago

I think I see the issue, it works all great for the Ikea stuff I have, but the Philips hue seems not to work, though they seem to be in the list with a different brand (signify). The numbers are ver similar though for some reason (929003099101 vs 929003099001)

bramstroker commented 1 year ago

signify is not an issue, that is aliased to Philips inside powercalc library.

929003099101 just needs to be added as an alias to 3216331P6 to make things work, as noted above. When you are not able to make a PR for this code change I will do, but I first need to know which other models are not detected but should, so I can do them all at once.

You'll need to enable debug logging for powercalc and share the lines saying someting like this. light.ambient_muur: Auto discovered model (manufacturer=Signify Netherlands B.V., model=Hue Play (440400982841))

For the models which are not working.

stefanschaedeli commented 1 year ago
Bildschirm­foto 2023-04-08 um 18 06 50

thats the final one that does not work, another hue lamp (signify | 1742930P7 | Hue Impress Outdoor Wall Light Small |   | 0.170 | hs,color_temp -- | -- | -- | -- | -- | --)

All others seem to work indeed now :) thanks

bramstroker commented 1 year ago

What did you do to make the other lights work? As you mentioned a lot of devices were not detected. How are they magically working all of a sudden?

Regarding this light which give an error. Looking at the error the model is 929003045001. Which is "Hue White Ambiance Milliskin" light, which is a completely other light than "Hue Impress Outdoor Wall Light Small" only allows to control color temperature and no hs (color mode). That's why you get this error. Searching on Google for https://www.google.com/search?q=929003045001 also returns only Milliskin spot light.

Did you set this model manually yourself? Cannot impossibly be the Hue bridge mis identifiying the bulb I would assume.

bramstroker commented 1 year ago

@stefanschaedeli did you see my remarks / questions above?

stefanschaedeli commented 1 year ago

@bramstroker sorry, got interupted by the birth of my daughter and forgot about this one :D the ID gets filled by the zigbee2mqtt application and passed over by the mqtt integration into home assistant. the ids are

It would be this lamp: https://www.amazon.de/Philips-Hue-Wandleuchte-Aussenbereich-kompatibel/dp/B07KMPCHBV

bramstroker commented 1 year ago

@stefanschaedeli Congratz on the birth of your daughter.

I don't have Zigbee myself, so also don't use Zigbee2Mqtt. But this looks like a bug in that integration to me when it returns an id for a completely other model.

Could you have a look into device info of the eg_eingang_lampe_hue, and see what manufacturer and model is exposed there for your light?

For example screenshot here for one of my Hue lights:

Screenshot 2023-04-21 at 10 29 51
stefanschaedeli commented 1 year ago
Bildschirm­foto 2023-04-22 um 20 28 31

interstingly here it shows another ID... its only in the error log it shows the other id

bramstroker commented 1 year ago

Please enable debug logging https://homeassistant-powercalc.readthedocs.io/en/latest/troubleshooting/debug-logging.html. Restart and have a look into the debug logs, that should give insight. Or share the logs in this issue if you can't find the culprit.

stefanschaedeli commented 1 year ago

its the same as before:

Bildschirm­foto 2023-04-22 um 20 38 52
bramstroker commented 1 year ago

This are not the debug logs, but only the log which resulted in an error. HA will only log error level logs by default. When you enable debug logging for powercalc you'll get hundreds of logs lines after restarting. That should hopefully give some more clues.

bramstroker commented 1 year ago

And one more question. You did setup all the sensors with the GUI/discovery, right? Or did you use YAML? When using GUI you can click the three dots at the powercalc integration panel and click "Download diagnostics".

Screenshot 2023-04-22 at 20 46 10
stefanschaedeli commented 1 year ago

This are not the debug logs, but only the log which resulted in an error. HA will only log error level logs by default. When you enable debug logging for powercalc you'll get hundreds of logs lines after restarting. That should hopefully give some more clues.

2023-04-22 20:32:36.183 INFO (MainThread) [homeassistant.setup] Setting up powercalc 2023-04-22 20:32:36.184 INFO (MainThread) [homeassistant.setup] Setup of domain powercalc took 0.0 seconds 2023-04-22 20:32:36.559 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.powercalc 2023-04-22 20:32:36.578 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.powercalc 2023-04-22 20:32:36.579 DEBUG (MainThread) [custom_components.powercalc.sensors.daily_energy] Creating daily_fixed_energy energy sensor (name=Heizungssteuerung_kwh, entity_id=sensor.heizungssteuerung_kwh, unique_id=Heizungssteuerung) 2023-04-22 20:32:36.579 DEBUG (MainThread) [custom_components.powercalc.sensors.daily_energy] Creating daily_fixed_energy power sensor (base_name=Heizungssteuerung unique_id=Heizungssteuerung) 2023-04-22 20:32:36.579 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=sensor.dummy entity_category=None, sensor_name=Heizungssteuerung_pwr strategy=FixedStrategy manufacturer= model= standby_power=0.00 unique_id=Heizungssteuerung_power) 2023-04-22 20:32:36.586 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.powercalc 2023-04-22 20:32:36.586 DEBUG (MainThread) [custom_components.powercalc.sensors.daily_energy] Creating daily_fixed_energy energy sensor (name=musiccast Standby_kwh, entity_id=sensor.musiccast_standby_kwh, unique_id=musiccast Standby) 2023-04-22 20:32:36.586 DEBUG (MainThread) [custom_components.powercalc.sensors.daily_energy] Creating daily_fixed_energy power sensor (base_name=musiccast Standby unique_id=musiccast Standby) 2023-04-22 20:32:36.586 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=sensor.dummy entity_category=None, sensor_name=musiccast Standby_pwr strategy=FixedStrategy manufacturer= model= standby_power=0.00 unique_id=musiccast Standby_power) 2023-04-22 20:32:36.592 DEBUG (MainThread) [custom_components.powercalc.discovery] light.eg_eingang_lampe_hue: Auto discovered model (manufacturer=Signify Netherlands B.V., model=Hue outdoor Impress wall lamp (1743030P7)) 2023-04-22 20:32:36.612 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] Loading LUT data file: /config/custom_components/powercalc/power_profile/../data/signify/929003045001/color_temp.csv.gz 2023-04-22 20:32:36.616 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] LUT file loaded: 1664 lines 2023-04-22 20:32:36.617 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=light.eg_eingang_lampe_hue entity_category=None, sensor_name=eg_eingang_lampe_hue_pwr strategy=LutStrategy manufacturer=signify model=929003045001 standby_power=0.30 unique_id=pc_0x00178801067f11b6_light_zigbee2mqtt) 2023-04-22 20:32:36.617 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: eg_eingang_lampe_hue_kwh 2023-04-22 20:32:36.623 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.eg_eingang_lampe_hue_pwr to device a327327c26509f028f203231e2dbf11a 2023-04-22 20:32:36.627 DEBUG (MainThread) [custom_components.powercalc.sensors.daily_energy] sensor.heizungssteuerung_kwh: Restoring state: 89.9529 2023-04-22 20:32:36.627 DEBUG (MainThread) [custom_components.powercalc.sensors.daily_energy] sensor.musiccast_standby_kwh: Restoring state: 93.3425 2023-04-22 20:32:36.630 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.eg_eingang_lampe_hue_kwh to device a327327c26509f028f203231e2dbf11a 2023-04-22 20:32:36.643 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.powercalc 2023-04-22 20:32:36.643 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.powercalc 2023-04-22 20:32:36.643 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.powercalc 2023-04-22 20:32:36.643 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.powercalc 2023-04-22 20:32:36.643 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.powercalc 2023-04-22 20:32:36.643 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.powercalc 2023-04-22 20:32:36.644 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.powercalc 2023-04-22 20:32:36.644 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.powercalc 2023-04-22 20:32:36.645 DEBUG (MainThread) [custom_components.powercalc.discovery] light.alu_q: Auto discovered model (manufacturer=IKEA of Sweden, model=TRADFRI driver for wireless control (10 watt) (ICPSHC24-10EU-IL-1)) 2023-04-22 20:32:36.654 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=light.alu_q entity_category=None, sensor_name=Alu Q_pwr strategy=LinearStrategy manufacturer= model= standby_power=0.00 unique_id=0x000d6ffffefce3cb_light_zigbee2mqtt) 2023-04-22 20:32:36.655 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: Alu Q_kwh 2023-04-22 20:32:36.655 DEBUG (MainThread) [custom_components.powercalc.discovery] light.eg_buro_bambus: Auto discovered model (manufacturer=IKEA of Sweden, model=TRADFRI driver for wireless control (10 watt) (ICPSHC24-10EU-IL-1)) 2023-04-22 20:32:36.655 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=light.eg_buro_bambus entity_category=None, sensor_name=Bambus_pwr strategy=LinearStrategy manufacturer= model= standby_power=0.00 unique_id=0x086bd7fffe076348_light_zigbee2mqtt) 2023-04-22 20:32:36.655 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: Bambus_kwh 2023-04-22 20:32:36.655 DEBUG (MainThread) [custom_components.powercalc.discovery] light.alu_rund: Auto discovered model (manufacturer=IKEA of Sweden, model=TRADFRI driver for wireless control (30 watt) (ICPSHC24-30EU-IL-1)) 2023-04-22 20:32:36.655 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=light.alu_rund entity_category=None, sensor_name=Alu Rund_pwr strategy=LinearStrategy manufacturer= model= standby_power=0.00 unique_id=0x000b57fffee363e3_light_zigbee2mqtt) 2023-04-22 20:32:36.656 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: Alu Rund_kwh 2023-04-22 20:32:36.656 DEBUG (MainThread) [custom_components.powercalc.discovery] light.alu_l: Auto discovered model (manufacturer=IKEA of Sweden, model=TRADFRI driver for wireless control (30 watt) (ICPSHC24-30EU-IL-1)) 2023-04-22 20:32:36.656 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=light.alu_l entity_category=None, sensor_name=Alu L_pwr strategy=LinearStrategy manufacturer= model= standby_power=0.00 unique_id=0x90fd9ffffe18418f_light_zigbee2mqtt) 2023-04-22 20:32:36.656 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: Alu L_kwh 2023-04-22 20:32:36.656 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=light.eg_schlafzimmer_stilllicht entity_category=None, sensor_name=eg schlafzimmer stilllicht_pwr strategy=LinearStrategy manufacturer= model= standby_power=0.00 unique_id=None) 2023-04-22 20:32:36.656 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: eg schlafzimmer stilllicht_kwh 2023-04-22 20:32:36.657 DEBUG (MainThread) [custom_components.powercalc.discovery] switch.ug_buro_heizung: Auto discovered model (manufacturer=IKEA of Sweden, model=TRADFRI control outlet (E1603#slash#E1702#slash#E1708)) 2023-04-22 20:32:36.657 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=switch.ug_buro_heizung entity_category=None, sensor_name=Heizung_pwr strategy=FixedStrategy manufacturer= model= standby_power=0.00 unique_id=0x086bd7fffe3714a8_switch_zigbee2mqtt) 2023-04-22 20:32:36.657 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: Heizung_kwh 2023-04-22 20:32:36.658 DEBUG (MainThread) [custom_components.powercalc.discovery] climate.ir_heizung_ug_buro: Auto discovered model (manufacturer=Tuya, model=Wonderwall Air Art Smart (aemgen54nfdktfej)) 2023-04-22 20:32:36.660 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=climate.ir_heizung_ug_buro entity_category=None, sensor_name=ir_heizung_ug_buro_pwr strategy=FixedStrategy manufacturer= model= standby_power=0.00 unique_id=tuya.22000752a4e57c9a91b7) 2023-04-22 20:32:36.660 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: ir_heizung_ug_buro_kwh 2023-04-22 20:32:36.661 DEBUG (MainThread) [custom_components.powercalc.discovery] switch.eg_wohnzimmer_kugel: Auto discovered model (manufacturer=IKEA of Sweden, model=TRADFRI control outlet (E1603#slash#E1702#slash#E1708)) 2023-04-22 20:32:36.661 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=switch.eg_wohnzimmer_kugel entity_category=None, sensor_name=Kugel_pwr strategy=FixedStrategy manufacturer= model= standby_power=0.00 unique_id=0x086bd7fffe2b99e5_switch_zigbee2mqtt) 2023-04-22 20:32:36.661 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: Kugel_kwh 2023-04-22 20:32:36.663 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.alu_q_pwr to device 186b8e08addbe7a51b4322cbf6db48ea 2023-04-22 20:32:36.664 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.eg_buro_bambus_pwr to device c7a21d590b7bb9cad503c09d1fc4e266 2023-04-22 20:32:36.665 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.alu_rund_pwr to device 5717e19d9affedcd5fde8c60b956e2c3 2023-04-22 20:32:36.666 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.alu_l_pwr to device 72aaa61b04b60bd55e7bc5de5577606d 2023-04-22 20:32:36.668 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.ug_buro_heizung_pwr to device 948aada5706699a207c68f8dfeccea32 2023-04-22 20:32:36.669 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.ir_heizung_ug_buro_pwr to device 2aae1236e63f5177ca6c58051390c045 2023-04-22 20:32:36.670 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.eg_wohnzimmer_kugel_pwr to device c1306ef319343f0c03265de619f2ef79 2023-04-22 20:32:36.702 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.alu_q_kwh to device 186b8e08addbe7a51b4322cbf6db48ea 2023-04-22 20:32:36.703 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.eg_buro_bambus_kwh to device c7a21d590b7bb9cad503c09d1fc4e266 2023-04-22 20:32:36.704 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.alu_rund_kwh to device 5717e19d9affedcd5fde8c60b956e2c3 2023-04-22 20:32:36.705 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.alu_l_kwh to device 72aaa61b04b60bd55e7bc5de5577606d 2023-04-22 20:32:36.705 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.ug_buro_heizung_kwh to device 948aada5706699a207c68f8dfeccea32 2023-04-22 20:32:36.706 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.ir_heizung_ug_buro_kwh to device 2aae1236e63f5177ca6c58051390c045 2023-04-22 20:32:36.707 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.eg_wohnzimmer_kugel_kwh to device c1306ef319343f0c03265de619f2ef79 2023-04-22 20:33:07.201 DEBUG (MainThread) [custom_components.powercalc.sensors.power] switch.ug_buro_heizung: Source entity has an invalid state, setting power sensor to unavailable 2023-04-22 20:33:07.235 DEBUG (MainThread) [custom_components.powercalc.sensors.power] switch.eg_wohnzimmer_kugel: Source entity has an invalid state, setting power sensor to unavailable 2023-04-22 20:33:07.656 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.eg_buro_bambus: Source entity has an invalid state, setting power sensor to unavailable 2023-04-22 20:33:07.657 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.alu_rund: Source entity has an invalid state, setting power sensor to unavailable 2023-04-22 20:33:07.657 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.alu_q: Source entity has an invalid state, setting power sensor to unavailable 2023-04-22 20:33:07.658 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.alu_l: Source entity has an invalid state, setting power sensor to unavailable 2023-04-22 20:33:07.723 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.eg_eingang_lampe_hue: State changed to "unavailable". Power:0.00 2023-04-22 20:33:08.927 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.eg_eingang_lampe_hue: Source entity has an invalid state, setting power sensor to unavailable 2023-04-22 20:33:08.928 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.alu_l: Source entity has an invalid state, setting power sensor to unavailable 2023-04-22 20:33:08.929 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.alu_q: Source entity has an invalid state, setting power sensor to unavailable 2023-04-22 20:33:08.929 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.alu_rund: Source entity has an invalid state, setting power sensor to unavailable 2023-04-22 20:33:08.929 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.eg_buro_bambus: Source entity has an invalid state, setting power sensor to unavailable 2023-04-22 20:33:08.933 DEBUG (MainThread) [custom_components.powercalc.sensors.power] switch.eg_wohnzimmer_kugel: Source entity has an invalid state, setting power sensor to unavailable 2023-04-22 20:33:08.933 DEBUG (MainThread) [custom_components.powercalc.sensors.power] switch.ug_buro_heizung: Source entity has an invalid state, setting power sensor to unavailable 2023-04-22 20:33:13.832 DEBUG (MainThread) [custom_components.powercalc.sensors.power] climate.ir_heizung_ug_buro: Source entity has an invalid state, setting power sensor to unavailable 2023-04-22 20:33:22.819 DEBUG (MainThread) [custom_components.powercalc.sensors.power] sensor.dummy: State changed to "on". Power:0.00 2023-04-22 20:33:22.819 DEBUG (MainThread) [custom_components.powercalc.sensors.power] sensor.dummy: State changed to "on". Power:21.00 2023-04-22 20:33:22.820 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.eg_eingang_lampe_hue: Source entity has an invalid state, setting power sensor to unavailable 2023-04-22 20:33:22.820 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.alu_q: Source entity has an invalid state, setting power sensor to unavailable 2023-04-22 20:33:22.821 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.eg_buro_bambus: Source entity has an invalid state, setting power sensor to unavailable 2023-04-22 20:33:22.821 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.alu_rund: Source entity has an invalid state, setting power sensor to unavailable 2023-04-22 20:33:22.822 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.alu_l: Source entity has an invalid state, setting power sensor to unavailable 2023-04-22 20:33:22.822 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.eg_schlafzimmer_stilllicht: Source entity has an invalid state, setting power sensor to unavailable 2023-04-22 20:33:22.823 DEBUG (MainThread) [custom_components.powercalc.sensors.power] switch.ug_buro_heizung: Source entity has an invalid state, setting power sensor to unavailable 2023-04-22 20:33:22.823 DEBUG (MainThread) [custom_components.powercalc.sensors.power] climate.ir_heizung_ug_buro: Source entity has an invalid state, setting power sensor to unavailable 2023-04-22 20:33:22.824 DEBUG (MainThread) [custom_components.powercalc.sensors.power] switch.eg_wohnzimmer_kugel: Source entity has an invalid state, setting power sensor to unavailable 2023-04-22 20:33:57.506 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.eg_buro_bambus: State changed to "off". Power:0.00 2023-04-22 20:33:57.658 DEBUG (MainThread) [custom_components.powercalc.sensors.power] switch.ug_buro_heizung: State changed to "off". Power:0.00 2023-04-22 20:33:57.930 DEBUG (MainThread) [custom_components.powercalc.strategy.linear] light.alu_rund: Linear mode state value: 18 range(1-127) 2023-04-22 20:33:57.931 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.alu_rund: State changed to "on". Power:2.54 2023-04-22 20:33:57.933 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.alu_q: State changed to "off". Power:0.00 2023-04-22 20:33:57.934 DEBUG (MainThread) [custom_components.powercalc.strategy.linear] light.alu_l: Linear mode state value: 18 range(1-63) 2023-04-22 20:33:57.934 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.alu_l: State changed to "on". Power:2.41 2023-04-22 20:33:58.203 DEBUG (MainThread) [custom_components.powercalc.sensors.power] switch.eg_wohnzimmer_kugel: State changed to "off". Power:0.00 2023-04-22 20:33:58.269 ERROR (MainThread) [custom_components.powercalc.strategy.lut] light.eg_eingang_lampe_hue: Lookup table not found (model: 929003045001, color_mode: hs) 2023-04-22 20:33:58.272 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.eg_eingang_lampe_hue: State changed to "on". Power:None 2023-04-22 20:38:00.634 DEBUG (MainThread) [custom_components.powercalc.strategy.linear] light.alu_l: Linear mode state value: 125 range(63-127) 2023-04-22 20:38:00.635 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.alu_l: State changed to "on". Power:6.89 2023-04-22 20:38:00.649 DEBUG (MainThread) [custom_components.powercalc.strategy.linear] light.alu_rund: Linear mode state value: 125 range(1-127) 2023-04-22 20:38:00.650 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.alu_rund: State changed to "on". Power:5.94 2023-04-22 20:38:36.646 DEBUG (MainThread) [custom_components.powercalc.sensors.daily_energy] sensor.musiccast_standby_kwh: Updating daily_fixed_energy sensor: 93.3457 2023-04-22 20:44:36.654 DEBUG (MainThread) [custom_components.powercalc.sensors.daily_energy] sensor.musiccast_standby_kwh: Updating daily_fixed_energy sensor: 93.3478

stefanschaedeli commented 1 year ago

And one more question. You did setup all the sensors with the GUI/discovery, right? Or did you use YAML? When using GUI you can click the three dots at the powercalc integration panel and click "Download diagnostics".

Screenshot 2023-04-22 at 20 46 10

I have a mix due to historical reasons... the manual ones work though (yaml and gui) the automatic once are the "strange behaving"

bramstroker commented 1 year ago

Relevant log lines are these. I have omitted the date etc, to make it a bit more readable.

light.eg_eingang_lampe_hue: Auto discovered model (manufacturer=Signify Netherlands B.V., model=Hue outdoor Impress wall lamp (1743030P7)) 
Loading LUT data file: /config/custom_components/powercalc/power_profile/../data/signify/929003045001/color_temp.csv.gz
LUT file loaded: 1664 lines
Creating power sensor (entity_id=light.eg_eingang_lampe_hue entity_category=None, sensor_name=eg_eingang_lampe_hue_pwr strategy=LutStrategy manufacturer=signify model=929003045001 standby_power=0.30 unique_id=pc_0x00178801067f11b6_light_zigbee2mqtt)

The correct model id is autodiscovered 1743030P7, but next line the model id is forced to 929003045001 and also that LUT file is selected. Only way I can see this happening is you manually selected the model when setting up the sensor.

So please share the diagnostics for this powercalc configuration as requested in comment above.

stefanschaedeli commented 1 year ago

Sorry, tired to do this but there was no manual entry... I did reinstall the plugin from hacs and the issue is gone... I think it must have been somehow a previos attemd of a manual entry that failed to delete somehow...

so the error is gone. its still does not yet detect the lamp, but thats expected as its not yet on the supported list...

bramstroker commented 1 year ago

Very strange issue still, but glad you got it resolved and error is gone.

Yes you are correct, it shouldn't detect the light because it is not supported (yet).