Here is the scenario. Turn switch on if:
-
Motion in room AND Temperature is above 73 or below 64. Turn off if motion stops for 30 minutes. All modes except evening/night mode.
-
Motion in room between 8pm-10pm and Temperature is above 73 or below 64, leave on while mode is in Evening/Night mode even if motion stops and temperature is in that range.
Devices:
- Motion/Temp Sensor
- Zigbee Plug
Here is my first thought on how to do this. If I'm missing some aspect of the specific logic you want, hopefully you can figure out how to modify this as needed, or someone correct me if I've missed something.
This assumes you're using Rule 5.0, where you can take advantage of the new "predicate conditions" feature (the rule will not trigger unless this condition is true; it's not impossible to replicate in Rule 4.x, but in this case it simplifies your actions):
Predicate condition: Temperature < 64 OR Temperature > 73
Trigger events: Motion active
Actions to run:
IF (Mode is NOT Evening, Night) THEN
On: Lights
Wait for condition: motion inactive --> duration 0:30:00
Off: Light
ELSE-IF (Time Between 8 PM and 10 PM AND Mode is Evening, Night) THEN
On: Light
Wait for condition: Mode is NOT Evening, Night
Off: Light
END-IF
2 Likes
Worked like a charm. Thank you very much!
I may tweek it a bit to run during specific evening/night times rather than modes, since my evening mode shifts according to sunset times.
Not turning off, suggestions?
Turn on trigger and action logging for the rule and see if they give any clues. At the time your screenshot above was taken, the sensor should have turned off 30 minutes after motion became inactive, which either already happened or it never became active in the first place to set things into motion (that's all I can tell from the screenshot, though I don't see anything wrong off the top of my head; I may be missing something in how I wrote the rule).