Newbee question about Sonoff 4ch and tasmota

Hi… iam just started with home assistant, and so far, it is going well, I have made a switch with a sonoff basic, that works great, and now I am struggling with a 4ch sonoff also with tasmota, power on works, but power off don’t, I have made it the same way as the basic, so I can figure out what iam doing wrong, I think the solution is easy, but I don’t know what the fail is…

  - platform: mqtt
name: "Sonoff 4ch 1"
command_topic: "cmnd/4ch01/POWER1"
state_topic: "stat/4ch01/POWER1"
qos: 1
payload_on: "ON"
payload_off: "OFF"
retain: true  
  - platform: mqtt
name: "Sonoff 4ch 2"
command_topic: "cmnd/4ch01/POWER2"
state_topic: "stat/4ch01/POWER2"
qos: 1
payload_on: "ON"
payload_off: "OFF"
retain: true  
  - platform: mqtt
name: "Sonoff 4ch 3"
command_topic: "cmnd/4ch01/POWER3"
state_topic: "stat/4ch01/POWER3"
qos: 1
payload_on: "ON"
payload_off: "OFF"
retain: true  
  - platform: mqtt
name: "Sonoff 4ch 4"
command_topic: "cmnd/4ch01/POWER4"
state_topic: "stat/4ch01/POWER4"
qos: 1
payload_on: "ON"
payload_off: "OFF"
retain: true

Anyone…?

Brian,
From what you are showing for the configuration the spacing is wrong, name, command_ topic etc should be aligned with the “p” in platform (four space in front of the word). You will need to re-start after the change.

The spacing should be correct, it is just something with the formatting og this page…
This is what I looks like, (hope it shows correct)

  • platform: mqtt
    name: “Sonoff 4ch 1”
    command_topic: “cmnd/4ch01/POWER1”
    state_topic: “stat/4ch01/POWER1”
    qos: 1
    payload_on: “ON”
    payload_off: “OFF”
    retain: true

No, neither of your posts are formatted properly. See the link at the top of the page.

Hi, Brand new here, I have a problem, 4CH Sonoff R2 will turn on via HA, but cannot turn off.
Also whenever the device disconnects, all the channels turn on upon reconnection.
Is it coded properly ??

switch:
  - platform: mqtt
    name: "Yard String Lights"
    command_topic: "cmnd/sonoff4ch/power1"
    state_topic: "stat/sonoff4ch/POWER1"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    retain: true
  - platform: mqtt
    name: "Yard Paver Lights"
    command_topic: "cmnd/sonoff4ch/power2"
    state_topic: "stat/sonoff4ch/POWER2"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    retain: true
  - platform: mqtt
    name: "Yard Pole Lights"
    command_topic: "cmnd/sonoff4ch/power3"
    state_topic: "stat/sonoff4ch/POWER3"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    retain: true
  - platform: mqtt
    name: "Pool Light"
    command_topic: "cmnd/sonoff4ch/power4"
    state_topic: "stat/sonoff4ch/POWER4"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    retain: true