Bouni / luxtronik

Luxtronik integration for Home Assistant
MIT License
82 stars 13 forks source link

Use unique_id instead of entity_id #46

Closed remuslazar closed 1 year ago

remuslazar commented 1 year ago

Generate the unique_id attribute to avoid errors like

This entity ('luxtronik.*') does not have a unique ID, therefore its settings cannot be managed from the UI.

when trying to modify existing entities in the UI.

remuslazar commented 1 year ago

@Bouni This change also allows using the Luxtronik entities for e.g. helpers, for example to create an utility meter for the ID_WEB_WMZ_Heizung value. But also to tweak the name attribute using the UI (e.g. to use German Labels).

Thank you for your great work on that component!

Bouni commented 1 year ago

Thanks for your PR!

henne49 commented 1 year ago

Since this change I cannot use my old config for sensors and binaries, can you check what needs to be changed on the config side to get it working?

Bouni commented 1 year ago

I wasn't really aware that this is a breaking change, sorry for that. All sensors are now sensor.X I stead of luxtronik.X so you need to change these.

henne49 commented 1 year ago

well that broke now all my history data.

Things happen, thank you anyway for you work, because of you I could definitely save so much energy. A real climate hero!

henne49 commented 1 year ago

Not sure what happens, but the sensor or binary_sensor are not created.

remuslazar commented 1 year ago

@henne49 oh, sorry for the trouble with this change. I was not really aware that this is a breaking change, sorry once again!

I will take a look at the implementation of the binary_sensor, I think that the unique id related changes have to be streamlined.

remuslazar commented 1 year ago

@henne49 could u please check if https://github.com/Bouni/luxtronik/pull/50 fixes the issue in your particular case? Thanks!

henne49 commented 1 year ago

Will do, but I do not see a new version in hacs

remuslazar commented 1 year ago

@henne49 the PR not being merged, there is no new version so far. When using git you could checkout my testing branch for that purpose: https://github.com/remuslazar/luxtronik/tree/testing

henne49 commented 1 year ago

Sorry, but l‘m unable to do so. I have now fixed for me using the integration of benpru

WhistleMaster commented 1 year ago

I had the same issue after updating to 2022.12.01, all the sensors are now indeed sensor.xxx instead of luxtronik.xxx as @Bouni said, but this is not the case for binary sensors which are still luxtronik.xxx.

Bouni commented 1 year ago

PR #50 will do the same for binary sensors. I'll merge it in a few minutes and release a new version. I know that the change from luxtronik.xxx to sensor.xxx brings quite some trouble with it for the user, but I should have made it that way in the first place. If I'm correct thats a must have if we want to get stuff into the energy dashboard ...