lsismeiro / awesome-ha-blueprints

A curated collection of automation blueprints for Home Assistant.
https://epmatt.github.io/awesome-ha-blueprints
GNU General Public License v3.0
85 stars 19 forks source link

Bug - E1744 rotates continuously with light brightness or media volume #25

Open scorednever opened 1 month ago

scorednever commented 1 month ago

Blueprint name

ikea_e1744

Home Assistant Core Version

2024.10.2

Home Assistant Installation Type

Home Assistant Operating System

Description

I've imported the new blueprint for the Ikea E1744 controller (with light and media hooks) from the following repository: https://github.com/lsismeiro/awesome-ha-blueprints/tree/main/blueprints. I then created automations using these blueprints.

However, when rotating the controller (either left or right), the associated action (light brightness or media volume) continues to change continuously, even after releasing the controller, until it reaches the maximum or minimum value. The change only stops if the button is clicked.

Automation YAML config

alias: black 3 volume bp oct24
description: ""
use_blueprint:
  path: lsismeiro/ikea_e1744.yaml
  input:
    integration: Zigbee2MQTT
    controller_entity: sensor.ikea_volume_black_3_action
    helper_last_controller_event: input_text.ikea_volume_black_3_blueprint_helper
    rotate_left_loop: false
    rotate_right_loop: false

alias: black 3 volume light test
description: ""
use_blueprint:
  path: lsismeiro/light.yaml
  input:
    controller_device: 22c5a65e11aa6bec180a3162f02fcfd7
    controller_entity: sensor.ikea_volume_black_3_action
    controller_model: IKEA E1744 SYMFONISK Rotary Remote
    light: light.bedroom_ceiling

alias: black 3 volume squeeze bedroom
description: ""
use_blueprint:
  path: lsismeiro/media_player.yaml
  input:
    controller_device: 22c5a65e11aa6bec180a3162f02fcfd7
    controller_entity: sensor.ikea_volume_black_3_action
    controller_model: IKEA E1744 SYMFONISK Rotary Remote
    media_player: media_player.squeeze_bedroom
    volume_steps_short: 99
    volume_steps_long: 99

To Reproduce

  1. Go to '...'
  2. Click on '....'
  3. Trigger the automation '....'
  4. See error

Expected behavior

The rotary action should stop adjusting brightness or volume when the controller is no longer being rotated.

Actual Behaviour

Volume / brightness changes continuously and only stops if the button is clicked to pause / play, toggle light.

Additional Details

Screenshots

No response

Additional context

No response

LewisSpring commented 1 month ago

This has been reported on the forum as well: https://community.home-assistant.io/t/zha-deconz-zigbee2mqtt-ikea-e1744-symfonisk-rotary-remote-universal-blueprint-all-actions-control-lights-media-players-and-more-with-hooks/287536/177 (this controller has not been adopted on the forum yet)

LewisSpring commented 1 month ago

Could you send a trace of the automation running with a spin left/right event? Maybe the event has changed recently?

If we could compare this with older versions we might find our answer.

scorednever commented 1 month ago

When I give it a short twist it gives 6 traces, plus one for the hook - trace automation.black_3_hook_test_new_oct24 2024-10-21T11_00_16.357169+00_00.json trace automation.black_3_volume_bp_oct24 2024-10-21T11_00_16.865848+00_00.json trace automation.black_3_volume_bp_oct24 2024-10-21T11_00_16.855696+00_00.json trace automation.black_3_volume_bp_oct24 2024-10-21T11_00_16.833401+00_00.json trace automation.black_3_volume_bp_oct24 2024-10-21T11_00_16.365891+00_00.json trace automation.black_3_volume_bp_oct24 2024-10-21T11_00_16.360699+00_00.json trace automation.black_3_volume_bp_oct24 2024-10-21T11_00_16.351002+00_00.json

rafuz commented 2 weeks ago

I have this problem with IKEA E1743 but only using zigbee2mqtt. In ZHA it works correctly.

LewisSpring commented 1 week ago

I've had a look through the traces but I haven't been able to spot the new action anywhere in there. If you can determine what the new actions are then it will be easy to update them as I believe that is the issue. As I do not use Z2M nor this remote, I cannot help much without that information.

rafuz commented 1 week ago

I have this problem with IKEA E1743 but only using zigbee2mqtt. In ZHA it works correctly.

I fixed it adding to ignore the action "unknown" into the trigger condition section:

condition:
  - condition: and
    conditions:
      # check that the button event is not empty
      - >-
        {%- set trigger_action -%}
        {%- if integration_id == "zigbee2mqtt" -%}
        {{ trigger.event.data.new_state.state }}
        {%- elif integration_id == "deconz" -%}
        {{ trigger.event.data.event }}
        {%- elif integration_id == "zha" -%}
        {{ trigger.event.data.command }}{{"_" if trigger.event.data.args|length > 0}}{{ trigger.event.data.args|join("_") }}
        {%- endif -%}
        {%- endset -%}
        {{ trigger_action not in ["","None","unknown"] }}
      # only for zigbee2mqtt, check if the event is relative to a real state change, and not only some minor changes in the sensor attributes
      # this is required since multiple state_changed events are fired for a single button press, with the result of the automation being triggered multiple times
      - '{{ integration_id != "zigbee2mqtt" or trigger.event.data.new_state.state != trigger.event.data.old_state.state }}'
spencer-scott commented 1 week ago

I have this problem with IKEA E1743 but only using zigbee2mqtt. In ZHA it works correctly.

I fixed it adding to ignore the action "unknown" into the trigger condition section:

condition:
  - condition: and
    conditions:
      # check that the button event is not empty
      - >-
        {%- set trigger_action -%}
        {%- if integration_id == "zigbee2mqtt" -%}
        {{ trigger.event.data.new_state.state }}
        {%- elif integration_id == "deconz" -%}
        {{ trigger.event.data.event }}
        {%- elif integration_id == "zha" -%}
        {{ trigger.event.data.command }}{{"_" if trigger.event.data.args|length > 0}}{{ trigger.event.data.args|join("_") }}
        {%- endif -%}
        {%- endset -%}
        {{ trigger_action not in ["","None","unknown"] }}
      # only for zigbee2mqtt, check if the event is relative to a real state change, and not only some minor changes in the sensor attributes
      # this is required since multiple state_changed events are fired for a single button press, with the result of the automation being triggered multiple times
      - '{{ integration_id != "zigbee2mqtt" or trigger.event.data.new_state.state != trigger.event.data.old_state.state }}'

This works perfectly. Thanks for figuring out the interim solution.