awesome-ha-blueprints
awesome-ha-blueprints copied to clipboard
Fix button_up/down_long not working in HASS 2022.4.3
Breaking change
After updating to HASS 2022.4.3 it seems the ZHA events for long press up/down has changed leading to possible errors in the input texts and, above all, the up/down long press event not being recognized by the Ikea E1743 automation. Bleeding edge HASS users will appreciate this change as the Ikea dimmers spring back to life. Others will feel the same frustration as the aforementioned did after the upgrade.
Proposed change
Ideally, the template would accept both the old ZHA events as well as the new ones or (even better) the least common denominator.
Checklist
- [x] I followed sections of the Contribution Guidelines relevant to changes I'm proposing.
- [x] 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.
Hey @kanflo, 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!
Oh, and I added a note on the input text length in the docs.
Hey, thank you for this fix! Could you fix E1812 as well? It shows the same behavior. Possibly other devices are affected, these are just the ones that I know of.
@Sab44 If you have changed the text input max length and install the Studio Code Server add-on install, please try to change this line:
button_long: [move_with_on_off_0_83]
to
button_up_long: ['move_with_on_off_MoveMode.Up_83']
I am a bit reluctant to raise a PR for a controller I do not own and cannot test ;)
Edit: I would expect the ikea_e1524_e1810.yaml
and ikea_e2001_e2002.yaml
automations would be affected by this ZHA change. Possibly the ikea_e1812.yaml
too.
Hey @kanflo,
✅ Your contribution passed all the checks, awesome! A maintainer will soon review your submission and provide additional feedback regarding your changes.
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.
https://github.com/kanflo/awesome-ha-blueprints/blob/ikea_e1742_dimmer_fix/blueprints/controllers/ikea_e1743/ikea_e1743.yaml
@Sab44 If you have changed the text input max length and install the Studio Code Server add-on install, please try to change this line:
button_long: [move_with_on_off_0_83]
to
button_up_long: ['move_with_on_off_MoveMode.Up_83']
I am a bit reluctant to raise a PR for a controller I do not own and cannot test ;)
Edit: I would expect the
ikea_e1524_e1810.yaml
andikea_e2001_e2002.yaml
automations would be affected by this ZHA change. Possibly theikea_e1812.yaml
too.
I can confirm that this change fixes the issue also for the E1812.
What I'm wondering is why ZHA changed these values in the first place. Especially comparing them to the values from deconz and zigbee2mqtt defined in the yaml, the ZHA values seem overly complex. Additionally requiring the user to increase the length of the helpers is not ideal. No idea though if something can be done about it in ZHA.
ZHA depends on ZigPy where move_with_on_off
and MoveMode
are defined meaning any change to what Awesome* receives today is not likely.
Using the ikea_e2001_e2002.yaml
blueprint I also had to update the stop event name. Now it correctly stops dimming my lights when I let go of the button.
+++ w/blueprints/automation/EPMatt/ikea_e2001_e2002.yaml
@@ -315,11 +315,11 @@ variables:
button_right_long: [hold_3328_0]
button_right_release: [release_-27903]
button_up_short: ['on']
- button_up_long: [move_with_on_off_0_83]
- button_up_release: [stop]
+ button_up_long: [move_with_on_off_MoveMode.Up_83]
+ button_up_release: [stop_with_on_off]
button_down_short: ['off']
- button_down_long: [move_1_83]
- button_down_release: [stop]
+ button_down_long: [move_MoveMode.Down_83_bitmap8.0_bitmap8.0]
+ button_down_release: [stop_with_on_off]
zigbee2mqtt:
button_left_short: [arrow_left_click]
button_left_long: [arrow_left_hold]
Same Problem for the rotation of E1744 nothing is working anymore
@paulbrunn : if you could please try the same change with your E1744 I can add your change and @Azrael-Kun's to the PR.
FYI, for reference also see this related ZHA issue discussion for Home Assistant core -> https://github.com/home-assistant/core/issues/69375
Hi @kanflo,
sorry for my late response. Thank you so much for opening a PR here! 🚀 I'll review your submission later today. I've a few ideas on how to deal with the input text max length.
Thank you for your precious time, and thank you to you all guys for providing feedback on this!
@kanflo @EPMatt Here is what I did to get e1744 working as I had the same issues as @paulbrunn. This also relies on changing the max input text length as described above.
+++ b/blueprints/controllers/ikea_e1744/ikea_e1744.yaml
@@ -164,12 +164,12 @@ variables:
click_double: ['1004']
click_triple: ['1005']
zha:
- rotate_left: [move_1_195]
- rotate_stop: [stop]
- rotate_right: [move_0_195]
+ rotate_left: [move_MoveMode.Down_195_bitmap8.0_bitmap8.0]
+ rotate_stop: [stop_bitmap8.0_bitmap8.0]
+ rotate_right: [move_MoveMode.Up_195_bitmap8.0_bitmap8.0]
click_short: [toggle]
- click_double: [step_0_1_0]
- click_triple: [step_1_1_0]
+ click_double: [step_StepMode.Up_1_0_bitmap8.0_bitmap8.0]
+ click_triple: [step_StepMode.Down_1_0_bitmap8.0_bitmap8.0]
@kanflo if you want to add this to your PR that would be appreciated, or I can submit a separate one
Hey @kanflo, 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!
@pcarton : Done! Sorry about the delay.
Hey @kanflo,
✅ Your contribution passed all the checks, awesome! A maintainer will soon review your submission and provide additional feedback regarding your changes.
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.
https://github.com/kanflo/awesome-ha-blueprints/blob/ikea_e1742_dimmer_fix/blueprints/controllers/ikea_e1743/ikea_e1743.yaml https://github.com/kanflo/awesome-ha-blueprints/blob/ikea_e1742_dimmer_fix/blueprints/controllers/ikea_e1744/ikea_e1744.yaml
Hey @kanflo, 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!
@EPMatt: I added your your proposed changes and those from @Azrael-Kun and @Sab44 (could you please verify I added the correct changes).
Oh, and thanks for your precious work!
Thanks @Azrael-Kun and @Sab44
Hey @kanflo please check my review comment again, I was mentioning the button release action that also needs to be updated. Thank you for your work!
Hi @kanflo, thank you for your work. And @EPMatt for your original work as well of course :)
I have added a fix for the E1810 remote as well, tested it locally and can confirm it works.
I was not sure how to publish this so I made a PR from my fork to yours: https://github.com/kanflo/awesome-ha-blueprints/pull/1
I hope it's the correct way of going for it, otherwise feel free to advise how I can do this (for example if you prefer me to make a second, direct PR to this repository instead).
Have a great weekend!
Found this PR tonight after finally having time to try and figure out why dimmer controller E1743 stopped working a while ago. Imported the blueprint directly from link above and confirmed it now works again as expected.
For anyone else that comes across this problem, simply import the most recent link above that matches your device and replace your controller with that instead.
I too found this when I was about to go mad when my Symfonisk remote wouldn't control volume on my Sonos system. It will with this update, however I found that it does so perpetually by spamming this event and won't stop:
{
"event_type": "call_service",
"data": {
"domain": "media_player",
"service": "volume_set",
"service_data": {
"volume_level": 0,
"entity_id": [
"media_player.kontoret"
]
}
},
"origin": "LOCAL",
"time_fired": "2022-07-01T21:47:48.532672+00:00",
"context": {
"id": "01G6XVQCZM1QXZKT4ANHAZVH0Q",
"parent_id": "01G6XVQCYYFVW0HNFD5RZ4DWXC",
"user_id": null
}
}
"volume_level"
goes between 0 and 1 in increments, but then it won't stop spamming at either end, sending 0
or 1
forever.
Possibly unrelated to other changes...? I don't know, but it's equally useless behavior for a volume control. 😅
@EPMatt I saw your change request but it was marked as "outdated" so I hit "request review". Not sure if it is me or Github that is on the wrong side of things.
Found this thread today while checking how I could submit fixes for controller Ikea e2001/e2002 after fighting a few days to correct the Button Up/Down Hold, Button Up/Down Release and Button Left/Right Release. For some reason none of the fixes above for the controller are on the blueprint I downloaded from the community form unfortunately. Did I miss something regarding the controller Ikea e2001/e2002 blueprint?
There is still one fix that needs to be done regarding the Left/Right Release that I didn't see fixed or maybe I missed. The "random" number (positive for left, negative for right) that is after release_ ZHA event prevents the release from working correctly and I included a validation for the ZHA integration where the condition is evaluated on my code:
diff --git a/blueprints/controllers/ikea_e2001_e2002/ikea_e2001_e2002.yaml b/blueprints/controllers/ikea_e2001_e2002/ikea_e2001_e2002.yaml
index 42fcf37..501c211 100644
--- a/blueprints/controllers/ikea_e2001_e2002/ikea_e2001_e2002.yaml
+++ b/blueprints/controllers/ikea_e2001_e2002/ikea_e2001_e2002.yaml
@@ -482,7 +482,7 @@ action:
# if looping is not enabled run the custom action only once
default: !input action_button_left_long
- conditions:
- - '{{ trigger_action | string in button_left_release }}'
+ - '{% if integration_id == "zha" %} {{ trigger_action[:7] | string in button_left_release }} {% else %} {{ trigger_action | string in button_left_release }} {% endif %}'
# for integrations which need to store the last controller event, need to check the previous button event, stored in the provided input_text
- '{{ not integration_id in integrations_with_prev_event_storage or last_controller_event | string in button_left_long }}'
sequence:
@@ -565,7 +565,7 @@ action:
# if looping is not enabled run the custom action only once
default: !input action_button_right_long
- conditions:
- - '{{ trigger_action | string in button_right_release }}'
+ - '{% if integration_id == "zha" %} {{ trigger_action[:7] | string in button_right_release }} {% else %} {{ trigger_action | string in button_right_release }} {% endif %}'
# for integrations which need to store the last controller event, need to check the previous button event, stored in the provided input_text
- '{{ not integration_id in integrations_with_prev_event_storage or last_controller_event | string in button_right_long }}'
sequence:
And the change for:
button_left_release: [release]
button_right_release: [release]
Feel free to add this fix to the blueprint repository if you find it useful and confirm that solves the problem without issues. For me is working, before when I changed the color of a Ikea RGB lamp by holding the left or rigt button using the Light Hook, the color change never stopped after I release the button. With this fix works as expected.
@EPMatt I saw your change request but it was marked as "outdated" so I hit "request review". Not sure if it is me or Github that is on the wrong side of things.
Can you confirm if the perpetual behavior I'm seeing is new to this PR?
I noted that I get the following event both for long press up release and long press down release on my E1743:
{
"event_type": "zha_event",
"data": {
"device_ieee": "8c:f6:81:ff:fe:12:46:3a",
"unique_id": "8c:f6:81:ff:fe:12:46:3a:1:0x0008",
"device_id": "7373e365206f24b54f6423ab692dde58",
"endpoint_id": 1,
"cluster_id": 8,
"command": "stop_with_on_off",
"args": [],
"params": {}
},
"origin": "LOCAL",
"time_fired": "2022-07-17T19:40:53.244014+00:00",
"context": {
"id": "c95c44f38e9ae031fed41bb7350fcc4b",
"parent_id": null,
"user_id": null
}
}
Maybe this is why your Symfonisk remote does not stop spamming @spacecakes.
⚠️ Important announcement about the project: #371 ⚠️
I'd like to kindly ask for your feedback about our work here. If you have time, please answer the poll in the above discussion. This will help shaping the future of Awesome HA Blueprints. 🚀
Thank you!
Hi folks! I'm terribly sorry for my long delay, but I'm happy to come back to contributing to the project.
I read the entire discussion, which had many developments during the last few months. Here's a recap about the status of this PR, for anyone who's coming here and would like to contribute.
The PR is focused on fixing blueprints for IKEA controllers integrated with ZHA, starting from HASS 2022.4.3.
- Fix for E1524/E1810 (Blueprint URL)
- [X] Done and tested (@nonninz)
- [X] Backward compatible
- Fix for E1743 (Blueprint URL)
- [X] Done and tested (@kanflo @ajfisher)
- [X] Backward compatible
- [ ] Need to check whether the release/stop events have changed for this blueprint as well (https://github.com/EPMatt/awesome-ha-blueprints/pull/314#discussion_r872387052 @Azrael-Kun). A report about
stop_with_on_off
events triggered by the controller was made (https://github.com/EPMatt/awesome-ha-blueprints/pull/314#issuecomment-1186595901 @kanflo).
- Fix for E1812 (Blueprint URL)
- [X] Done and tested (?) (@Sab44 @kanflo).
- [X] Backward compatible
- [ ] Add
stop_with_on_off
to thebutton_release
action (?) (@Sab44 https://github.com/EPMatt/awesome-ha-blueprints/pull/314#discussion_r872299259)
- Fix for E2001/E2002 (Blueprint URL)
- [X] Done and tested (@Azrael-Kun @kanflo)
- [X] Backward compatible
- [ ] Received a report that the fix is not working, because ZHA events changed. User reported a possible fix (@lsismeiro https://github.com/EPMatt/awesome-ha-blueprints/pull/314#issuecomment-1172733187).
- Fix for E1744 (Blueprint URL)
- [X] Done and tested (@pcarton @kanflo)
- [X] Backward compatible
- [ ] The controller seems to continuously spam events (@spacecakes https://github.com/EPMatt/awesome-ha-blueprints/pull/314#issuecomment-1172733187) making it unusable for volume control. Need to investigate.
- Other changes
- [ ] Bump blueprint version, update change log and docs. I can take care of this once we're done with all the edits here.
- [x] Overcome 100 chars limit in input_text helpers, which is causing controllers using long-named events to fail. Tracked in #333. Development tracked in #378. @ghgeiger confirms that increasing the size of text helpers to 255 chars eliminates the issue with blueprints.
I hope to have included everything correctly, please let me know if something's missing.
Thank you so much for all your work here. I'm glad to see that so many people got involved in this PR!