Initial commit

This commit is contained in:
Andrej Friesen 2021-09-26 15:34:48 +02:00
commit 0d33904f88
2 changed files with 50 additions and 0 deletions

4
README.md Normal file
View File

@ -0,0 +1,4 @@
# pc-switch
ESPHome powered switch to turn on/off your PC.

46
esphome.yaml Normal file
View File

@ -0,0 +1,46 @@
esphome:
name: pc-switch
platform: ESP8266
board: nodemcuv2
# Enable logging
logger:
# Enable Home Assistant API
api:
# Put ota password here
ota:
password: ""
# Your wifi config
wifi:
# ssid: ""
# password: ""
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "PC-Switch Fallback Hotspot"
password: "fallback-wifi"
captive_portal:
switch:
- platform: gpio
pin: D6
id: power
name: "Power toogle"
icon: "mdi:PC"
on_turn_on:
- delay: 300ms
- switch.turn_off: power
- platform: gpio
pin: D6
id: force_power
name: "Force power off"
icon: "mdi:PC"
on_turn_on:
- delay: 5000ms
- switch.turn_off: force_power