出於好奇我把您的yaml寫進一顆d1 mini (所有線都沒接),卻發現binary_sensor一直是ON的?
完整代碼如下:
substitutions:
device_name: 30dehumidifier
esphome:
name: ${device_name}
platform: ESP8266
board: d1_mini
logger:
api:
ota:
password: !secret wifi_pw
web_server:
port: 80
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_pw
ap:
ssid: ${device_name}_Fallback
password: !secret wifi_pw
captive_portal:
binary_sensor:
- platform: status
name: "${device_name} Status"
- platform: gpio
pin:
number: D1
mode: INPUT_PULLUP
name: "Power LED"
filters:
- delayed_off: 1200ms
- platform: gpio
pin:
number: D2
mode: INPUT_PULLUP
name: "Full LED"
filters:
- delayed_off: 1200ms
switch:
- platform: gpio
name: ${device_name}_relay
pin:
number: D3
inverted: true
id: relay
restore_mode: always_off
on_turn_on:
- delay: 250ms
- switch.turn_off: relay
- platform: restart
name: ${device_name}_restart
|