Allow closest() to return the zone closest to a person #3560
Replies: 1 comment 1 reply
-
|
The behavior comes from In the template helper source, So the feature request makes sense, but I would avoid changing |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the enhancement
I'd like to use
closest('person.paul', states.zone)to show the zone that is closest to my current location.This doesn't work yet because the second argument of
closest()is always expanded, so HA doesn't consider any zone entities, but instead considers the entities within those zones (eg persons, because they have location data)I found it on this line: https://github.com/home-assistant/core/blob/8a74b41db55d4a8eb3f053dcf1319c2b34e939e9/homeassistant/helpers/template/__init__.py#L737
Maybe we can skip expanding for zones? I don't know. What do you think?
Example usage
Current workarounds
Anything else?
No response
Beta Was this translation helpful? Give feedback.
All reactions