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

add support for event entities #644

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

add support for event entities #644

wants to merge 2 commits into from

Conversation

xeaon
Copy link

@xeaon xeaon commented Jan 6, 2025

Thank you for taking the time to work on a Pull Request. Your contribution is really appreciated! 🎉
Please don't delete any part of the template, since keeping the provided structure will help maintainers to review your work more rapidly.

Sections marked as * are required and need to be filled in.

Breaking change

This change requires you to enable Home Assistant experimental event entities in Zigbee2MQTT. Enabling this experimental features may break you current automations, dashboards, etc.

Enabling event entities
image

Event entities in HA
image

image

Trace of working automation
image

Proposed change*

This change allows to make use of event entities in HA. Enabling Home Assistant experimental event entities in Zigbee2MQTT will add event entities to your devices, like the ikea_e1744, which we can utilize to define the Controller Entity in this blueprint.

Checklist*

  • I followed sections of the Contribution Guidelines relevant to changes I'm proposing.
  • I properly tested proposed changes on my system and confirm that they are working as expected.
  • I formatted files with Prettier using the command npm run format before submitting my Pull Request.

this commit allows to migrate from z2m legacy triggers to experimental event entities
Copy link
Contributor

github-actions bot commented Jan 6, 2025

Hey @xeaon, thank you so much for your contribution! 🚀

🔄 We're currently running a few checks to make sure that everything is great with your contribution.
If further actions need to be performed before your contribution can be reviewed, additional guidance will be provided to you in the next comment.

Results are coming soon, stay tuned!

@xeaon
Copy link
Author

xeaon commented Jan 6, 2025

fixes #622

Copy link

@LaStrada LaStrada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested the changes, and it works! Added a comment

# only for zigbee2mqtt, check if the event is relative to a real state change, and not only some minor changes in the sensor attributes
# this is required since multiple state_changed events are fired for a single button press, with the result of the automation being triggered multiple times
- '{{ integration_id != "zigbee2mqtt" or trigger.event.data.new_state.state != trigger.event.data.old_state.state }}'
# - '{{ integration_id != "zigbee2mqtt" or trigger.event.data.new_state.attributes.event_type != trigger.event.data.old_state.attributes.event_type }}'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this commented out? Isn't this needed anymore?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

afaict there is no need for this line. i'm testing this for about a week now and everything works as expected

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.

2 participants