Home/away automation when the last one leave

It appears this doesn’t work, because numeric state triggers only happen once each time the threshold is crossed.

So, if you are home, zone.home will be above 0 (= 1), and the trigger will fire. If you leave, the entity value is 0, which does not cross the threshold of 0 (even though it is no longer above 0), so it doesn’t reset. If you come home again, the entity value will go to 1, but it is still in range / hasn’t reset, so it won’t fire again.

https://community.home-assistant.io/t/home-zone-automation-not-triggering/