Yes, I agree. Unfortunately config flow isn’t ready for that but I believe changes are being made to support something like that. Something like that is definitely within the realm of possibility and I wouldn’t be surprised if we see it within the next year. However, understand that it will not replace the current entity, it will be a new entity that references the other entity.
for sure.
Just another step along the road to help the onboarding of new users…
Adding Tuya light switches today via the Tuya Integration and noticed something interesting, the single gang dimable Delta switches default to a light, and the non dimable 2,3 and 4 gang Delta light switch’s all come up as switches.
This threat helped make sense of why, but also raises that an easier way is needed to change between the two to avoid having to manually configure each one.
For now mine might stay as switch’s until I can be bothered to manually use the light template or some yaml code for each one.
As of 2022.4, Switch as X is now available in the UI, you no longer need the yaml configuration listed here.
Keep in mind that this follows the paradigm that I’ve been stressing in this thread. It does not replace your existing switch with a light. It creates a light and hides the switch. Both entities are available for use, but the switch is hidden using the new hidden option introduced in 2022.4.
So, for my full understanding. This switch as X will make a new entity starting with e.g. light. And hide the exisitng switch. Entity? Thus all logics will have to change after that?
If you read the details on ‘hidden’, you’ll see that hidden entities are only hidden from the auto generated dashboards. The entities still exist and can still be used anywhere in HA.
It’s a nice to have. But it sure sounds like a mess in the making. I’d prefer to just use the generic home assistant turn on. The “hide” feature is kinda useful and I think it’ll also hide it from other integrations like Google home without having to explicitly hide it.
Wow, that Switch as X integration is a godsend! Since I started using home-assistant a year ago, half my light switches show up as lights and half show up as switches. (They are imported via the ISY integration with Insteon hardware.) I eventually figured out the difference - Insteon dimmer switches presented as lights while Insteon on/off switches presented as switches. While I recognize they are different, that my hallway lights were a different thing from the office lights just smacked of a broken abstraction somewhere. (Yes, I read all the technical “but they’re different underneath” arguments, but as a new user, that this light and that light are not both lights, but this light and that outlet are both switches just did not match what was sitting there in front of me. Lights and Outlets are different, and yet, the difference in HA split lights in half and grouped half with the outlets. It was infuriating.)
I added the Switch as X integration and now there’s a lovely little dropdown right there in the device “Oh, this is a switch? Do you want it to be a light? Cool, here you go!”
Thank you.
But I have a lot of SONOFF switchs with 3 buttons, like switch.100139cc73_1, switch.100139cc73_2, switch.100139cc73_3 for instance, to use Switch As X I have to convert each one of them one by one. How to make all of them turn to light at once? It doesnt allow something like switch.100139cc73_*, is it possible?
Sorry, you have to do them one by one.
You might be able to make them a group using the Helpers.
Hi, I only came on board with HA two weeks ago, so didn’t know the times before Switch as X, but first thing I did is classify my Tuya switches as lights. Worked happily for a week or so, but now the lights have become unavailable. They disappeared from the Entities list, completely gone.
Funnily enough the switches are still there, working, but I am only exposing the lights to the dashboard.
I am using HomeKit as Frontend as well, and I wonder if it might be crosstalk with HomeKit in some way although I believe that hidden entities, ie the switches, don’t get exposed to HomeKit.
The following post seems also interesting and related to that topic:
https://community.home-assistant.io/t/request-to-add-yaml-option-to-manually-configure-helper-change-device-type-of-a-switch/410412/2
light:
- platform: switch
name: LED Table
entity_id: switch.led_table
Will that principle of defining in the yaml configuration be documented and official at some time or rather becomes obsolete?
It’s a helper entity so yaml shouldn’t go away. That doesn’t mean it won’t. Historically, helpers are available in yaml and ui.