Button to start night and


#1

1) Give a description of the problem
I need help designing this thing, not all of it ofc, but a point in the right way

2) What is the expected behavior?
I want the press of a aqara button to start night (turn of some lights that is on) and at a second press start the day (turn on some lights that is off).

I dont know i its best to have the piston start night routine and in the app create the rules for night and the same for day routine.


#2

Best way is to use modes:

IF
button is pressed
AND
mode IS night (never subscribe)
THEN
Set location mode to day
ELSE
Set location mode to night

Then build other pistons to respond to the different modes.


#3


#4

That should work.

Not sure why you are using ‘with $currentEventDevice’ instead of ‘with location’ but result is the same.


#5

Bec i cant find “with location”
*edit *
found it


#6

When you build an IF it defaults to location unless you choose a device (or device variable) from the list.