Skip to content

Instantly share code, notes, and snippets.

@martinwoodward
Created February 26, 2022 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinwoodward/b570bc0bc853e1b0b13bdaaf3bbf6f02 to your computer and use it in GitHub Desktop.
Save martinwoodward/b570bc0bc853e1b0b13bdaaf3bbf6f02 to your computer and use it in GitHub Desktop.
ESPHome recipie for sonoff basic
esphome:
name: router-booter
on_boot:
then:
- switch.turn_on: relay
esp8266:
board: esp8285
ota:
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
api:
logger:
binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode:
input: true
pullup: true
inverted: true
name: "button"
on_press:
- switch.toggle: relay
switch:
- platform: gpio
name: "Router power"
pin: GPIO12
id: relay
- platform: template
icon: mdi:restart
name: "Router reboot"
turn_on_action:
- switch.turn_off: relay
- delay: 15s
- switch.turn_on: relay
status_led:
pin:
number: GPIO13
inverted: yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment