Issue with Automation triggering based on who is away from home

I have home assistant installed on both my wife’s and my phone for notifications and to track when we are home and away. I have an automation that is meant to lock my doors and turn off lights if the amount of people in the home is zero but it has not been triggering. I can see the home entity going to 0 but no trigger on my automation. Appreciate any help on where im going wrong

The attribute field should be empty. The attribute persons returns a list of the entity IDs of person entity’s in the zone… it will never return 0.

FWIW, I usually use a Numeric state trigger for these kind of automations, not a State trigger.

Thank you! I changed it to numeric state, no attribute. So now its just below 1. Just need to test it