New Component - Sonoff S20 running ESPEasy

Cool, if you want to use the built in component you just need to put…

mqtt:

in your config yaml as you said, if you want to use the hass.io addon instead just install it and start it, then add…

mqtt:
  broker: core-mosquitto

to your config yaml, then add this to your switches or lights…

- platform: mqtt
  name: "Sonoff"
  command_topic: "cmnd/sonoff/power"
  state_topic: "stat/sonoff/POWER"
  qos: 1
  payload_on: "ON"
  payload_off: "OFF"
  retain: true

The “sonoff” in the two topic lines lines is what you call the Sonoff in it’s config, either when flashing or in the web interface after, just make sure they match. Adding another just by changing that name.

When you flash it in user_config.h you can prefill the name at #define project, it will default to ‘sonoff’ which is why most people just add a number after for new ones, your wifi ssid at #define STA_SSID1 and password under it at #define STA_PASS1. Scroll down a little bit to the second #define MQTT_HOST and put your Pi’s IP address in. I’ve ringed what you need to change below…

After a successful flash it should just work, nothing else needed, you can tweak the config in the Sonoff’s built in web page if you want to as well as change anything you may have incorrectly entered in the config :slight_smile:

That’s literally it, good luck :+1: