Files
homeassistant/esphome/sonoff-plug-2.yaml
2021-11-21 22:49:46 -05:00

42 lines
553 B
YAML

esphome:
name: sonoff_switch_2
platform: ESP8266
board: esp01_1m
wifi:
ssid: "LANofOZ"
password: "@a1b2c3d4e5!"
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
web_server:
port: 80
binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
name: "Sonoff_switch_1_button"
on_press:
- switch.toggle: relay
switch:
- platform: gpio
name: "Sonoff_switch_1_relay"
pin: GPIO12
id: relay
status_led:
pin:
number: GPIO13
inverted: yes