Sonoff Tasmota MQTT

Sorry if im posting in a wrong forum topic.

Im new to HASS trying to convert from Domoticz. I have a couple of Sonoff switches with Tasmota. (They work in the addon TasmoAdmin) im trying to get them to work in HASS… Either via MQTT or something that just work…
This is my configuration.yaml on mqtt

Mqtt

mqtt:
broker: m23.cloudmqtt.com
port: xxxxx
username: username(its correct)
password: password(its correct)

switch:

  • platform: mqtt
    name: “Test”
    command_topic: “cmnd/Test/OFF”
    state_topic: “stat//Test/off”
    payload_on: “ON”
    payload_off: “OFF”
    qos: 0
    retain: True

  • platform: mqtt
    name: “Test2”
    command_topic: “cmnd/sonoff1/OFF”
    state_topic: “stat//sonoff1/off”
    payload_on: “ON”
    payload_off: “OFF”
    qos: 0
    retain: True

This is how my Sonoff mqtt config looks like for one of my switches:

Host
m23.cloudmqtt.com

Port

Xxxxx(Yep correct port)

Client
Testmqtt

User
Username

Password
Password

Topic
Sonoff1

Full Topic
(%prefix%/%topic%/)

See that big blue box at the top of the page? It’ll be easier for people to help you if you post having inserted your extracts in a readable fashion

Hello. I have noticed something to try:

The Full Topic of the Sonoff switch config indicates that your state and command topics should be: prefix/topic/. You have prefix/topic/OFF. Try removing OFF in both the state and command topics.

One thing that I do when troubleshooting MQTT is to make sure MQTT works without Home Assistant. I use the Chrome Extension MQTT BOX to help isolate the issue to MQTT or HA.

Also make sure that each MQTT client device has a unique ClientID. I have made that mistake before.

Hope this helps.