core: Automations with "zone" trigger don't work anymore

The problem

I have two automations that are triggered when I leave the house and when I return. They have worked faultlessly for more than a year until April. Since the May update, however, the automations are only triggered sporadically - sometimes one of them, but usually none at all. I can’t find a cause for this - the person’s status is still recognised correctly and the absence times are correct.

How can I find out why the automations no longer trigger?

What is version of Home Assistant Core has the issue?

2021.6.3 (issue first seen in 2021.5.x)

What was the last working version of Home Assistant Core?

2021.4.x

What type of installation are you running?

Home Assistant OS

Integration causing the issue

zone

Link to integration documentation on our website

https://www.home-assistant.io/integrations/zone/

Example YAML snippet

alias: Abwesend
description: ''
trigger:
  - entity_id: person.jens
    event: leave
    platform: zone
    zone: zone.home
condition:
  - condition: state
    entity_id: input_boolean.heating_mode_auto
    state: 'on'
action:
  - service: input_select.select_option
    target:
      entity_id: input_select.heating_mode
    data:
      option: abwesend/zeitgesteuert
mode: single



alias: Anwesend
description: ''
trigger:
  - entity_id: person.jens
    event: enter
    platform: zone
    zone: zone.home
condition:
  - condition: state
    entity_id: input_boolean.heating_mode_auto
    state: 'on'
action:
  - service: input_select.select_option
    target:
      entity_id: input_select.heating_mode
    data:
      option: anwesend/zeitgesteuert
mode: single

Anything in the logs that might be useful for us?

I don't think so

Additional information

Firefox_Screenshot_2021-06-12T20-09-22 017Z Firefox_Screenshot_2021-06-12T20-10-13 149Z Firefox_Screenshot_2021-06-12T20-11-14 151Z Firefox_Screenshot_2021-06-12T20-11-56 875Z Firefox_Screenshot_2021-06-12T20-11-42 067Z Firefox_Screenshot_2021-06-12T20-12-28 275Z

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 36 (12 by maintainers)

Most upvoted comments

Still not working. Honestly, the terminology used in home assistant is misleading. If it is not enough for a person to enter a zone, it shouldn’t be a zone trigger, but a GPS trigger. Please either fix the UX or the code and the docs. It’s not a coincidence many people are getting here.

Does this requirement make sense though?

That is a different discussion, it currently works as designed. This is an issue tracker, not a feature request forum 😃

This one works:

trigger:
  - platform: state
    entity_id: person.jens
    from: home

resp.

trigger:
  - platform: state
    entity_id: person.jens
    to: home

So it’s clearly related to the “zone” integration trigger.

Sorry, I didn’t try a zone-based trigger again. I don’t think there’s any point in trying again and again unless a developer looks at it and at least gives some tips on which log files might be relevant.

Does this requirement make sense though? I mean, leave/enter events are triggered, so why is there a need for GPS coordinates?

I think the unclarity here (and in our docs), is that the zone trigger only works on location based device trackers (GPS powered). Zone triggers calculate leaving/entering a zone based on those coordinates and take GPS accuracy into account.

https://www.home-assistant.io/docs/automation/trigger/#zone-trigger

image

That means if a location is triggered by a device tracker that doesn’t use GPS coordinates (e.g., a device tracker from network presence), or when the person’s location changes caused by a device tracker that doesn’t use GPS coordinates: It won’t trigger.

If you want to trigger specific state changes in a zone, person, or device tracker: Use a state trigger/condition.

…/Frenck

I have the same problem now since I used wifi detection on my person state. At first I only used iOs cloud integration for presence detection on my person, with worked fine. Then I added wifi detection (fritz box), after this it does not work anymore. Also the trigger GUI does not let me select the person anymore. It’s gone - I only can select a device, but not the person. I have to edit YAML. But this still does not work.

Only fix is to use state platform instead of zone.

Home Assistant 2022.10.2 Frontend 20221006.0 - latest

As far as I can see (https://github.com/home-assistant/core/pulls?q=is%3Apr+is%3Aclosed+label%3A"integration%3A+zone"+), this was not addressed in 2022.03.0 - so let’s hope for 2022.04.0

Reason for this is probably as follows - the zone trigger and condition are designed to work with coordinates of the zones, not the zone names themselves (see explanation and link to code snippets in https://github.com/home-assistant/core/pull/65040#discussion_r793587746). As some device_trackers may not report coordinates, this could lead the trigger/ condition to not be matched.