Tasmotorture another Sonoff/Tasmota/HA problem

So, I know there are loads and loads of discussions about this, I believe I’ve read them all, tried every solution that seemed to work to everybody else but not for me… I’m losing the will to live!

I’m fairly new to HA and bought some Sonoff basics and TH16, and thought the flashing would be the hardest part by watching all the DrZzs’s and Bruh’s youtube videos.

Flashing went like a brease and everything responds through the web interface of Tasmota, now came my nightmare material.

Atm runing an updated version of hassio and tried both the embedded mqtt broker and the Mosquitto addon.

While using the embedded broker, I can get the switch to show up in the GUI, but when I activate it nothing happens on the phisical switch and the GUI one deactivates shortly after.
But at least it shows!

While using Mosquitto I can tell the switch gets connected to the mqtt server by checking de Addon Log but nothing is discovered and nothing shows on the GUI!

I’ve tried all sorts of configuration codes.

While using the embedded Im using:

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

When I try the Mosquitto addon I set:

mqtt:
broker: 192.168.1.1
discovery: true

and on the addon Config

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

I’m going crazy, can’t figure whats wrong nor whats happening!
Also I’m fairly noob on diagnosing and command line stuff.

Anyone has any idea?

try the embedded broker again since you say that it actually shows up there and try the following for your switch set up:

- 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

Hello

  1. Update mosquitto addon to latest version.

mqtt:
broker: core-mosquito
username: home,
password: mypass
discovery: true

and on the addon Config

{
“logins”: [
{
“username”: “home”,
“password”: “mypass”
}
],
“anonymous”: true,
“customize”: {
“active”: false,
“folder”: “mosquitto”
},
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”
}

  1. In ha: Configuration-Integration delete all autodiscovered mqtt integration and create new with settings:
    broker: core-mosquito
    username: home,
    password: mypass

Restart HA and enjoy.

You just changed the capitalization of power on the command right?

Yeah, sorry I should have pointed that out better.

That’s the command topic for my Tasmota Sonoff switches.

So I did everything you said and got half way through lol.

The Sonoff now show up on the GUI with Mosquitto and altough the command doesnt work it reads the state. If I toggle on or off on the Tasmota page it updates de state on HA.

Something is wrong on the command part.

This is what I have at the momment:

config.yaml:

mqtt:
broker: core-mosquitto
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

Already tried with qos: 0 and retain: 0 but i dont know what that does.

Addon config:
{
“logins”: [
{
“username”: “home”,
“password”: “mypass”
}
],
“anonymous”: true,
“customize”: {
“active”: false,
“folder”: “mosquitto”
},
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”
}

My tasmota config is like this:

the default command topic isn’t “cmnd” instead of “cmd” ?

1 Like

Crap!

I missed one more thing in your code I copied and pasted from your previous reply…

the command needs to be:

“cmnd/sonoff1/POWER”

You just barely beat me to it!

:laughing:

Guys It Works!!!

It’s weird because I believe every resource I read and watched used the cmd topic, I would never notice that typo!

Now I can peacefully flash and config these!!

Thank you so much for your help guys!

To get the frustration going a bit more:

First TH16 successfully flashed, HA responding to the switch function, but cant get the SI7021 readings showing :face_with_symbols_over_mouth:

Challenge after challenge eheh, any ideas? couldnt find much documentation about HA configs for the TH with this sensor :thinking:

Nevermind it’s done! :smiley: