Help, mqtt not working

Hello All,

Use home assistant they said, it’s easy they said. Until Sonoff and mqtt. I don’t even know where to start debugging this one.

I have 2 x sonoff items, an RF bridge and a TH10 temperature switch. Both have been flashed with Tasmota 6.4.1 and are connected to wifi.

I installed the mqtt broker and followed the instructions.

Both of my Sonoff units are throwing
MQT: Connect failed to <>:1883, rc -2. Retry in 10 sec.

Please be patient as this is all gibberish to me.

1 Like


Is mqqt definitely enabled? Is the IP address of your machine?



Hi, Thanks for your help,

I have uninstalled for now as other things were being affected, yeah that’s the machine, and I did get a connection with MQTTlens, and that showed in the mqtt broker log on HA. But the sonoffs didn’t.

Nobody said that. If they did, they are not your friend.


try to connect only one device at a time to see if one is interfering with the other.

Make sure that your username and passwords are correct in your sonoff mqtt configuration and that the client id is unique.

I have just set up my Yeelights, now back to it.

I need to install mqtt again. Like always there is a lot of old, duff info out there. I will try again following the HA documentation. I have shut down completely and pulled the plug (I wanted to move it anyway). It seems to be a lot quicker now.

Which is why, everyone here, suggests you use the official documentation only.

Yeah I am learning that, I don’t always understand it though, and go looking for the dumbed down version.

Feel free to ask the forums for better explanation. If the documentation needs expanding, it’s our job to do so.

These all appear to be correct, I completely reset the sonoff and have double checked the settings through the browser. The host, username, password are right and the client is RF_Bridge. In the MQTT log the sonoff IP address never appears, it’s url= with an AUTH Error.

which mqtt broker are you using?

Which version is the broker?
Can you show your broker settings?

It sounds to me like you are setting active: true in the broker?

Are you using a Home Assistant user and not defining a user in the broker?

You have given so far about 1% of the information needed to troubleshoot this…

I personally am having an issue if I use a Home Assistant User and set active: true in the broker even after I set up the ACL required but if I leave active: false it all works - just spams the logs…

So more information is required…

(Also as an aside… if you’re using the precompiled release version of Tasmota 6.4.1 it is based on core 2.4.2 which is utter shit… but lets see if we can get the thing working before we try and fix that)

mosquitto broker in the add-on store. The sonoff simply isn’t getting through to it.

And the username and password for mqtt in the sonoff is a regular HA username and password?

That broker is fine but you need to show your configuration for it…

it’s broker version 1.5.6,


“logins”: [
“username”: “xxx”,
“password”: “xxx”
“anonymous”: false,
“customize”: {
“active”: false,
“folder”: “mosquitto”
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”

These are the details in the sonoff.

The mqqt broker is set up to a user with the same username and password.

I have tried my HA username and password as well (in the sonoff) but that didn’t work either

Are you sure?
The current broker version is 4.1

Yeah, 4.1, i got the other number from the log. Doh!

Do you have anything in configuration.yaml? Is the MQTT Integration installed?

Not this time, it says not to bother in the documentation.