Two automations not playing nice together


I have two automations, side gate light and sliding door light. If you go through one, you’ll go through the other within ten seconds, the automations clash, and the lights stay on. I thought I’d got some good advice here and added “turn off automation” at the start and “turn on automation” at the end - but it still happens. What should I be looking at to fault find this?

Please don’t use screenshots, but post the yaml of both these automations, inside a code block (three backticks) if you want us to be of any help. See point 11 of:

It’s hard to see without seeing the real code, but you probably want to trigger the second automation rather than turning it on.
Keep in mind that if you use the automation.trigger action, the conditions (in the ‘And if’ section) will not be evaluated, it will just start with the first item in the list of actions (which might be a condition btw).

Overall better approach:
Write the 2nd automation as a script.

And yes:
Please don’t use screenshots!