Turn on light with switch, turn off after trigger within timeframe


#1

I have a small corridor in my house which is kind of a junction between two frequent paths.
It has one light toggled by a GE Zigbee switch.

I want to achieve the following behaviour:

  1. Switch on turns the light on, switch off turns the light off (that of course works as standard Smartthings behaviour

in addition I want - and there I need help:

  1. Switch on turns light on, but if contact X changes (door acceleration or open/close toggle) within 1 minute, turn light off

I don’t want to turn off light in all cases within 1 minute, but only if contact X changes.