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