Turn on switch for a duration after trigger from contact sensor

Good Day.
I've managed to set a few rules and triggers up in rule machine but couldn't figure this one.
I would like to turn a light on for a duration ( say 5 mins) after a door is opened. Then have the light go off. Was fairly simple in IRIS but i stumbled through trying this today and couldn't quite get it right.

IRIS door contact sensor V1
Wave Light Switch

Thats as a minimum what im trying to accomplish.
there is a variation if it will work.
Same rule as above, but stay on if there its motion - then go off x mins after motion stops.

I don't have the motion sensor yet...well i did but i don't think the IRIS gen 1 motion sensors work yet.

There is the scenario ( if it helps understand what im trying to accomplish)
I have a garage door on the outside of my home and a garage door between the house and garage. The only place to control the light is by the garage door between the garage and house, so when i leave for work in the dark, i either leave the light on, or walk out through the garage in the dark ( trip hazard). I had a rule in Iris where the Garage door light would stay on for 2 or 3 minutes when the garage door contact sensor was opened.
So as a minimum - i'd like to get back to that state.

The only drawback was if i went out into the garage in the evening and was out there for a few minutes, the light would shut off on its own ( based on the rule) so given the option i'd like to incorporate a motion sensor to the rule.

  • Lights on when contact sensor open ( makes it rather immediate)
  • Stay on for a minimum of 2 mins
  • remain on if there is motion
  • shut down 1 min after motion stops.

Appreciate if anyone can point me in the right direction.
Thanks
Mac

I would use rule machine

If motion or contact sensor open,
True: light on
False: delay 2 minutes (cancel on truth change) light off.

I used Hubitat simple lighting app. There is an option for trigger (I used motion detector) Then enabled turn off after 2 min.

I use two separate rules that accomplishes what you are seeking, you would just need to change the delay time and the dimmer settings not by mode but by level on yours.

hi...im just about to try this. I must have understood the true false scenario....i was thinking not open for the contact sensor would always trigger a false. So does that mean it will be sending an off command every 2 minutes if the contact sensor is closed? the reason i ask is that i suspect that would turn the light off after 2 minutes even if i turned it on manually at the switch ( assuming i was working in the garage as an example) thanks
Mac

With rm4,
Trigger:
contact changed
Motion changed
Action:
if (contact open or motion) then
Stopped delayed actions
Turn on light
Else
Turn off light delayed 2 min
End if

Should do it.

Appreciate that.
I ended up using simple lighting. There is a restriction to turn off after a duration. Wotks perfect. Thanks.