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
834 stars 250 forks source link

Bug - Double Press event not recognized/working with E1766 #592

Closed aatifk closed 8 months ago

aatifk commented 8 months ago

Blueprint name

Controller - IKEA E1766 TRÅDFRI Open/Close Remote

Home Assistant Core Version

2024.1.3

Home Assistant Installation Type

Home Assistant Operating System

Description

I have followed the instructions fully and created a helper as the documentation suggests, and everything seems to be in order. However, the double press events are not firing at all. Not sure what's wrong here. Running via Z2M. I've also tried playing around with Double Press Delay values from 100ms all the way to 800ms, but nothing has worked so far. Any help? What am I doing wrong?

Automation YAML config

alias: Controller Test Automation
description: ""
use_blueprint:
  path: EPMatt/ikea_e1766.yaml
  input:
    integration: Zigbee2MQTT
    controller_entity: sensor.bedroom_lamps_button_action
    helper_last_controller_event: input_text.bedroom_lamps_button_helper
    helper_double_press_delay: 250
    action_button_up_short:
      - service: light.turn_on
        metadata: {}
        data: {}
        target:
          entity_id: light.rec_room_overhead_lights
    action_button_up_double:
      - service: light.turn_on
        metadata: {}
        data: {}
        target:
          entity_id: light.rec_room_floor_lamps
    action_button_down_short:
      - service: light.turn_off
        metadata: {}
        data: {}
        target:
          entity_id: light.rec_room_overhead_lights
    action_button_down_double:
      - service: light.turn_off
        metadata: {}
        data: {}
        target:
          entity_id: light.rec_room_floor_lamps
    action_button_down_release: []
    button_up_double_press: true
    button_down_double_press: true
    helper_debounce_delay: 0
    action_button_up_release: []

To Reproduce

Create the automation using my YAML and the same helper name, and only the short press events work.

Expected behavior

The double-press events should work, but the short press events are fired immediately.

Actual Behaviour

Double-press events not run at all

Additional Details

Screenshots

No response

Additional context

No response

aatifk commented 8 months ago

For anyone having the same issue, I found the solution in another thread. The regex for matching to helper controller events is out of date in the blueprint. Open the blueprint YAML file (EPMatt/ikea_e1766.yaml), find the two entities that start with regex_match and replace the existing first regex_match with this:

regex_match("^\{((\"a\":\".*\"|\"t\":\d+\.\d+)(,)?){2}\}$")) else as_timestamp("1970-01-01 00:00:00"))) * 1000 }}' for the second one, use this

regex_match("^\{((\"a\":\".*\"|\"t\":\d+\.\d+)(,)?){2}\}$")) else "" }}'

basically this eliminated the spaces from the regex match which is what's causing the blueprint to not recognize double-press events. for good measure, don't forget to reload automations or restart home assistant after this.

github-actions[bot] commented 7 months ago

Hi there,

🔒 This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new ticket for related bugs.

Thanks!