So I followed this guide on setting up a Cloudflare tunnel with my only change being setting it it up for a subdomain. Works very well. Having previously had DuckDNS with SSL, I can now access my HA remotely without any ports open. And being in a location where routers get fried due to lightning a few times a year, it’s useful not having to open ports as I am not there much of the time.
But I digress. My issue is with local access, I still had this in my configuration.yaml from when I used DuckDNS:
This shouldn’t be needed with Cloudflare tunnel, but as soon as I deleted it I could no longer access HA. Put it back in and HA via subdomain works again but local via Android app does not, as there is no valid security cert. I can override this for local access via https on browser but not in the app, unless I access via subdomain even when on the local network, which is not ideal.
Does anyone know what I have done wrong or how I can get local access working again for the app?
There is another guide I read I didn’t follow for Cloudfare tunnel setup, but it requires port opening, it states the connection between Cloudfare and HA is not secure, is this correct for the guide I followed? I assume not given I didn’t need any ports open…
Now fixed, and I thought I’d specify what I did for anybody else having the same issue. You’ll need to be on your local network accessing via your local https://IP:8123
Go to the Cloudflared add-on, configuration, edit in YAML, copy the YAML into somewhere so you’ve got it for later
Uninstall the add-on
Go to your code editor of choice, and in the configuration.yaml file you need to delete the ssl_certificate and ssl_key lines. Save
Restart home assistant
Go to Cloudflare site itself. Click Access in the left hand menu. Launch Zero Trust
Go to Networks/Tunnels on the left hand menu
You should see your tunnel listed. Click the 3 dots at the end of the row, and delete. You’ll get some warnings which you need to accept.
Go back to home assistant, but you’ll now need to use http://IP:8123 (note not https)
Reinstall cloudflared add-on
In configuration, edit in YAML, and paste your config you saved earlier
Start the add-on and give it a few seconds.
Go to the logs. You should get instructions for copying a url to authorise your new tunnel. Do that and confirm on the Cloudflare site
Go back to HA, and your Cloudflared logs should switch shortly to confirming the new tunnel, and you’re all done! Your local access is now http, and external is all https.