Home Assistant doesn't know when my phone leave the home zone

I want my Home Assistant to know when I leave home by using my phones location sensors so that my heating turns off. I have the sensors turned on but my automation isn’t triggering.

alias: Leaving Home Heating
description: ""
trigger:
  - platform: device
    device_id: c6a1e85c0da763d4e363a124fc00dca9
    domain: device_tracker
    entity_id: f4567ce7d7a171981675674bb657458c
    type: leaves
    zone: zone.home
condition: []
action:
  - service: climate.set_temperature
    metadata: {}
    data:
      temperature: 14
    target:
      device_id:
        - 73e07993a11ff1f877644e4560fc1f85
        - 3e97a1c217393c96bfdd742aef81ae62
mode: single

On the phone, have you turned off battery saving for the HA app?

Yes I have done that.

Android or iOS app?

And can you access HA from your phone once you’ve left the house (or are off wifi)? If you can’t access HA, it can’t update your location.

Yes, this was something I had to find out as well. The app needs to send location updates and when it cannot because your instance is only available through the local network, the location stays where it was, so you are always at home according to HA. For me, setting up a ping device tracker worked as a decent home/not home binary sensor.

Oh right I didn’t realise this. No I can’t access HA once I leave my WiFI. It makes sense now you say it.

That’s good to know, ill look into setting up a ping device tracker? Is it relatively easy?

If there is a Home Assistant integration for your router, use that instead of setting up a ping sensor.

I assume you’re using the Companion App - therefore you probably do/will want to use it outside the house. The easiest way to do this is to pay for Nabu Casa, but a close second easiest (IMO) is Cloudflared. Then no need for a different sensor.

It’s fairly simple. See here for the documentation of the ping integration. Ping (ICMP) - Home Assistant
There are two more steps. One is that your router needs to assign the same ip address to your phone every time. That usually works better if your phone doesn’t use random Mac address for your home network, so those may need to be set up correctly.
The last thing, which is optional, is that you can link the device tracker to the person (yourself) that you want to track. This is done inthe ‘people’ section of the settings. Detecting you at home is done as a combination of different sensors, and you can use the person presence in automation. Alternatively, you can use the device tracker entity directly in your automation.

All this is worth while if you do not want to have your Ha instance reachable over the internet. If you do want that anyway, get a NC Cloud subscription, or set up cloudflared or other method as described in various how to articles.

Couldn’t he also set the companion app to broadcast a virtual beacon uuid, then have the iBeacon Tracker integration watch for this uuid constantly via an automation? When the iBeacon Tracker integration based automation does NOT see the virtual beacon, then the home/away state could be switched to away, right?

(I’m not sure if an iBeacon Tracker integration automation can be set to do something when a beacon is missing in action though).

I don’t know. I do know that there are a couple of ways to track a phone or other device, tried a few Iand for me ping was the easiest one to set up that worked reliably (except for the short period when the integration was moved to the ui and the consider_home was not available but that is in the past.)