Turning lights on and off

Hi all,

Just getting going in the Homey world and I just can’t figure out something so simple. I want any of two switches to turn on a light, then both switches need to be off to then turn the light off. I seems so simple using advance flow, I’m trying to get familiar on how do use advance flows. Please see below that does not work. The light turns on, but does not turn off when both switches go off. Thanks for any help!

WHEN
Switch 1 turned off OR switch 2 turned off
AND
switch 2 is turned off AND switch 1 is turned off
THEN
turn off lamp

‘Aangezet = turned on’ is a trigger (rounded leftside)

‘Is uit = Is turned off’ is a condition (two exits on the right: true or false

1 Like

Thanks for response, but still not sure what I have won’t work to turn off if both switches off. I guess I may not understand what turns the result “on” if a switch is “off” then take that result to control something.

If switch 1 is turned off

AND

switch 2 is OFF

THEN

turn lights off

and a second flow

If switch 2 is turned off

AND

switch 1 is OFF

THEN

turn lights off

1 Like

1 Like

I think the On card is the when, and the off card is an and/then card. they should both be when cards, otherwise the off flow will never start

1 Like

It work they way DirkG suggested!!

I guests the states of switches (when) all going into an (all) block doesn’t work like one would think just looking at it.

Now I know what has to be done for the correct responses based on conditions.

You are correct, the bottom 2 card (off) are not trigger cards but AND cards.

BUT even if you replace them it will not work. Because the ALL card check at every trigger (it is not a wait untill).

2 trigger cards will never trigger at the same time so the ALL card will never be a YES.

SO

For both switched add the trigger (WHEN) card. Behind both connct the AND Card of the otherswitch (the ones you have at the bottom). Connect them bot to a ANY card (so replace your ALL card by an ANY card)

The. It will work

Below is what work for me.

Thanks you all for the help!!

1 Like

Yess thats it

:+1:

Do make sure no other flows turn on/of the light because that would result in having to doubletap the switches…

Example:

Both switched are off, so the light is off.

Now sone other flow turns on the light.

The only way to turn of the light now is:

Switch1 to on and to off right away

Walk to switch2 seitxh it on and off right away

Yes 10-4, you really need to keep all your flows in order or you will be scratching your head saying WTF!

“when” in combination with “any” will also work, if you want the light to respond to one of the two triggers. The “all” card will never work, as it needs to originate from the same flow/when card. Then indeed you need to build in the “and card” to check for the other state.

In this case it was indeed both steps. replacing for a when card, and removing the " all” .

Enjoy!

Good info…Thanks

I think you mean ‘any’ instead of “all”

And ‘all’ instead of ‘and-card’

pffff…. my bad…indeed. adapted.

Almost…

—> “the ALL card will never work”

1 Like

Hi @Chet_Brokhof ,
For the Is turned off Cards you use AND cards. They do not start without a WHEN card. So if you would start with Every 5 seconds (dumb/busy method) and then go to both cards your Homey would constantly check, if both are switches are off. The better idea is either the methods @Wim_Post, @Paul_van_Ulft and @DirkG showed, or you take the WHEN-Cards **turned off" connect them with any and then go to both cards you started with.
My old example is a bit more complex, but I guess you can adopt it to your needs.

That’s absolutely right. :+1:

The question is, what exactly do you want to achieve, @Chet_Brokhof?