Is it possible to turn off smart bulb without cutting its power when the switch physical button is pressed?

I’m planning to get Sonoff M5 (I believe it’s a one way press) and flash it with ESPHome. I have smart bulb connected to it.

May I know if it’s possible in ESPHome to turn off bulb without cutting its power when the switch physical button is pressed? I believe the Sonoff firmware doesn’t support this (detached mode)

And is it also possible for example if I have 2 bulb connected to a 1 gang switch, and I configure the switch to be in this state
1st press: bulb A ON, bulb B OFF
2nd press: bulb A OFF, bulb B ON
3rd press: bulb A ON, bulb B ON
4th press: bulb A OFF, bulb B OFF

It seems like it can run ESPHome, so then everything is pretty much possible.
You will probably have to use HA to control the bulbs, so the button will just send an event to HA, that will then control the bulbs.

1 Like