HA iOS device_tracker not working

Hi everyone,

I have started a migration project from Telldus to HA and is going perfect actually; however it seems that I have been falling into the device_tracker, geofencing, device tracking issues like everyone else using HA. Anyhow, I really need your help here as I am stuck with a HA without any device tracking.

This is my setup

  • I’m running HA on my Rasp Pi with the latest hassio (0.65)
  • I have two iPhones where I have installed the HA iOS App and configured the App for push and location
  • Verified that :ios has been added to configuration.yaml

Everything ‘was’ working until I added bluetooth and nmap device_tracker, then everything became bluetooth and nmap only. I would say that bluetooth did work well, however I would like to use the GPS information also, so then I started to se if I could get the HA iOS App location information/status back into HA. (this I shouldn’t have done :frowning: – as ever since I haven’t been able to re-active my iOS track status… this is what I would like your help)

So, status is… I have disabled bluetooth and nmap and tried almost everything I could fine to get HA iOS App to report home/not_home status without luck.

I have tried to remove the .ios.conf and known_devices.yaml however it didn’t help, well it clean up the HA GUI but didn’t solve my issue. Further now, when I start the iOS app and loads the HA site, is seems to be working fine, and it even reports battery state, but when I verifies the status marks under Settings all the iOS components are X and not Checkmarked :frowning: … pushing Save makes then OK until next re-start of the iOS app.

The files .ios.conf contains my iPhone information but no new known_devices.yaml has been re-created by the system. Last time I tried to re-create the file manual, the phone are the visible in the HA GUI but doesn’t get updated with location information, hence always on not_home state.

…and last - even though I have removed and configuration files has been re-created, the battery entities remains + a sequent number sensor.iphone_8_battery_state_3. I better add that the iPhone is named ‘iPhone 8’, the HA iOS App Device ID is ‘xxxx_iphone8_app’ and within the HA gui the phone battery are named ‘iPhone 8’. I guess it reads the hostname from the phone and uses this at friendly name.

So what would I have to do, to re-set everything and get HA iOS app Geofencing to work again, how do I remove any cached information and how does a working HA Geofencing configuration look like. (… I would like, if some how possible, to have HA iOS GPS + Bluetooth and NMAP if possible, but lets start with HA iOS app)

Any hints on getting the iOS tracking back?

My iOS device tracker isn’t working either.

I removed nmap device_trackers, deleted .ios.conf and known_devices.yaml. Restarted HA.
iOS App is showing that the iOS component, device tracking component and notification platform is loaded.

I have the following error in home-assistant.log

2018-03-20 23:08:08 ERROR (MainThread) [homeassistant.core] Error executing service <ServiceCall device_tracker.see: gps_accuracy=101, battery=67, dev_id=Fabbafs iPhone, hostname=Fabbafs iPhone, battery_status=Charging, gps=[xx.xxxx, x.xxxx]>
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/homeassistant/core.py”, line 1006, in _event_to_service_call
await service_handler.func(service_call)
File “/usr/lib/python3.6/site-packages/homeassistant/components/device_tracker/init.py”, line 229, in async_see_service
yield from tracker.async_see(**data)
File “/usr/lib/python3.6/site-packages/homeassistant/components/device_tracker/init.py”, line 296, in async_see
dev_id = cv.slug(str(dev_id).lower())
File “/usr/lib/python3.6/site-packages/homeassistant/helpers/config_validation.py”, line 323, in slug
raise vol.Invalid(‘invalid slug {} (try {})’.format(value, slg))
voluptuous.error.Invalid: invalid slug fabbafs iphone (try fabbafs_iphone)

There are no entries in known_devices.yaml, because I created an empty file. Don’t know where to change that invalid slug…

Found the solution for my problem, this might help others though.

I changed the device id in the iOS app (iOS app -> settings -> device id).
My problem was that my device id was “Fabbafs iPhone”. I changed that to “FabbafsiPhone” and it appeared in known_devices.yaml. No spaces in device id fixed it.

My battery sensors are showing up as sensor.fabbafs_iphone_battery_state and sensor.fabbafs_iphone_battery_level though.

@anon90333909 I have put my migration from Telldus to Home Assistant on a hold, but would be trying your solution when I have some more time… so see if that would fix my issue as well - thanks ! :slight_smile:

And speaking about time, I find that Home Assistant on one side, is very flexible, but on the other side very much beta and full of small issues, which of cause can be solved, but this solving issues, and of cause learning the pit falls, requires an extremely amount of time, for solving extremely simple home automation tasks and activities.

It think, what I’m trying to say, if you take e.g. Vera, Apple HomeKit, Telldus or even better, Homey, those platforms works with the simple and basic stuff, out of the box, something which I really would like Home Assistant did too.

@anon90333909 it worked thanks !!

It seems that I had the same issue, with a space in my “hostname” of my iPhone, which cause the issue. I renamed my iPhone and restarted it, removed the .ios.conf and known_devices.yaml and comment out the device_tracker in the configuration file, restarted HA and installed the HA App on my iPhone again… and then - it worked, switched to HOME, restarted HA, and the battery etc status was fixed too… amazing !! :slight_smile:

Will do some testing, and the I will try to activate the bluetooth device_tracker option again and see if it works :slight_smile:

I’ll keep you posted.


First of all: Thanks for leading me into the night direction. :smiley:

Secondly: Did you ever find a solution for the problem of multiple device_trackers? I had to deactivate nmap in order to use the iOS-tracker and vice versa. But I’d like to have both.

Hi @Regularj

I have activated Bluetooth tracking, which works just perfect. So now I have HA iOS App and Bluetooth.

I haven’t tried nmap, but I would expect that it works, as it was working for me before I had the issues with the blank space in my iPhone hostname.