Please help, I don't know how to solve this:
So have a door sensor and a light.
If the door opening the light is turned on and after 4 minutes turn off auto. If I open again before the 4 minutes expire the trigger extended delay and wait another 4 minutes It is ok.
But I want that if this light turned on manually and after open the door don't need to turn off the light after 4 minutes. So I need that check the light state and if it on for more than 4 minutes stop trigger to turn off.