How do I assign a device tracker photo?

I’m using the Owntracks integration to track devices. The documentation states that the known_devices.yaml file is deprecated and not used by the Owntracks integration anymore. However, I havent found any information describing what I’m supposed to use instead?

Can anyone point me in the right direction?

1 Like

This thread contains a working solution:

I had to “re-enable” the old way so I could get the required data for the icon, but it worked after that was done.

Now you link it all to the ‘person’ entity from ‘Configuration’ - > ‘Users’
Choose under the user what entities are used to track this person.

Then, in customize.yaml add (as for me):

person.stigh:
  entity_picture: /local/TheStigh.jpg
1 Like

Thank you. Where does /local/ point to though?

root-config-directory/www

The ‘www’ directory is not part of the default installation and you will have to make it yourself.
For the system, the path to ‘www’ is

local/

Did it make sense ?

Makes perfect sense. Thanks.

I added the appropriate entry to customize.yaml but the profile photo when I log in to HA still shows the placeholder letter. Is it possible to change this as well? The map picture is still unchanged too. (I’ve restarted HA)

I would need to see some code examples before I can help further, to many unknown factors here :slight_smile:

Sure, but not entirely certain how much code there is to share.

customize.yaml:

person.dave:
  entity_picture: /local/dave.jpg # image shows up when accessed through the URL

ah, remove the first forward slash so it becomes ‘local/dave.jpg’

No difference.

I also tried assigning it to the device tracker:

device_tracker.dave_phone:
  entity_picture: /local/dave.jpg

a 200x200 jpg should work, right?

1 Like

still, you have one forward slash too much

Here is part of my entities-card:

              - type: entities
                show_header_toggle: false
                entities:
                  - entity: person.stigh
                  - type: divider
                  - entity: sensor.battery_stigh_huawei

Then I have assigned my ‘device_tracker.stigh_huawei’ (from owntracks) to me as person (Configuration->Persons).

In customize.yaml I put the

entity_picture: local/TheStigh.jpg

leading slash or not doesnt seem to make any difference for me.

I havent manually configured the entities card. I just assigned the tracker to the “person” entity in the web interface.

Where do you expect the image to appear then?

If you just created the www folder you have to restart ha for it to be seen.

Why not just use the front end to assign the image?

Is doing it through the front end any different than through the customize.yaml file?

Just summarizing what worked for me (Thanks to @TheStigh for the customize.yaml part)

In customize.yaml the path I used is what was originally in the known_devices.yaml:

person.angelo:
  entity_picture: /local/avatar_person1.jpg

In configuration.yaml

person: !include_dir_merge_list persons/

In my persons directory I have:

- name: Angelo
  id: angelo
  user_id: my_user_id
  device_trackers:
    - device_tracker.axon7

In my www directory i have a file with the name of avatar_person1.jpg

I no longer have a known_devices.yaml anymore as I am gpslogger. I completely removed the file and was getting the blank avatar until I added the customize.yaml entry.

In case this helps, because I had tried adding the same person in yaml and then in the UI, I had two entries for “Angelo” so the 2nd one (the one actually tied to my device) was showing up as angelo_2. I removed the entries from entity config file and then everything started working as expected.

2 Likes

So the problem on my end was that I was missing the following in my configuration.yaml:

homeassistant:
  customize: !include customize.yaml

Works fine now. Even with a leading path slash :wink:

2 Likes

Hi
what you mean “person directory” ?
its same folder ? or yaml file ?

I have my config split up where i have a directory called “persons” in my .homeassistant directory. In this directory i have two yaml files…one for me and one for my wife. You could just put it in your configuration.yaml if you prefer like this:

person:
  - name: Angelo
    id: angelo
    user_id: my user guid
    device_trackers:
      - device_tracker.axon_7
      - device_tracker.angelo_phone_wifi
  - name: Sara
    id: sara
    user_id: wife's user guid
    device_trackers:
      - device_tracker.galaxy_s9
      - device_tracker.sara_phone_wifi