本帖最后由 ylilike 于 2023-5-25 17:52 编辑
switch:
- platform: gpio
name: relay_1
id: relay_1
pin:
number: D1
inverted: true
- platform: gpio
name: relay_2
id: relay_2
pin:
number: D2
inverted: true
binary_sensor:
- platform: gpio
pin: D5
name: "button1"
on_press:
then:
- switch.toggle: relay_1
- platform: gpio
pin: D6
name: "button2"
on_press:
then:
- switch.toggle: relay_2
|