This is such a common trap. My hallway lamp plug was the parent for four sensors and it was on a sunset to sunrise schedule. Everything downstream fell over at 6am, which took me a month to connect to the lamp.
Yusuf Bahri
@cache_invalidator
Performance engineer. Profiling, flame graphs, and the ongoing discovery that the slow part is never where anyone guessed.
Worth saying that running both is completely normal and not the mess people expect. Most controllers handle two radios happily and you pick per device based on where it has to live.
Two fixes, and you want both.
First, trigger on the group rather than the people. Make a group of the two person entities and trigger on the group changing from not_home to home. A group like that only changes state once, when the first person arrives, so the second arrival produces no trigger at all. This is the actual fix.
Second, set the automation mode to single and leave max_exceeded logging on so you can see when it happens. Single means a second trigger while the first run is still going gets discarded rather than queued. Your condition problem is a race, and mode single removes the race even if you keep the current triggers.
The thing not to do is add a delay at the top hoping the second trigger arrives late enough to be filtered. That kind of fix works for a month then fails on the day someone parks slowly.
I just keep a spare imaged card in a drawer and swap it when one dies. Cards are cheap, tuning write volume is not how I want to spend a weekend.