请教一下各位达人
因为现在开始在学玩ESPHOME
我想把HA的自动化改到ESPHOME里
场景是白天温度在30度以上时
每5分钟开启喷雾10秒
温度低于28.5度则关闭
在网上找了很久东抄西抄还是搞不定
只好厚着脸皮来这边求助
sensor:
- platform: dht #溫濕度模組外
model: DHT22
pin: 6
temperature:
name: temperature-1
on_value_range:
- above: 30.0 # 高於xx然後打開relay3
then:
- script.execute: my_script
- below: 28.5 # 低於xx然後關閉relay3
then:
- script.stop: my_script
humidity:
name: humidity-1
update_interval: 5s
switch:
- platform: gpio
pin: 0
name: Relay3
id: relay3
# Example configuration entry
script: # 腳本
- id: my_script
then:
- switch.turn_on: relay3
- delay: 3s
- switch.turn_off: relay3
- delay: 5s
- switch.turn_on: relay3
- delay: 3s
- switch.turn_off: relay3
- delay: 5s
- switch.turn_on: relay3
- delay: 3s
- switch.turn_off: relay3
- delay: 5s
|