Created
February 26, 2022 20:19
-
-
Save martinwoodward/b570bc0bc853e1b0b13bdaaf3bbf6f02 to your computer and use it in GitHub Desktop.
ESPHome recipie for sonoff basic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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