Choose style:

Author Topic: OR rules  (Read 6738 times)

0 Members and 1 Guest are viewing this topic.

Offline cputoaster

  • Backer
  • *
  • Posts: 19
  • Thanks: 0
  • Registered : 08/05/2014
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYears
OR rules
« 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

Offline rldreams

  • Beta Testers
  • *
  • Posts: 240
  • Thanks: 0
  • Registered : 02/06/2014
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: OR rules
« Reply #1 on: March 27, 2015, 11:11:31 am »
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


Offline d.kiran

  • Backer
  • *
  • Posts: 500
  • Thanks: 0
  • Registered : 11/09/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: OR rules
« Reply #2 on: April 01, 2015, 10:34:45 pm »
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).

Offline Fire69

  • Backer
  • *
  • Posts: 344
  • Thanks: 0
  • Registered : 03/08/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: OR rules
« Reply #3 on: April 02, 2015, 03:15:21 am »
+1

Offline cputoaster

  • Backer
  • *
  • Posts: 19
  • Thanks: 0
  • Registered : 08/05/2014
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: OR rules
« Reply #4 on: April 07, 2015, 07:42:12 am »
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

Offline bwainscott

  • Backer
  • *
  • Posts: 138
  • Thanks: 0
  • Registered : 02/08/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: OR rules
« Reply #5 on: April 07, 2015, 10:35:42 am »
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...

Offline cputoaster

  • Backer
  • *
  • Posts: 19
  • Thanks: 0
  • Registered : 08/05/2014
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: OR rules
« Reply #6 on: April 07, 2015, 12:41:55 pm »
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).

Offline kanmanirajap

  • Backer
  • *
  • Posts: 5
  • Thanks: 0
  • Registered : 24/08/2014
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: OR rules
« Reply #7 on: April 07, 2015, 08:27:53 pm »
+1 'Clear event queue for light X' would be nice.

Offline cputoaster

  • Backer
  • *
  • Posts: 19
  • Thanks: 0
  • Registered : 08/05/2014
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: OR rules
« Reply #8 on: April 09, 2015, 05:05:58 am »
So, as a conclusion, there is no way to correctly do the two-sensors-one-light case currently?

Offline matt

  • Backer
  • *
  • Posts: 151
  • Thanks: 1
  • Registered : 26/08/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: OR rules
« Reply #9 on: April 09, 2015, 09:02:54 am »
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.

Offline tt4me

  • Backer
  • *
  • Posts: 140
  • Thanks: 1
  • Registered : 20/08/2014
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: OR rules
« Reply #10 on: April 09, 2015, 12:14:03 pm »
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.

 

Page created in 0.203 seconds with 23 queries.

bottleneck