06-03-2023, 07:28 PM
can write code example contains ( on_click - on_double_click - on_multi_click ) ?
i tryed but not work
i tryed but not work
Code:
binary_sensor:
- platform: gpio
# ...
on_click:
- min_length: 50ms
max_length: 350ms
then:
- switch.turn_off: relay_1
- min_length: 500ms
max_length: 1000ms
then:
- switch.turn_on: relay_1
Code:
- platform: gpio
# ...
on_double_click:
min_length: 50ms
max_length: 350ms
then:
- switch.turn_off: relay_1
Code:
binary_sensor:
- platform: gpio
# ...
on_multi_click:
- timing:
- ON for at most 1s
- OFF for at most 1s
- ON for 0.5s to 1s
- OFF for at least 0.2s
then:
- logger.log: "Double-Clicked"
Code:
on_multi_click:
- timing:
- ON for at most 1s
- OFF for at most 1s
- ON for at most 1s
- OFF for at least 0.2s
then:
- logger.log: "Double Clicked"
- timing:
- ON for 1s to 2s
- OFF for at least 0.5s
then:
- logger.log: "Single Long Clicked"
- timing:
- ON for at most 1s
- OFF for at least 0.5s
then:
- logger.log: "Single Short Clicked"