本帖最后由 mimikiki 于 2025-3-8 02:46 编辑
switch:
- platform: gpio
pin: GPIO4
name: "lihgt"
id: relay_1
binary_sensor:
- platform: gpio
pin:
number: GPIO12
mode: INPUT_PULLUP
inverted: True
filters:
- delayed_on_off: 50ms
name: "button"
on_press:
then:
- switch.toggle: relay_1
灯直接接继电器上,开关一边接gnd一边接gpio12 |