Simple Rules Engine Question

(Zack Duchene) #1

i want to create a rule in the SRE that turns off the AC if there is no motion (multi sensor) for one hour.

As of now I have it set up to say if there is no motion AND it is between 8:00 AM and 5:00 PM turn AC off (delay 3600 seconds).

My question is, will that 3600 second timer reset if there is motion within that. 3600 second window?

Is there a different/better way to do this?

Thanks for the help!

(Joe) #2

With Simple Rule Builder ( there isn’t a good way to do that right now. The timer will not get reset if there is motion within that 3600 second window.

Your question has got me thinking about it again though. If I have some free time this weekend I’ll work on it. I think I’ve got an idea for a good way to implement this.

(Keith Croshaw) #3

@JoeC I too had a need for checking something between hours A and B and if conditions were met then do C. That need has since passed but it would be nice, I know that goes against “event based” programming but sometimes time between is the event that needs automation in our lives. :smiley:

I’d be satisfied with a check every 5 minutes.

(Joe) #4

Well, I think it can already do something like:

if switch A is turned on
and time is between 5:00pm and 6:00pm
then do X

or something like:

if time is 5:00pm
and switch A is on
then do X

I think that combo would be close to the same as:

Between 5:00pm and 6:00pm
if switch A is on
do X

The trouble I have with

Between 5:00pm and 6:00pm
if switch A is on
and condition B is met
do X

is that it can be hard to easily specify if you want something to happen just once, or once per check, or once each time the condition has changed, or something else.

(Keith Croshaw) #5

My specific requirement was a switch that would always be on while entering the trigger period between 9PM and 7AM if Switch A powerMeter current value < 8 watts then turn switch A off.

If the watts are above 8 I need it to keep checking until the thing is done then turn it off when it is.

This would be very easy in any loop based controller but frustrating in this environment.