Closed Mariusthvdb closed 11 months ago
Yes probably only needs the new alias added. You may go forward and create a PR for that. I'll merge it asap and release new version.
but how? as I said, I added it locally and it didnt fix the issue.. Also, see the note I added to the opening topic, we had this before
maybe its something else after all, because this is in the debug logs:
2023-12-05 22:48:00.646 DEBUG (MainThread) [custom_components.powercalc.discovery] light.ster_links: Auto discovered model (manufacturer=IKEA of Sweden, model=TRADFRI bulb E14 WS 470lm)
2023-12-05 22:48:00.647 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=light.ster_links entity_category=None, sensor_name=Ster links device power strategy=lut manufacturer=ikea model=LED1835C6 unique_id=cc:86:ec:ff:fe:19:d8:a7-1)
2023-12-05 22:48:00.647 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] Loading LUT data file: /config/custom_components/powercalc/power_profile/../data/ikea/LED1835C6/color_temp.csv.gz
2023-12-05 22:48:00.653 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] LUT file loaded: 1144 lines
and
2023-12-05 22:48:00.654 DEBUG (MainThread) [custom_components.powercalc.discovery] light.ster_rechts: Auto discovered model (manufacturer=IKEA of Sweden, model=TRADFRI bulb E14 WS 470lm)
2023-12-05 22:48:00.654 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=light.ster_rechts entity_category=None, sensor_name=Ster rechts device power strategy=lut manufacturer=ikea model=LED1835C6 unique_id=cc:86:ec:ff:fe:16:1e:6f-1)
and even though they have a name: sensor_name=Ster links device power and sensor_name=Ster rechts device power, these are not in the dev tools....
This seems fine and indicates the profile for the light is found and CSV files loaded correctly. It indicates that the power sensor should be created. You are 100% sure it's not to be found in entities list / developer tools? No further errors / issues in the logs regarding these entities?
yes, sure, I've tried both name and attribute, and anything with 'dummy'
we can see it being set as source for the energy sensors correctly. (though it isnt found, hence the 'unknown')
same for the other device_power entity
and trickles down into the group entities:
I have no clue why the entities are not created. You are confident there are no errors / warnings following the "Creating power sensor" lines after startup?
from the logs:
2023-12-06 13:20:33.764 DEBUG (MainThread) [custom_components.powercalc.discovery] light.ster_links: Auto discovered model (manufacturer=IKEA of Sweden, model=TRADFRI bulb E14 WS 470lm)
2023-12-06 13:20:33.764 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=light.ster_links entity_category=None, sensor_name=Ster links device power strategy=lut manufacturer=ikea model=LED1835C6 unique_id=cc:86:ec:ff:fe:19:d8:a7-1)
2023-12-06 13:20:33.765 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] Loading LUT data file: /config/custom_components/powercalc/power_profile/../data/ikea/LED1835C6/color_temp.csv.gz
2023-12-06 13:20:33.769 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] LUT file loaded: 1144 lines
2023-12-06 13:20:33.769 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: Ster links device energy
2023-12-06 13:20:33.769 DEBUG (MainThread) [custom_components.powercalc.sensors.utility_meter] Creating utility_meter sensor: Ster links device energy daily (entity_id=sensor.ster_links_device_energy_2_daily)
2023-12-06 13:20:33.770 DEBUG (MainThread) [custom_components.powercalc.sensors.utility_meter] Creating utility_meter sensor: Ster links device energy yearly (entity_id=sensor.ster_links_device_energy_2_yearly)
2023-12-06 13:20:33.770 DEBUG (MainThread) [custom_components.powercalc.discovery] light.ster_rechts: Auto discovered model (manufacturer=IKEA of Sweden, model=TRADFRI bulb E14 WS 470lm)
2023-12-06 13:20:33.770 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=light.ster_rechts entity_category=None, sensor_name=Ster rechts device power strategy=lut manufacturer=ikea model=LED1835C6 unique_id=cc:86:ec:ff:fe:16:1e:6f-1)
2023-12-06 13:20:33.770 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: Ster rechts device energy
2023-12-06 13:20:33.770 DEBUG (MainThread) [custom_components.powercalc.sensors.utility_meter] Creating utility_meter sensor: Ster rechts device energy daily (entity_id=sensor.ster_rechts_device_energy_2_daily)
2023-12-06 13:20:33.770 DEBUG (MainThread) [custom_components.powercalc.sensors.utility_meter] Creating utility_meter sensor: Ster rechts device energy yearly (entity_id=sensor.ster_rechts_device_energy_2_yearly)
2023-12-06 13:20:33.771 DEBUG (MainThread) [custom_components.powercalc.sensors.group] Creating grouped power sensor: Kerst sterren device power (entity_id=sensor.kerst_sterren_device_power)
2023-12-06 13:20:33.771 DEBUG (MainThread) [custom_components.powercalc.sensors.group] Creating grouped energy sensor: Kerst sterren device energy (entity_id=sensor.kerst_sterren_device_energy)
2023-12-06 13:20:33.771 DEBUG (MainThread) [custom_components.powercalc.sensors.utility_meter] Creating utility_meter sensor: Kerst sterren device energy daily (entity_id=sensor.kerst_sterren_device_energy_daily)
2023-12-06 13:20:33.771 DEBUG (MainThread) [custom_components.powercalc.sensors.utility_meter] Creating utility_meter sensor: Kerst sterren device energy yearly (entity_id=sensor.kerst_sterren_device_energy_yearly)
a bit down:
2023-12-06 13:20:34.472 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.ster_links_device_energy_2 to device cce913993542f1d458925713358e598f
2023-12-06 13:20:34.476 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.ster_links_device_energy_2_daily to device cce913993542f1d458925713358e598f
2023-12-06 13:20:34.478 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.ster_links_device_energy_yearly_2 to device cce913993542f1d458925713358e598f
2023-12-06 13:20:34.480 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.ster_rechts_device_energy_2 to device a579956e9c1a7ec2702e365a29ff3119
2023-12-06 13:20:34.480 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.ster_rechts_device_energy_2_daily to device a579956e9c1a7ec2702e365a29ff3119
2023-12-06 13:20:34.482 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.ster_rechts_device_energy_yearly_2 to device a579956e9c1a7ec2702e365a29ff3119
2023-12-06 13:20:34.484 WARNING (MainThread) [custom_components.powercalc.sensors.group] sensor.kerst_sterren_device_energy: Could not restore last state: [<class 'decimal.ConversionSyntax'>]
could these be written in some hidden file, whihc I could maybe delete? I did try to edit the powercalc_group, but it gets rewritten during edit.. maybe I should delete that completely? Or will my config be lost then
arghh, some progress:
but cant enable them?
Might this be a remnant of the former integration (Ikea Tradfri), and, because I no longer have the lights on that integration, and thus that device no longer exists) so I cant re-enable?
sensor.ster_links_device_energy_2
mind the _2
. That's probably part of you problem / issues.
Might be some similar issue as #1919. Where the unique_id of the source entity has changed. Probably also the case for you because another integration is providing the entity now. You could try looking into core.entity_registry if there are some old references somehow.
Very busy atm and coming weeks, so don't have time to investigate this further. It's also a very complex problem, so will definitely take some time to dig in to.
and so it was! I deleted all entires from core.entity registry and restarted:
there still are other issues in the energy sensor, but maybe that can be solved in the same way:
group entities:
and for the individual entities, there's a mixup between the new _2 entities as source and ones with the unsuffixed entity_id's
though the unsuffixed entities update now:
and the _2 remain unknown.
finally, after having followed this order of operation:
all entities are there, and no more suffixes.
still a lot of 'unknown' energy entities both for the grouped and for the individual.
but at least no more unavailable and yet:
this keeps bugging
Deze fout is ontstaan door een aangepaste integratie.
Logger: custom_components.powercalc.sensors.group
Source: custom_components/powercalc/sensors/group.py:498
Integration: Powercalc (documentation, issues)
First occurred: 16:52:19 (1 occurrences)
Last logged: 16:52:19
sensor.kerst_sterren_device_energy: Could not restore last state: [<class 'decimal.ConversionSyntax'>]```
update
after some time (not sure since I had to go away...but certainly not the regular initial 10 minutes) I now see that all energy sensors have been populated with an actual state. Seems perfect now.
Also restart on the new 2023.12 release And the todays Powercalc update to 1.9.9 fixed the restore error I have been reporting.
this issue will close .
It might be a sane thing to do and post the order of operation when actually trying to delete legacy entities from a yaml config in your guide somewhere......
System Health details
before I had these lights on a Tradfri gateway and they were nicely added to powercalc, creating a device_power sensor.
Ive moved some of the Ikea lights to ZHA, and that is now showing as
TRADFRI bulb E14 WS 470lm
could it be the LED1949C5 (which this is, see https://www.ikea.com/nl/en/p/tradfri-led-bulb-e14-470-lumen-smart-wireless-dimmable-white-spectrum-chandelier-20486784/) needs another alias in the model.json? currently listing:
so failing the exact
TRADFRI bulb E14 WS 470lm
?because of that, the PC group is throwing below error
Checklist
Describe the issue
light not recognized/nop device_power entity created
Reproduction steps
...
Debug logs
Diagnostics dump or YAML config
fwiw, I added that to the alias section manually locally, but that does Not fix the issue...
nor does adding a unique_id to the create_group:
btw, I missed we had this before: https://github.com/bramstroker/homeassistant-powercalc/issues/658