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

Fix button_up/down_long not working in HASS 2022.4.3 #314

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

Conversation

kanflo
Copy link

@kanflo kanflo commented Apr 13, 2022

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

  • 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.

@github-actions
Copy link
Contributor

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!

@kanflo
Copy link
Author

kanflo commented Apr 13, 2022

Oh, and I added a note on the input text length in the docs.

@Sab44
Copy link

Sab44 commented Apr 13, 2022

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.

@kanflo
Copy link
Author

kanflo commented Apr 13, 2022

@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.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 13, 2022

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
Copy link

Sab44 commented Apr 15, 2022

@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.

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.

@kanflo
Copy link
Author

kanflo commented Apr 15, 2022

ZHA depends on ZigPy where move_with_on_off and MoveMode are defined meaning any change to what Awesome* receives today is not likely.

@Azrael-Kun
Copy link
Contributor

Azrael-Kun commented Apr 15, 2022

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]

@paulbrunn
Copy link

Same Problem for the rotation of E1744 nothing is working anymore

@kanflo
Copy link
Author

kanflo commented Apr 15, 2022

@paulbrunn : if you could please try the same change with your E1744 I can add your change and @Azrael-Kun's to the PR.

@Hedda
Copy link

Hedda commented Apr 19, 2022

FYI, for reference also see this related ZHA issue discussion for Home Assistant core -> home-assistant/core#69375

@EPMatt
Copy link
Owner

EPMatt commented Apr 22, 2022

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!

@pcarton
Copy link

pcarton commented May 1, 2022

@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

@github-actions
Copy link
Contributor

github-actions bot commented May 9, 2022

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!

@kanflo
Copy link
Author

kanflo commented May 9, 2022

@pcarton : Done! Sorry about the delay.

@github-actions
Copy link
Contributor

github-actions bot commented May 9, 2022

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

Copy link
Owner

@EPMatt EPMatt left a comment

Choose a reason for hiding this comment

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

Hi @kanflo,

first of all thank you for your truly precious contribution and for your patience. I'm terribly sorry for my delay but I'm currently really busy and can't dedicate lot of time to the project. I truly appreciate the help you're providing here. :)

Here I suggested a few changes, providing backward compatibility for users still at Home Assistant 2022.4.* or below.

I'm aware that the project lacks a clear developer guide on how to contribute to blueprints docs, so I'll take care of it after we're done with all the code changes. :)

Edit: Could you please also add the new actions for the E1812 (#314 (comment) @Sab44) and the E2001/E2002 (#314 (comment) @Azrael-Kun) to the respective controller blueprints? We've received positive feedback in both cases, so I believe it's safe to add those mappings as well (but always keeping the old ones for backward compatibility).

Thank you again for your precious time!

blueprints/controllers/ikea_e1743/ikea_e1743.yaml Outdated Show resolved Hide resolved
blueprints/controllers/ikea_e1743/ikea_e1743.yaml Outdated Show resolved Hide resolved
blueprints/controllers/ikea_e1744/ikea_e1744.yaml Outdated Show resolved Hide resolved
blueprints/controllers/ikea_e1744/ikea_e1744.yaml Outdated Show resolved Hide resolved
@@ -33,7 +33,7 @@ This field requires that you have an existing text helper. Therefore, before set
:::caution
Make sure the text input is not altered by any other agents. The provided entity is used as a permanent storage area for the controller automation; any change to its state not carried out by the respective automation could lead to inconsistencies and unexpected behaviour.

Therefore, you should create **a separate text input for each Controller blueprint** you're configuring.
Therefore, you should create **a separate text input for each Controller blueprint** you're configuring. Additionally, **you need to set the maximum length of the input to 255** as the default length of 100 will lead to troubles.
Copy link
Owner

Choose a reason for hiding this comment

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

I noticed we're really wasting a lot of precious characters in the helper_last_controller_event input, and probably that's why increasing the max length of the input is required in this case.

I've opened #333 to keep track of this issue. I plan to submit a fix for this in the upcoming days, in a separate PR. Hopefully, then we won't need this note anymore. :)

I'll let you know as soon as the fix is in the main branch, so that you can rebase your PR and test blueprints without having to increase the max length of the text helper. 👍🏻

Copy link
Author

Choose a reason for hiding this comment

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

Sounds great!

Copy link

Choose a reason for hiding this comment

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

I just want to comment about this change in the helper from 100 to 255 max characters. I'm using this blueprint for the e1744 symfonisk rotary controller & while the updated blueprint linked to several posts above now recognizes turn right & turn left, it would not stop and go full max or full min. Only after I updated the helper max value to 255 did I see everything working again. Thanks so much for getting this working again, I really appreciate it!

Copy link
Owner

Choose a reason for hiding this comment

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

Thank you for the feedback @ghgeiger!

@EPMatt EPMatt added the status - waiting for feedback Waiting for additional feedback from people involved in the issue / pull request label May 9, 2022
@EPMatt EPMatt linked an issue May 10, 2022 that may be closed by this pull request
1 task
@github-actions
Copy link
Contributor

github-actions bot commented May 11, 2022

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!

@kanflo
Copy link
Author

kanflo commented May 11, 2022

@EPMatt: I added your your proposed changes and those from @Azrael-Kun and @Sab44 (could you please verify I added the correct changes).

@nonninz
Copy link

nonninz commented May 22, 2022

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: kanflo#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!

kanflo and others added 2 commits May 24, 2022 20:51
Co-authored-by: Matteo Agnoletto <acc.epmatt@gmail.com>
@ajfisher
Copy link

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.

@spacecakes
Copy link

spacecakes commented Jul 1, 2022

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. 😅

@kanflo kanflo requested a review from EPMatt July 5, 2022 05:57
@kanflo
Copy link
Author

kanflo commented Jul 5, 2022

@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.

@lsismeiro
Copy link

lsismeiro commented Jul 15, 2022

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.

@spacecakes
Copy link

@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?

@kanflo
Copy link
Author

kanflo commented Jul 17, 2022

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.

@EPMatt
Copy link
Owner

EPMatt commented Jul 22, 2022

⚠️ 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!

@EPMatt
Copy link
Owner

EPMatt commented Jul 22, 2022

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.

  1. Fix for E1524/E1810 (Blueprint URL)
    • Done and tested (@nonninz)
    • Backward compatible
  2. Fix for E1743 (Blueprint URL)
  3. Fix for E1812 (Blueprint URL)
  4. Fix for E2001/E2002 (Blueprint URL)
  5. Fix for E1744 (Blueprint URL)
  6. Other changes

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!

Copy link
Owner

@EPMatt EPMatt left a comment

Choose a reason for hiding this comment

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

Everything seems ok to me here!
@kanflo the fix I suggested in the review has already been included in a commit, so we're good here.

Now we can take a look at the remaining tasks mentioned in my last comment (#314 (comment)). After those are fixed we should be done with this PR. :)

Thank you for your precious contribution!

@EPMatt
Copy link
Owner

EPMatt commented Jul 22, 2022

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. sweat_smile

Hi @spacecakes thank you for reporting here.

I guess you're using this blueprint in conjunction with the Media Player Hook.
Can you please share the YAML config for your automations (the E1744 Controller one and, if present, the Media Player Hook one)?

Thanks!

@EPMatt
Copy link
Owner

EPMatt commented Jul 22, 2022

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.

Hi @kanflo,

do these events get fired continuously, or only after a button is released?
I guess this is also related to what @Azrael-Kun mentioned a while ago: if this behavior is confirmed, we should add stop_with_on_off events to the button_*_release actions for the E1743 too (#314 (comment)).

@Azrael-Kun
Copy link
Contributor

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.

I can confirm that the release events have changed their event args and that these args change every time the event is fired. Applying the above changes now correctly fires the ahb_controller_event release event.

@kanflo
Copy link
Author

kanflo commented Jul 23, 2022

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.

Hi @kanflo,

do these events get fired continuously, or only after a button is released? I guess this is also related to what @Azrael-Kun mentioned a while ago: if this behavior is confirmed, we should add stop_with_on_off events to the button_*_release actions for the E1743 too (#314 (comment)).

@EPMatt They get fired on button press and button release, no events are fired while the button is being pressed.

@Sab44
Copy link

Sab44 commented Jul 24, 2022

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.

1. Fix for E1524/E1810 ([Blueprint URL](https://github.com/kanflo/awesome-ha-blueprints/blob/ikea_e1742_dimmer_fix/blueprints/controllers/ikea_e1524_e1810/ikea_e1524_e1810.yaml))
   
   * [x]  Done and tested (@nonninz)
   * [x]  Backward compatible

2. Fix for E1743 ([Blueprint URL](https://github.com/kanflo/awesome-ha-blueprints/blob/ikea_e1742_dimmer_fix/blueprints/controllers/ikea_e1743/ikea_e1743.yaml))
   
   * [x]  Done and tested (@kanflo @ajfisher)
   * [x]  Backward compatible
   * [ ]  Need to check whether the release/stop events have changed for this blueprint as well ([Fix button_up/down_long not working in HASS 2022.4.3 #314 (comment)](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 ([Fix button_up/down_long not working in HASS 2022.4.3 #314 (comment)](https://github.com/EPMatt/awesome-ha-blueprints/pull/314#issuecomment-1186595901) @kanflo).

3. Fix for E1812 ([Blueprint URL](https://github.com/kanflo/awesome-ha-blueprints/blob/ikea_e1742_dimmer_fix/blueprints/controllers/ikea_e1812/ikea_e1812.yaml))
   
   * [x]  Done and tested (?) (@Sab44 @kanflo).
   * [x]  Backward compatible
   * [ ]  Add `stop_with_on_off` to the `button_release` action (?) (@Sab44 [Fix button_up/down_long not working in HASS 2022.4.3 #314 (comment)](https://github.com/EPMatt/awesome-ha-blueprints/pull/314#discussion_r872299259))

4. Fix for E2001/E2002 ([Blueprint URL](https://github.com/kanflo/awesome-ha-blueprints/blob/ikea_e1742_dimmer_fix/blueprints/controllers/ikea_e2001_e2002/ikea_e2001_e2002.yaml))
   
   * [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 [Fix button_up/down_long not working in HASS 2022.4.3 #314 (comment)](https://github.com/EPMatt/awesome-ha-blueprints/pull/314#issuecomment-1172733187)).

5. Fix for E1744 ([Blueprint URL](https://github.com/kanflo/awesome-ha-blueprints/blob/ikea_e1742_dimmer_fix/blueprints/controllers/ikea_e1744/ikea_e1744.yaml))
   
   * [x]  Done and tested  (@pcarton @kanflo)
   * [x]  Backward compatible
   * [ ]  The controller seems to continuously spam events (@spacecakes [Fix button_up/down_long not working in HASS 2022.4.3 #314 (comment)](https://github.com/EPMatt/awesome-ha-blueprints/pull/314#issuecomment-1172733187)) making it unusable for volume control. Need to investigate.

6. 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.
   * [ ]  Overcome 100 chars limit in input_text helpers, which is causing controllers using long-named events to fail. Tracked in [Enhancement - Overcome 100 chars limit in input_text helpers #333](https://github.com/EPMatt/awesome-ha-blueprints/issues/333). Since it affects multiple controllers and not only IKEA ones, I'll work on a separate PR. @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!

Can confirm E1812 is working fine for weeks now with these changes, also stop_with_on_off needs to be added as mentioned in my comment in order to make use of the button release event.

Thanks for moving this forward.

@EPMatt EPMatt linked an issue Jul 30, 2022 that may be closed by this pull request
1 task
@varac
Copy link

varac commented Sep 8, 2022

I am testing this branch for my ikea e2001_e2002 styrbar remote. I now can dim a bit until I still recieve these messages:

2022-09-08 20:31:09.619 WARNING (MainThread) [homeassistant.components.input_text] Invalid value: {"trigger_action": "move_with_on_off_MoveMode.Up_83", "last_triggered": "2022-09-08 20:31:09.618168+02:00"} (length range 0 - 100)
...
2022-09-08 20:31:12.178 WARNING (MainThread) [homeassistant.components.input_text] Invalid value: {"trigger_action": "move_MoveMode.Down_83_bitmap8.0_bitmap8.0", "last_triggered": "2022-09-08 20:31:12.175660+02:00"} (length range 0 - 100)

Should I provide more details ? Is this a known issue ?

@nonninz
Copy link

nonninz commented Sep 9, 2022

@varac That's the issue of the text helper being limited to 100 characters by default. To fix this, increase the "Maximum length" of the helper to 255 characters.

Example:
Screenshot 2022-09-09 at 11 40 37

@varac
Copy link

varac commented Sep 9, 2022

@nonninz Thanks for your help, but I can't see any length in my text helper. I created it under Settings -> Devices & Services -> Helpers -> Create Helper -> Text, using latest HA core 2022.8.7

image

@Azrael-Kun
Copy link
Contributor

The 100 character limit has also already been addressed in master. @kanflo @EPMatt is is possible to get this pull request rebased on top of master or have master merged in to avoid this issue in testing going forward?

@darmach
Copy link

darmach commented Mar 18, 2023

@EPMatt Is there anything missing here? Will this get merged?

@xitation
Copy link

Would be nice to get this one sorted ay :)

@darmach
Copy link

darmach commented Apr 21, 2023

@EPMatt Will you be merging this one? :)

@kanflo
Copy link
Author

kanflo commented Jul 23, 2023

I noted that long press down was failing again on 2023.6.3 and required the following change to ikea_e1743.yaml:

    zha:
      button_up_short: ["on"]
      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_MoveMode.Down_83_0_0"]
      button_down_release: ["stop_with_on_off"]

If anyone needs to debug this in the future, check the helpers and make sure the stuff above matches the trigger_action of the helper text field. That's where I got the move_MoveMode.Down_83_0_0" change from.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet