Replies: 4 comments 6 replies
-
Does Z2M send events entities now ? |
Beta Was this translation helpful? Give feedback.
-
Great suggestion. I'm new to Z2M and I was looking for something similar of what's done with Deconz integration: a button press sends an event on the event bus on HA. It's so easy to use in automations...
As HA users, we know that the device trigger is sadly the worst method in the long term and it should not be recommended. Current method with states (the state value is cleared immediately after the value is set):
The shortest equivalent (mono button device, any click type trigger), with the support of the Event entity, would be:
The state of an Event entity is always the timestamp of the last event for a button. Sample for Fibaro (Z-Wave JS) that now creates event entities: It's possible to support multiple buttons with trigger IDs and multiple types of button press with a conditional switch.
Detailed examples and documentation: |
Beta Was this translation helpful? Give feedback.
-
Do you know of any updates related to adding this functionality to Zigbee2MQTT? |
Beta Was this translation helpful? Give feedback.
-
I have created a PR. |
Beta Was this translation helpful? Give feedback.
-
Home Assistant has added a new entity type called event entities. It was merged in home-assistant/core#96797 and was released in HA 2023.8. This entity type makes it easier for users to discover the events available on a device and create automations involving them.
On this documentation page, Zigbee2MQTT currently suggests using device triggers as the recommended way to listen to events from a Zigbee device. It would be awesome if Zigbee2MQTT could support event entities as a new way to accomplish this. The event entity could replace the legacy sensor entity (
legacy_triggers: true
), and potentially the device triggers as well, since I assume that HA will automatically generate device triggers for the event entities on a device.HA has added support for event entities in the MQTT integration in this PR: home-assistant/core#96876
Beta Was this translation helpful? Give feedback.
All reactions