After hours of troubleshooting, I thought I’d share my journey and maybe help someone else avoid the same frustration. I recently set up a few Sonoff Basics and TH16 switches with Tasmota firmware, and while the flashing process went smoothly, integrating them into my Home Assistant setup was a nightmare. Here’s what I learned:
I started with the embedded MQTT broker in Hass.io, and while the switches appeared in the GUI, activating them didn’t do anything physically—they just flickered off after a second. Frustrated, I switched to the Mosquitto addon, which showed more promise in the logs but still didn’t discover the devices or display them in the frontend. I tried every configuration code I could find, but nothing worked.
Here’s what finally solved the issue:
-
Configuration for Embedded MQTT:
yaml
mqtt:
username: home
password: mypass
discovery: true
platform: mqtt
name: “Sonoff1”
command_topic: “cmd/sonoff1/power”
state_topic: “stat/sonoff1/POWER”
qos: 1
payload_on: “ON”
payload_off: “OFF”
payload_available: “online”
payload_not_available: “offline”
retain: true -
Mosquitto Addon Settings:
yaml
mqtt:
broker: 192.168.1.1
discovery: true
And in the addon config:
{
“logins”: [
{
“username”: “home”,
“password”: “mypass”
}
],
“anonymous”: false,
“customize”: {
“active”: false,
“folder”: “mosquitto”
},
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”
}
The key takeaway? Patience and meticulous logging. By checking the Mosquitto logs, I realized the devices were connecting but not being discovered properly. Reconfiguring the MQTT settings and ensuring all topics were correctly set made the difference. Now, my Tasmota devices are working seamlessly with HA!
If anyone else is struggling with similar issues, I’d recommend starting with the embedded broker, verifying your MQTT settings, and checking logs religiously. It’s a learning process, but it’s so rewarding when everything clicks into place! ![]()