Hi,
I have been using esphome with mqtt and fhem for several years now.
Now I am trying HA as well.
I have many buttons implemented in esphome. Those buttons have click, double-click, long-press and so on actions.
When using mqtt I can simply publish like this:
binary_sensor:
- platform: gpio
id: tasteroben_button01
pin:
number: GPIO13
inverted: true
mode:
input: true
pullup: true
name: "tasteroben_button01"
filters:
- delayed_on: 30ms
on_multi_click:
- timing:
- ON for at most 1s
- OFF for at most 1s
- ON for at most 1s
- OFF for at least 0.2s
then:
- logger.log: "Double Clicked"
- mqtt.publish:
topic: toben/state/btn_01
payload: "doubleclick"
- timing:
- ON for 1s to 2s
- OFF for at least 0.5s
then:
- logger.log: "Single Long Clicked"
- mqtt.publish:
topic: toben/state/btn_01
payload: "longclick"
- timing:
- ON for at least 2.2s
then:
- logger.log: "Click and Hold"
- mqtt.publish:
topic: toben/state/btn_01
payload: "clickhold"
- timing:
- ON for at most 1s
- OFF for at least 0.5s
then:
- logger.log: "Single Short Clicked"
- mqtt.publish:
topic: toben/state/btn_01
payload: "click"
But I am a little bit confused how to get this payloads directly to HA without using mqtt?
Probably this is a stupid question, but I did not really find anything on that…
Best regards and thanks in advance,
Otto