Complex mode and motion rule?

I have two driveway motions, Driveway Motion Right (DMR) and Driveway Motion Left (DML).
The driveway is illuminated by a set of floods, Driveway Floods (DF).

Here's what I want to be able to figure out how to do.

  1. If it's day time and the DF are on, turn them off after 10 minutes
  2. if it's evening, set the DF to 50% illumination
  3. If it's night time, set the DF to 25% illumination
  4. If there is motion on DFL or DFR, and if it is evening or night, turn DF to 100% for 10 minutes

Any hints on how to do something relatively complex like this?

Instead of making it complex, how about some simple things?

Rule 1 triggered by DF on.

Actions:
   IF(Time Between Sunset and Sunrise) Exit Rule
   Off: DF delayed by 10 minutes

Rule 2 triggered by Mode becomes Evening:

   Actions:
      Set Dimmer: DF to 50
      Wait for Mode to become Night
      Set Dimmer:  DF to 25
      Wait for Certain Time:  Sunrise
      Off: DF

Rule 3 triggered by DFL or DFR active:

Actions:
   Set Dimmer: DF to 100
   IF(Mode is Evening) Set Dimmer:  DF to 50 delayed by 10 minutes
   IF(Mode is Night) Set Dimmer: DF to 25 delayed by 10 minutes
   IF(Time between Sunrise and Sunset) Off: DF delayed by 10 minutes
2 Likes

Doesn't he also need some cancel delayed actions? And the delays made cancellable?

Not based on his description, but you could well be right. He said, "If there is motion ... turn to 100% for 10 minutes." There are also edge cases, such as motion just before dawn, or just before a mode change. Dealing with all of that could be round 2...

1 Like

For some reason it took 24 hours to work right, but it's behaving more or less correctly now.

The next question I have is that my guess would be that someone manually manipulating the dimmer switch would mess all this finely crafted logic up. How hard would it be to add something like - if the switch was manually toggled, either on or off - it would stay that way for minutes and then go back to the way it's programmed to behave

This is doable, IFF the switch reports "physical" events. Many do, some do not. You can tell by looking at the Events from the device page for this switch. You should see entries with type "physical" or "digital". If turning the switch on or off manually results in a "physical" event, then you can create a rule with "Physical Switch" as the trigger, and go from there. Also, there are Capture and Restore actions to help with your goal.

1 Like