Anything special in Sonoff S20 config?

I have several Sonoff Basic configured at home, but I have just installed my first Sonoff S20.

I have no issues with my Basics, but I don’t know what’s wrong with the S20 that I can’t control it through Home Assistant. I don’t get status info and if I click on/off on the entity_ID nothing happens. But I can control it publishing mqtt packages through HA.

Here is the S20 switch config.

  - platform: mqtt
    name: "Server"
    state_topic: "stat/sonoff08/POWER1"
    command_topic: "cmnd/sonoff08/POWER1"
    payload_on: "ON"
    payload_off: "OFF"
    optimistic: false
    qos: 1
    retain: true    

And this is the Tasmota configuration

Clicking on it doesn’t change it’s state

But If I issue a mqtt_publish message like this with ON/OFF the switch responds perfectly.

06

Does the Sonoff S20 have something different than the Basic ones?

The payload in your manually published message is different (‘On’ vs ‘ON’ in your config).

It is case sensitive.

In my config is ON, as the rest of the Sonoffs I have.

Well that’s what you published and you said it worked.

I agree though the default is usually ‘ON’.

Do you have setoption26 enabled?

If not you have to use POWER, not POWER1. https://github.com/arendst/Sonoff-Tasmota/wiki/Home-Assistant-‐-Manual-Config#configure-switches

No, I don’t have setoption26 enabled. I’ve tried both with the availability_topic and without it.

The rest of my setup uses the availability_topic. I just copied the details from one of the other switches and changed it into “sonoff08”, and when it didn’t work I started trying different things to no avail

Sorry I just edited my post, you have to use POWER not POWER1 if setoptio26 = 0

This is my working configuration for Tasmota 6.3.1 / Core 2_3_0

Tasmota settings applied by  cmnd/sonoff-s20-portabel/Backlog:

PowerOnState 0    off | Keep relay(s) off after power on -> overriden by MQTT retain
SaveData 1        Save parameter changes every second (config & stats)
SetOption 0       Do not save power changes and do not set relay after restart
TelePeroid 60     Publish telemetrie every 60 seconds
SwitchRetain 0    There is no custom switch added to the device: https://github.com/arendst/Sonoff-Tasmota/wiki/Buttons-and-Switches
SensorRetain 0    Don't retain telemetrie messages
PowerRetain 1     Retain flag for cmnd/sonoff/power
ButtonTopic 1     Set the ButtonTopic to cmnd/sonoff/power
ButtonRetain 1    Enable MQTT retain flag on button press for cmnd/sonoff/power (set by ButtonTopic 1)
SetOption26 0     Use cmnd/sonoff/POWER instead of cmnd/sonoff/POWER1
WifiConfig 4      Disable wifi config but retry other AP without restart. If no alternative SSID is available just retry (same as WifiConfig 5)

switch:
  - platform: mqtt
    name: Sonoff S20 Portabel
    state_topic: "stat/sonoff-s20-portabel/POWER"
    command_topic: "cmnd/sonoff-s20-portabel/POWER"
    availability_topic: "tele/sonoff-s20-portabel/LWT"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    payload_available: "Online"
    payload_not_available: "Offline"
    retain: true
    optimistic: false

Ok, so after SetOption26 1 and SetOption 59 1 it’s working as expected. I don’t know which one of them made it to work, or if both were needed. Now is working and reporting correctly.

Thanks everyone!