esphome的config吗?就很简单,设置三个开关互锁的就可以了
switch:
- platform: gpio
pin: GPIO4
name: "Low"
id: relay1
interlock: [relay2,relay3]
interlock_wait_time: 1s
- platform: gpio
pin: GPIO13
name: "Medium"
id: relay2
interlock: [relay1,relay3]
interlock_wait_time: 1s
- platform: gpio
pin: GPIO15
name: "High"
id: relay3
interlock: [relay1,relay2]
interlock_wait_time: 1s
binary_sensor:
- platform: gpio
pin:
number: 12
mode:
input: true
pullup: true
icon: 'mdi:toggle-switch-variant'
name: Left Button
on_press:
then:
- switch.toggle: relay1
- platform: gpio
pin:
number: 14
mode:
input: true
pullup: true
icon: 'mdi:toggle-switch-variant'
name: Middle Button
on_press:
then:
- switch.toggle: relay2
- platform: gpio
pin:
number: 5
mode:
input: true
pullup: true
icon: 'mdi:toggle-switch-variant'
name: Right Button
on_press:
then:
- switch.toggle: relay3
|