awesome-ha-blueprints icon indicating copy to clipboard operation
awesome-ha-blueprints copied to clipboard

Fix long press up/down for ikea_e2001_e2002.yaml

Open LewisSpring opened this issue 2 years ago • 20 comments

Breaking change

Shouldn't be a breaking change for end users.

Proposed change*

Works towards resolving #399, fixes for long pressing the up and down buttons. Update 2022-12-13 Also fixes left and right hold too.

Strikethrough 2022-12-13 ~~Does NOT include release action fixes as detailed here (See Note 2). If someone could work out how to implement that would be appreciated - I wasn't entirely sure how to do it myself.~~

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.

LewisSpring avatar Sep 12 '22 21:09 LewisSpring

Hey @LewisSpring, 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!

github-actions[bot] avatar Sep 12 '22 21:09 github-actions[bot]

This patch fixes long pressing the up and down buttons on my e2002 device.

da2x avatar Sep 14 '22 03:09 da2x

This patch fixes long pressing the up and down buttons on my e2002 device.

That's great news. Do you have issues with the "hold actions" not stopping? I'm experiencing that right now, as a result of me personally not being able to implement the "release action" fix.

LewisSpring avatar Sep 15 '22 08:09 LewisSpring

Updated pull request with @lsismeiro's changes. https://github.com/EPMatt/awesome-ha-blueprints/issues/399#issuecomment-1345357195 Myself and @simon-mettler have tested it and it works as expected.

FYI: The version number in the description of the blueprint has been changed to reflect the deviation from the released version.

LewisSpring avatar Dec 13 '22 18:12 LewisSpring

The changes in this PR are working great for me now. Finally can reset my lights with a double click without losing the ability to dim.

dunxd avatar Feb 03 '23 07:02 dunxd

@LewisSpring Consider splitting this PR into two to increase chance of being approved and merged. First commit updates quite a lot of thing and not clear how it fixes any issue.

Second commit actually updates name of events and should be trivial to review, test and will probably get approved and merged.

Anyway, thanks for your work!

koorool avatar Apr 19 '23 16:04 koorool

@LewisSpring Consider splitting this PR into two to increase chance of being approved and merged. First commit updates quite a lot of thing and not clear how it fixes any issue.

Second commit actually updates name of events and should be trivial to review, test and will probably get approved and merged.

Anyway, thanks for your work!

Hi @koorool, That's a good proposal.

I'm not sure what the first commit actually changes to be honest. It was quite a while ago(!) Seems like it's been prettified or similar. I will see if @lsismeiro 's changes on their own with a copy from main works.

Edit: I as far as I can tell, I only changed the button press actions. I will make a third commit that uses the original YAML from main, and update it with the changes me and @lsismeiro 's changes. As nothing significant is changed, I am comfortable with not creating a new pull.

LewisSpring avatar Apr 19 '23 18:04 LewisSpring

Thank for your update. Installed and tested on my E2002 controllers, all works as expected.

Seems like there is a bigger PR that fixes that issue for most controllers (apparently it's not E2001/E2002 specific): https://github.com/EPMatt/awesome-ha-blueprints/pull/314

And there was some activity from repo author, so there is a chance it will get merged.

Regardless, thank you for your work!

koorool avatar Apr 21 '23 22:04 koorool

Thank for your update. Installed and tested on my E2002 controllers, all works as expected.

Seems like there is a bigger PR that fixes that issue for most controllers (apparently it's not E2001/E2002 specific): https://github.com/EPMatt/awesome-ha-blueprints/pull/314

And there was some activity from repo author, so there is a chance it will get merged.

Regardless, thank you for your work!

You're welcome. Same here - no issues I can find.

I wasn't aware of that pull and activity. That's good news too.

LewisSpring avatar Apr 22 '23 11:04 LewisSpring

Hi all, just to be sure that the changes I made and that work, as already proved by other people besides me, are not missing. Here is the diff between the latest working code from the repository with the help fix (https://github.com/EPMatt/awesome-ha-blueprints/pull/378) and my own changes:

--- ikea_e2001_e2002.yaml.orig_new	2022-12-10 18:04:01.630304100 +0000
+++ ikea_e2001_e2002.yaml	2022-12-10 17:47:36.643041900 +0000
@@ -334,25 +334,25 @@ variables:
       button_left_long:
       - hold_3329_0
       button_left_release:
-      - release_1365
+      - release
       button_right_short:
       - press_256_13_0
       button_right_long:
       - hold_3328_0
       button_right_release:
-      - release_-27903
+      - release
       button_up_short:
       - 'on'
       button_up_long:
-      - move_with_on_off_0_83
+      - move_with_on_off_MoveMode.Up_83
       button_up_release:
-      - stop
+      - stop_with_on_off
       button_down_short:
       - 'off'
       button_down_long:
-      - move_1_83
+      - move_MoveMode.Down_83_bitmap8.0_bitmap8.0
       button_down_release:
-      - stop
+      - stop_with_on_off
     zigbee2mqtt:
       button_left_short:
       - arrow_left_click
@@ -496,7 +496,8 @@ action:
             sequence: !input action_button_left_long
       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 %}'
     - '{{ not integration_id in integrations_with_prev_event_storage or last_controller_event
       | string in button_left_long }}'
     sequence:
@@ -560,7 +561,8 @@ action:
             sequence: !input action_button_right_long
       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 %}'
     - '{{ not integration_id in integrations_with_prev_event_storage or last_controller_event
       | string in button_right_long }}'
     sequence:

Regards, Luis Sismeiro

lsismeiro avatar Apr 23 '23 18:04 lsismeiro

Hi all, just to be sure that the changes I made and that work, as already proved by other people besides me, are not missing. Here is the diff between the latest working code from the repository with the help fix (#378) and my own changes: [...] Regards, Luis Sismeiro

Hey Luis, I am now aware of that change. I will update the pull with these changes. Thank you!

LewisSpring avatar Apr 23 '23 20:04 LewisSpring

With the latest version of this PR, my long press down doesn't actually dim the light. Long up will increase brightness. Up and down work for on/off. With an e2002. When I long press I see new values going into the helper. {"a":"move_MoveMode.Down_83_0_0","t":1688272844.479248} followed by {"a":"stop_0_0","t":1688272844.572418} on release.

AHoran avatar Jul 02 '23 04:07 AHoran

Line 324 is incorrect. This: button_down_long: [move_MoveMode.Down_83_bitmap8.0_bitmap8.0]

Should be changed to this: button_down_long: [move_MoveMode.Down_83_0_0]

Some change in ZHA was made in a recent HA update that also broke another Ikea switch (The two button dimmer)

rofo69 avatar Jul 18 '23 17:07 rofo69

Line 324 is incorrect. This: button_down_long: [move_MoveMode.Down_83_bitmap8.0_bitmap8.0]

Should be changed to this: button_down_long: [move_MoveMode.Down_83_0_0]

Some change in ZHA was made in a recent HA update that also broke another Ikea switch (The two button dimmer)

~~Hi @rofo69 After checking my remote, it does appear the down hold action does not release. Is this the same issue you experienced and fixed with this?~~

~~I will put your changes into a gist and test. If anyone else could test this that would be appreciated.~~

Hi @rofo69, It appears this fix is already in place https://github.com/LewisSpring/awesome-ha-blueprints/blob/380130b3a8b87037402b0f1da55e93635737804f/blueprints/controllers/ikea_e2001_e2002/ikea_e2001_e2002.yaml#L325

I'm still experiencing the aforementioned "down hold action does not release" issue with this fix.

LewisSpring avatar Jul 19 '23 15:07 LewisSpring

Hi all, Event integration has just been released as part of 2023.8.0. https://www.home-assistant.io/integrations/event

If ZHA IKEA remotes move to this integration, We would need a new automation, but this looks like a really positive move.

Current methods should remain to work for the foreseeable future, I assume.

LewisSpring avatar Aug 02 '23 18:08 LewisSpring

Hi, I didn't find the time yet to check the changes. As soon as I have some time and restore the files of my dev tree I can take a look. Regards, Luis Sismeiro

lsismeiro avatar Sep 10 '23 10:09 lsismeiro

Hi, I didn't find the time yet to check the changes. As soon as I have some time and restore the files of my dev tree I can take a look. Regards, Luis Sismeiro

I updated the repository with the changes on the main branch, I think it is OK to add it as a blueprint using the HA GUI: https://github.com/lsismeiro/awesome-ha-blueprints

lsismeiro avatar Sep 10 '23 13:09 lsismeiro

Hi, I didn't find the time yet to check the changes. As soon as I have some time and restore the files of my dev tree I can take a look. Regards, Luis Sismeiro

I updated the repository with the changes on the main branch, I think it is OK to add it as a blueprint using the HA GUI: https://github.com/lsismeiro/awesome-ha-blueprints

Cheers Luis, will put a post up

LewisSpring avatar Sep 15 '23 15:09 LewisSpring

Great work! thank you. Why isn't this merged?

shaulbarlev avatar Jan 12 '24 13:01 shaulbarlev

Unfortunately EPMatt has not been active on the project so we as a community are unable to do so.

Please check the GitHub repository I linked above, where we are updating the blueprints as a community effort.

LewisSpring avatar Jan 12 '24 13:01 LewisSpring