Sonoff T1 R2 Touch Wall Switch

esp8266 eu Comes with ESPHome switch

Notes

  • to boot chip (blue led blinking): connect ftdi
  • to enter flash mode (blue led not blinking): short resistor R19 to GND then connect ftdi

GPIO Pinout

2-Gang Version

PinFunction
GPIO0Touch Sensor 1 (HIGH = off, LOW = on)
GPIO9Touch Sensor 2 (HIGH = off, LOW = on)
GPIO5Relay 1
GPIO12Relay 2
GPIO13Status LED

1-Gang Version

PinFunction
GPIO0Touch Sensor (HIGH = off, LOW = on)
GPIO12Relay
GPIO13Status LED

Basic Configuration (2-Gang)

esphome:
  name: sonoff_t1_r2
  platform: ESP8266
  board: esp01_1m
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  fast_connect: true
api:
  encryption:
    key: !secret api_encryption_key
ota:
  password: !secret ota_secret
logger:
  esp8266_store_log_strings_in_flash: false
text_sensor:
  - platform: version
    name: Sonoff T1 R2 Version
sensor:
  - platform: uptime
    name: Sonoff T1 R2 Uptime
    update_interval: 60s
button:
  - platform: restart
    name: Sonoff T1 R2 Restart
switch:
  - platform: gpio
    name: Sonoff T1 R2 Switch 1
    pin: GPIO5
    id: relay_1
  - platform: gpio
    name: Sonoff T1 R2 Switch 2
    pin: GPIO12
    id: relay_2
binary_sensor:
  - platform: status
    name: Sonoff T1 R2 Status
  - platform: gpio
    name: Sonoff T1 R2 Touchpad 1
    pin:
      number: GPIO0
      mode: INPUT_PULLUP
      inverted: True
    on_press:
      - switch.toggle: relay_2
  - platform: gpio
    pin:
      number: GPIO9
      mode: INPUT_PULLUP
      inverted: True
    name: Sonoff T1 R2 Touchpad 2
    on_press:
      - switch.toggle: relay_1
status_led:
  pin:
    number: GPIO13
    inverted: True