Advertisement
arushear

Untitled

Apr 7th, 2025
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.07 KB | None | 0 0
  1. binary_sensor:
  2.   - platform: gpio
  3.     pin:
  4.       number: GPIOXX
  5.       mode: INPUT_PULLUP
  6.       inverted: true
  7.     name: "Przycisk"
  8.     on_press:
  9.       - binary_sensor.template.publish:
  10.           id: btn_short
  11.           state: ON
  12.       - delay: 50ms
  13.       - binary_sensor.template.publish:
  14.           id: btn_short
  15.           state: OFF
  16.     on_double_click:
  17.       - binary_sensor.template.publish:
  18.           id: btn_double
  19.           state: ON
  20.       - delay: 50ms
  21.       - binary_sensor.template.publish:
  22.           id: btn_double
  23.           state: OFF
  24.     on_long_press:
  25.       - binary_sensor.template.publish:
  26.           id: btn_long
  27.           state: ON
  28.       - delay: 50ms
  29.       - binary_sensor.template.publish:
  30.           id: btn_long
  31.           state: OFF
  32.  
  33. binary_sensor:
  34.   - platform: template
  35.     id: btn_short
  36.     name: "Przycisk Short"
  37.     device_class: moving
  38.   - platform: template
  39.     id: btn_double
  40.     name: "Przycisk Double"
  41.     device_class: moving
  42.   - platform: template
  43.     id: btn_long
  44.     name: "Przycisk Long"
  45.     device_class: moving
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement