So I have several switches that I’ve converted to lights using the following yaml entries. How do I convert this to using the UI via Switch as X helper from 2022.4? I’m trying not to break my automations, so I would like to retain the same light entities. Thoughts?
Well, I figured that would be the process, but it doesn’t seem to work in my case. When you delete the yaml entry and restart Home Assistant, the entity is still there but listed as ‘Unavailable’. Then when you create the light using Switch as X’ using the same name, the entity gets prepended with a 2.
I did a similar process for groups created in yaml and migrated to the UI, but instead of restarting HA, I reloaded the groups from developer options then recreated in the UI using the same name and it worked! I thought about doing the same thing for the switch platform, but didn’t see an option to reload that specific yaml, hence me creating this post.
That’s the main issue. The reason why it creates it with a _2 is because the original light entity still exist even though it was removed from yaml. Renaming gives me this error…
No not a bug. I’ve opened an issue about this before. There’s a reason for the yaml entries remaining as restored items after deletion. Probably something to do with how the backend tracks yaml entities.
Exactly! Which is why there needs to be an option here specifically for yaml based entities like light, sensor etc. Remember, it works for reloading group entities, just not light entities created in yaml.