用ESPHOME,写了点动开关,打算用来做远程电脑启动,因为我主板可以常5v,
但是现在问题是如果家里断电再来电的话,电脑就自己启动了。。。。
esphome:
name: mypc
platform: ESP8266
board: esp01_1m
wifi:
ssid: "Sma"
password: " "
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Mypc Fallback Hotspot"
password: "drxUFUpLxxD0"
# captive_portal:
# Enable logging
logger:
level: DEBUG
# Enable Home Assistant API
api:
ota:
#按键
# binary_sensor:
# - platform: gpio
# pin:
# number: GPIO0
# # mode: INPUT_PULLUP
# # inverted: True
# name: "Button"
# on_press:
# - switch.toggle: power
switch:
- platform: gpio
pin: GPIO0
id: power
inverted: yes
- platform: template
name: "Power"
icon: "mdi:power"
turn_on_action:
- switch.turn_on: power
- delay: 500ms
- switch.turn_off: power
status_led:
pin:
number: GPIO13
inverted: false
|