To start this post I want to say that I have searched the forum and found loads of posts. I’ve also done a lot of Googling. I can’t find the answer to my question(s) and worryingly the posts I have found that come close either don’t have an answer or finish with the OP saying words to the effect of “I couldn’t get it to work”.
I have built a Mosquitto MQTT server on a Digital Ocean droplet. The SSL is provided by a Let’s Encrypt certificate. That is, it’s not self signed. My reason for this is long and involved but it involves data collection from sensors outside my home network.
To this server I have successfully connected
OwnTracks on my phone
ESP32 clients located in a field
A RPi on my home network running Zigbee2MQTT
And some other bits. Point is, I have
mosquitto_sub -h localhost -t '#'
running on the server and I can see a steady stream of these devices connecting and publishing without a problem.
But I can’t get HA to connect to this server. If I try and do it through the integration I get “Connection failed” and
[paho.mqtt.client] failed to receive on socket: [Errno 104] Connection reset by peer
In the log. If I go back to basics and configure it in the YAML, the log fills up with
[homeassistant.components.mqtt] The 'broker' option near /config/configuration.yaml:13 is deprecated, please remove it from your configuration
And it doesn’t connect. I remember in the days when we had to do everything with YAML you could specify keys like certificate: auto or specify paths to certificates but any of those options just cause the “deprecated” warning above and, since I’m using a LE certificate should theoretically not be needed.
Is there something else I need to do to get HA to connect to MQTT with SSL? This is Home Assistant OS 2022.5.4 by the way.
have you still successfully integrated your external mqtt broker today?
I’m running HA 2023.6 where the yaml config is invalid and I can’t figure out how to connect to an MQTT server with TLS enabled via the UI.
Everything I tried so far unfortunately results in the generic error message ‘Connection failed’ and I have absolutely no idea what else I should do. Other apps can talk to the mqtt broker just fine. It’s just HA that somehow refuses to connect.
Did you ever get this working? I also have an MQTT broker set up on Digital Ocean for my Personal Weather Station - it publishes data every 2s to my weather station website, and works very well. I want to bring that same data into my HA set up - but am a HA newbie. Any help you can give on what I have to put in my YAML file would be much appreciated, as I can’t see much detail on the HA MQTT documentation. Many Thanks. David.
Hi - thanks for your reply. Yes, I saw all the posts. I guess by detail, I mean what exactly do I need to put in the YAML file and where do I set the server name etc. Sorry, am probably just being dumb, as not used MQTT in WA before, and am new to HA anyway. I use my MQTT broker as part of a “weewx” implementation on a RPi for my personal weather station. The config file for weewx has the following code for the MQTT implementation: