Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to use one click , double , holed click for automation esphome
#6
this is 3 mode for KC868-A16S controller set by ESPHome:
1-click: toggle relay1
2-click: toggle relay2
3-click: toggle relay3
actually you can add 4-click, 5-click, 6-click, ........

tested with KC868-A16S
   

mainin use these code:

binary_sensor:
  - platform: gpio
    name: "a16s-input1"
    on_multi_click:
    - timing:
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at least 0.5s
      then:
        - switch.toggle: a16s_output3
    - timing:
        - ON for at most 0.5s
        - OFF for at most 0.5s
        - ON for at most 0.5s
        - OFF for at least 0.5s
      then:
        - switch.toggle: a16s_output2
    - timing:
        - ON for at most 0.5s
        - OFF for at least 0.5s
      then:
        - switch.toggle: a16s_output1
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 0
      mode: INPUT
      inverted: true


.txt   Made_for_ESPHome_KC868-A16S - multi-click.txt (Size: 6.28 KB / Downloads: 207)

sample config code from ESPHome github: https://github.com/jesserockz/esphome-co...utton.yaml
Reply


Messages In This Thread
RE: how to use one click , double , holed click for automation esphome - by admin - 06-05-2023, 02:05 AM

Forum Jump:


Users browsing this thread:
2 Guest(s)