Background: Nearly all of my smart home lights are controlled by wall switches. It is nice that you are able to do this in the UI helper; I ask and recommend that it is also available by yaml entry. YAML has so many advantages. First you can easily review the text and make modifications and additions much faster. Secondly, as a yaml file, you have the control. I am not saying that I do not us the UI features. Once the function is complete, I transfer it as yaml to the appropriate place in my file system.
In my research on the subject, I thought the function was available in the file
The customization passes validation, in the Server control, but the device class does not get updated as expected. Additionally, once adding the helper in the UI, there seems no way of removing or editing it, as there would be in a yaml chunk. Thanks you in advance, as I appreciate all that the community does to make HA as wonderful as it is.
We should keep the option to change the device type of a switch in YAML, along with other helpers, whenever possible.
Based on my testing on HA 2025.1, if the database is removed and recreated, all lights converted from switches are lost, and I have to manually reconfigure them one by one. This is unacceptable.
faced the same issue here. i had a light switch misbehaving so i deleted and re-added it in z2m, and realised all my “change the device type” helpers associated with that device had disappeared, and i had to manually create them one by one again in the GUI.
I definitely think this is something that needs to be looked at.
I had the same issue and found out that you can change it.
Below is the link that creates a “hidden” light of your switch.
This helped me out in what i wanted.
My switches as lights worked perfectly for YEARS, but now it’s broken, because for whatever reason HA now creates light.christmas_tree_1, light.christmas_tree_2 and so on on every reboot (guess how I found out).
I use switches as lights because how convenient it is, each time I use a different set of smart plugs for my lights set up and I can just change the underlying config with the correct plugs and all the automation still works.
But now, no, I have to go to the UI, FIND which ones are related to Christmas lights setup (of course all yaml configs are in a package called christmas.yaml, and in the UI I have like 2000 entities), recreate each one I need to edit manually with a dozens on of clicks.
Why not just keep the old way of config working while adding new functionality? And the documentation just vanished from the website like it never existed…