Request to add yaml option to manually configure helper "Change device type of a switch"

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

customize:
  switch.driveway_light:
  friendly_name: Driveway Light
  device_class: light
  icon: mdi:light

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. :wink:

It is possible, but no longer documented. e.g.

light:
  - platform: switch
    name: LED Table
    entity_id: switch.led_table
4 Likes

While the undocumented feature works, I am wary that it might go away with any update.

So I still support this feature request: having documented YAML support for Switch as X would be amazing.

5 Likes

I can confirm that this method is still working:

I’m afraid one day it might stop working. Therefore I would also like to request a proper way to configure switch_as_x in YAML config file.

Other threads, I’ve stumbled upon, mentioning the topic: