Ok here's a starting idea...
Prep: Make a dummy module M3
M2 ON macro (triggers on M2 on)
set flag 2 ON
delay 60 min
M3 ON (turns on dummy modal M3 on triggering M3 ON macro)
M3 ON macro (triggers on M3 on)
if flag 2 ON
ALL OFF
set flag 2 OFF
M4 ON macro ("cancels" pending "ALL OFF")
clear flag 2
This is far from a perfect solution, however. It work better in situations with shorter times. i.e. Longer times allow more potential for multiple count down macros such as "M2 ON" above.
The above will respond to earlier macros if a later macro is started.
e.g.
- At 2:00 M2 ON is triggered.
- At 2:45 you change your mind and send a "M3 ON" to "cancel" the pending "ALL OFF"
- At 2:50 you start a new M2 ON countdown
- Since the first M2 ON macro hasn't expired it will still trigger M3 ON macro at 3:00. Since the second M2 ON macro has set flag 2 again, M3 ON macro will do an "ALL OFF"
Multiple flags could help with multiply "count down macros" but for me it's more trouble than it's worth. My shut down macro dims key lights first. If I still get caught in the dark, one of my LED night lights will guide me to a switch.