Advertisement
TehnoZet2

Untitled

Feb 4th, 2024 (edited)
746
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.47 KB | Source Code | 0 0
  1. binary_sensor:
  2. # Кнопка
  3.   - platform: gpio
  4.     pin:
  5.       number: 5
  6.       mode:
  7.        input: true
  8.        pullup: true
  9.     filters:      
  10.      - delayed_on: 10ms
  11.     name: "button"
  12.     id: button
  13.    
  14. # Нажатие кнопки переключает реле
  15.     on_click:
  16.       min_length: 30ms
  17.       max_length: 250ms
  18.       then:
  19.        - switch.toggle: relay
  20.  
  21. switch:
  22. # Реле
  23.   - platform: gpio
  24.     name: "relay"
  25.     pin: GPIO12
  26.     id: relay
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement