Sonoff Basic / ITEAD ESP8266

Flash ESPEasy with a FTDI adapter

pip3 install tasmotizer
chmod 777  /dev/ttyUSB0 
tasmotizer.py
Release 12.5.0
tasmota.bin
Tasmotizue!

Connect to temporary WiFi access point

SSID: ESP_0
pass: configesp

Configure connect to your WiFi access point

http://192.168.4.1/

Commands
# remove serial connector

# on
http://192.168.178.10/tools?cmd=gpio,12,1

# off
http://192.168.178.10/tools?cmd=gpio,12,0

Fix
Hidden rules page
http://192.168.178.10/rules

Debug

screen /dev/ttyUSB0 115200

Integrate to HomeAssistant
https://automation.baldacchino.net/flashing-tasmota-on-a-sonoff-basic-r4-connecting-to-home-assistant/

# configuration.yaml
switch:                         
  - platform: mqtt            
    unique_id: sonoff_poweroutlet
    name : "SonOff"           
    state_topic: "stat/device_name/POWER"
    command_topic: "cmnd/device_name/POWER"
    value_template: "{{ value_json.STATE }}"
    payload_on: "ON"          
    payload_off: "OFF"        
    state_on: "ON"            
    state_off: "OFF"          
    qos: 2 

Links
https://rutg3r.com/sonoff-firmware-tutorial-to-esp-easy/
https://wiki.fhem.de/w/index.php?title=Sonoff
https://wiki.fhem.de/wiki/Sonoff#Produkt.C3.BCbersichtsliste_sonoff
https://github.com/espressif/esptool
https://waschto.eu/easyesp
https://www.letscontrolit.com
https://github.com/arendst/Sonoff-MQTT-OTA
https://forum.fhem.de/index.php/topic,55036.90.html
http://captain-slow.dk/2016/05/22/replacing-the-itead-sonoff-firmware/
https://github.com/tasmota/tasmotizer