Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Add support for Home Assistant event entities #24233

Merged
merged 4 commits into from
Nov 3, 2024

Conversation

mundschenk-at
Copy link
Contributor

@mundschenk-at mundschenk-at force-pushed the homeassistant-events branch 3 times, most recently from 2c7d7ca to e4e6d41 Compare October 6, 2024 11:48
@Koenkk
Copy link
Owner

Koenkk commented Oct 6, 2024

This looks like an alternative to MQTT device trigger. It's a bit unclear what exactly the pros/cons are.

I think this also deserves some docs here.

@mundschenk-at
Copy link
Contributor Author

I think at this point device triggers are somewhat deprecated (not officially, but the event entity is easier to work with when writing automations for multiple devices). With device triggers, when you change the underlying device, you can't reuse the triggers because the all have unique IDs, where as with an event entity you just need to change entity name (as long as the events are the same for the new device).

@thecode
Copy link

thecode commented Oct 6, 2024

This looks like an alternative to MQTT device trigger. It's a bit unclear what exactly the pros/cons are.

Historically HA team did not agree creating entities for things that are momentary (mostly push buttons style) since they create multiple events and there was an intention to reduce the number of states stored in the DB (so you mostly don't want to store push and release of each button), since device triggers was complicated and not intuitive for most users and storing states became more efficient HA team created the event entities.

Event entities are more trivial to understand, they are similar to other entities, they hold the time and event of the last event while device triggers are completely out of the state machine.

What I wrote above does not eliminate the need to document the new feature 😸

@mundschenk-at
Copy link
Contributor Author

I think this also deserves some docs here.

I have added a documentation PR: Koenkk/zigbee2mqtt.io#3112

@mundschenk-at mundschenk-at force-pushed the homeassistant-events branch 4 times, most recently from 93e8a21 to c8043ba Compare October 21, 2024 19:47
test/homeassistant.test.js Outdated Show resolved Hide resolved
@mundschenk-at mundschenk-at force-pushed the homeassistant-events branch 3 times, most recently from 587200f to 9681bb2 Compare October 26, 2024 20:59
@Koenkk Koenkk merged commit 848f250 into Koenkk:dev Nov 3, 2024
11 checks passed
@Koenkk
Copy link
Owner

Koenkk commented Nov 3, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants