Since some time ago “zone” entities keep number of persons inside these zones.
Here is some non-passive zone:
The “states(‘zone.some_zone’)” is ZERO - even when persons inside it.
Compared with the “home” zone:
{{states.person | selectattr('entity_id','is_state','home') | map(attribute='entity_id') | list}}
states('zone.home') = {{states('zone.home')}}
gives:
which is correct.
But this does not work - the 1st statement gives a correct list of persons inside the zone, the 2nd statement is wrong:
{{states.person | selectattr('entity_id','is_state','XXXXXXXXXXX') | map(attribute='entity_id') | list}}
states('zone.some_zone') = {{states('zone.some_zone')}}
where “XXXXXXXXXXX” is a friendly name for the “zone.some_zone”,
Checked with one more non-home zone (not passive too) with 3 persons inside - same ZERO state.
Is this a bug?
Seems to be definitely a bug.
opened 12:03AM - 10 Feb 23 UTC
integration: zone
### The problem
Here is some non-passive zone:

The “states(‘zone.some_zone’)” is ZERO - even when persons inside it.
Compared with the “home” zone:

```
{{states.person | selectattr('entity_id','is_state','home') | map(attribute='entity_id') | list}}
states('zone.home') = {{states('zone.home')}}
```
gives:

which is correct.
But this does not work - the 1st statement gives a correct list of persons inside the zone, the 2nd statement is wrong:
```
{{states.person | selectattr('entity_id','is_state','XXXXXXXXXXX') | map(attribute='entity_id') | list}}
states('zone.some_zone') = {{states('zone.some_zone')}}
```
where “XXXXXXXXXXX” is a friendly name for the “zone.some_zone”,

Checked with one more non-home zone (not passive too) with 3 persons inside - same ZERO state.
### What version of Home Assistant Core has the issue?
2023.2.2
### What was the last working version of Home Assistant Core?
_No response_
### What type of installation are you running?
Home Assistant Container
### Integration causing the issue
zone
### Link to integration documentation on our website
https://www.home-assistant.io/integrations/zone/
### Diagnostics information
_No response_
### Example YAML snippet
_No response_
### Anything in the logs that might be useful for us?
_No response_
### Additional information
_No response_
Do these zones overlap? If they do, I understand you can only be in one zone at a time. I’ve read stuff about HA picking the smaller area, or the one with the closest centre (not sure what the reality is). See this thread for a suggestion to use a proximity sensor instead.
Do not overlap.
~100 km between them.