Owntracks and Identifying Devices when MQTT has a userid/password

hi
i’m sure there is a simple answer to this.

i have an external MQTT server with requires a user id and password etc.
Owntracks on an android device
Owntracks publishes the topic as /owntracks/mqttuserid/deviceid

when using the device_tracker component , it only identifies the devices at the second level , ie mqttuserid

I’m only using one mqtt userid for all my devices

so when i use device_tracker, i get five devices all called “mqttuserid”

is there away to clearly identify my devices when using owntracks?

Thanks

Lee berry

1 Like

I have a similar setup here using an external MQTT server with authentication, and owntracks.

In my instance, the entity IDs are presented as device_tracker.<username>_<device-id>. In the user interface however, the icon then apparently just shows the username. And I guess this is the intended behaviour assuming that each member of the household typically owns a single mobile phone that is used for tracking purposes.

Check your list of entity ids via the developer tools (<> icon in the toolbar) in the user interface, and see how the device_tracker entities are showing up.

If you are only using a single username and multiple device ids, then you may want to rename the entities in your configuration file:

homeassistant:
...
  customize:
    device_tracker.<username>_<device-id 1>:
      friendly_name: 'Device 1'
    device_tracker.<username>_<device-id 2>:
      friendly_name: 'Device 2'
2 Likes

what worked … thanks :slight_smile:

1 Like

Check my HOWTO for configuring OwnTracks.
https://community.home-assistant.io/t/howto-using-owntracks-with-auth-and-the-mqtt-bridge-for-smartthings/

You don’t mention whether or not you are using a different deviceid and tracker ID on each device.

refer to these sections:

– Config in HASS
– OwnTracks settings - for Android

you can also confirm what’s making it to you MQTT servers.

– Confirm messages are making it to your server

what was ending up on the MQTT server was ‘owntracks/mqtt user id /device id’

using the suggested solution , provided a friendly name to ‘owntracks/mqtt user id /device id’ i.e . “Lee’s Phone”
now i have three device with their own friendly name , but only using one MQTT server logon ID for all devices