iOS tracking - all done via app?

Reading a lot of posts from several months ago talks about Owntracks etc. Is the location reporting now all done through the iOS App or to track the phone do I still need to use a 3rd party service? I have the notifications coming through fine but still confused on how to track the device.
Cheers.

No need for a 3rd or even 4th party software. Unless its more reliable?

Your HA gets updates about your location via the current HA App. Once you allow the app to track your location, the app will update your HA with your current location on certain intervals, sending data with your current connection to the server.

I read somewhere the location data is updated every 15 min, yet I do not seem to get it to work properly like that. Many times I have to open the actual app for it to update or it won’t for hours although it’s allowed to run in the background…

Not very reliable, when you want to base half of your automations on IF at HOME or IF AWAY etc…

Anyone else with more insight on this?

1 Like

The app does location tracking. You do not need a 3rd party or external service. You do need zones configured if you want more than just “home” and “away” tracking. The location will update frequently, but I don’t know at what interval. On my commute to and from work it will update on it’s own without having the app open. As soon as I enter a zone, it will update on it’s own using geofencing and the zone radius setup. Occasionally I have had to force the app otherwise it will stop updating, but that’s as simple as opening the app and pressing the location manual push button (up arrow in bottom left corner) or going into the settings and clicking on “Save” again to get the zones loaded.

You can use the app in conjunction with other device tracking such as iCloud (uses find my iPhone service which I think is a slow update, but configurable), OwnTracks, or NMAP/router based solutions for better tracking.

EDIT: make sure the ios: component is configured. This component automatically loads the device_tracker: and zeroconf: components which will enable the device tracking via the app. On the app, go into the settings, make sure you see a checkmark next to the device tracker component, and that’s it. you’ll now have a device in the states tab configured as device_tracker.<device_name> with the name that is set from the app.

In case it helps you… I have had good luck with the geofency app on ios for tracking. It uses minimal battery and always works. I usually forget I even have it running in the background. Even after changing to a new phone, I never even had to reconfigure it :slight_smile: It works very well for simply telling HASS when I’m in the home zone or work zone.

The only gotcha is that it has a minimum radius of 100meters, so it’s not terribly precise, but just fine for GPS locations, and it ALWAYS updates HASS when I cross a geofence, as opposed to owntracks and has ios which had been less reliable at updating. YMMV.

PS - I still use (and really like) the hass ios app, just not for geofencing.

Hi there,
I know this topic is a little old. Hopefully no one will blame me for resurrecting it.

I am using the iOS App for really simple geofencing (just home or not home). However, as others wrote here this won’t work all the time. I can not really reconstruct the situations when it does not work. But if it does not work in most cases the App lost all components (iOS component, device tracker component, iOS notification platform) in the App settings (gearwheel bottom right) under “status”. Only after saving the settings (without changing anything) the components will be loaded again and also the tracking works again.
Often it works by just entering my home zone. And sometimes it does not.
That is really annoying. Do someone know any fix in the meantime? Sadly there was no update for the app for 11 months :frowning:

Thats because why I wanted to go back to Geofency. I already used its webhooks with my last smart home project. However I can not get it to work with Home Assistant. I always get “401: Unauthorized”. However, I am sure the username and password is correct. Maybe it has something to do with the new users support? I do not use Legacy API password, but my own user with its own password. Therefore I do not want to transfer the password via URL parameter “?api_password=”. Geofency supports http basic auth. Can I somehow use my Home Assistant user here?
@someinternetguy: May I ask how you got Geofency to work?

Thank you!

Sorry @Xargon but I no longer use it. I had a bunch of phone issues over the summer and was too busy being outside to bother with my poor Hass system. now that winter is almost here again ill be getting back to it. I will update you when I can.

From what I remember all I had to do was find the right URL string to mark me as home or now, etc. using the Hass API docs that and then set geofency to call that URL as needed. Simple, but it was reliable.

Edit… I just loaded the app again to look. You would use the Webhook function to send API calls to Hass.

Hi @someinternetguy
Thanks for your reply. I already used GeoFency with Webhooks in an other home automation system before. Sadly by GeoFency sending a webhook to Home Assistant I always get 401 User unauthorized. I try to use the basic auth function in GeoFency, not the PW transfer via URL parameter. Is that even possible with Home Assistant?
I will investigate that and come back if I find a solution.
Greetings

Any luck? Suffering from the same 401 error. It seems to me that the HA documentation is also not consistent/up to date as activating the API password (no luck with that either) gives a warning ‘deprecated’ in the log. Would also love to see a concrete guide to define a webhook, because I have the same issues there…

Hi @Flaker
it is currently not as I want it to work, however, it works with api_password parameter. Just like described in the component description.
I had to reactivate the following line in the configuration.yaml. Maybe you removed the line from your configuration as well?
http:
# Secrets are defined in the file secrets.yaml
api_password: !secret http_password
# Uncomment this if you are using SSL/TLS, running in a Docker Container, etc
base_url: …

I think if there is no api_password configuration in your yaml the response to GeoFency might be that it is deprecated.

The components seems not to support any other way to use it currently.

Greetings

Hi @Xargon, thanks. The documentation mentions the api_password as optional (“and make sure to include the API password if you have configured a password in Home Assistant”). If I set the api_password, do I also have to ‘turn on’ the general API by including “api:” in the configuration.yaml file?

Hi @Flaker
I did not configuration api: in my configuration.yaml
And ?api_password=… is not optional for me. Without I get a unauthorized response from Home Assistant.
So my webhook looks like this:
https:///api/geofency?api_password=
Did you insert GeoFency settings properly in the configuration.yaml?
Greetings

Thanks, @Xargon, working now. I was referring to the home-assistant.log file that mentions ‘WARNING (MainThread) [homeassistant.components.http] legacy_api_password support has been enabled.’ when I set the API password. But defining the webhook as https://[mydomain].duckdns.org:8123/api/geofency?api_password=[my api password] it works like a charm.

Hi @Flaker
glad to hear that. Due to security reasons I also would prefer basic auth with user and password. Maybe the Home Assistant Component for GeoFency will support that later.
Greetings

I don’t get the device tracker, iOS and notification platform on my iPhone app at all. It used to there, but has gone away after I did a re-install of Home Assistant. It sometimes reports a password error, but doesn’t prompt me for one. Very odd,

I have “ios:” specified in my configuration.yaml, but doesn’t seem to get those components to load.

Not sure what I have to do to get those components to load. According to the documentation I’ve read specifying “ios:” in the configuration.yaml file should be all that’s required.

Hi @currest2620
shouldn’t it be „ios:“? Means dots after „ios“.
Maybe it it was just a typo.
Greets and happy new year :partying_face:

1 Like

Yeah, I do have it as “:ios”. I’ll have to edit my previous. Thanks.

Have the same problem.
I do have the battery sensor and “unplugged” sensor but i do not have any divece_tracker entities

Solved:
First I had a space xxx’s iPhone as the name of my iPhone (not in HA iOS app, but phone!)
Read the I shod remove the space. This did not solve this, but then I removed the ‘ in the name. Went from xxx’s_iphone to xxxiphone.
After that it was all good

1 Like

Does my Hassio server need to be accessible from the internet for HA IOS App device tracking to work. My Hassio installation is currently local only.

I don’t think it does. It uses the apple link - so even when I’m on my mobile network I get notifications via the app even though the device_tracker doesn’t work. On the weekend I configured the URL for home assistant in the ios app to be my zerotier one address and port and then as long as I have ZT1 running on the mobile, the HA works with tracking etc.

1 Like