Track_ios & device_tracker

First of all, Thank you @robbiet480 for all your hard work on bringing the iOS app to the app store. I’m sure you’ve been quite busy lately, and if I could buy you a beer, I would!

I’m wondering, how does iOS tracking work with other device_trackers?

I’ve currently got the new IOS app installed, and working wonderfully, but I’ve also got the owntracks platform configured with some ibeacons. I’m a little confused here, mainly because the iOS app/platform doesn’t show up as a device_tracker. So (with the track_ios: true) does the app report to HA when it’s in the home zone?

It seems like this would bypass other device_trackers. Am I missing something here?

Not Robbie but when I set up the iOS app the device shows up in known_devices.yaml as the name that you use in the app. ie I have mine setup as device_ios so that I can track the app separately

@jhavens12 is correct, the device should be showing up in your known_devices.yaml. At least for me (I also use OwnTracks still, just to make sure things are working) location always works fine with the app and OwnTracks (and my wifi router) reporting my location. The app does report when you enter and exit zones, including your home zone, as well as report significant location updates.

Alright, thanks @robbiet480 & @jhavens12, I think that makes sense. So for instance, if I have a device_tracker.iphone (iOS app), and a device_tracker.owntracks (owntracks), and they’re both in a group.presence group, and I’m doing home / not-home automations based on the state of the group. Then everything should work fine, I’m guessing?

Does the device_tracker.iphone (iOS app) work like any other device_tracker, and mark the home / not-home state based on which service reported it last?

Lastly I’m assuming both owntracks & the shiny new HA iOS app both have to be running, in the background on the phone, for them to report location information?

What I do is I just use the same device ID in the iOS app as I have for OwnTracks, so everything reports as the same device.

It should behave like any other device tracker and report home/not_home properly, yes.

Both need to run in background, however, the new iOS app is extremely friendly to your battery. OwnTracks can be too as long as you are in significant location updates mode all the time. The iOS app only uses significant location updates and zone enter/exit tracking, both of which require low battery consumption. I’ll be adding iBeacon soon too which is another low power mode.

2 Likes

Thanks @robbiet480, that makes sense. I look forward to the iBeacons update (that’s what I’m currently using with owntracks). I’ll configure owntracks to match the iOS app, so it reports as the same device (as far as HA is concerned), that should make things a little easier. Thanks for all the help, please keep up the good work… Also, where can I “buy you a beer”?

Is there a way to get the last location tracked by the iOS app after a reboot?

After reboot, the device_tracker (device_tracker.myiphone) shows as not_home and doesn’t seem to update. Didn’t try yet, but pretty sure it would as soon as I would leave my current location, but that’s not ideal of course.

The sensors sensor.myiphone_battery_level and sensor.myiphone_battery_state update frequently, so I wonder if there is a way to include the current location in that update, to allow the device_tracker to be updated.

My battery sensors only update when I force close the app and open it again…

Yeah, same thing here, noticed that too in the mean time. Or at least opening the app and not in the background.

battery update is coming.

I have an automation that runs on startup that calls the “request_location_update” function.

Sometimes it wouldn’t work so I have it send the message twice.

Automation looks like this.

- alias: Update IOS location on HA start
  trigger:
  - platform: homeassistant
    event: start
  action:
   - service: notify.ios_ryans_iphone_app
 data:
  message: request_location_update  
   - delay: 00:00:20
   - service: notify.ios_ryans_iphone_app
 data:
  message: request_location_update

My iPhones aren’t showing in known_devices.yaml, any thoughts on that?

1 Like

1.0.2 is now available and has a fix to send battery updates much more frequently.

I need to re-test the known_devices.yaml thing, I could’ve sworn we get added to it but could be wrong.

Awesome, thanks @robbiet480!!

I’m not certain how to utilize location from an iOS device running the app if it’s not in know_devices.

Thanks :slight_smile:

Can you post your battery sensor code?

You don’t need some special configuration for the sensor, once configured the ios, it will appear as well.

All I have configured only the appearance:

sensor.myiphone:
  friendly_name: iPhone Battery
  homebridge_hidden: true
  unit_of_measurement: '%'

Hi. Maybe a silly question, but how do you get the device ID the same in OwnTracks? My OwnTracks device shows up in known-devices as UserID_DeviceID. I would love to use OwnTracks as a backstop to the iOS app. I love the iOS app BTW.

Just copy the MAC address (and anything else you’ve customised) from your iOS device in known_devices.yaml to your OwnTracks device. The iOS device can then be removed.

This is really confusing

I installed the Home assistant App and created a name that would differ from the hostname so I could get two different device trackers in known devices (Wanted to use bayesian precense detection)

So I ended up with:

Hostname Unifi Wifi:
- entity_id: ‘device_tracker.victoriasiphone’
Home assistant app:
- entity_id: ‘device_tracker.victoria_iphone’
Bluetooth:
- entity_id: ‘device_tracker.victoriasiphone_2’

I then enabled iCloud because I dont always get a notification from the app, and then iCloud could be used as a backup (I thought)

BUT now it uses the hostname for iCloud which means that its split between wifi and icloud this also means that it shows two different GPS locations for the same iPhone and the binary sensors I gues would now be wrong?..

slettes

HELP! - what should I do? Is there anyway to force the two GPS to use the same known_device id?
or maybee get af fourth id?

Can you place them in a group, then customize the individual ones to be hidden from the UI?