Problem with device_tracker.ping after update to 0.106.0

So, I noticed a shiny release today and decided to upgrade to it. This has been working fine for me for a while but suddenly I now get an notification on the web UI saying this is invalid.

Here is the config for my device_tracker.

device_tracker:
  - platform: ping
    hosts:
      foo: 192.168.1.10
      bar: 192.168.1.11
      next: 192.168.1.12

The log says:

Invalid config for [device_tracker.ping]: [foo] is an invalid option for [device_tracker.ping]. Check: device_tracker.ping->hosts->foo

Any help is appreciated.

Thanks

Same issue here…

Have you tried hyphens to make it into a proper list?

Hosts:
  - foo: xxxcc
  - bar: xxxxccc

Etc

yep, no use:
error with hyphens:

Invalid config for [device_tracker.ping]: expected a dictionary for dictionary value @ data['hosts']. Got [OrderedDict([('yyy_ping', 'yyy.local')]), OrderedDict([('xxx_ping, 'xxx.local')]), OrderedDict([('zzz_ping', 'zzz.local')])]. (See ?, line ?). 

actual config that worked until 0.106.0 update:

device_tracker:
  - platform: ping
    hosts:
      xxx_ping: xxx.local
      yyy_ping: yyy.local
      zzz_ping: zzz.local

The config checker also catches the error:

Configuration invalid

Invalid config for [device_tracker.ping]: [xxx_ping] is an invalid option for [device_tracker.ping]. Check: device_tracker.ping->hosts->xxx_ping. (See ?, line ?).

Same issue here

Invalid config for [device_tracker.ping]: [Trish_iPhone] is an invalid option for [device_tracker.ping]. Check: device_tracker.ping->hosts->Trish_iPhone. (See ?, line ?)

Yup, same issue here too!

Seems like the problem originates from this change: https://github.com/home-assistant/home-assistant/pull/31329/files which was not listed as a breaking change.

From what I can make out of that, you’re supposed to use a slug there, but I don’t know what a slug is.

Thanks for finding that! I think in HA a slug is just a string, but only lowercase letters and underscores are allowed.

I was getting an error for

mikeysPhone: 192.168.1.10

so I changed it to

mikeys_phone: 192.168.1.10

and no more errors.

4 Likes

thanks, I can confirm this work

1 Like

Yup - worked for me as well.

Thanks

Worked for me too, Thanks for your help.

I still think there’s a problem here if you have more than one entry - e.g. I have two listed as hostone & hosttwo - but only hosttwo actually works. I don’t get any errors but hostone simply doesn’t appear to exist.

In my original config they were called KKphone & IFphone so presumably the capitalization was my first problem.

Can the other posters who had multiple entries confirm that they still have an issue ? Or not if thats the case!

Thank you all for clarifying … Looks like slug refers to a lowercase string indeed. This is working for me now

I have two entries and after replace capitalization, all works fine

device_tracker:
  - platform: ping
    count: 3
    hosts:
      stix_pixel: 192.168.77.112
      xperia_xz: 192.168.77.113

Thanks for the responses guys, after another restart it’s appeared…although thats three restarts before I got it…very odd!!

i am on 0.106.5 and still i cannot get any device trackers to show within homeassistant with the ping platform.

device_tracker:
  - platform: ping
    interval_seconds: 60
    consider_home: 180
    hosts:
      raphael: 1.x.x.x

What do the logs say?

nothing remotely related to this

PS: the problem seems to have gone overnight, the device_tracker is visible in ha now

Thank you sweet lord infant baby jesus for this thread. I have been scratching my head about this error for some time and it was driving ragged. Problem fixed by removing upper case host names.

1 Like