I am working on a setup to get HA working outside my house. Now there is a tutorial which gives an explanation for duckDNS but my router already has this function which is asuscomm.com. So this link: xxxxxx.asuscomm.com can redirect my external ip.
Now I need to setup an save ssl, but I am not familiar with ssl. I also don’t like to manually get a new ssl certificate every 90 days. (let’s encrypt)
The only thing I want to do, is to use HA as userinterface. Most of the programming will be done with Node-Red so I can make everything changeable. Communication is with MQTT.
Are you using raspberry with linux? if so you can make a shellscript that renews the certificate, and call it using cron every two months or so. You might want to restart some services in the script aswell, once you got the new certificates.
The line in /etc/crontab should be something like: 0 1 1 1,3,5,7,9,11 * /root/myrefreshscript.sh
You also have the option of purchasing a certificate from a vendor like hover.com. But I think when you see the price for these you will decide that the 90 day update isn’t such a big problem.
Then use certbot, from the LetsEncrypt folks. It has a function that’ll allow you to automate the renewal, and restart the service using it. There’s no need for any manual effort.
A quick Google for certbot renewfound this, which is a good starting point. For something more detailed, we’d need to know whether you’re using HA directly with the certificate, you’re using nginx, or something else…
Do you already have automations, sensors and shell commands elsewhere in your configuration? If so, these go with them. The code definitely still works, I have it all running here. My guess would be formatting issue somewhere.
There’s no need to do that. You used certbot to get the certificate, so use it to check if the certificate is expired, renew the certificate if needed, and then restart HA: