On_click push button

I try to use the example from esphone to use one button for 2 functions.

First function to toggle a light ( short click)

Second function to do all the lights out and one light one for some time ( long click.)

Short click works, but long click doensn’t


binary_sensor:

  - platform: gpio
    name: "S14-gang" # gang + all off
    pin:
      pcf8574: inputs_A
      number: 5
      mode: INPUT
      inverted: true
    on_click:
      - min_length: 50ms
        max_length: 350ms
        then:
          - switch.toggle : L11
      - min_length: 1000ms
        max_length: 3000ms
        then:
          - switch.turn_off: L1
          - switch.turn_off: L2
          - light.turn_off: L3
          - switch.turn_on: L11
          - delay: 2min
          - switch.turn_off: L11  

What you get on esphome logs?

where to find these logs ?

Where you upload the code..


It’s 2 to the right of edit

Are you holding the button down for 2-3 seconds ? That seems like rather a long time to press a button.

Minimum length is 1s, not 2s. Sounds like a perfectly reasonable hold duration to me

    # ...
    filters:
      - delayed_on_off: 30ms
    on_multi_click:
       - timing:
           - ON for at most 0.35s
         then:
         ...
       - timing:
           - ON for at least 1s
         then:
         ...