Invalid slug

Not sure what this means but, I was trying out the push notifications and when I clicked on it I saw these errors in the HA log

16-10-14 02:24:44 INFO (MainThread) [homeassistant.core] Bus:Handling <Event ios.notification_action_fired[R]: action_data=my_custom_data=foo_bar, sourceDevicePermanentID=..., sourceDeviceName=iPhone dlippman, actionName=com.apple.UNNotificationDefaultActionIdentifier>
IDENTIFY DEVICE DATA {'device': {'model': 'iPhone', 'type': 'iPhone 5s', 'systemVersion': '10.0.2', 'localizedModel': 'iPhone', 'permanentID': '...', 'name': 'iPhone dlippman', 'systemName': 'iOS'}, 'pushSounds': [], 'pushToken': '...', 'deviceId': 'Devan iPhone', 'permissions': ['location'], 'pushId': '...', 'app': {'bundleIdentifer': 'io.robbie.HomeAssistant', 'versionNumber': 1, 'buildNumber': 45}}
16-10-14 02:24:45 INFO (MainThread) [homeassistant.core] Bus:Handling <Event device_identified[L]: device=model=iPhone, type=iPhone 5s, systemVersion=10.0.2, localizedModel=iPhone, permanentID=... name=iPhone dlippman, systemName=iOS, pushSounds=[], pushToken=..., deviceId=Devan iPhone, permissions=['location'], pushId=..., app=bundleIdentifer=io.robbie.HomeAssistant, versionNumber=1, buildNumber=45>
DEVICE IDENTIFIED EVENT FIRED <Event device_identified[L]: device=model=iPhone, type=iPhone 5s, systemVersion=10.0.2, localizedModel=iPhone, permanentID=..., name=iPhone dlippman, systemName=iOS, pushSounds=[], pushToken=..., deviceId=Devan iPhone, permissions=['location'], pushId=..., app=bundleIdentifer=io.robbie.HomeAssistant, versionNumber=1, buildNumber=45>
16-10-14 02:24:45 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service_call_id=1977656880-7, domain=device_tracker, service_data=gps=[..., ...], battery_status=Unplugged, gps_accuracy=65, dev_id=Devan iPhone, battery=57, hostname=iPhone dlippman, service=see>
16-10-14 02:24:45 ERROR (ThreadPool Worker 8) [homeassistant.core] BusHandler:Exception doing job
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/core.py", line 1164, in job_handler
    func(*args)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/core.py", line 1027, in _execute_service
    service(call)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/core.py", line 827, in __call__
    self.func(call)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/device_tracker/__init__.py", line 173, in see_service
    tracker.see(**args)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/device_tracker/__init__.py", line 221, in see
    dev_id = cv.slug(str(dev_id).lower())
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/config_validation.py", line 215, in slug
    raise vol.Invalid('invalid slug {} (try {})'.format(value, slg))
voluptuous.error.Invalid: invalid slug devan iphone (try devan_iphone)
16-10-14 02:24:45 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service_call_id=1977656880-8, domain=device_tracker, service_data=gps=[..., ...], battery_status=Unplugged, gps_accuracy=65, dev_id=Devan iPhone, battery=57, hostname=iPhone dlippman, service=see>
16-10-14 02:24:45 ERROR (ThreadPool Worker 6) [homeassistant.core] BusHandler:Exception doing job
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/core.py", line 1164, in job_handler
    func(*args)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/core.py", line 1027, in _execute_service
    service(call)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/core.py", line 827, in __call__
    self.func(call)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/device_tracker/__init__.py", line 173, in see_service
    tracker.see(**args)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/device_tracker/__init__.py", line 221, in see
    dev_id = cv.slug(str(dev_id).lower())
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/config_validation.py", line 215, in slug
    raise vol.Invalid('invalid slug {} (try {})'.format(value, slg))
voluptuous.error.Invalid: invalid slug devan iphone (try devan_iphone)

Any clue what this means?

That’s a problem with device_tracker not the iOS app. It looks like you have a space in the slug. Look in your known_devices.yaml for something like:

devan iphone:

and replace the space with an underscore (_) as the error suggests.

Looks like it went away with a restart of HA, maybe just needed to reload the file?

It looks like this is back after my most recent upgrade. I’m running HA 0.31.1 with build 46 of the app. I believe that I have removed the custom component as well.

Every time that I press the “Enable Notifications” button in the app HA will spit out this error. The push token field also reads “Not registered for remote notifications”.

16-11-02 22:01:22 homeassistant.core: BusHandler:Exception doing job
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/core.py", line 1221, in job_handler
    func(*args)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/core.py", line 1075, in execute_service
    service_handler.func(service_call)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/device_tracker/__init__.py", line 174, in see_service
    tracker.see(**args)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/device_tracker/__init__.py", line 222, in see
    dev_id = cv.slug(str(dev_id).lower())
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/config_validation.py", line 225, in slug
    raise vol.Invalid('invalid slug {} (try {})'.format(value, slg))
voluptuous.error.Invalid: invalid slug devan iphone (try devan_iphone)

There is no entry in the known_devices.yaml for a “devan iphone” or “devan_iphone”. Also, neither of these are the name of this phone…

Possibly of interest. I found that, while my phone still does not report a token, I see an entry to call the iosapp_devan_iphone service. Even more confused where this name is coming from given that the sensors created for the phone are called sensor.iphone_dlippman_battery_level and sensor.iphone_dlippman_battery_state.

Is there a way to at least try clearing the ios data out and starting fresh?

Thanks,
Devan