Garage door + access door to the garage, turn light on, then off


#1

1) Give a description of the problem
I want to turn the garage light on when I open either the garage door or the access garage door and have it turned off when either door is open again

2) What is the expected behavior?
turn the light off, when I open again either the garage door or the access garage door

3) What is happening/not happening?
it is not turning the light off

**4) Post a Green Snapshot of the piston![image|45x37]


#2

Your second if block never executed because the first one is exactly the same conditions.

Try deleting the second if block entirely.

Then in the first block, change the turn on part to toggle

Baddicaly if on toggle to off and vice versa


#3

because my thought was: "opening the door sensor, would trigger and turn the light on. Then the door closes, resets the door sensor and then, when it is open again, it would turn the light off

but i’ll try your suggestion. Thank you :slight_smile:


#4

It does reset the open close sensor to closed status, but once it opens again now it is open and turns light on.

Then it gets to your second if block and since the door is open already it is not changing to open any more. It happens really fast. So it will evaluate as false and not trigger the turn off command. Hope tgat explains a little better


#5

yes, thank you for your time! Yesterday was my first day, I’m trying to learn all the things here. :slight_smile: