Hello,
I read about the relatively new Event component, and I understand the concept that a momentary switch (like in my case the doorbell button) is considered as a stateless thing that kicks off events. I don’t understand how to do this.
The documentation doesn’t reveal which platforms event can have:
It looks like there’s only one event platform available, event.template.
From how I understand it, you use it to define events for later use. So to get it working with a GPIO pin, it seems like you need to do something like this:
Ok, thanks, I can confirm that this works - somehow
I see in the logs of the ESP that it triggers the event. But I didn’t succeed to catch that in Home Assistant. I tired an automation with an even trigger:
The event type in the HA automation is the same literal as in the ESP, but nothing happens. I also tried to find it somewhere in the developer tools, but couldn’t see it. I guess I have to try more when I feel more motivated.
It feels a bit odd and over-complicated to use a stateful binary senor, hide that (internal: true) and to define an event template and trigger that event from the binary sensor … that is a lot more to do and more potential for failures. And I do not see the benefit of this approach. With my current knowldge about the event thing it appears much better to just use a binary sensor. Anything I’m missing?
You can enable the event logger (Developer Tools > Events) to see if the events actually appear on the bus.
As for this feeling odd and over-complicated: I completely agree. But I don’t know if this is the actual intended use for events, it’s just one way I found to get it working. I might be missing something too