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
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
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
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