本帖最后由 phofun 于 2022-9-18 09:40 编辑
我是這樣做啦
esphome:
name: xxxxxxxx
# 啟動後 關閉 LCD
on_boot:
- priority: 5000
then:
- output.turn_off: onbaord_led
# 略
interval:
# 定義ESP8266版上LED關閉,假設 wifi 連接就關閉
- interval: 10s
then:
if:
condition:
wifi.connected:
then:
- output.turn_off: onbaord_led
else:
- output.turn_on: onbaord_led
output:
- platform: esp8266_pwm
id: onbaord_led
pin: GPIO2
inverted: True
light:
- platform: monochromatic
output: onbaord_led
name: "Onboard LED"
不知道對大家有沒有幫助 |