EPMatt / 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
850 stars 251 forks source link

Bug - IKEA long press actions not working because of oversized string values #313

Open Sab44 opened 2 years ago

Sab44 commented 2 years ago

Blueprint name

E1743 & E1812 possibly more, these are the only ones I use

Home Assistant Core Version

2022.4.3

Home Assistant Installation Type

Home Assistant Supervised

Description

Automations are no longer working for long press events. I can see the automation being triggered via the timestamp updating, but nothing is happening. In the logs I get the following error messages:

Invalid value: {"trigger_action": "move_MoveMode.Down_83_bitmap8.0_bitmap8.0", "last_triggered": "2022-04-13 21:35:36.283628+02:00"} (length range 0 - 100)
Invalid value: {"trigger_action": "move_with_on_off_MoveMode.Up_83", "last_triggered": "2022-04-13 21:38:24.969126+02:00"} (length range 0 - 100)
Invalid value: {"trigger_action": "move_MoveMode.Down_83_bitmap8.0_bitmap8.0", "last_triggered": "2022-04-13 21:39:17.072616+02:00"} (length range 0 - 100)
Invalid value: {"trigger_action": "move_with_on_off_MoveMode.Up_83", "last_triggered": "2022-04-13 21:39:44.504816+02:00"} (length range 0 - 100)
Invalid value: {"trigger_action": "move_with_on_off_MoveMode.Up_83", "last_triggered": "2022-04-13 21:41:32.708516+02:00"} (length range 0 - 100)

Which are apparently too long and therefore discarded, causing the automation to no longer work. Short press actions are still working fine.

Automation YAML config

- id: '1645733165854'
  alias: Shortcut Button Desk Automation
  description: ''
  use_blueprint:
    path: EPMatt/ikea_e1812.yaml
    input:
      integration: ZHA
      controller_device: 08220827d37e4008d53816a65c7c3c44
      helper_last_controller_event: input_text.shortcut_button_1_helper
      action_button_short:
      - service: light.toggle
        data:
          brightness_pct: 80
          kelvin: 2200
        target:
          entity_id: light.desk
      action_button_long:
      - service: light.turn_on
        data:
          kelvin: 6500
          brightness_pct: 100
        target:
          entity_id: light.desk
      helper_debounce_delay: 100
- id: '1647536470344'
  alias: TRADFRI on/off switch automation
  description: ''
  use_blueprint:
    path: EPMatt/ikea_e1743.yaml
    input:
      integration: ZHA
      controller_device: 6f6f20919710c8dbb5056b3a670a12ea
      helper_last_controller_event: input_text.tradfri_on_off_helper
      action_button_up_short:
      - service: light.turn_on
        data: {}
        target:
          device_id:
          - 89be567de5e8eb532cd61ddd8409409a
          - 2e79ea525f5f987d7ce65f3fb328bfc6
      action_button_up_long:
      - device_id: 89be567de5e8eb532cd61ddd8409409a
        domain: light
        entity_id: light.office_light1
        type: brightness_increase
      - device_id: 2e79ea525f5f987d7ce65f3fb328bfc6
        domain: light
        entity_id: light.office_light2
        type: brightness_increase
      action_button_down_short:
      - service: light.turn_off
        data: {}
        target:
          device_id:
          - 89be567de5e8eb532cd61ddd8409409a
          - 2e79ea525f5f987d7ce65f3fb328bfc6
      action_button_down_long:
      - device_id: 89be567de5e8eb532cd61ddd8409409a
        domain: light
        entity_id: light.office_light1
        type: brightness_decrease
      - device_id: 2e79ea525f5f987d7ce65f3fb328bfc6
        domain: light
        entity_id: light.office_light2
        type: brightness_decrease
      button_up_long_loop: true
      button_up_long_max_loop_repeats: 50
      button_down_long_max_loop_repeats: 50
      button_down_long_loop: true

To Reproduce

  1. Set up automations with long press actions
  2. Long press e.g. a shortcut button or the tradfri on/off switch
  3. Observe the automation's last execution timestamp updating but nothing happening
  4. Check the logs for the warnings pasted above

Expected behavior

Long press button events are working as they did previously.

Actual Behaviour

Long press button events are not working at all.

Additional Details

Screenshots

grafik

Additional context

No response

kanflo commented 2 years ago

@Sab44 : please see #312 and #314 which might be of help.

Hedda commented 2 years ago

FYI, for reference also see this related ZHA issue discussion for Home Assistant core -> https://github.com/home-assistant/core/issues/69375

lsismeiro commented 2 years ago

Hi, there is an easy fix for this problem, just increase the helper size to 500. There shouldn't be any side effects of this change. Regards, Luis Sismeiro

Sab44 commented 2 years ago

@EPMatt I'm going to close this issue as is looks like it will be fixed as part of #314.

EPMatt commented 2 years ago

⚠️ 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 commented 2 years ago

Hi @Sab44,

I'm reopening the issue and linking it to #314, so we can keep track of its status once we merge the PR in main.

Thank you for your patience! Looking forward to solve this major issue with a few controller blueprints - hopefully in the next few days. :)