Owntracks device tracker not configuring

Hi All,

I’ve been playing around with HA for the past 2 weeks and enjoying it. I’m getting a nice build together by referencing these forums and the guides. Everything was going smoothly, but I’m finally bumping into an issue I’m not understanding. Like some users, I have been having trouble with presence detection using owntracks and MQTT. I’m using HASS.IO 0.52.1 and the built-in Mosquitto 1.0 broker.

Following community guides I have Android Owntracks status showing it connected and the Mosquitto logs in HA shows the client connected and receiving information:

1504706888: New client connected from 70.214.xxx.xx as homeassistantme (c0, k3600, u'homeassistant')

Following the HA guide, I’ve added mosquitto with my PI’s local ip as the broker and the owntracks device tracker my configurations.yaml file

mqtt:      
  broker: 192.168.x.xxx

device_tracker:
  - platform: owntracks 

I’m not seeing any device tracker entities or a “known_devices” file being created after several reboots and traveling with the phone. At this point, i’m not sure if it is an MQTT issue or a device tracker issue communicating with each other. I am seeing the following in the logs:

ERROR (MainThread) [homeassistant.components.device_tracker] Error setting up platform owntracks
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/components/device_tracker/__init__.py", line 156, in async_setup_platform
    hass, p_config, tracker.async_see, disc_info)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/device_tracker/owntracks.py", line 313, in async_setup_scanner
    hass, LOCATION_TOPIC, async_owntracks_location_update, 1)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 237, in async_subscribe
    yield from hass.data[DATA_MQTT].async_subscribe(topic, qos)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 535, in async_subscribe
    _raise_on_error(result)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 644, in _raise_on_error
    'Error talking to MQTT: {}'.format(mqtt.error_string(result)))

Thank you for any suggestions or ideas.

Hi,

did not see your entry and created my own topic. I think we may have the same questions.
Did you get a better understanding since posting this?

I had issues too when I first started with MQTT. I suggest you break your problem down into two steps. Get MQTT working first, then work on getting Owntracks up and running. Comment out the device tracker stuff in your config file to concentrate on MQTT first.

To see if Mosquitto was set up correctly, I used Putty and opened two sessions connected to the Pi. One was for publishing, the other for subscribing. Publish a couple of messages and see it they are received. The Hass.io user interface also has a MQTT publisher. Access it from the developer tools section. See if HA can send a message to Mosquito too.

After you get that working, then tackle the Owntracks issues.

Thanks, JSC,

After a few tries I managed to get everything up and going. It’s been running consistently for the past few days. There was an error in my MQTT work that bugged everything down, but that’s how you learn, right?

1 Like

Perhaps a step-by-step to help us?