Sonoff Dual doesn't work in HASS

Hi, I need your help. I am a beginner in this matter. My problem is that my Dual Sonoff does not work in Home Asssistant. There are no problems with the configuration, the test is positive and there are no errors. As a general information, Mosquito is connected and working well. I have contact with it in the local network. In HASS when I push a switch for the first time, it’s makes contact with the Sonoff and turn den “ON”. At the same time the switch after a couple of seconds is returned to the original position and there is no more contact with Sonoff. This happens with the 2 switches. The Sonoff was flashed with Tasmota OTA. The HASS configuration and the Sonoff configuration in the MQTT section are added here. I will be very grateful if anyone could give me a hand in solving this problem. Thank you

yaml

What is the consel output? This can help with debugging your config.

Check the capitalization in your MQTT commands, they won’t work if they don’t match exactly.

Way old so I am sure you figured it out but thought I would post my working config as I just set this up today. Given my mitt topic is sonoff-dual

  - platform: mqtt
    name: "Sonoff Dual 1"
    state_topic: "stat/sonoff-dual/POWER1"
    command_topic: "cmnd/sonoff-dual/POWER1"
    payload_on: "ON"
    payload_off: "OFF"
    retain: true
  - platform: mqtt
    name: "Sonoff Dual 2"
    state_topic: "stat/sonoff-dual/POWER2"
    command_topic: "cmnd/sonoff-dual/POWER2"
    payload_on: "ON"
    payload_off: "OFF"
    retain: true

Lowercase and uppercase letters are sensitive and can influence the action. In my case it works like this:

  • platform: mqtt
    name: “Sonoff Dual 1”
    state_topic: “stat/sonoff-dual/power1”
    command_topic: “cmnd/sonoff-dual/POWER1”
    payload_on: “ON”
    payload_off: “OFF”
    retain: true
    • platform: mqtt
      name: “Sonoff Dual 2”
      state_topic: “stat/sonoff-dual/power2”
      command_topic: “cmnd/sonoff-dual/POWER2”
      payload_on: “ON”
      payload_off: “OFF”
      retain: true