Sonoff t1 UK 2 channel MQTT configuration help please

I’ve just installed a 2ch T1 light switch and I’m trying to get it to work with home assistant. Here’s what I have already which isn’t working.

  • platform: mqtt
    name: “Workshop lights”
    state_topic: “stat/OfficeSwitch/POWER1”
    command_topic: “cmnd/OfficeSwitch/POWER1”
    qos: 1
    payload_on: “ON”
    payload_off: “OFF”
    retain: true
  • platform: mqtt
    name: “Office lights”
    state_topic: “stat/OfficeSwitch/POWER2”
    command_topic: “cmnd/OfficeSwitch/POWER2”
    qos: 1
    payload_on: “ON”
    payload_off: “OFF”
    retain: true

Does anyone have one of these swtches working with home assisiant?

Thanks

Callum

Hi!
Are you using the Tasmota firmware on the Sonoff switch?

B

Yes, sorry I should have mentioned that in my post.

each switch should have its own main topic change OfficeSwitch to OfficeSwitch1 and OfficeSwitch2

platform: mqtt
name: "Workshop lights"
state_topic: "stat/OfficeSwitch1/POWER"
command_topic: "cmnd/OfficeSwitch1/POWER"
qos: 1
payload_on: "ON"
payload_off: "OFF"
retain: true

platform: mqtt
name: "Office lights"
state_topic: "stat/OfficeSwitch2/POWER"
command_topic: "cmnd/OfficeSwitch2/POWER"
qos: 1
payload_on: "ON"
payload_off: "OFF"
retain: true

Thanks for the help guys. I just got them to work using:

  • platform: mqtt
    name: “Workshop lights”
    state_topic: “stat/OfficeSwitch/POWER1”
    command_topic: “cmnd/OfficeSwitch/POWER1”
    qos: 1
    payload_on: “ON”
    payload_off: “OFF”
    retain: true

  • platform: mqtt
    name: “Office lights”
    state_topic: “stat/OfficeSwitch/POWER2”
    command_topic: “cmnd/OfficeSwitch/POWER2”
    qos: 1
    payload_on: “ON”
    payload_off: “OFF”
    retain: true

I’m not sure why that’s different from my original version but it’s working!

It seems while gettting this working I’ve broken something else. Now when I physically touch the switch the light goes out and then right back on again. I can turn them off and on no problem with hass.io though.

Thank you to all for this post, I was having trouble setting the T1 up. This has resolved all. Thanks again