substitutions:
device_name: your_device_name
esphome:
name: ${device_name}
platform: ESP8266
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
password: "eb4756b27094e822ef78e32dadf46f20"
wifi:
ssid: "tp-67878"
password: "25963223"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "010101 Fallback Hotspot"
password: "kUx7FLDi1ax6"
captive_portal:
binary_sensor:
- platform: gpio
pin:
number: GPIO2
mode: INPUT
inverted: True
name: "${device_name}_1"
on_multi_click:
- timing:
- ON for at most 0.5s
- OFF for at least 0.2s
then:
- switch.toggle: load1 #################### 还是这一行报错。
- timing:
- ON for at most 0.5s
- OFF for at most 0.5s
- ON for at most 0.5s
- OFF for at least 0.2s
then:
- homeassistant.service:
service: switch.toggle
data:
entity_id: switch.sonoff_s20b #魚缸燈
- timing:
- ON for 1s to 3s
- OFF for at least 0.2s
then:
- homeassistant.service:
service: switch.toggle
data:
entity_id: switch.sonoff_basic134 #魚缸過濾