Smart Home Automation Forum
lesson32 - set button work for latch,inching,momentary, Interlocking work mode by ESP - Printable Version

+- Smart Home Automation Forum (https://www.kincony.com/forum)
+-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=1)
+--- Forum: Home automation training courses (https://www.kincony.com/forum/forumdisplay.php?fid=18)
+--- Thread: lesson32 - set button work for latch,inching,momentary, Interlocking work mode by ESP (/showthread.php?tid=1992)



lesson32 - set button work for latch,inching,momentary, Interlocking work mode by ESP - admin - 06-17-2022

1. latch mode: Button1

    on_press:
      then:
      - switch.toggle: e16s_output1


2. inching mode: Button2

    on_press:
      then:
      - switch.turn_on: e16s_output2
    on_release:
      then:
      - switch.turn_off: e16s_output2 


3. momentary mode: Button3

    on_turn_on:
    - delay: 1000ms
    - switch.turn_off: e16s_output3


4. interlocking mode: Button4-Button5

interlock: [e16s_output5]

interlock: [e16s_output4]


.txt   KC868-E16S-ESPHome-Config-buttons-work-mode.txt (Size: 6.36 KB / Downloads: 378)


RE: lesson32 - set button work for latch,inching,momentary, Interlocking work mode by ESP - engmohades - 05-08-2023

thank you

how i use double click , Long Clicked  and  Multi click input switch for scine mode ?


RE: lesson32 - set button work for latch,inching,momentary, Interlocking work mode by ESP - admin - 05-09-2023

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