I recently embarked on setting up an MQTT server using Mosquitto on a Digital Ocean droplet, and I wanted to share my journey and some insights for anyone else tackling a similar project. My goal was to integrate various devices like ESP32 clients, a Raspberry Pi running Zigbee2MQTT, and my phone’s OwnTracks app, all secured with an SSL certificate from Let’s Encrypt.
The initial setup was smooth—connecting all devices and ensuring they published and subscribed without issues. However, the real challenge came when trying to integrate Home Assistant (HA) into the mix. Despite numerous attempts, HA couldn’t connect to the MQTT server, throwing errors like ‘Connection reset by peer’ and deprecated configuration warnings.
After days of troubleshooting, I realized the issue lay in HA’s configuration. The deprecated ‘broker’ option was causing conflicts, and specifying SSL certificates wasn’t straightforward. I discovered that using the newer integration method in HA, which automatically handles SSL when a valid certificate is present, was the key. Removing the deprecated settings and relying on HA’s built-in MQTT support resolved the connection issues.
This experience taught me the importance of staying updated with the latest software versions and configurations. It also highlighted the value of community forums, where others had faced similar challenges and shared their solutions. If you’re setting up an MQTT server, especially with SSL, ensure your HA version is up-to-date and avoid deprecated settings. Happy tinkering! ![]()