Skip to content

Commit

Permalink
(ZHA) Fixed a bug preventing long pressing actions to be triggered. (#…
Browse files Browse the repository at this point in the history
…620)

* Fixed a bug preventing long pressing actions to be triggered.
Ikea e2002 button up / button down / left hold / right hold are now working properly

* docs: add clarification comment

* bump version to 2025.01.02

* docs: update changelog

---------

Co-authored-by: EPMatt <30753195+EPMatt@users.noreply.github.com>
  • Loading branch information
Ivarvdb and EPMatt authored Jan 2, 2025
1 parent 9ee5920 commit 2066c43
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
20 changes: 11 additions & 9 deletions blueprints/controllers/ikea_e2001_e2002/ikea_e2001_e2002.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ blueprint:
🚀 This blueprint is part of the **[Awesome HA Blueprints](https://epmatt.github.io/awesome-ha-blueprints) project**.
ℹ️ Version 2022.08.08
ℹ️ Version 2025.01.02
source_url: https://github.com/EPMatt/awesome-ha-blueprints/blob/main/blueprints/controllers/ikea_e2001_e2002/ikea_e2001_e2002.yaml
domain: automation
input:
Expand Down Expand Up @@ -310,16 +310,16 @@ variables:
zha:
button_left_short: [press_257_13_0]
button_left_long: [hold_3329_0]
button_left_release: [release_1365]
button_left_release: [release] # second parameter is number of ms button is held
button_right_short: [press_256_13_0]
button_right_long: [hold_3328_0]
button_right_release: [release_-27903]
button_right_release: [release] # second parameter is number of ms button is held
button_up_short: ['on']
button_up_long: [move_with_on_off_0_83]
button_up_release: [stop]
button_up_long: [move_with_on_off_0_83,move_with_on_off_MoveMode.Up_83]

Check failure on line 318 in blueprints/controllers/ikea_e2001_e2002/ikea_e2001_e2002.yaml

View workflow job for this annotation

GitHub Actions / yamllint

[yamllint] blueprints/controllers/ikea_e2001_e2002/ikea_e2001_e2002.yaml#L318

[error] too few spaces after comma (commas)
Raw output
./blueprints/controllers/ikea_e2001_e2002/ikea_e2001_e2002.yaml:318:46: [error] too few spaces after comma (commas)
button_up_release: [stop, stop_with_on_off] # Kept first parameter for potential backwards compatibility of previous firmware versions

Check failure on line 319 in blueprints/controllers/ikea_e2001_e2002/ikea_e2001_e2002.yaml

View workflow job for this annotation

GitHub Actions / yamllint

[yamllint] blueprints/controllers/ikea_e2001_e2002/ikea_e2001_e2002.yaml#L319

[warning] too few spaces before comment (comments)
Raw output
./blueprints/controllers/ikea_e2001_e2002/ikea_e2001_e2002.yaml:319:51: [warning] too few spaces before comment (comments)
button_down_short: ['off']
button_down_long: [move_1_83]
button_down_release: [stop]
button_down_long: [move_1_83, move_MoveMode.Down_83_0_0]
button_down_release: [stop, stop_with_on_off] # Kept first parameter for potential backwards compatibility of previous firmware versions

Check failure on line 322 in blueprints/controllers/ikea_e2001_e2002/ikea_e2001_e2002.yaml

View workflow job for this annotation

GitHub Actions / yamllint

[yamllint] blueprints/controllers/ikea_e2001_e2002/ikea_e2001_e2002.yaml#L322

[warning] too few spaces before comment (comments)
Raw output
./blueprints/controllers/ikea_e2001_e2002/ikea_e2001_e2002.yaml:322:53: [warning] too few spaces before comment (comments)
zigbee2mqtt:
button_left_short: [arrow_left_click]
button_left_long: [arrow_left_hold]
Expand Down Expand Up @@ -482,7 +482,8 @@ 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 }}'
# target all release events without considering the event suffix
- '{{ trigger_action.split("_")[0] in button_left_release }}'
# 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:
Expand Down Expand Up @@ -565,7 +566,8 @@ 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 }}'
# target all release events without considering the event suffix
- '{{ trigger_action.split("_")[0]in button_right_release }}'
# 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:
Expand Down
1 change: 1 addition & 0 deletions website/docs/blueprints/controllers/ikea_e2001_e2002.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -290,3 +290,4 @@ If you notice your controller is not behaving as expected please reset the devic

- **2021-11-07**: first blueprint version :tada:
- **2022-08-08**: Optimize characters usage for the `helper_last_controller_event` text input.
- **2025-01-02**: (ZHA) Fixed a bug preventing long pressing actions to be triggered. ([@Ivarvdb](https://github.com/Ivarvdb))

0 comments on commit 2066c43

Please sign in to comment.