Help with Logic

Hi All,
Looking for a little help with my logic planning.

This is what I want to achieve:

  • Sunrise -> Sunset | Lights come on with motion > Lights dim down to 20% after 15 minutes of no motion | Alarm system “Disarm” while home > “Armed (away)” if away
  • Sunset -> Sunrise | Lights come on with motion > Lights dim down to 40% after 30 minutes of no motion | Alarm system “Disarm” while home > “Armed (away)” if away > “Armed (Stay)” between 11:30PM and 6AM

I’ve tried doing this via routines, but the logic of triggers and such is proving a bit of a pain to figure out.

I’ve finally moved and have a lot of the IoT that I will be using now, so its a case of getting it all working as I want.

Any help would be appreciated.

The Rule Machine Smartapp might work for you.

Rule Machine won’t be able to directly change SHM modes yet, but you could create virtual switches to indirectly do it.

Ok I think I worked this out a bit more.

I used RuleMachine as the trigger setup, but used the routines to actually do the work.

So if set of conditions are A,B + C, RuleMachine runs a routine which in turn, sets the SHM and Mode.

The only bit I’ve had to do externally is the dim to X after no motion for X minutes.

It’s working ok at the minute. Now all I need is the presence sensors to work so the alarm wont go off with I leave the wife in the house…