How to add pic to device_tracker device

I configured mosquitto with my HA and it works fine.
It show the first letter of the name in the map in circle, I provided the path for the pic in known_devices.yaml but i get empty circle no letter nor picture.

What am i doing wrong?

from map:

from HA UI:

What has this to do with MQTT? Also without a config we can’t really help you…what is the path you used in your known_devices.yaml for the picture and where is it stored physically.

~Cheers

If i am right HA has built in MQTT broker which is the mosquitto that i see installed and there is config file for mosquitto in /etc/mosquitto. I use OwnTracks as MQTT client to push location to mosquitto. when pushed from a device (say iPhone) it creates this devices in known_devices.yaml file which looks like this

mqttuser_name:
hide_if_away: false
mac:
name: myname
picture: /home/homeassistant/.homeassistant/test.jpg
track: true
vendor:

(the above config was created automatically when a device is first connected, all i tried is to give the file path for picture)

Put the picture in the “www” directory in your Hass folder (or create it if it doesn’t exist).
Then use:

picture: /local/test.jpg

PS I updated the topic title because it has nothing to do with MQTT indeed :slight_smile:

2 Likes

Awesome, that worked.
thank you and sorry about the topic

Also another question relate to MQTT, i setup my HA with letsencrypt cert. it works but i wasn’t able to achieve this for MQTT. My config now without tls look like this:
(for tls I uncommented the client cert and changed port to 8883 which did not work for me)

mqtt:
broker: 127.0.0.1
port: 1883
username: mqtt_user
pasword:
#client_key: /etc/mosquitto/certs/mqtt.key
#client_cert: /etc/moquitto/certs/mqtt.crt

Is the recent update 0.41 had made anything to fix this issue since i see something similar mentioned

sorry if its not the right place to post, let me know if so.
thanks for your help.

no need for tls when you’re going from localhost to localhost. if it’s all on the same machine just use the normal 1883 port from HA and use the TLS stuff for your clients.

Hi,

I have the same problem. I run AIO instaler. I use samba, no commandline use. Can I just right click in windows explorer and add new folder called www?
My setup in known_devices.yaml

paul_mobile:
  hide_if_away: false
  icon:
  mac: Hidden ( dont want to show my phone mac adress ).
  name: Paul's Mobile
  picture: /www/paul-192x192.jpg
  track: true
  vendor: HUAWEI TECHNOLOGIES CO.,LTD

I’ve allsow tested using local folder. same result, no images.
image

Can the problem do to the rights to acsess the folder?

www should already exist in an install. it’s accessed via /local/. no need to make a www/ directory.

if it doesn’t exist it’ll need to be created with the same permissions of the local HA install.

use this:

picture: /local/paul-192x192.jpg

Hi BoB_NL

Thanks for your replay.
I’ve tried with just /local/filname.jpg, but still not working.
image

My folder setup that come default with my HAssIO instalation looks like this.
image
How can I set permissions via windows browser? I’ve tried but it don’t work.

I use Hass.IO all instaler. I didn’t install via the command line. I just used etcher to create img to SD card.
I’m now expert on using commandline.

1 Like

Hi,

The folder on disk should be www and not “local”.

The name in configuration should be “local” - like you have it.

Hi RogueCrow,

Thanks, that fixed it. But that is not easy to understand. Cos it make no sense :slight_smile:
I think a lot of the documention is outdated.

Can I do this for using custom icons?

Thanks to every one for help.

Yes you can. Everything inside your www folder uses this path: /local/

1 Like

Hi,

Tested it, and it works. I see that there is a problem with size on the image. I was hoping it self adjusted the formating, but it dident. So I got to re-size the icons :slight_smile:

Don’t forget you can link to facebook profile images if you want. Just make sure it’s https to keep SSL happy. You just need your facebook id number and you should be good to go. Use something like https://findmyfbid.com/ to find your ID.

https://graph.facebook.com/<FacebookID>/picture?type=normal

3 Likes

That I did not know, thanks!

Hi
so what the solution ? i have same problem

Also stuck here.
I am using the map with the device/person tracker.
Including the customize.yaml and added the lines there and added the images to the www folder, but nothing happens.

person.maarten_2:
picture: /local/maarten.jpg
name: Maarten
track: true

This is the person being tracked in the map.

What is going wrong?

customize the person to have a picture. This whole thread is out of date. known_devices.yaml is no longer used by all device_trackers.

also, a person is not a device_tracker. So this whole thread doesn’t pertain to your person anyways.

1 Like

Thank you! I just found out a minute ago I needed to use entity_picture instead of picture in my customize.yaml

1 Like