I am trying to configure owntracks to track whether family members are at home or at some other location. To do that, I enabled the built-in MQTT server and enabled owntracks in configuration.yaml:
device_tracker:
- platform: owntracks
mqtt:
username: somename
password: somepw
certificate: /home/pi/cert_hass/mydomain.crt
My public ip is accessible via a domain name, let’s say home.somedomain.com and I already had a certificate for that domain, so figured I would use that so that the data could be send over a secured connection.
On my router I set up port forwarding for port 1883 to the IP of the raspberry that I’m running hass on.
I installed owntracks on my android phone, set the mode to “private MQTT”, set the host to home.somedomain.com and the port to 1883.
In identification I set the username and password to the ones I configured in HASS, and filed in my name as the “device ID”
As soon as I save these settings, I see this in the HASS log:
INFO (MainThread) [hbmqtt.broker] Connection from 84.241.208.46:43445 on listener 'default'
So it seems the connection get’s where it’s supposed to get, however right after it, I see:
WARNING (MainThread) [hbmqtt.broker] [MQTT-3.1.0-1] (client @=84.241.208.46:43445): Can't read first packet an CONNECT: No more data
When I go back to the home screen of owntracks and press the upload location button, I get a “message queued” message, but nothing seems to happen on the HASS side.
When I go to “status” in owntracks, I see this error:
so clearly, something, somewhere is going wrong, but I can’t figure out where I’m going wrong. Any ideas?