Automation to stop another aumation

Hi guys

I bought a door sensor and i’ll place it on my main door, what i want to achive is automatically turn on light when i open door after sundown.
I have a turn off everything button on main door so when i exit i press it and everything goes off.
How can i turn off the “auto turn light on after sundown on open door” for 30 seconds AFTER i press the “turn off everything button” ?
I need to do this because, if i go out after sundown, i’ll press my magic switch and as soon as i open the door light will turn on

Thanks

I haven’t tested this and it may not be the best solution but…

For your automation that runs when you press your magic switch: add a ‘Wait for time to pass (delay)’ action to the end of the actions and have it last 30 seconds.

For your automation that turns the light on when the door is opened: add a condition that checks the ‘current’ attribute of the magic switch automation entity. If the automation is running then the ‘current’ attribute will be non-zero.

i’ll have a try! Thanks