Avoiding Multiple Motion Detections

Whilst this doesn’t really answer your scenario (you use ESPhome, ZHA and 2 gang light switches?), I’ve posted some musings on a pinned topic

https://community.home-assistant.io/t/motion-activated-lights-automation/608968/48?u=curlywurly