05-09-2023, 12:44 AM
1. on_double_click (Optional, Automation): An automation to perform when the button is pressed twice for specified periods of time. See on_double_click.
2. on_multi_click (Optional, Automation): An automation to perform when the button is pressed in a specific sequence. See on_multi_click.
here is esphome webpage details have showed: https://esphome.io/components/binary_sensor/index.html
3. about "hold on" , here is demo code for "hold on" change brightness.
on_press:
then:
- if:
condition:
light.is_off: light_1
then:
- delay: 2.5s
- while:
condition:
binary_sensor.is_on: light_1_touch
then:
- light.dim_relative:
id: light_1
relative_brightness: 5%
transition_length: 0.1s
- delay: 0.1s
2. on_multi_click (Optional, Automation): An automation to perform when the button is pressed in a specific sequence. See on_multi_click.
here is esphome webpage details have showed: https://esphome.io/components/binary_sensor/index.html
3. about "hold on" , here is demo code for "hold on" change brightness.
on_press:
then:
- if:
condition:
light.is_off: light_1
then:
- delay: 2.5s
- while:
condition:
binary_sensor.is_on: light_1_touch
then:
- light.dim_relative:
id: light_1
relative_brightness: 5%
transition_length: 0.1s
- delay: 0.1s