A couple of rules i'm really happy with -maybe this helps someone?

In the spirit of sharing, here is essentially a single function split across three rules for managing the lights in my garage.

The scenario:
I have a standalone garage with three overhead garage doors, and off to a side i have an regular door with a lock on it. Each overhead door has an econolink tilt sensor on it, the regular door has a yale zigbee lock and a lowes zigbee open/close sensor. The locks are paired to a different hub than the garage doors (historical reasons).

The automation:
I wanted lights to come on whenever a door is opened. And i want it to stay on for up to 5 minutes after i close the door both for overhead garage doors and the side door. I have a fridge and a freezer in the garage and sometimes it takes a few minutes to get stuff out of there so having the lights on for that amount of time is good. My door closes automatically by a spring so i can't have it setup to keep the lights on only when the door is open.

Sometimes i want the lights on no matter what
When i work in the garage on a car i usually leave the overhead door open. But sometimes i work there with the door closed. I decided to do an automation so that when i doubletap on the zen27 wall switch it activates a light on scene that disables the automation to turn off lights 5 minutes after a door closed. i do this by setting a global variable. When someone turns the light off (pushed the off button) on the switch i have an automation that sets that boolean valuable so the regular automation works as intended.

Cleanup (eg. just in case i forgot to turn off the lights)
I occasionally forgot to turn off the lights. i have a little automation that turns off the lights at 1 am (and which also sets the global variable to off). Its my cleanup routine in case i forget to turn the lights off. I just can't imagine being in the garage past 1 AM, but if it happens i guess i will stumble over and push the button again.

My Automations
(note "Garage door on Watkins ave" is a sensor i get from a different hub via hub mesh).
First the basic "turn on the lights if door opens, turn it off 5 minutes after its last event".
Note the variable "LightsOn", if its not set to true it means that the "off" call fires.

DoubleTap the zooz light switch
Turn on the lights and set the variable to true, this disables the timed off routine without having to worry about cancelling delay calls etc. I did the log entry to simplify debugging. @BrianX Made a great suggestion to blink the lights when the scene is activated. i took that to heart and implemented a double blink for when the scene activates. works great.

Single "off" push on the zooz light switch
A single push turns off the lights, and sets the LightsOn variable to false so that the timer in my main automation fires the off call 5 minutes after all doors closed. I did the log entry to simplify debugging

Nightly turn off the light automation
Aka, the failsafe in case i forgot to turn off the lights or someone played with a dashboard on a tablet. I explicitly set the LightsOff to false here in case i had a doubleTapp activating the lights. i don't bother to check if that is needed or not, save a few cpu cycles by setting it without testing for it first.

I hope this is useful for someone. I find sharing recipies and how to is a great way to learn.

below are exports of the rules:

Turn on Garage Can Lights when doors open

{"deviceReplacements":{"33":{"deviceName":"Zooz Central Scene Switch","deviceLabel":"Garage can lights","deviceTypeName":"Zooz Central Scene Switch","deviceTypeNamespace":"hubitat"},"34":{"deviceName":"Generic Z-Wave Contact Sensor","deviceLabel":"Garage door 3 sensor","deviceTypeName":"Generic Z-Wave Contact Sensor","deviceTypeNamespace":"hubitat"},"35":{"deviceName":"Generic Z-Wave Contact Sensor","deviceLabel":"Garage door 2 sensor","deviceTypeName":"Generic Z-Wave Contact Sensor","deviceTypeNamespace":"hubitat"},"36":{"deviceName":"Generic Z-Wave Contact Sensor","deviceLabel":"Garage door 1 sensor","deviceTypeName":"Generic Z-Wave Contact Sensor","deviceTypeNamespace":"hubitat"},"49":{"deviceName":"Garage door sensor on Watkins Ave","deviceLabel":null,"deviceTypeName":"Generic Zigbee Contact Sensor (no temp)","deviceTypeNamespace":"hubitat"}},"appReplacements":{"6":{"appTypeName":"Rule-4.0","appTypeNamespace":"hubitat","appName":"Rule-4.0","appLabel":"Turn on Garage Can Lights when doors open","parentAppTypeName":"Rule Machine","parentAppLabel":"Rule Machine","singleInstance":false}},"appData":{"6":{"state":{"actionListMain":["1","2","4","7","8","5","9","6"],"connectors":{},"parens":{"1":0,"3":0,"4":0},"actionDone":true,"hasRuleAct":false,"selectActionsParams":{"thisStr":"Main","label":"Turn on Garage Can Lights when doors open"},"editCondIf":null,"waitDone":{"Main.7":{"2":true}},"usesTime":false,"insertN":7,"inIf":true,"trigCustoms":[],"repeating":[],"capabDone":true,"lastEvtName":"Garage door sensor on Watkins Ave","skippingMain":false,"skipAllMain":true,"locationBlocked":[],"inRepIf":null,"ndx.false":19,"lvList":[],"ruleNdx":5,"firstR":{"1":false,"3":false,"4":false},"timeTriggers":[],"allVarsO":["LightsOn"],"actLabelIndent":"","howManyT":3,"subscribedVariables":[],"certainTimes":[],"prevState":{"34":"closed","PB":"true","35":"closed","36":"closed","49":"closed","LightsOn":"false"},"eval":{"1":[2,"OR",3,"OR",4,"OR",14],"3":["7","AND","8","AND","10","AND","15"],"4":["16"]},"capabstrue":{"1.true":"Garage door sensor on Watkins Ave, Garage door 3 sensor, Garage door 2 sensor, Garage door 1 sensor any changed","2.true":{},"-2.true":{}},"blockIfMain":false,"lastEvtDate":"02-Jan-2021","parenLev":0,"actionsMain":{"1":{"wait":null,"delay":"","modes":{},"method":"getIfThen","indent":"","rule":1,"label":"IF (Garage door 1 sensor open(F) OR \nGarage door 2 sensor open(F) OR \nGarage door 3 sensor open(F) OR \nGarage door sensor on Watkins Ave open(F) [FALSE]) THEN\n","cond":0},"2":{"wait":null,"delay":"","modes":{},"method":"getOnSwitch","indent":"\t","rule":0,"label":"\tOn: Garage can lights\n","cond":0},"4":{"wait":null,"delay":"","modes":{},"method":"getElseIf","indent":"\t","rule":3,"label":"ELSE-IF (Garage door 1 sensor closed(T) AND \n\tGarage door 2 sensor closed(T) AND \n\tGarage door 3 sensor closed(T) AND \n\tGarage door sensor on Watkins Ave closed(T) [TRUE]) THEN\n","cond":0},"5":{"wait":null,"delay":"","modes":{},"method":"getOffSwitch","indent":"\t\t","rule":0,"label":"\t\tOff: Garage can lights\n","cond":0},"6":{"wait":null,"delay":"","modes":{},"method":"getEndIf","indent":"","rule":0,"label":"END-IF\n","cond":0},"7":{"wait":[2],"delay":"0:05:00","modes":{},"method":"getWaitEvents","indent":"\t","rule":0,"label":"\tWait for event: --> elapsed time: 0:05:00\n","cond":0},"8":{"wait":null,"delay":"","modes":{},"method":"getIfThen","indent":"\t","rule":4,"label":"\tIF (Variable LightsOn(false) = false(T) [TRUE]) THEN\n","cond":0},"9":{"wait":null,"delay":"","modes":{},"method":"getEndIf","indent":"\t","rule":0,"label":"\tEND-IF\n","cond":0}},"nestedInIf":[null,true],"actNdx":10,"lastEvtValue":"closed","installed":true,"waitEvents":["Main.4.-2"],"private":"true","waitNdx":{"Main.7":[2]},"skipTypeMain":"if","gvList":["LightsOn"],"hasDevice":null,"ndx.true":2,"editingRule":0,"allVars":{"LightsOn":{"val":"false","type":"Boolean"}},"simpleCond":false,"tok":null,"nestedRepIf":[],"nestedBlockMain":[false],"lastEvtTime":"10:54 AM","condOper":"cond","formerState":"LightsOn","waitMethod":"allHandlerW","cutAction":[],"stopped":false,"nestedIfMain":[false],"nestedLabel":[],"paramNdx":1,"lastEvtDevId":"49","howMany":9,"varUseList":{},"waitCondNdx":3,"token":0,"nestedSkipAllMain":[true],"capabsfalse":{"15.false":"Garage door sensor on Watkins Ave closed","2.false":"Garage door 1 sensor open","13.false":"","4.false":"Garage door 3 sensor open","10.false":"Garage door 3 sensor closed","8.false":"Garage door 2 sensor closed","7.false":"Garage door 1 sensor closed","1.false":"Garage door 3 sensor, Garage door 2 sensor, Garage door 1 sensor any changed","16.false":"Variable LightsOn(false) = false","3.false":"Garage door 2 sensor open","14.false":"Garage door sensor on Watkins Ave open"},"timeTriggersW":{},"timeFormat":"hh:mm a","waitConds":[]},"appSettings":[{"deviceList":null,"multiple":false,"name":"pausRule","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"state8","type":"enum","value":"closed"},{"deviceList":null,"multiple":false,"name":"state7","type":"enum","value":"closed"},{"deviceList":null,"multiple":false,"name":"cond","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"state2","type":"enum","value":"open"},{"deviceList":null,"multiple":false,"name":"insertAct","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"state1","type":"string","value":"open"},{"deviceList":null,"multiple":false,"name":"state4","type":"enum","value":"open"},{"deviceList":null,"multiple":false,"name":"state3","type":"enum","value":"open"},{"deviceList":null,"multiple":false,"name":"delaySecMain.7","type":"text","value":""},{"deviceList":null,"multiple":false,"name":"tstate1","type":"enum","value":"changed"},{"deviceList":{"33":null},"multiple":true,"name":"onSwitchMain.2","type":"capability.switch","value":null},{"deviceList":null,"multiple":false,"name":"anotherWait","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"editToken","type":"button","value":""},{"deviceList":{"34":null,"35":null,"36":null},"multiple":true,"name":"rDev1","type":"capability","value":null},{"deviceList":{"36":null},"multiple":true,"name":"rDev2","type":"capability.contactSensor","value":null},{"deviceList":null,"multiple":false,"name":"stopRule","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"insertToken1","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"insertToken3","type":"enum","value":""},{"deviceList":{"36":null},"multiple":true,"name":"rDev7","type":"capability.contactSensor","value":null},{"deviceList":{"35":null},"multiple":true,"name":"rDev8","type":"capability.contactSensor","value":null},{"deviceList":{"35":null},"multiple":true,"name":"rDev3","type":"capability.contactSensor","value":null},{"deviceList":{"34":null},"multiple":true,"name":"rDev4","type":"capability.contactSensor","value":null},{"deviceList":null,"multiple":false,"name":"RelrDev16","type":"enum","value":"="},{"deviceList":null,"multiple":true,"name":"logging","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"editCond","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"updateRule","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"hasRule","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"runAction","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"rCapab7","type":"enum","value":"Contact"},{"deviceList":null,"multiple":false,"name":"rCapab8","type":"enum","value":"Contact"},{"deviceList":null,"multiple":false,"name":"rCapab3","type":"enum","value":"Contact"},{"deviceList":null,"multiple":false,"name":"rCapab4","type":"enum","value":"Contact"},{"deviceList":null,"multiple":false,"name":"rCapab1","type":"enum","value":"Contact"},{"deviceList":null,"multiple":false,"name":"rCapab2","type":"enum","value":"Contact"},{"deviceList":null,"multiple":false,"name":"editAct","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"rCapab15","type":"enum","value":"Contact"},{"deviceList":null,"multiple":false,"name":"rCapab14","type":"enum","value":"Contact"},{"deviceList":null,"multiple":false,"name":"tCapab-2","type":"enum","value":"Elapsed Time"},{"deviceList":null,"multiple":false,"name":"rCapab16","type":"enum","value":"Variable"},{"deviceList":null,"multiple":false,"name":"rCapab10","type":"enum","value":"Contact"},{"deviceList":null,"multiple":false,"name":"cutAct","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"delayActMain.7","type":"bool","value":"true"},{"deviceList":null,"multiple":false,"name":"not10","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"not14","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"delayActMain.2","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"not15","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"delayActMain.5","type":"bool","value":""},{"deviceList":null,"multiple":true,"name":"deleteAct","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"oper","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"not16","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"tCapab1","type":"enum","value":"Contact"},{"deviceList":null,"multiple":false,"name":"tCapab2","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"actionDone","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"actSubTypeMain.9","type":"enum","value":"END-IF"},{"deviceList":null,"multiple":false,"name":"actSubTypeMain.7","type":"enum","value":"Wait for Events"},{"deviceList":null,"multiple":false,"name":"actSubTypeMain.8","type":"enum","value":"IF (conditions) THEN"},{"deviceList":null,"multiple":false,"name":"actSubTypeMain.5","type":"enum","value":"Turn switches off"},{"deviceList":null,"multiple":false,"name":"actSubTypeMain.6","type":"enum","value":"END-IF"},{"deviceList":null,"multiple":false,"name":"actSubTypeMain.4","type":"enum","value":"ELSE-IF (conditions) THEN"},{"deviceList":null,"multiple":false,"name":"actSubTypeMain.1","type":"enum","value":"IF (conditions) THEN"},{"deviceList":null,"multiple":false,"name":"actSubTypeMain.2","type":"enum","value":"Turn switches on"},{"deviceList":null,"multiple":false,"name":"not2","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"actTypeMain.10","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"state10","type":"enum","value":"closed"},{"deviceList":null,"multiple":false,"name":"refreshActions","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"state16","type":"enum","value":"false"},{"deviceList":null,"multiple":false,"name":"state15","type":"enum","value":"closed"},{"deviceList":null,"multiple":false,"name":"delayMinMain.7","type":"number","value":"5"},{"deviceList":null,"multiple":false,"name":"state14","type":"enum","value":"open"},{"deviceList":null,"multiple":false,"name":"doneWaits","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"hasAll","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"cancelCapab","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"origLabel","type":"text","value":"Turn on Garage Can Lights when doors open"},{"deviceList":null,"multiple":false,"name":"eraseRule","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"delete","type":"enum","value":""},{"deviceList":{"49":null},"multiple":true,"name":"rDev14","type":"capability.contactSensor","value":null},{"deviceList":{"49":null},"multiple":true,"name":"rDev15","type":"capability.contactSensor","value":null},{"deviceList":{"49":null,"34":null,"35":null,"36":null},"multiple":true,"name":"tDev1","type":"capability.contactSensor","value":null},{"deviceList":null,"multiple":false,"name":"delayHorMain.7","type":"number","value":""},{"deviceList":{"34":null},"multiple":true,"name":"rDev10","type":"capability.contactSensor","value":null},{"deviceList":null,"multiple":false,"name":"actionCancel","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"rDev16","type":"enum","value":"LightsOn"},{"deviceList":null,"multiple":false,"name":"actTypeMain.9","type":"enum","value":"Conditional Actions"},{"deviceList":null,"multiple":false,"name":"comments","type":"textarea","value":""},{"deviceList":{"33":null},"multiple":true,"name":"offSwitchMain.5","type":"capability.switch","value":null},{"deviceList":null,"multiple":false,"name":"doneToken","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"not4","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"not3","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"newToken3","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"not8","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"not7","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"actTypeMain.2","type":"enum","value":"Control Switches, Push Buttons"},{"deviceList":null,"multiple":true,"name":"deleteToken3","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"actTypeMain.1","type":"enum","value":"Conditional Actions"},{"deviceList":null,"multiple":false,"name":"actTypeMain.4","type":"enum","value":"Conditional Actions"},{"deviceList":null,"multiple":false,"name":"actTypeMain.6","type":"enum","value":"Conditional Actions"},{"deviceList":null,"multiple":false,"name":"actTypeMain.5","type":"enum","value":"Control Switches, Push Buttons"},{"deviceList":null,"multiple":false,"name":"cancelInsert","type":"button","value":""},{"deviceList":null,"multiple":true,"name":"deleteToken1","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"actTypeMain.8","type":"enum","value":"Conditional Actions"},{"deviceList":null,"multiple":false,"name":"actTypeMain.7","type":"enum","value":"Delay or Repeat Actions, Wait"}],"subscriptions":[{"handler":"allHandler","name":"contact","type":"DEVICE","typeId":49,"typeName":"Garage door sensor on Watkins Ave","filter":"true"},{"handler":"allHandler","name":"contact","type":"DEVICE","typeId":34,"typeName":"Garage door 3 sensor","filter":"true"},{"handler":"allHandler","name":"contact","type":"DEVICE","typeId":35,"typeName":"Garage door 2 sensor","filter":"true"},{"handler":"allHandler","name":"contact","type":"DEVICE","typeId":36,"typeName":"Garage door 1 sensor","filter":"true"}]}}}

Turn off Garage lights at 1 am

{"deviceReplacements":{"33":{"deviceName":"Zooz Central Scene Switch","deviceLabel":"Garage can lights","deviceTypeName":"Zooz Central Scene Switch","deviceTypeNamespace":"hubitat"}},"appReplacements":{"10":{"appTypeName":"Rule-4.0","appTypeNamespace":"hubitat","appName":"Rule-4.0","appLabel":"Turn off garage lights at 1 am","parentAppTypeName":"Rule Machine","parentAppLabel":"Rule Machine","singleInstance":false}},"appData":{"10":{"state":{"actionListMain":["3","2"],"connectors":{},"parens":{},"actionDone":true,"oldConst2":null,"hasRuleAct":false,"selectActionsParams":{"thisStr":"Main","label":"Turn off garage lights at 1 am"},"editCondIf":null,"usesTime":false,"trigCustoms":[],"repeating":[],"capabDone":true,"lastEvtName":"Triggered","skippingMain":false,"locationBlocked":[],"ndx.false":3,"lvList":[],"ruleNdx":3,"firstR":{},"timeTriggers":[],"allVarsO":["LightsOn"],"actLabelIndent":"","howManyT":3,"subscribedVariables":[],"certainTimes":[],"oldConst":null,"prevState":{"PB":"true"},"eval":{},"capabstrue":{"1.true":"When time is 1:03 AM PST","2.true":{}},"installedCapabs":["EnergyMeter","PowerMeter","PushableButton","IlluminanceMeasurement","VoltageMeasurement","ReleasableButton","HoldableButton","Battery","Outlet","MotionSensor","SwitchLevel","Switch","Light","Configuration","Actuator","Sensor","Refresh","ContactSensor","DoubleTapableButton","TamperAlert"],"lastEvtDate":"02-Jan-2021","actionsMain":{"2":{"wait":null,"delay":"","modes":{},"method":"getOffSwitch","indent":"","rule":0,"label":"Off: Garage can lights\n","cond":0},"3":{"wait":null,"delay":"","modes":{},"method":"getSetVariable","indent":"","rule":0,"label":"Set LightsOn to false\n","cond":0}},"nestedInIf":[],"actNdx":5,"lastEvtValue":"","installed":true,"waitEvents":[],"private":"true","gvList":["LightsOn"],"hasDevice":null,"ndx.true":2,"allVars":{"LightsOn":{"val":"false","type":"Boolean"}},"simpleCond":false,"nestedRepIf":[],"nestedBlockMain":[],"lastEvtTime":"01:03 AM","condOper":"cond","cutAction":[],"stopped":false,"nestedIfMain":[],"nestedLabel":[],"paramNdx":1,"lastEvtDevId":null,"varUseList":{},"waitCondNdx":3,"token":0,"nestedSkipAllMain":[],"capabsfalse":{"2.false":{},"1.false":{}},"timeTriggersW":{},"timeFormat":"hh:mm a","waitConds":[]},"appSettings":[{"deviceList":null,"multiple":false,"name":"tCapab1","type":"enum","value":"Certain Time"},{"deviceList":null,"multiple":false,"name":"tCapab2","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"actionDone","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"runAction","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"actSubTypeMain.3","type":"enum","value":"Set Variable"},{"deviceList":null,"multiple":false,"name":"pausRule","type":"button","value":""},{"deviceList":null,"multiple":true,"name":"modes2","type":"enum","value":null},{"deviceList":null,"multiple":true,"name":"modes1","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"actSubTypeMain.2","type":"enum","value":"Turn switches off"},{"deviceList":null,"multiple":false,"name":"cond","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"insertAct","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"not2","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"delete","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"not1","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"time1","type":"enum","value":"A specific time"},{"deviceList":null,"multiple":false,"name":"valBoolMain.3LightsOn","type":"enum","value":"false"},{"deviceList":null,"multiple":false,"name":"rCapab1","type":"enum","value":"Mode"},{"deviceList":null,"multiple":false,"name":"rCapab2","type":"enum","value":"Mode"},{"deviceList":null,"multiple":false,"name":"actionCancel","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"refreshActions","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"editAct","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"comments","type":"textarea","value":""},{"deviceList":null,"multiple":false,"name":"hasAll","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"myVarsMain.3","type":"enum","value":"LightsOn"},{"deviceList":null,"multiple":false,"name":"cancelCapab","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"cutAct","type":"enum","value":""},{"deviceList":null,"multiple":true,"name":"modesX1","type":"enum","value":null},{"deviceList":{"33":null},"multiple":true,"name":"offSwitchMain.2","type":"capability.switch","value":null},{"deviceList":null,"multiple":false,"name":"stopRule","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"atTime1","type":"time","value":"01:03"},{"deviceList":null,"multiple":false,"name":"pasteAct","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"origLabel","type":"text","value":"Turn off garage lights at 1 am"},{"deviceList":null,"multiple":false,"name":"delayActMain.3","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"atSunriseOffset1","type":"number","value":""},{"deviceList":null,"multiple":false,"name":"delayActMain.2","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"actTypeMain.2","type":"enum","value":"Control Switches, Push Buttons"},{"deviceList":null,"multiple":true,"name":"logging","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"editCond","type":"enum","value":""},{"deviceList":null,"multiple":true,"name":"deleteAct","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"actTypeMain.3","type":"enum","value":"Set Mode, Variables or File, Run Custom Action"},{"deviceList":null,"multiple":false,"name":"updateRule","type":"button","value":""}],"subscriptions":[]}}}

Garage Lights turn off scene

{"deviceReplacements":{"33":{"deviceName":"Zooz Central Scene Switch","deviceLabel":"Garage can lights","deviceTypeName":"Zooz Central Scene Switch","deviceTypeNamespace":"hubitat"}},"appReplacements":{"9":{"appTypeName":"Rule-4.0","appTypeNamespace":"hubitat","appName":"Rule-4.0","appLabel":"Garage Light turn off scene","parentAppTypeName":"Rule Machine","parentAppLabel":"Rule Machine","singleInstance":false}},"appData":{"9":{"state":{"actionListMain":["1","3","2"],"connectors":{},"actionDone":true,"oldConst2":null,"hasRuleAct":false,"selectActionsParams":{"thisStr":"Main","label":"Garage Light turn off scene"},"editCondIf":null,"usesTime":false,"trigCustoms":[],"repeating":[],"capabDone":true,"lastEvtName":"Garage can lights","skippingMain":false,"locationBlocked":[],"ndx.false":1,"lvList":[],"ruleNdx":1,"timeTriggers":[],"allVarsO":["LightsOn"],"actLabelIndent":"","howManyT":5,"subscribedVariables":[],"certainTimes":[],"oldConst":null,"prevState":{"PB":"true"},"capabstrue":{"1.true":"Garage can lights button 2 pushed","2.true":{}},"installedCapabs":["EnergyMeter","PowerMeter","PushableButton","IlluminanceMeasurement","VoltageMeasurement","ReleasableButton","HoldableButton","Battery","Outlet","MotionSensor","SwitchLevel","Switch","Light","Configuration","Actuator","Sensor","Refresh","ContactSensor","DoubleTapableButton","TamperAlert"],"lastEvtDate":"02-Jan-2021","actionsMain":{"1":{"wait":null,"delay":"","modes":{},"method":"getLogMsg","indent":"","rule":0,"label":"Log: 'Par says: Button Push means turn off garage lights. LightsOn = false'\n","cond":0},"2":{"wait":null,"delay":"","modes":{},"method":"getOffSwitch","indent":"","rule":0,"label":"Off: Garage can lights\n","cond":0},"3":{"wait":null,"delay":"","modes":{},"method":"getSetVariable","indent":"","rule":0,"label":"Set LightsOn to false\n","cond":0}},"nestedInIf":[],"actNdx":4,"lastEvtValue":"2","installed":true,"waitEvents":[],"private":"true","gvList":["LightsOn"],"hasDevice":null,"ndx.true":2,"allVars":{"LightsOn":{"val":"false","type":"Boolean"}},"simpleCond":false,"nestedRepIf":[],"nestedBlockMain":[],"lastEvtTime":"10:54 AM","cutAction":[],"stopped":false,"nestedIfMain":[],"nestedLabel":[],"paramNdx":1,"lastEvtDevId":"33","howMany":2,"varUseList":{},"waitCondNdx":1,"token":0,"nestedSkipAllMain":[],"capabsfalse":{"1.false":{}},"timeTriggersW":{},"timeFormat":"hh:mm a","waitConds":[]},"appSettings":[{"deviceList":null,"multiple":false,"name":"tCapab1","type":"enum","value":"Button"},{"deviceList":null,"multiple":false,"name":"tCapab2","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"actionDone","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"runAction","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"actSubTypeMain.3","type":"enum","value":"Set Variable"},{"deviceList":null,"multiple":false,"name":"pausRule","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"actSubTypeMain.1","type":"enum","value":"Log a Message"},{"deviceList":null,"multiple":false,"name":"actSubTypeMain.2","type":"enum","value":"Turn switches off"},{"deviceList":null,"multiple":false,"name":"insertAct","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"delete","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"valBoolMain.3LightsOn","type":"enum","value":"false"},{"deviceList":{"33":null},"multiple":true,"name":"tDev1","type":"capability.pushableButton","value":null},{"deviceList":null,"multiple":false,"name":"tstate1","type":"enum","value":"pushed"},{"deviceList":null,"multiple":false,"name":"rCapab1","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"actionCancel","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"logmsgMain.1","type":"textarea","value":"Par says: Button Push means turn off garage lights. LightsOn = false"},{"deviceList":null,"multiple":false,"name":"refreshActions","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"editAct","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"comments","type":"textarea","value":""},{"deviceList":null,"multiple":false,"name":"ButtontDev1","type":"number","value":"2"},{"deviceList":null,"multiple":false,"name":"hasAll","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"myVarsMain.3","type":"enum","value":"LightsOn"},{"deviceList":null,"multiple":false,"name":"cancelCapab","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"cutAct","type":"enum","value":""},{"deviceList":{"33":null},"multiple":true,"name":"offSwitchMain.2","type":"capability.switch","value":null},{"deviceList":null,"multiple":false,"name":"stopRule","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"delayActMain.1","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"origLabel","type":"text","value":"Garage Light turn off scene"},{"deviceList":null,"multiple":false,"name":"delayActMain.3","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"delayActMain.2","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"actTypeMain.2","type":"enum","value":"Control Switches, Push Buttons"},{"deviceList":null,"multiple":true,"name":"logging","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"editCond","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"actTypeMain.1","type":"enum","value":"Send, Speak or Log a Message, Send HTTP Request"},{"deviceList":null,"multiple":true,"name":"deleteAct","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"actTypeMain.4","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"actTypeMain.3","type":"enum","value":"Set Mode, Variables or File, Run Custom Action"},{"deviceList":null,"multiple":false,"name":"updateRule","type":"button","value":""}],"subscriptions":[{"handler":"allHandler","name":"pushed.2","type":"DEVICE","typeId":33,"typeName":"Garage can lights","filter":"true"}]}}}

Garage Can Lights doubleTap Scene

{"deviceReplacements":{"33":{"deviceName":"Zooz Central Scene Switch","deviceLabel":"Garage can lights","deviceTypeName":"Zooz Central Scene Switch","deviceTypeNamespace":"hubitat"}},"appReplacements":{"8":{"appTypeName":"Rule-4.0","appTypeNamespace":"hubitat","appName":"Rule-4.0","appLabel":"Garage Can Lights doubleTap scene","parentAppTypeName":"Rule Machine","parentAppLabel":"Rule Machine","singleInstance":false}},"appData":{"8":{"state":{"actionListMain":["3","4","7","8","9","10","11","12","13"],"connectors":{},"parens":{},"actionDone":true,"oldConst2":null,"hasRuleAct":false,"selectActionsParams":{"thisStr":"Main","label":"Garage Can Lights doubleTap scene"},"editCondIf":null,"usesTime":false,"trigCustoms":[],"repeating":[],"capabDone":true,"lastEvtName":"Garage can lights","skippingMain":false,"locationBlocked":[],"ndx.false":2,"lvList":[],"ruleNdx":2,"firstR":{},"timeTriggers":[],"allVarsO":["LightsOn"],"actLabelIndent":"","howManyT":5,"subscribedVariables":[],"certainTimes":[],"oldConst":null,"prevState":{"33":"off","PB":"true"},"eval":{},"capabstrue":{"4.true":{},"1.true":"Garage can lights button 1 doubleTapped"},"lastEvtDate":"02-Jan-2021","actionsMain":{"11":{"wait":null,"delay":"","modes":{},"method":"getOffSwitch","indent":"","rule":0,"label":"Off: Garage can lights\n","cond":0},"12":{"wait":null,"delay":"0:00:00.4","modes":{},"method":"getDelay","indent":"","rule":0,"label":"Delay 0:00:00.4\n","cond":0},"13":{"wait":null,"delay":"","modes":{},"method":"getOnSwitch","indent":"","rule":0,"label":"On: Garage can lights\n","cond":0},"3":{"wait":null,"delay":"","modes":{},"method":"getLogMsg","indent":"","rule":0,"label":"Log: 'Par Says: Double tap up button means that the garage scene has started. LightsOn = true'\n","cond":0},"4":{"wait":null,"delay":"","modes":{},"method":"getSetVariable","indent":"","rule":0,"label":"Set LightsOn to true\n","cond":0},"7":{"wait":null,"delay":"","modes":{},"method":"getOffSwitch","indent":"","rule":0,"label":"Off: Garage can lights\n","cond":0},"8":{"wait":null,"delay":"0:00:00.4","modes":{},"method":"getDelay","indent":"","rule":0,"label":"Delay 0:00:00.4\n","cond":0},"9":{"wait":null,"delay":"","modes":{},"method":"getOnSwitch","indent":"","rule":0,"label":"On: Garage can lights\n","cond":0},"10":{"wait":null,"delay":"0:00:00.4","modes":{},"method":"getDelay","indent":"","rule":0,"label":"Delay 0:00:00.4\n","cond":0}},"nestedInIf":[],"actNdx":14,"lastEvtValue":0,"installed":true,"waitEvents":[],"private":"true","gvList":["LightsOn"],"hasDevice":null,"ndx.true":4,"allVars":{"LightsOn":{"val":"false","type":"Boolean"}},"simpleCond":false,"nestedRepIf":[],"nestedBlockMain":[],"lastEvtTime":"10:57 AM","condOper":"cond","cutAction":[],"stopped":false,"nestedIfMain":[],"nestedLabel":[],"paramNdx":1,"lastEvtDevId":"33","howMany":3,"varUseList":{},"waitCondNdx":2,"token":0,"nestedSkipAllMain":[],"capabsfalse":{"2.false":{},"1.false":{}},"timeTriggersW":{},"timeFormat":"hh:mm a","waitConds":[]},"appSettings":[{"deviceList":null,"multiple":false,"name":"tCapab1","type":"enum","value":"Button"},{"deviceList":null,"multiple":false,"name":"actionDone","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"actSubTypeMain.9","type":"enum","value":"Turn switches on"},{"deviceList":null,"multiple":false,"name":"actSubTypeMain.7","type":"enum","value":"Turn switches off"},{"deviceList":null,"multiple":false,"name":"actSubTypeMain.8","type":"enum","value":"Delay Actions"},{"deviceList":null,"multiple":false,"name":"tCapab4","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"actSubTypeMain.3","type":"enum","value":"Log a Message"},{"deviceList":null,"multiple":false,"name":"pausRule","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"actSubTypeMain.4","type":"enum","value":"Set Variable"},{"deviceList":null,"multiple":false,"name":"delaySecondMain.8","type":"text","value":"0.4"},{"deviceList":null,"multiple":false,"name":"delaySecondMain.6","type":"text","value":"0.5"},{"deviceList":null,"multiple":false,"name":"insertAct","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"cond","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"not1","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"actTypeMain.14","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"tstate1","type":"enum","value":"doubleTapped"},{"deviceList":null,"multiple":false,"name":"actTypeMain.10","type":"enum","value":"Delay or Repeat Actions, Wait"},{"deviceList":null,"multiple":false,"name":"actTypeMain.11","type":"enum","value":"Control Switches, Push Buttons"},{"deviceList":null,"multiple":false,"name":"actTypeMain.12","type":"enum","value":"Delay or Repeat Actions, Wait"},{"deviceList":null,"multiple":false,"name":"actTypeMain.13","type":"enum","value":"Control Switches, Push Buttons"},{"deviceList":null,"multiple":false,"name":"refreshActions","type":"button","value":""},{"deviceList":{"33":null},"multiple":true,"name":"onSwitchMain.9","type":"capability.switch","value":null},{"deviceList":null,"multiple":false,"name":"valBoolMain.4LightsOn","type":"enum","value":"true"},{"deviceList":null,"multiple":false,"name":"ButtontDev2","type":"number","value":"2"},{"deviceList":null,"multiple":false,"name":"myVarsMain.4","type":"enum","value":"LightsOn"},{"deviceList":null,"multiple":false,"name":"delayActMain.13","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"ButtontDev1","type":"number","value":"1"},{"deviceList":null,"multiple":false,"name":"hasAll","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"cancelCapab","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"stopRule","type":"button","value":""},{"deviceList":{"33":null},"multiple":true,"name":"offSwitchMain.11","type":"capability.switch","value":null},{"deviceList":null,"multiple":false,"name":"delayActMain.11","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"origLabel","type":"text","value":"Garage Can Lights doubleTap scene"},{"deviceList":null,"multiple":true,"name":"logging","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"editCond","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"delayHourMain.8","type":"number","value":""},{"deviceList":null,"multiple":false,"name":"updateRule","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"delayHourMain.6","type":"number","value":""},{"deviceList":{"33":null},"multiple":true,"name":"onSwitchMain.13","type":"capability.switch","value":null},{"deviceList":null,"multiple":false,"name":"runAction","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"delayMinuteMain.12","type":"number","value":""},{"deviceList":null,"multiple":false,"name":"delayMinuteMain.10","type":"number","value":""},{"deviceList":null,"multiple":false,"name":"delete","type":"enum","value":""},{"deviceList":{"33":null},"multiple":true,"name":"tDev1","type":"capability.pushableButton","value":null},{"deviceList":null,"multiple":false,"name":"delayMinuteMain.6","type":"number","value":""},{"deviceList":null,"multiple":false,"name":"cancelActMain.8","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"rCapab1","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"delayMinuteMain.8","type":"number","value":""},{"deviceList":null,"multiple":false,"name":"rCapab2","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"actionCancel","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"logmsgMain.1","type":"textarea","value":"Par says: Double tapped"},{"deviceList":null,"multiple":false,"name":"logmsgMain.3","type":"textarea","value":"Par Says: Double tap up button means that the garage scene has started. LightsOn = true"},{"deviceList":null,"multiple":false,"name":"ButtontDev3","type":"number","value":"2"},{"deviceList":null,"multiple":false,"name":"delayHourMain.10","type":"number","value":""},{"deviceList":null,"multiple":false,"name":"editAct","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"delayHourMain.12","type":"number","value":""},{"deviceList":null,"multiple":false,"name":"randomActMain.8","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"actTypeMain.9","type":"enum","value":"Control Switches, Push Buttons"},{"deviceList":null,"multiple":false,"name":"comments","type":"textarea","value":""},{"deviceList":null,"multiple":false,"name":"randomActMain.6","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"delaySecondMain.12","type":"text","value":"0.4"},{"deviceList":null,"multiple":false,"name":"cancelActMain.12","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"cutAct","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"delaySecondMain.10","type":"text","value":"0.4"},{"deviceList":null,"multiple":false,"name":"cancelActMain.10","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"delayActMain.7","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"actSubTypeMain.12","type":"enum","value":"Delay Actions"},{"deviceList":null,"multiple":false,"name":"actSubTypeMain.13","type":"enum","value":"Turn switches on"},{"deviceList":null,"multiple":false,"name":"delayActMain.9","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"actSubTypeMain.10","type":"enum","value":"Delay Actions"},{"deviceList":null,"multiple":false,"name":"actSubTypeMain.11","type":"enum","value":"Turn switches off"},{"deviceList":{"33":null},"multiple":true,"name":"offSwitchMain.7","type":"capability.switch","value":null},{"deviceList":null,"multiple":false,"name":"delayActMain.3","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"delayActMain.4","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"randomActMain.12","type":"bool","value":""},{"deviceList":null,"multiple":true,"name":"deleteAct","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"actTypeMain.4","type":"enum","value":"Set Mode, Variables or File, Run Custom Action"},{"deviceList":null,"multiple":false,"name":"randomActMain.10","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"actTypeMain.3","type":"enum","value":"Send, Speak or Log a Message, Send HTTP Request"},{"deviceList":null,"multiple":false,"name":"actTypeMain.8","type":"enum","value":"Delay or Repeat Actions, Wait"},{"deviceList":null,"multiple":false,"name":"actTypeMain.7","type":"enum","value":"Control Switches, Push Buttons"}],"subscriptions":[{"handler":"allHandler","name":"doubleTapped.1","type":"DEVICE","typeId":33,"typeName":"Garage can lights","filter":"true"}]}}}

`

6 Likes

Why not export the rules and share them? Makes it even easier for someone to recreate them!

Nice job.
If I may make a suggestion, why not put your contact sensors into a group.
This way you will end up with all your sensors under one 'master' sensor. Works just the same but just looks a bit cleaner for me.
Just a thought, there is no right or wrong in this scenario. Just preference.

I don't know how to export a rule. Let me see if I can figure it out. Edit, I just figured it out. Let me add it to my original post.

One of the really nice properties of "time elapsed" is that when a trigger is triggered it will automatically cancel the "time elapsed"..

Thus the logic flow is:
Door opens -> lights on
Door closes -> 5 minute timer starts
Minute 4 and door opens -> 5 minute timer cancels, lights is turned on (they are already on so this does not change anything.
Door closes -> 5 minute timer starts
5 minutes elapsed -> wait for event (timer) finishes, lights turned off

Probably ignorance on my part. I haven't done much with groups on hubitat yet. I'll consider it. I like the AND , OR in conditionals for devices in rm4. The (T) or (F) per sensor in the UI makes it easy to debug and understand program flow.

Nice, thanks for sharing! In the spirit of sharing, here is my set of rules for my garage lights. I've got a Hue Outdoor motion sensor in there with a 3 minute timeout -- it is very fast and has enough range to cover (almost) the whole garage. I put a contact sensor on the door from the laundry room so the lights come on even before I get into the garage:

LaundryRule

I have the conditional in here because I don't want to do the delayed off if the lights are already on when I open the door. And there is no reason to do any of this if I'm LEAVING the garage (in which case the lights are already on).

Once I'm in the garage, this rule keeps them on:

LightsRule

That all works fine most of the time, but if I'm stationary too long, or in one particular corner of the garage the motion can time out and kill the lights. I could put another motion sensor in there (or perhaps relocate the existing one), but I already have a 4 button device for turning on and off my dust collection, so I programmed one of the buttons to "keep the lights on until I turn them off:"

ButonRule

This is a lot more complicated than it needs to be to just do its job, because I added a "flash the lights off then back on" as a visual confirmation that it took effect (this button is occasionally not 100% reliable, but that is a separate issue).

Finally, there is the rule that resets everything whenever the lights go off for any reason:

OffRule

And, like @par.botes, I have a 2am rule that turns off pretty much everything in the house. That will trigger this last rule and reset things also.

Having 4 rules to control one set of lights seems overkill somehow. Maybe one of the motion lighting or simple automation apps could do all of this but my cursory investigation of them leads me to believe not.

1 Like

Cute trick with the blinking the lights to confirm that you want the lights kept on. I'm going to steal that idea...

I chose to not use resume or stop rules type of logic. I guess I'm more used to test/set semantics on a coordination object from working with concurrent code in my professional line of work.

When I learned about rm the author of it was kind enough to discuss general program flow as well as his preference for time elapsed for these types of automations vs delay/cancel. I've used the elapsed time behavior extensively in my automations. It makes it really clean.

And I like the idea of disabling automation via a global boolean, new automations can just test that boolean to modify their program flow which I find nicer than modifying old automations to interact with a new automation via cancel our pause execution calls.

1 Like

What is the state of a local or global boolean when the system first comes up? My concern about using them has been about somehow making sure they are in the correct initial state. Do they default to true, false, or whatever they were when the system shut down? I don't know, which has kept me from using them much. If someone can enlighten me I'd appreciate it.

Maybe the same issues apply to rules being paused/enabled.

When you create the variable you get to decide how it should be initialized. I declared mine to be initialized to false. You have to declare them to have an initial value.

With my logic false makes the most sense, even if I have a power loss and my switches recover into an unknown state, the 1am cleanup routine gets everything back in order. And if I door is opened before then I just start the lights as if the scene is not active. I think that is the exact behavior I wanted in this automation.

Great question actually.

Thanks. I'll have to think about how that might change the way I'll design my rules...

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.