Owntracks_http with duckdns and lets encrypt not working on iphone

Hi all,

I’ve got Hass.io running on my RPi3 with duckdns and lets encrypt. Everything works perfect from inside my network and outside. I access from outside the network on https://myduckdnsname.duckdns.org:8123.

I have forwarded port 8123 TCP in my router to my RPi3 internal address port 8123.

I also of course use a separate username and password in my secrets file to access homeassistant from outside my network.

I’ve added in the owntracks_http component into my config file:

device_tracker:

  • platform: owntracks_http

I’ve checked the config file and everything is valid.

I’ve setup owntracks on my iphone with the following:

Mode - http
TrackerID - RP
Authentication - on
UserID - homeassistant
Password - password used to login to homeassistant remotely
secret encryption key - blank
Host - https://myduckdnsname.duckdns.org/api/owntracks/russell/iphone

Unfortunately in the owntracks app I continuously get the following error:
“error an SSL error has occured and a secure connection to the server cannot be made. {NSErrorFailingURLKey = “https://myduckdnsname.duckdns.org/api/owntracks/russell/iphone”;
NSErrorFailingURLStringKey = “https://myduckdnsname.duckdns.org/api/owntracks/russell/iphone”;
NSLocalizedDescription = “An SSL error has occurred and a secure connection to the server cannot be made.”;
NSLocalizedRecoverySuggestion = “Would you like to connect to the server anyway?”;
NSUnderlyingErro = “Error Domain=kCFErrorDomainCFNetwork Code=-1200”(null)”
UserInfo={_kCFStreamPropertySSLClientCertificateState=0,
_kCFNetworkCFStreamSSLErrorOriginalValue=-9800,
_kCFStreamErrorDomainKey=3,
_kCFStreamErrorCodeKey=-9800}";

So, interestingly, it works fine from outside my local network. It appears the issue only happens when I’m connected to my local wifi?

I’m using the Android version, but I’ve never had that problem. One difference I can see between my setup and yours is that I use the port number in my host URL. So it’s duckdns.org:8123/api/owntracks, etc…

I’ve tried with and without the port number with same results. In the end, I primarily want to use OwnTracks for tracking movement outside my network so that HASSio is aware of my movements into and out of key zones, so having location tracking within my own network won’t really be a priority.

I’m testing now to see if I can live with it.

How are you connecting to your HA server from your home network if you aren’t using your new SSL domain through DuckDNS/Let’s Encrypt?

After I set it up the SSL connection, I am no longer able to connect to my HA server using its local IP address. So regardless of whether I’m at home on WiFi, or out and about using cellular data, I am technically always accessing my HA server externally through SSL.

I suspect the problem comes down to an improper setting on your Owntracks app. Not having the iOS version, I have no idea what that may be. Hopefully an iOS Owntracks user will respond!

I access HA through the duckdns web address both locally and externally. Same for owntracks.

The only issue occurs with owntracks when I’m connected to my home WiFi. Then it started throwing errors.

However, after using it for a few days, the errors seem to have gone away. Once I disabled WiFi and connected via 4G everything started working in owntracks. When I reconnected to WiFi it seems to be maintaining the connection.

The type of error where it just starts working when you haven’t done anything different is definitely the most frustrating type of error! I’m glad it’s working for you now, and I hope it continues working.

No doubt :slight_smile: It’s tough to troubleshoot!

Owntracks has been working okay. Not very responsive when entering / leaving zones, so I’m not sure I’m going to stick with it. Primary reason to use it is for opening / closing garage door and kicking off “return home” automation. Doesn’t really work if it doesn’t kick it off until I’m already inside the house :slight_smile:

1 Like

You’ll probably want to set up multiple zones for your geofence. A smaller one for your exit automation, because you probably don’t want to get too far away before your door closes. Just make sure it’s large enough that you don’t start getting false exit triggers due to normal GPS location drift. (assuming you’re going to use this geofence as your home zone)

Then make your return zone larger, so you can get it to trigger before you get home, without needing to mess around with adjusting the background polling settings, like time between reports, or distance between reports. This way, you can still use the default settings that are pretty battery friendly, and still get accurate triggers.

I’ve been using Owntracks for almost two months now, and after a bit of trial and error radius adjustments, it reliably triggers 200-300 feet from my house when I’m coming home.