SonoffS22 Switch

Will do John. Thanks! Baby sitting duty tomorrow so maybe Sunday…

Sunday works for me.

That Image @kanga_who posted is exactly how the S22 looks when you open it up.

Gotta say I found DrZ’s blog and video pretty useless unfortunately. It just wouldn’t work.

@bukurat was awesome and we spoke on the phone. I ended up using Visual Studio Code as John suggested and it was pretty straightforward. It didn’t like my complex WLAN password, same as the ewelink app but as I wanted to use it with a repeater I was able to get that to work no issues.

The MQTT configuration suggested by DrZ worked perfectly and once flashed the switch just worked immediately.

Not sure why MQTT is better than the IFTTT and Binary switch I was using except it’s going to have less delay I believe. Pretty sure I was also getting the temperature before but it’s just a switch now.

Anyway, good experience. I’m leaving the other S22 as is as I want to be able to control it if Home Assistant is not working for some reason.

Thanks everyone for the help and advice especially @bukurat

Not sure why I see this in the logs of the Hassio addon for MQTT

1523936682: New connection from 10.90.11.16 on port 1883.
1523936682: New client connected from 10.90.11.16 as DVES_4E6C26 (c1, k15, u'mqttuser').
1523937452: Saving in-memory database to /data/mosquitto.db.
1523938165: Client xxx disconnected.
1523938191: New connection from 172.30.32.1 on port 1883.
1523938191: New client connected from 172.30.32.1 as xxx (c1, k60, u'mqttuser').
1523939253: Saving in-memory database to /data/mosquitto.db.

Local MQTT is better because you have complete control, you’re not relying on some other dude’s server on the internet.

Try changing the S22 config to th10 and see if the temperature works. You will have to change the yaml script to read the temp sensor.

grc.com shields up says 1883 is closed.

So in my config yaml I have the switch configured thus:

mqtt:
  broker: core-mosquitto
  username: !secret mqtt_user_name
  password: !secret mqtt_password

and with the Hassio MQTT Broker options are:

{
  "plain": true,
  "ssl": false,
  "anonymous": true,
  "logins": [
    {
      "username": "my username",
      "password": "my password"
    }
  ],
  "customize": {
    "active": false,
    "folder": "mosquitto"
  },
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem"
}

Wondering how to change that to get TH10? Also maybe I should use SSL? (I run SSl for HA)

If I change to SSL, (plain:false, ssl:true and anonymous:false) do I need to edit the config of the Tasmota as well as it seems to be locked to 1883:

Nothing there needs changing. TH10 is another version Sonoff device, essentially a Sonoff Basic with temp sensor. If you tell the Tasmota firmware is running on a TH10 and not an S22 you may see temperature readings sent to the broker. The switch part will still work as Sonoff appear to have the same GPIO port for the relay on all devices.

You will have to change the HA YAML configuration to get the temperature.

I mentioned how I use node- red to see what is sent to the broker yesterday. Once you know what’s sent and to where, you can set up HA to read the temperature.

What changes do I need there?

I just found this thread. It will give you an idea.