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.

4 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:

Just confirming that the Change device type of a switch helper integration currently requires that you use the GUI and does not support YAML?

As I’ve stated just above you, you can still use the “hidden” but “still working” way:

light:
  # https://web.archive.org/web/20211207144015mp_/https://www.home-assistant.io/integrations/light.switch
  # https://community.home-assistant.io/t/request-to-add-yaml-option-to-manually-configure-helper-change-device-type-of-a-switch/410412/4
  - platform: switch
    name: Wall Switch WS1 As Light
    entity_id: switch.tuya_wall_switch_ws1_socket

Right, thanks @DvdNwk. I was curious about the other helper approach.