Connect ping to person

Hello everyone,

I am quite sure that I did not yet get the concepts behind home assistant, but maybe this will help me. :wink:

I have users, e.g. me, and I would like to link the status to one or several trackers, e.g. ping. As I also have my TV pinged for an automation, those pings are done as binary_sensor, like in the following:

binary_sensor
  - platform: ping
    name: ping_phone_user
    host: 192.168.178.52

How can I connect the on/off state to the user? I cannot choose this in the resulting entities in the user configuration.

As soon as I replace binary_sensor with device_tracker, I receive errors when checking the config. Does ping not work with device_tracker?
Thanks for your help!

Best regards,
Fo

You can’t do this, only device_tracker entities can be linked to a user.

There’s multiple workaround such as creating an MQTT device tracker and update the status with an automation or the custom component composite device tracker that allows to include binary sensos.

1 Like

Thank you, it took me a while, but I understood and learned on the go and got it to work. :slight_smile:

And now I have noticed, that router presence is much more reliable than ping. :man_shrugging:

1 Like

Oh, and in case someone else wants to try to solve this as well: Don’t! :smiley:

Use router presence if possible. Ping drops relatively often and marks people as “not home”. This still happens when a long delay for marking people “not home” is given. So far, router presence has been much more reliable and quite accurately shows when someone is home or not.

In case you still want to or have to do this:

device_tracker:
  - platform: mqtt
    devices:
      user_phone_mqtt: 'ping/user'