Struggling to add new phone to device tracking

I’ve installed the app to my son’s phone - however I’m having trouble getting it to report it’s location.

The device name is Oliver. I’ve add an entry to known_devices

oliver:
  hide_if_away: false
  name: Oliver
  track: true
  • but no matter what I do I seem to get the same error every time I push location from the phone:

    2018-02-18 19:41:33 ERROR (MainThread) [homeassistant.core] Error executing service <ServiceCall device_tracker.see: gps_accuracy=65, battery=98, gps=[xxxx, yyyy], hostname=Oliver’s iPhone, dev_id=Oliver , battery_status=Unplugged>
    Traceback (most recent call last):
    File “/home/pi/homeassistant/lib/python3.5/site-packages/homeassistant/core.py”, line 1010, in event_to_service_call
    yield from service_handler.func(service_call)
    File “/home/pi/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/init.py”, line 209, in async_see_service
    yield from tracker.async_see(**args)
    File “/home/pi/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/init.py”, line 272, in async_see
    dev_id = cv.slug(str(dev_id).lower())
    File “/home/pi/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/config_validation.py”, line 299, in slug
    raise vol.Invalid(‘invalid slug {} (try {})’.format(value, slg))
    voluptuous.error.Invalid: invalid slug oliver (try oliver
    )
    2018-02-18 19:41:33 INFO (MainThread) [homeassistant.core] Bus:Handling <Event system_log_event[L]: source=helpers/config_validation.py, level=ERROR, exception=Traceback (most recent call last):
    File “/home/pi/homeassistant/lib/python3.5/site-packages/homeassistant/core.py”, line 1010, in event_to_service_call
    yield from service_handler.func(service_call)
    File “/home/pi/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/init.py”, line 209, in async_see_service
    yield from tracker.async_see(**args)
    File “/home/pi/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/init.py”, line 272, in async_see
    dev_id = cv.slug(str(dev_id).lower())
    File “/home/pi/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/config_validation.py”, line 299, in slug
    raise vol.Invalid(‘invalid slug {} (try {})’.format(value, slg))
    voluptuous.error.Invalid: invalid slug oliver (try oliver
    )

What am I doing wrong?

I just fixed a similar issue. My iPhone was named “elahd-iphone” in the iOS app’s settings screen but was listed as “device_tracker.elahd_iphone” in the Home Assistant “States” page. I changed the device name in the iOS app to “elahd_iphone” and updated my config files to use this name, as well. My phone now works with HA as intended.

Check to see how the iPhone is listed in the states page – make sure everything matches that.