#not sure where exactly to ask this but
1 messages · Page 1 of 1 (latest)
- platform: template
name: Double Tap
id: double_tap
event_types:
- "double_tap_event"
# Optional variables:
icon: "mdi:switch"
device_class: "button"
on_event:
then:
- lambda: |-
ESP_LOGD("main", "Event %s triggered.", event_type.c_str());
binary_sensor:
- platform: gpio
pin:
number: GPIO14
mode: INPUT
id: button1
on_multi_click:
- timing:
- ON for at most 1s
- OFF for at least 0.5s
then:
- logger.log: "Single Clicked"
- switch.toggle: light_switch
- timing:
- ON for at most 1s
- OFF for at most 1s
- ON for at most 1s
- OFF for at least 0.1s
then:
- logger.log: "Double Tap Press"
- event.trigger:
id: double_tap
event_type: "double_tap_event"
# three second long press to reboot
- timing:
- ON for at least 5s
then:
- switch.toggle: reboot```
I thought it would show up when adding a Device automation trigger as another drop down option but that seems not to be how this works
Probably you want "manual_event" trigger
it sounded like, based on the page I linked, these are different event types though?
The trigger type is event.
The event_type is double_tap_event.
So I can't make device specific events without including/using/parsing a bunch of metadata about source from the automation? I guess i thought new event thing was supposed to make that easier
like.. if i have 10 of these light switches and i want to make a generic template for them that allows me to configure what they do when you tap or double tap
i'd need to make automations that would have to identify the source of the event and make a decision based on the source
Hm maybe I'm confused what you're doing.
The "new event thing" that I know of is event entities.
Does your device create an event entity?
https://esphome.io/components/event/index.html I'm following this which says Note Events in ESPHome are designed to trigger an action in Home Assistant, and have a unidirectional flow from ESPHome to Home Assistant. Home Assistant event entities are different from events on event bus. If you just want to trigger an event on the Home Assistant event bus, you should use a Home Assistant event instead.
the home assistant event entities are different from events on event bus which i think is what you're describing?
perhaps I need to make a virtual button instead
and make it press thatr virtual button when a double tap occurs
or switch rather
well that wouldnt work either hmm
Ok so that page you linked says that esphome will create an event entity.