This device cannot be converted to ESPHome using tuya-convert.
You must remove the cover and use the serial header for first upload. Hold down the button while powering on the device to put it into bootloader mode.
|GPIO0||Push Button (HIGH = off, LOW = on)|
|GPIO12||Relay and its status LED|
|GPIO13||Green LED (HIGH = off, LOW = on)|
|GPIO1||RX pin (for external sensors)|
|GPIO3||TX pin (for external sensors)|
Edit this page on GitHub
# Basic Configesphome:name: sonoff_s31platform: ESP8266board: esp01_1mwifi:ssid: !secret wifi_ssidpassword: !secret wifi_passwordlogger:baud_rate: 0 # (UART logging interferes with cse7766)# Remove this line if you're not using Home Assistsant or your switch will restart every now and againapi:ota:# Device Specific Configuart:rx_pin: RXbaud_rate: 4800binary_sensor:- platform: gpiopin:number: GPIO0mode: INPUT_PULLUPinverted: Truename: "Sonoff S31 Button"on_press:- switch.toggle: relay- platform: statusname: "Sonoff S31 Status"sensor:- platform: wifi_signalname: "Sonoff S31 WiFi Signal"update_interval: 60s- platform: cse7766current:name: "Sonoff S31 Current"accuracy_decimals: 1voltage:name: "Sonoff S31 Voltage"accuracy_decimals: 1power:name: "Sonoff S31 Power"accuracy_decimals: 1id: my_power- platform: total_daily_energyname: "Sonoff S31 Daily Energy"power_id: my_powerswitch:- platform: gpioname: "Sonoff S31 Relay"pin: GPIO12id: relayrestore_mode: ALWAYS_ONtime:- platform: sntpid: my_timestatus_led:pin:number: GPIO13inverted: True