Securifi Community Forum
Sensors and Home Automation => Home automation => Topic started by: cputoaster on March 27, 2015, 05:12:26 am
-
Hi,
I have a relatively simple setup: two motion detectors and one lamp switch. I want to have a rule that switches on the light on motion from any of the sensors, and only switches off N seconds after the last motion from any of them.
Currently, I have two rules, one for each motion sensor, that switch on the single switch, wait for N seconds and switch off again. But somehow it does not seem to work well. Could it be that one rule sends a switch-off event which intersects with the other rule? How is this parallel handling done?
Cheers,
Andres
-
I would think you would need 3 rules.
1 If motions detected a then turn on light
2 if motion detected b then turn on light
3 if no motion a and b then turn off light in N seconds
-
Just checking to see if there are any plans to add OR support in IF part of the Rules ? (I don't think OR support makes sense in the THEN part). For example, I have similar rules that I use across multiple sensors that could be solved by a simple OR function. (E.g. If a motion detector is detected in any one of multiple places, then turn on and turn off a light somewhere).
-
+1
-
So, with the 3 suggested rules, there would still be a problem, no? The "off" event cannot be removed in case there is additional activity during the timer period.
As a test case:
s0: sensor 0
s1: sensor 1
l0: light
When any of the sensors go on, there should be light for 60s.
timeline:
t | sensor | target | actual |
0 | s0 on | 1 | 1 |
10 | s1 on | 1 | 1 |
30 | s0 off | 1 | 1 |
50 | s1 off | 1 | 1 |
60 | s1 on | 1 | 1 |
70 | s1 off | 1 | 1 |
110 | | 1 | 0 |
130 | | 0 | 0 |
-
How to do this properly is a bit tricky. I can't yet do what seems the correct thing to even lock my front door. I have it set to lock 180 seconds after the door sensors says it is closed. But what it OUGHT to be is "if the door has been closed for 180 seconds, then lock" which is not at all the same thing. One of these days someone is going to go out the door, come back in 178 seconds later, and then try to close the door with the deadbolt sticking out. One idea is to have rules that can enable/disable other rules, along with some special time interval based rules:
Rule A: lock door 180 seconds after this rule is enabled, then disable this rule
Rule B: if the door closes, enable Rule A
Rule C: if the door opens, disable Rule A (cancel any pending action)
That is kind of round about for a non-techy user (my wife, who is very intelligent but not tech savvy, would say this is way too complicated)
For my garage door, I'd eventually like this:
Rule A: if the door between the house and garage opens, turn on the kitchen light (normally disabled)
Rule B: if it is dark outside and the outer garage door opens, enable Rule A for 120 seconds
That way the light would not come on when I leave, but would when I come home.
I don't necessarily think this is the ideal rules interface, but SOMETHING like this is needed. Just trying to give the programmers some ideas...
-
yeah, something is needed. Or maybe some kind of "clear event queue for light X" action, so that all kind of future actions there would be cleared (the OFF events in my example).
-
+1 'Clear event queue for light X' would be nice.
-
So, as a conclusion, there is no way to correctly do the two-sensors-one-light case currently?
-
So, as a conclusion, there is no way to correctly do the two-sensors-one-light case currently?
Yes, no way to do this correctly currently. I believe the only way currently (note, not correctly) is to use a dummy device as a variable, as mentioned in another post.
-
I'm planning on installing a hot water circulation pump and don't want it run all the time or via a timer, so I'm hoping to have it kicked on when a light in any of the bathrooms it turned on, but then shut off 5 minutes after it's turned on.
This would be easy with a single light switch, but not so much with multiple.