I need to implement the "follow me" lighting procedure for the garage lighting without using motion sensors. I have 2 doors to the garage, one from outside with the smart lock(garage door lock) and one from inside with open/close sensor(kitchen door)
There are 2 scenarios:
When I come home from outside I need garage lighting to turn on when garage door lock unlocks (unlock from outside) Then after I went through garage and open kitchen door the light should turn off (open from outside)
Completely opposite scenario. When I go out from kitchen I need garage lights to turn on(open from inside) . Then after I went through garage and open garage door lock the light should turn off (open from inside)
The problem I see is how to identify whether I came from inside or outside to act correspondingly on lights turn on/off. For example, I need to turn the garage lights on when I come from kitchen (from inside), but to turn them off when i come to kitchen (from outside)
I simply added a motion detector to my garage to help with this scenario. If any door opens, or motion is detected, turn on the lights. If all doors are closed, and no motion for at least 5 minutes, turn off the lights.
This design is simple and has worked for months without a hiccup.
Garage Lock TR:
Trigger event: Lock unlocks
Condition: Private Boolean true
Action for True: turn on light, set PB of Kitchen Door TR PB to false
Action for False: turn off light, set PB of this rule to true
Kitchen Door TR:
Trigger event: door opens
Condition: Private Boolean true
Action for True, turn on light, set PB of Garage Lock TR PB to false
Action for False, turn off light, set PB of this rule to true
Here's how it works. At the beginning, you are in the house and the light is off. You open the kitchen door, its TR rule is true, so it turns on the light, and sets Garage Lock Private Boolean to false. You go out the garage door, its TR rule is false, so it turns off the light, sets itself to true, and sets Kitchen Door TR PB to false.
Now, when you come back in the Garage Door, its rule is true, turns on the light. Kitchen Door rule is false, turns off the light, and resets PB
BTW, It depends on there only being one person. If first person came in from garage door and went inside, second person coming in from garage door would not turn on the light. Same going out. But, that problem could be solved I think.
I was thinking about your automation and the solution I gave above. It's not a very robust solution.
Perhaps this would be better: If we assume a starting condition of both doors closed and the lights off, then we can consider the case of either door opening to be a time to turn on the lights. Similarly, in the case of the lights being on (from the first case), then any door opening would be the time to turn them off (perhaps after a short delay). This way, the order of events doesn't matter so much.
Rule 1:
Conditions: Lights Off, Garage Lock unlocked, Kitchen Door opened
Rule: Lights Off AND (Garage Lock unlocked OR Kitchen Door opened)
Action for True: Turn on Lights
Rule 2:
Conditions: Lights On, Garage Lock unlocked, Kitchen Door opened
Rule: Lights On AND (Garage Lock unlocked OR Kitchen Door opened)
Action for True: Turn off Lights after 15 second delay
Ah, but those two can be combined into a single Triggered Rule:
Trigger events: Garage Lock unlocked, Kitchen Door opened
Condition: Lights off
Rule: Lights off
Action for true: turn on Lights
Action for false: turn off Lights after 15 second delay.
Bruce,
Thank you very much for you new solution. It looks much simpler then a previous one and I definitely try it when I return home.
Actually I've already fixed the potential problem you described before (using corresponding PB renitialization) along with another situation when person enters the garage from any side, but decided not to go through other door and returns back where it came from.
The only edge scenario I need to take care of is the situation when person opens the door then go inside the garage without closing it and then simply close the door after some time. In this case the light will never turn off and will require to open and close the door one more time.
It looks like your new solution will not solve this problem too. Any ideas?
What you can do is put a timer on the light-on side, that turns it off after x minutes no matter what. Just set x high enough to cover your ordinary use of the garage in such a manner.
Trigger events: Garage Lock unlocked, Kitchen Door opened
Condition: Lights off
Rule: Lights off
Action for true: turn on Lights, turn off Lights after 5 minute delay
Action for false: turn off Lights after 15 second delay.
This discussion is very interesting to watch. It always amazes me how what appears to be so simple at first glance gets to be so complicated. We deal with these 'failure mode analyses' at work all of the time.
Bruce,
I'm a little confused. Can you point me out where I can set "Turn off lights after xx delay" in RM. The only delay I see is before execution delay. Or you are talking about fade in/out dimmer over time?