Zone Trigger configuration with companion app

Hi community,

I happily started integrating my devices in Home Assistant with some automations and I am very astonished about all the possibilities.
Now I have a questions in regards of the zone automation trigger together with the Android companion app.

My Zone automation triggers are not triggering despite the device is reporting the zone correctly when entered. I’ve googled a bit already and it seems the zone triggers do only function if the device-tracker would be able to send GPS-coordinates - Which the Androidphone is capable of course.

So is GPS reporting a must or is the zone enough as the zone is measured by GPS on the smartphone as the trackers attribute “source” shows GPS? My companion apps location sensor section is configured as following:

  • Background Location: On - High Accuracy Mode enabled if connected to the cars BT
    (Location Sent: Zone Only ← Is that maybe the issue as its actually not sending coordinates but the zone name?)
  • Location Zone: On
  • Single Accurate Location: Off - As I don’t 100% understand when that would be required - background with his accuracy mode seems to work well? (From what I understand from the description it is used if background accuracy would be too low or?)

From what I read as workaround I could use state triggers I but want to understand the concept why my current setup is not working and if my assumption is right.

My automation triggers looks like the following (so literally standard):

 - platform: zone
    entity_id: device_tracker.pixel_phone
    zone: zone.zone_d
    event: enter

I had to add the device_tracker.pixel_phone in yaml manually as the UI did not find any matchings entities.
Sorry if its beginners questions but I am trying to find a solution for longer now already, tried re-registering the app already but I guess that’s not the issue.

Thank you :slight_smile:

That should not be necessary… How is your phone providing it’s location to Home Assistant?

For example, are you using the HA companion app?

EDIT:

Apparently I missed the title of the post… :slight_smile:

If HA did not create a device tracker for your phone when you set up the companion app make sure that the Location sensors are enabled in Settings>Manage Sensors on the app.

Yes I am using the companion app from play store.

The location sensors configuration is as following:

And the device_tracker entity also sees the zone real time. Just the automation trigger does not care about that.

Does the automation have any traces available that you can post?

Have you gone through the troubleshooting flow for Device Tracker is not updating in Android app?

No unfortunately nothing, as the triggers are never executed there are also no traces.

I just checked in the companion app under Settings → Troubleshooting → Location that the zone entry / exists are successful transmitted and according to the app everything is fine (Even with “Single Accurate Location” turned off as described above)
Also the Entity in HA shows the zone changes. But the trigger just does not trigger as expected.

This is how it looks if I want to use the phone within zone trigger:

On the otherhand in YAML I can add the tracker - but the trigger still wont work even if fully configured.

It looks like the Zone triggers work by Home Assistant comparing the GPS location of the tracker or person to the zone’s coordinates and radius. If your tracker does not supply GPS coordinates, but is supplying a zone name as it’s state you should be able to use a State trigger instead.

- platform: state
  entity_id: device_tracker.pixel_phone
  to: Zone D

Thank you :slight_smile: thats what I read and was assuming.
But there were contradicting information as the companion app tracker was shown as GPS tracker in HA.
With the simple state change it seems to work well.

Thank you again