light:
- platform: switch
name: Christmas Tree Lights
entity_id: switch.christmas_tree_lights
I think this still works but … now … questions:
Is this (old?) yaml code still ok to use?
Any other better (actual/officially supported) solution ? (e.g.: template light ??)
Any solution to set the entity I want? (in the small (old?) yaml variant the entity is set by HA with the same name as the switch, and using the “name” as a FriendlyName only
Using the newer syntax, you can now achieve the same thing as ‘change the device type of a switch’ using a template light in configuration.yaml or a file included from it. (You should use a UUID generator to create a unique ID for each template entity you create of course. And you probably want to set the switch as ‘hidden’ to stop it showing up in automated dashboards.)