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

Bug - Z2M 2.0 will break all blueprints in January 2025 #622

Open
1 task
dagstuan opened this issue Dec 1, 2024 · 46 comments
Open
1 task

Bug - Z2M 2.0 will break all blueprints in January 2025 #622

dagstuan opened this issue Dec 1, 2024 · 46 comments
Labels
blueprint An issue related to a blueprint bug Something isn't working

Comments

@dagstuan
Copy link

dagstuan commented Dec 1, 2024

Blueprint name

All blueprints

Home Assistant Core Version

Home Assistant Installation Type

Home Assistant Core

Description

As mentioned in the latest release notes: Zigbee2MQTT 2.0 is planned to be released in January 2025. It will remove the homeassistant_legacy_triggers currently required to trigger these blueprints. Hopefully they can be updated in time.

Zigbee2MQTT docs suggest moving to MQTT device triggers instead of the sensor.*-triggers. Docs for breaking changes are here.

I saw #244 but I figured it would be nice with a new issue for visibility, since that one is quite old.

Automation YAML config

-

To Reproduce

Upgrade to Z2M 2.0

Expected behavior

Blueprints supporting MQTT device triggers.

Actual Behaviour

Currently no support for MQTT device triggers.

Additional Details

  • I'd like to help developing a fix for this issue.

Screenshots

No response

Additional context

No response

@dagstuan dagstuan added blueprint An issue related to a blueprint bug Something isn't working labels Dec 1, 2024
@ant1fr
Copy link

ant1fr commented Dec 30, 2024

Hi. Any news regarding this bug? I dropped the legacy mode in Z2M in preparation for Z2M 2.0...

@oskari
Copy link

oskari commented Dec 30, 2024

Probably wise to start migrating away, as the repo seems to be dead for quite a while now: #554

@ant1fr
Copy link

ant1fr commented Dec 30, 2024

Thanks @oskari . But sad to hear :(

@yarafie
Copy link
Contributor

yarafie commented Dec 30, 2024

There is a fork that is working on updating the blueprints (controllers) to work with z2m 2.0.0

lsismeiro#26

BTW: Currently z2m devs are delaying the removal of legacy triggers from the 2.0.0 version

@EPMatt
Copy link
Owner

EPMatt commented Jan 2, 2025

Hey there,
first of all thanks everyone for your kind patience - life happens, and unfortunately I couldn't contribute at all to this project for a long time. Luckily, I'm hopefully now slowly getting back to be more active here.

Thank you all for your continuous support - can't believe we are getting close to 900 stars! Let's bring Awesome HA Blueprints back to life! 🔥

@EPMatt
Copy link
Owner

EPMatt commented Jan 2, 2025

I might get to work on this in the following days. It looks like someone opened a PR some time ago with support for Direct Triggers for one of our blueprints.

#602

I will replicate the change to all blueprints, also making sure we provide backward compatibility to people still on Z2M <2.0.0.

Anyone here willing to help me test out the fix for at least a few controllers once the PR is ready?

@yarafie
Copy link
Contributor

yarafie commented Jan 3, 2025

I might get to work on this in the following days. It looks like someone opened a PR some time ago with support for Direct Triggers for one of our blueprints.

#602

I will replicate the change to all blueprints, also making sure we provide backward compatibility to people still on Z2M <2.0.0.

Anyone here willing to help me test out the fix for at least a few controllers once the PR is ready?

@EPMatt

There is a fork that is working on updating the blueprints (controllers) to work with z2m 2.0.0 with backwards compatibility.

https://github.com/lsismeiro/awesome-ha-blueprints

BTW: Currently z2m devs are delaying the removal of legacy triggers from the 2.0.0 version

@hvorragend
Copy link

I can warmly recommend this fork.
I myself also use the repositories from yarafie and lsismeiro in my HA installations.

@EPMatt
Copy link
Owner

EPMatt commented Jan 3, 2025

Thanks for pointing me out to the fork. Love the work you've done there guys!

I totally understand how upsetting it must have been for you all, users and supporters, to see this project fall into oblivion. I'm honestly left speechless by looking at the efforts and time everyone here put to keep the project alive while I was away. This simply shows how much you care about Awesome HA Blueprints, and motivates me to bring my contributions and time back to this project. Thank you so much! 🔥

I can see the fix for this bug is going strong in the fork. So, I'd be really happy to join efforts and gradually bring the development back to the main repo here. Let's discuss how to better approach this!

@SHxKM
Copy link

SHxKM commented Jan 3, 2025

I can warmly recommend this fork. I myself also use the repositories from yarafie and lsismeiro in my HA installations.

Any way to migrate sanely? I'm using this (the legacy version) for over 20 Phillips remotes and not looking forward to setting everything up from scratch again.

@richie80
Copy link

richie80 commented Jan 4, 2025

You can 'fix' your blueprints after migrating to 2.0.0 with checking this box:
image

@SHxKM
Copy link

SHxKM commented Jan 4, 2025

Thanks. But doesn't the light hook depend on entity attributes which are also gone?

@d33c0n
Copy link

d33c0n commented Jan 4, 2025

@SHxKM the setting @richie80 mentioned in Zigbee2Mqtt brings them back (for now).

@yarafie
Copy link
Contributor

yarafie commented Jan 4, 2025

A few of us are working on a solution to prepare for z2m 2.x that will also be backwards compatible with z2m 1.x.

@SHxKM
Copy link

SHxKM commented Jan 4, 2025

@SHxKM the setting @richie80 mentioned in Zigbee2Mqtt brings them back (for now).

Action sensors are not the same as entity attributes.

@theincogtion
Copy link

Just updated Z2m and this one is broken:
https://epmatt.github.io/awesome-ha-blueprints/docs/blueprints/controllers/ikea_e2001_e2002/

@d33c0n
Copy link

d33c0n commented Jan 4, 2025

@SHxKM sorry, missed that you were talking about attributes, but I guess then the answer to your question is no. The light and control hook need the action sensor, which is being brought back by that setting, have it working on my end.

@SHxKM
Copy link

SHxKM commented Jan 4, 2025

@SHxKM sorry, missed that you were talking about attributes, but I guess then the answer to your question is no. The light and control hook need the action sensor, which is being brought back by that setting, have it working on my end.

That's interesting, because this is what I get when I disable the legacy attributes in Z2M:

Template variable warning: None has no element 0 when rendering '{{ [((state_attr(light,"hs_color")[0] or 0) + 15) % 360, 100] }}'

And as you can see, this is part of the light hook:

- service: light.turn_on
data:
hs_color: '{{ [((state_attr(light,"hs_color")[0] or 0) + 15) % 360, 100] }}'
transition: 0.25
entity_id: !input light

@catch-33
Copy link

catch-33 commented Jan 4, 2025

You can 'fix' your blueprints after migrating to 2.0.0 with checking this box: image

Wherre can I find this setting?

@SHxKM
Copy link

SHxKM commented Jan 4, 2025

You can 'fix' your blueprints after migrating to 2.0.0 with checking this box: image

Wherre can I find this setting?

Zigbee2MQTT → [Cog Icon] → Settings → Home Assistant Integration

@d33c0n
Copy link

d33c0n commented Jan 4, 2025

@SHxKM I double checked on my end, that attribute is still there in Z2M 2.0 even with the legacy action sensor option in Z2M unchecked:

image

@SHxKM
Copy link

SHxKM commented Jan 4, 2025

@SHxKM I double checked on my end, that attribute is still there in Z2M 2.0 even with the legacy action sensor option in Z2M unchecked:

That's because it goes away (or at least: HA prints an error about it not being available) after you change homeassistant_legacy_entity_attributes to false. Which is precisely my point: actions aren't the only thing that will be missing.

@d33c0n
Copy link

d33c0n commented Jan 4, 2025

@SHxKM do you happen to have some documentation about these options? I am confused by now. I didn't really dig into this, but in my understanding these options were only needed to prep your Z2M <2.0 for the upgrade, I believe they were even automatically removed from the config.yml during the update.

Nevertheless, I addedd them back in now and still see all the attributes. I also couldn't find the error message you had in my logs.

@lyricnz
Copy link

lyricnz commented Jan 5, 2025

My hooks are all broken (from hue switch) after the upgrade, even with legacy turned on. I suspect the event is missing some data which the blueprint depends on? Regardless, I've switched to a simpler solution https://community.home-assistant.io/t/very-easy-custom-philips-hue-dimmer-switch-for-z2m-zigbee2mqtt/521205/6 and may come back if it gets fixed.

@yarafie
Copy link
Contributor

yarafie commented Jan 5, 2025

If anyone is up to testing, check this branch

https://github.com/lsismeiro/awesome-ha-blueprints

We are working to add z2m 2.x support and discussions with @EPMatt are ongoing to see how to merge back into the main branch

@SHxKM
Copy link

SHxKM commented Jan 5, 2025

My hooks are all broken (from hue switch) after the upgrade, even with legacy turned on. I suspect the event is missing some data which the blueprint depends on? Regardless, I've switched to a simpler solution https://community.home-assistant.io/t/very-easy-custom-philips-hue-dimmer-switch-for-z2m-zigbee2mqtt/521205/6 and may come back if it gets fixed.

Same here. Really weird. I don't want to change to the new solution in https://github.com/lsismeiro/awesome-ha-blueprints because I think relying on Device IDs/triggers is not an ideal solution. I'd rather stay with the deprecated actions for now.

@SHxKM
Copy link

SHxKM commented Jan 5, 2025

@SHxKM sorry, missed that you were talking about attributes, but I guess then the answer to your question is no. The light and control hook need the action sensor, which is being brought back by that setting, have it working on my end.

Is it working with the code in this repo? because I just upgraded to 2.0.0 and nothing is working. (I enabled legacy actions)

@lyricnz
Copy link

lyricnz commented Jan 5, 2025

Is it working with the code in this repo? because I just upgraded to 2.0.0 and nothing is working. (I enabled legacy actions)

Nope, it's broken for the moment - but I see commits actively being made as I write this. Watch this space.

@chpego
Copy link

chpego commented Jan 5, 2025

Thank you all for your continuous support - can't believe we are getting close to 900 stars! Let's bring Awesome HA Blueprints back to life! 🔥

boom!
image

@ctournayre
Copy link

@SHxKM sorry, missed that you were talking about attributes, but I guess then the answer to your question is no. The light and control hook need the action sensor, which is being brought back by that setting, have it working on my end.

Is it working with the code in this repo? because I just upgraded to 2.0.0 and nothing is working. (I enabled legacy actions)

If you enabled legacy actions, you have to relink the controler field to the good controler entity in the 2 automations created from the blueprints

@EPMatt
Copy link
Owner

EPMatt commented Jan 7, 2025

For anyone looking for a solution without legacy triggers enabled - @yarafie is working on that here, hopefully we're gonna bring that to you in a PR to this repo soon!

@EPMatt
Copy link
Owner

EPMatt commented Jan 7, 2025

boom! image

Amazing @chpego! 🔥 Thank you all for your incredible support!
Can we make it to 1k? 😎

@arsenicks
Copy link

Just wanted to chip in with a temporary solution, I've put the opposite of what was suggested in Zigbee2MQTT 2.0.0 breaking changes #24198 so false to true and everything work like it was before the upgrade.

From the doc:

In order to get the minimal amount of breaking changes when upgrading from 1.x.x to 2.0.0, make sure you have the following in your Zigbee2MQTT configuration.yaml:

advanced:
  homeassistant_legacy_entity_attributes: false
  homeassistant_legacy_triggers: false
  legacy_api: false
  legacy_availability_payload: false
device_options:
  legacy: false

change false to true, I don't know if all those options are required but at least it's a fix for now untill you guy's can upgrade the code!

@GamesBondNL
Copy link

Just wanted to chip in with a temporary solution, I've put the opposite of what was suggested in Zigbee2MQTT 2.0.0 breaking changes #24198 so false to true and everything work like it was before the upgrade.

Thanks! Will give that a try over the weekend. The recommendation to switch to 2.0.0 cold turkey and disable all the legacy stuff seems a bit rigorous for a non-developer setup

@arsenicks
Copy link

Thanks! Will give that a try over the weekend. The recommendation to switch to 2.0.0 cold turkey and disable all the legacy stuff seems a bit rigorous for a non-developer setup

Yeah it is but this message was back in october so I think the idea was, disable all the legacy stuff so you'll see what will break before 2.0 comes in. As we can see not many of us did it back then so here we are :P

@EPMatt
Copy link
Owner

EPMatt commented Jan 9, 2025

For anyone following this thread: Initial PR for MQTT Device triggers for the IKEA E1743 has been opened. 🔥
#661

As soon as we merge that, we are gonna follow up with PRs for all the other controllers.
Thanks for everyone who is contributing to the discussion here. Fix is coming so stay tuned! We are gonna need some kind help for testing the updated blueprints when the new PRs for the other controllers are ready, I will notify you here. :)

@GamesBondNL
Copy link

For anyone following this thread: Initial PR for MQTT Device triggers for the IKEA E1743 has been opened. 🔥 #661

As soon as we merge that, we are gonna follow up with PRs for all the other controllers. Thanks for everyone who is contributing to the discussion here. Fix is coming so stay tuned! We are gonna need some kind help for testing the updated blueprints when the new PRs for the other controllers are ready, I will notify you here. :)

Thanks! Will be happy to test E2001/E2002 remotes :)

@theincogtion
Copy link

E2002 is working fine for me! Waiting for e1810 now 👍

@GamesBondNL
Copy link

E2002 is working fine for me! Waiting for e1810 now 👍

Did you enable any of the legacy stuff? If I disable all the legacy stuff in Z2MQTT 1.4 already E2002 stops working as the sensor.XXX bit is no longer functioning

@theincogtion
Copy link

theincogtion commented Jan 11, 2025

E2002 is working fine for me! Waiting for e1810 now 👍

Did you enable any of the legacy stuff? If I disable all the legacy stuff in Z2MQTT 1.4 already E2002 stops working as the sensor.XXX bit is no longer functioning

Yes legecy I disabled and I manually had to remove the action sensor in the blueprint .
My version ist
Version 2025.01.07 - Added support for z2m 2.x mqtt device triggers - yarafie

@GamesBondNL
Copy link

Version 2025.01.07

Where did you find version 2025.01.07? The latest in this repository is 2025.01.03

@theincogtion
Copy link

Version 2025.01.07

Where did you find version 2025.01.07? The latest in this repository is 2025.01.03

From here
https://github.com/lsismeiro/awesome-ha-blueprints/tree/main/blueprints/controllers/ikea_e2001_e2002
But this looks like the old version again. @yarafie
Not sure why but they are working on merging the repos

@yarafie
Copy link
Contributor

yarafie commented Jan 11, 2025

Sorry guys.
I'm sure there is lots of confusiion due to the different versions out there.
That's why I deleted my fork of lsismeiro and forked with EPMatt. We R just discussing a few things as we R finding some hurdles trying to avoid breaking changes.
Hope u guys can be a little patient.

@theincogtion
Copy link

Sorry guys. I'm sure there is lots of confusiion due to the different versions out there. That's why I deleted my fork of lsismeiro and forked with EPMatt. We R just discussing a few things as we R finding some hurdles trying to avoid breaking changes. Hope u guys can be a little patient.

Thanks for your work and the clarification.
Patients is hard but I try 😉

@GamesBondNL
Copy link

Sorry guys. I'm sure there is lots of confusiion due to the different versions out there. That's why I deleted my fork of lsismeiro and forked with EPMatt. We R just discussing a few things as we R finding some hurdles trying to avoid breaking changes. Hope u guys can be a little patient.

There are a bit many forks, yes! Thanks for your hard work and efforts

@EPMatt
Copy link
Owner

EPMatt commented Jan 22, 2025

Update: IKEA E1743 Controller Blueprint Version 2025.01.23 is published, with Z2M 2.0.0 support! 🔥

See updated changelog here.

We will now replicate changes and bring Z2M 2.0.0 support to all controllers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blueprint An issue related to a blueprint bug Something isn't working
Projects
None yet
Development

No branches or pull requests