-
-
Notifications
You must be signed in to change notification settings - Fork 266
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
(IKEA E1743) - Migrate to zigbee2mqtt MQTT device triggers (mqtt) #661
base: main
Are you sure you want to change the base?
Conversation
Preserving backwards compatability with zigbee2mqtt legacy entity action events (sensor.<DEVICE>_action) (legacy)
Hey @yarafie, thank you so much for your contribution! 🚀 🔄 We're currently running a few checks to make sure that everything is great with your contribution. Results are coming soon, stay tuned! |
Hey @yarafie, ❌ It looks like there are some issues with your contribution. Don't worry, here's some additional information and guidance on how to solve them.
Please fix reported issues, then submit your updates here. If you have any questions or doubts, you can always contact a project maintainer. :) Thanks! |
Hey @EPMatt, ✅ Your contribution passed all the checks, awesome! Thanks again for dedicating your precious time to this project. 🔥 📝 Updated blueprints included in this PR can be tested by importing them in Home Assistant via the following links. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for your contribution @yarafie! Finally your changes made to the original repo 🔥
For anyone following this thread:
- Changes included in this repo and submitted here are confirmed to match 1:1 what included in Update to support mqtt based triggers lsismeiro/awesome-ha-blueprints#33 for the
e1743.yaml
blueprint. - @Nicolai- tested the blueprint successfully and reported results here.
Changes approved!
name: (Optional)(Deprecated) Controller Entity | ||
description: >- | ||
The action sensor of the controller to use for the automation. Choose a value only if the remote is integrated with Zigbee2MQTT and Legacy Action Sensors are enabled. | ||
This input is deprecated in favor of the Controller Device input, and will be removed in a future release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yarafie I've taken care of updating docs, cleaning up comments, improving the description of inputs and including a couple of style improvements to the code that do not impact on the overall functionality or control logic.
Most importantly, I changed the description of this input in such a way that new users are highly discouraged on using it - while still giving time to current ones to migrate to device triggers with no disruptions.
Why such a "harsh" deprecation notice? It looks like Device Triggers were supported by Z2M for quite a long time , so we can safely assume that almost no-one is still running a version that does not support them. The backward compatibility problem here is with our users - which have the controller_entity
input configured, and want to update. Hence, here's why we still keep the input as is, but mark it as deprecated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EPMatt Regarding the docs. I noticed each <controller>.yaml has a corresponding <controller>.mdx.
Are these auto-generated or do they need to be updated manually?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yarafie unfortunately they are not auto generated, so I had to update them manually. Auto-generation is on my radar as an improvement 👍🏻
@yarafie do we have anyone that confirmed that automations break after updating the blueprint code? As far as I can tell, I don't see Breaking Changes - users that now rely on the |
Just came here to say you're doing some legendary work guys! Thank you so much for updating the blueprints I use everyday. Back to this repo for my E1743 and E2001/2002 blueprints and can't wait for the updates to come! Much appreciated. |
@EPMatt Not Really, No one has said anything. |
Hey @EPMatt, ✅ Your contribution passed all the checks, awesome! Thanks again for dedicating your precious time to this project. 🔥 📝 Updated blueprints included in this PR can be tested by importing them in Home Assistant via the following links. |
@yarafie I've just tried and I can confirm that this is a Breaking Change. Moreover, it looks the situation is worse than what I expected:
However, we don't know whether the device ID for Home Assistant Core is somewhat hard-coded, or if it's generated on the fly for each running instance. @yarafie could you please copy-paste the following template in the Developer Tools -> Template tab and check what's the result?
In this way, we can check whether your HA instance and mine have different device IDs for the "Home Assistant Core" device. If that's not the case, we might need to drop support for legacy |
Result null BTW: I'm running home assistant in a docker {{device_id("Home Assistant")}} Result bf536b8e91584191ce5131ffd063ebcf
Maybe split the blueprints into 2 for each controller. |
There is another option, which is MQTT Triggers which is another thing. It could be implemented as non breaking. But that require an text input, which the user has to fill in with a MQTT topic to listen for. And then the trigger would look like this. triggers:
# trigger for zigbee2mqtt topic
- trigger: mqtt
topic: !input mqtt_topic Since this new field would be a user typed text field, selecting a controller_device is necessary to be able to add the controller_id to the event data. |
Yes. You are correct that can also be done but user will need to correctly type the friendly name or it won't work. |
First, thanks for all the effort being put into this. Just wanted to comment that I'm not even sure a typical workflow for a user would be to update their blueprints (unless there's something broken or perhaps they were looking for a feature). So it might make sense to either fork or a breaking change for the sake of ease of use with the latest Z2M. Selecting items from a list would be far easier in my mind I don't think there's any provision for even knowing that a blueprint was updated or why from the source (only that you can blindly re-import it) so it's been a bit of a gap in HA functionality |
I agree with @BlueFyre, it's a manual process and a feature that was recently implemented and I'd bet many people don't even know it exists. Additionally, HA is warning that automations could actually break: |
I may have found a way around this, check the code snippet The thing is with the code snippet using MQTT messages is that the automation triggers on ANY ‘action’ message and only afterwards filters it via a condition.
|
@yarafie I think there is multiple things talking me way from that aproach, I'm pretty sure it could work tho.
The aproach with MQTT Trigger and the manual user input, I'm not a fan of either, but it has none of the above drawbacks. Since Z2M delayed removing the legacy triggers, maybe we should wait and see how the changes to "Events" will look in the future. |
Just for the sake of discussion comments below
can be an input text with default as zigbee2mqtt which is default anyways.
Absolutly correct. No disagreement here
Yes that is why I put the enhanced selector for each for user easy use.
I agree with all what you said. |
Hey there, thanks all for sharing these updates and your thoughts. I took some time to think about this, and I'm more and more leaning towards the "Breaking Change" option.
So, at this point, I'd proceed as follows:
I'm sure not everyone will be happy with this decision, but hopefully the great discussion we are having here will provide the motivation for the changes, and demonstrate how much we'd like an upgrade process as smooth as possible. Before proceeding, I'd love to hear back from you guys! |
Point 3 sounds reasonable to me, in order to use the latest version an upgrade to the blueprint is necessary and there's no way around that anyhow. Plus if anyone needs the old blueprint they can look to the repo for it (perhaps a git tag would be a good idea) |
Comments below each point
I do agree
Yes. It will be a matter of switch the legacy off again.
I agree.
I agree also.
I think we just make the decision announce it and move forward.
I'll update ikea_e1743.yaml sometime today with the changes mentioned above.
Send me the text of the warning message you want me to put, this I'll put in the changelog at the bottom of ikea_e1743.mdx
Let me know what and where you want me to put in the ikea_e1743.yaml
You can't please everyone :)
|
Hey @yarafie, thank you so much for your contribution! 🚀 🔄 We're currently running a few checks to make sure that everything is great with your contribution. Results are coming soon, stay tuned! |
@yarafie thanks for your feedback! I've updated blueprint version, added the changelog link and the breaking change notice in the changelog. I leave the removal of Don't worry about the failing CI check |
@EPMatt
also in hooks light, cover, media_player there is controller_entity shouldn't it be removed from there also? |
7dad729
to
a7f96ac
Compare
Hi! First of all thanks for the great work on the original blueprints as well as this port to Z2M v2.0! |
Waiting for @EPMatt owner of repo and author of the blueprints. I posted something in the discussions check it out. |
@yarafie thanks for your patience, and for wrapping up the last changes. |
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
Automations using this blueprint may break if you re-download the blueprint.
Proposed change*
With zigbee2mqtt version 2.x, legacy features are planned to be removed and are disabled by default if you have updated to zigbee2mqtt version 2.x.
Further information can be found in in the zigbee2mqtt discussion link below:
Zigbee2MQTT 2.0.0 breaking changes
Koenkk/zigbee2mqtt#24198
This Blueprint has been updated to make use of MQTT device triggers but also allow for the use of legacy entity action sensors (sensor.*_action) if you have legacy enabled (i.e. set to true) in your zigbee2mqtt configuration.
Checklist*
npm run format
before submitting my Pull Request.