Proximity automation does not work, does not get triggered

Hi folks,

I have

  • defined my home zone “Home” in zones.yaml (geo values below are modified :wink: )
- name: Home
  latitude: 10.1234567
  longitude: 5.1234567
  radius: 30
  • added the link to zones.yaml in configuration.yaml:
zone: !include zones.yaml
  • added the proximity part to configuration.yaml (username below is modified :wink: )
proximity:
  Home:
    devices:
      - person.>username<
    tolerance: 25            # default tolerance in meters: 50
    unit_of_measurement: m   # default unit: km
  • configured my user settings to track my user with my iPhone with entity “device_tracker.>my_iphone_name<“

  • created an automation to set my lamps on based on user tracking when entering the home zone:

description: Zuhause ankommen und Beleuchtung Vorgarten einschalten
trigger:
  - platform: geo_location
    source: >username<
    zone: zone.home
    event: enter
condition: []
action:
  - service: script.lampen_vorgarten_an
    data: {}
  - delay:
      hours: 0
      minutes: 2
      seconds: 0
      milliseconds: 0
  - service: script.lampen_vorgarten_aus
    data: {}
mode: single

Logbook shows, that my user has entered the home zone:

21:02:19 - Vor 16 Minuten
>my_iphone_name< wurde zu Hause erkannt
21:02:19 - Vor 16 Minuten

but the automation “A - Vorgarten Ankommen Beleuchtung an” shows “never triggered”

Does anyone has an idea, what might be missing or wrong?

There is an entry right on top of configuration.yaml… I am not sure if that might disturb:

homeassistant:
  name: Home
#  latitude: 10.1234567
#  longitude: 5.1234567
#  elevation: 10
  unit_system: metric
  time_zone: Europe/Berlin
  country: DE

You’re using the wrong trigger. The geo-location trigger is a special trigger only used with Geolocation entities. From what you have shown, you have at least two options:

Zone trigger:

trigger:
    - platform: zone
      entity_id: person.x
      zone: zone.home
      event: enter

Numeric State trigger using the Proximity sensor you created:

trigger:
    - platform: numeric_state
      entity_id: proximity.home
      below: 5
1 Like

@didgeridrew thanks a lot! That works well now :man_facepalming: :blush:

While changing it, I took the chance to clean up my zone configuration a bit.
So if anyone needs a hint how to set it up, here it is how it works for me now:

In configuration.yaml, at the very top of the file:

homeassistant:
  name: home
  latitude: 10.1234567
  longitude: 5.1234567
  elevation: 10
  unit_system: metric
  time_zone: Europe/Berlin
  country: DE

In configuration.yaml, at the end of the file, but above the external configuration file links section:

proximity:
  athome:
    devices:
      - person.>username<
    tolerance: 25            # default tolerance in meters: 50
    unit_of_measurement: m   # default unit: km

In configuration.yaml, at the end of the file, in the external configuration file links section:

zone: !include zones.yaml

In zones.yaml:

- name: athome
  latitude: 10.1234567
  longitude: 5.1234567
  radius: 30

Configured my user settings to track my user with my iPhone with entity

device_tracker.>my_iphone_name<

Created an automation to switch on my garden lamps for two minutes based on user tracking when entering the “athome” zone:

description: arrive at home and switch on garden lighting
trigger:
  - platform: geo_location
    source: >username<
    zone: zone.athome
    event: enter
condition: []
action:
  - service: script.lamps_garden_on
    data: {}
  - delay:
      hours: 0
      minutes: 2
      seconds: 0
      milliseconds: 0
  - service: script.lamps_garden_off
    data: {}
mode: single