albaintor / homeassistant_electrolux_status

Get the status from your Electrolux Care devices
MIT License
90 stars 23 forks source link

Upgrade to v2 broke my automations #81

Open bartkummel opened 1 month ago

bartkummel commented 1 month ago

Yesterday I updated to v2.0.2 from v1.0.19. I have an automation to set the start time of my AEG dishwasher during the night when the electricity prices are lowest. The automation was broken after I updated the integration. Turns out that basically all sensors where recreated with a _2 suffix. As an example, I used to have a sensor called sensor.aeg_afwasmachine_timetoend, which is now called sensor.aeg_afwasmachine_timetoend_2. It looks like it's the exact same sensor, but with a different name. Is this a bug or a deliberate choice?

Also, there was no warning about breaking changes in the change log of the release. Would have been nice to be warned about this. It would have been even nicer to know what breaking changes there were, so that I could have changed my automation pro-actively.

albaintor commented 1 month ago

Sorry to hear that, but this is unexpected. The renaming occurs if 2 entities with the same names are reported by the integration and then homeassistant suffixes "_N" This occurs when :

  1. There is a bug in the integration : 2 different entities are built with the same name
  2. There are old ghost entities : in that case those ghost entities should be tagged as unavailable (and can be deleted) and you can safely rename the new "_N " one to the regular name.

I need more info to qualify the problem (logs)

bartkummel commented 1 month ago

I do indeed see unavailable "ghost" entities. I can supply you with logs, but I'd rather do that in a private channel, since my logs will contain a lot of info about my home. Let me know if you're interested in my logs and how I can get them to you in a secure way.

albaintor commented 1 month ago

Not necessarily : you can remove all the ghost entities and then you shouldn't have duplicate entities. Then you can either : 1/ remove the integration completely and reinstall it to have the correct names 2/ rename the entities that match to previous names

kingy444 commented 1 month ago

Sorry this was noted as a breaking change on the PR for v2 but seems missed in notifications for upgrade

I agree with the solution being remove and re-add the integration - the entity ID format was updated as I found an issue in them not being unique on my devices

Sascha-L commented 1 month ago

Had the same problem, that after this update all entities very duplicated with "_2" and had to fix a lot of automations and a lot of dashboards :-( I hope this will never happen again!

albaintor commented 1 month ago

Ohmy, you shouldn't have to change automations : this _2 effect happens if old entities are still there but not instantiated anymore (ghost entities). They must be removed and you can rename the _2 to the old name again, or more simple delete the integration and reinstall it to get back the regular names

kingy444 commented 1 month ago

@albaintor this was side effect of the updated entity_id, becuase i was receiving duplicate entity name errors

I didnt do a migration from the old name, but did note it as a breaking change. And recommended a reinstall as part of the upgrada. that would ensure the _2 is resolved and new names maintained

bartkummel commented 1 month ago

Isn't there a way to prevent this from happening at all? I've never seen something like this with other integrations. I mean, it's nice that there's a work around, but it would be better if the entities weren't duplicated in the first place.

kingy444 commented 1 month ago

Yes there are ways to migrate them, but it's complicated and can still lead to these issues if you don't get it right, especially as the issue it was solving was duplicate id's

Anyone with the issue would also need to delete the newly created v2 entries anyway, so starting with a clean slate is 100x easier as a fix in the interim