Automation options locked


#1

Hey,

I want to automatically turn On/Off a Yeelight in my toilets using a Xiaomi door sensor.

Goal is to switch to On state when an open event is detected, and next open event to switch Off, and so on and so on.

I thought that would be fairly easy but failed to success, when I want to select the “Turn on/off” option for the Yeelights, this option is locked, all the others being available. But this one has a small lock icon next to it.

Why is that ?
Is there any other way to achieve what I’m trying to do ?


#2

Anyone ?

Am I the only one to ever try to use a yeelight with a door sensor that way ?


#3

in order to solve that…

create two scenes that cancel each other out.

one will be named… “bath lights on”
and the other one will be named “bath lights off”

1st scene will be "when door opens… then a) turn on lights b) turn scene
“bath lights on” to off and then turn scene “bath lights off” to on

then… 2nd scene will be "when door opens… then a) turn off lights b) turn scene “bath lights off” to off and then turn scene “bath lights on” to on.

this will take care of your problem


#4

Wow, so smart.

Thanks very much for this :relaxed: it is now fully working as expected, too bad this option is not activated as a simple action.

I had to implement a 1s delay between the two scenes switch in each b) to make it work.
I would definitely not have figured out that by myself