- 积分
- 790
- 金钱
- 668
- 威望
- 0
- 贡献
- 0
- HASS币
- 0
高级会员
- 积分
- 790
- 金钱
- 668
- HASS币
- 0
|
发表于 2023-5-12 17:29:44
|
显示全部楼层
本帖最后由 taida 于 2023-5-12 17:36 编辑
继电器A常开接继电器2公共,我这样互锁的,esphome中,代码这样互锁:switch:
- platform: restart
name: "rst_esp32_fan"
- platform: gpio
name: "fanlow"
pin: 16
id: low
interlock: [mid, fast]
- platform: gpio
name: "fanmid"
pin: 14
id: mid
interlock: [low, fast]
- platform: gpio
name: "fanfast"
pin: 12
id: fast
interlock: [low, mid]
- platform: gpio
name: "fanshakes"
pin: 13
id: fanshakes
binary_sensor:
- platform: gpio
pin:
number: GPIO5
mode: INPUT_PULLUP
inverted: True
name: "fasttouch"
filters:
- delayed_on_off: 100ms
on_state:
then:
- switch.turn_off: fast
- switch.turn_off: mid
# - switch.turn_off: fanshakes
- switch.toggle:
id: low
用gmshiwoge 大佬的帖子https://bbs.hassbian.com/forum.php?mod=viewthread&tid=12361&highlight=%E6%99%AE%E9%80%9A%E9%A3%8E%E6%89%87
|
|