Sonoff with Tasmota and MQTT problem after update

Since i updated to the latest version of home assistant an mqtt broker I have problems with my sonoff (running Tasmota) devices. They keep disconnecting and turning off randomly. Can someone help how to solve it as it’s a bit annoying to take shower without lights :stuck_out_tongue:

In the picture you can see the mqtt logs

How did you install HA and your broker?

Running HA on a RPi 3 with mosquito as broker.

Upgrading HA will not make any difference to the connections between the sonoffs and the broker.

Did you do an upgrade to the system packages at some point, using something like sudo apt upgrade. Upgrading the mosquitto packages may have changed your configuration.

Just to see what the configuration is, can you type the output of

$ cat /etc/mosquitto/mosquitto.conf 

and

$ apt show mosquitto

Upgrading HA resulted in broken Samsung TV component, so I think it makes a difference. The problem started if I remember correctly when I updated mosquito broker a week ago and I had to change user/password for the broker.

I will check it later today and I will write again

DId you have to change the username/password for the sonoffs as well?

Nope, I just added user/password in broker config in HA

I think this will help you:

Thanks. I will check it.

That is only relevant for hassio installs. You said you were running HomeAssistant on a raspberry pi.

I would say it’s almost certainly because of “retain: true”. Is that set for any of your Sonoff MQTT devices in your HASS config?

This video solved a lot of my problems and helped me understand the retain flag a bit better:

Hi there, Not sure if this is relevant but I had lots of issues with latest Tasmota and Mosquitto MQTT. What I found was that I would fail to connect to the service if I started the service using inittab or systemd. However if I started the service manually as user pi I had no problem connecting from Tasmota. I ended up creating my own app using pubsubclient to work around the problem.

I have seen this video before and I set up my sonoffs according to it and it worked just fine until the latest updates. I have retain only in one of my devices but i have same problem with every device…

The only other thing I can think of is this double-broker issue that Dr. Zzs describes at the beginning of this live stream: https://www.youtube.com/watch?v=yjSH0aJDi1Q

Just a stab in the dark, but the timeline matches with yours.

Hi, I have one problem with sunoff basic and tasmot.
If I have a 3.3V and gnd connected from my computer, the device works ok. But if I connect to 230V, the device does not work. Only the green LED light flashes, and the button on the circuit works ok. Where is the problem? thanks J