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

Bug - Controller - IKEA E1743 TRÅDFRI On/Off Switch & Dimmer - Double Tap stopped working #544

Open
1 task
tumtumsback opened this issue May 5, 2023 · 21 comments · May be fixed by #545
Open
1 task
Labels
blueprint An issue related to a blueprint bug Something isn't working

Comments

@tumtumsback
Copy link

tumtumsback commented May 5, 2023

Blueprint name

Controller - IKEA E1743 TRÅDFRI On/Off Switch & Dimmer

Home Assistant Core Version

2023.5.1

Home Assistant Installation Type

Home Assistant Operating System

Description

The Blueprint 'Controller - IKEA E1743 On/Off Switch & Dimmer' stopped working after recent Home Assistant update

Upon further inspection it’s simply the double tap feature of that controller/blueprint that’s not working. The single press and long press functionality is working but the double press functionality is dead and appears to be throwing errors in the error log. Here is just one example of what I see simply after a home assistant reboot:

Logger: homeassistant.components.automation
Source: components/automation/config.py:207
Integration: Automation (documentation, issues)
First occurred: 6:58:51 AM (1 occurrences)
Last logged: 6:58:51 AM

Blueprint 'Controller - IKEA E1743 On/Off Switch & Dimmer' generated invalid automation with inputs {'integration': 'deCONZ', 'controller_device': 'd798e7a289381fe620c8ca2f6f1c7c9e', 'helper_last_controller_event': 'input_text.text1', 'action_button_up_double': [{'service': 'light.turn_on', 'data': {}, 'target': {'entity_id': 'light.living_room_fan_lights'}}], 'action_button_down_double': [{'service': ''}], 'button_up_double_press': True, 'button_down_double_press': True, 'helper_double_press_delay': 1000, 'action_button_up_short': [{'type': 'turn_on', 'device_id': 'bc0d7e01c84ff0e016a4c6bd1a6c480b', 'entity_id': 'light.texas_instruments_cc1352_cc2652_z_stack_3_30_build_20220219_living_room_downlights_zha_group_zha_group_0x0002', 'domain': 'light', 'brightness_pct': 100}], 'action_button_down_short': [{'type': 'turn_off', 'device_id': 'bc0d7e01c84ff0e016a4c6bd1a6c480b', 'entity_id': 'light.texas_instruments_cc1352_cc2652_z_stack_3_30_build_20220219_living_room_downlights_zha_group_zha_group_0x0002', 'domain': 'light'}], 'action_button_up_long': [{'device_id': 'bc0d7e01c84ff0e016a4c6bd1a6c480b', 'domain': 'light', 'entity_id': 'light.texas_instruments_cc1352_cc2652_z_stack_3_30_build_20220219_living_room_downlights_zha_group_zha_group_0x0002', 'type': 'brightness_increase'}], 'action_button_down_long': [{'device_id': 'bc0d7e01c84ff0e016a4c6bd1a6c480b', 'domain': 'light', 'entity_id': 'light.texas_instruments_cc1352_cc2652_z_stack_3_30_build_20220219_living_room_downlights_zha_group_zha_group_0x0002', 'type': 'brightness_decrease'}], 'button_up_long_loop': True, 'button_down_long_loop': True, 'button_up_long_max_loop_repeats': 2500, 'button_down_long_max_loop_repeats': 2500}: Service does not match format . for dictionary value @ data['action'][3]['choose'][3]['sequence'][0]['choose'][0]['sequence'][0]['choose'][0]['sequence'][2]['choose'][0]['sequence'][0]['service']. Got ''

Automation YAML config

alias: Bathroom - Doubletap - Fan
description: ""
use_blueprint:
  path: EPMatt/ikea_e1743.yaml
  input:
    integration: deCONZ
    controller_device: 1291a6dbd2844a87b99006cff6b0a308
    helper_last_controller_event: input_text.text1
    button_up_double_press: true
    button_down_double_press: true
    action_button_up_double:
      - type: turn_on
        device_id: 4b3c7d62506e2024325e9ac0a60eeed0
        entity_id: switch.bathroom_fan
        domain: switch
    action_button_down_double:
      - type: turn_off
        device_id: 4b3c7d62506e2024325e9ac0a60eeed0
        entity_id: switch.bathroom_fan
        domain: switch
    helper_double_press_delay: 1000

To Reproduce

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

Logger: homeassistant.helpers.template
Source: helpers/template.py:237
First occurred: 8:35:01 AM (1 occurrences)
Last logged: 8:35:01 AM

Template variable error: 'dict object' has no attribute 'event' when rendering '{%- 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 -%}'

Logger: homeassistant.components.automation.bathroom_doubletap_fan
Source: helpers/script.py:410
Integration: Automation (documentation, issues)
First occurred: 8:35:01 AM (1 occurrences)
Last logged: 8:35:01 AM

Bathroom - Doubletap - Fan: Error executing script. Error rendering template for variables at pos 2: UndefinedError: 'dict object' has no attribute 'event'

Logger: homeassistant.components.automation.bathroom_doubletap_fan
Source: components/automation/init.py:254
Integration: Automation (documentation, issues)
First occurred: 8:35:01 AM (1 occurrences)
Last logged: 8:35:01 AM

Error while executing automation automation.bathroom_doubletap_fan: UndefinedError: 'dict object' has no attribute 'event'

Expected behavior

I would expect the device_id of 4b3c7d62506e2024325e9ac0a60eeed0 to turn on/off.

Actual Behaviour

Nothing -- error is thrown, and device never receives command.

Additional Details

  • I'd like to help developing a fix for this issue.

Screenshots

No response

Additional context

No response

@tumtumsback tumtumsback added blueprint An issue related to a blueprint bug Something isn't working labels May 5, 2023
@tumtumsback
Copy link
Author

FYI, just rolled back to a backup from a week ago, which is running 2023.4.6 of Home Assistant Core. Problem goes away, double tap is back to working... this controller doesn't appear to be playing well with 2023.5.1

@jempo
Copy link

jempo commented May 5, 2023

Here the same issue and enviroment.

@tumtumsback
Copy link
Author

I'm just going to sit here @ 2023.4.6 until this is confirmed fixed. I need my bathroom fan to work 😂

@0wnjei
Copy link

0wnjei commented May 5, 2023

Same happens for E2001/E2002 STYRBAR remote control. Double-click stopped working after 2023.5

@MattFromTheFuture
Copy link

Same issue for me where double taps don't work, multiple Ikea remotes (E1766 and E1524/E1810) have this issue for me once upgrading to 2023.5.0.

@rubinho76
Copy link

Similar problem since the update with SYMFONISK sound controller (E1744).
I can no longer stop the volume control. Either the volume moves to 0% or to 100%.
However, the helper sends a slightly different format since the update. Before the update there was always a space after the colon, after the update this has disappeared.
I have no idea if this affects the function, but that’s what I notice.

After update:
{"a":"brightness_stop","t":1683304412.369172
{"a":"brightness_move_down","t":1683304412.024501}
{"a":"brightness_stop","t":1683197195.208142
{"a":"brightness_move_down","t":1683197194.97702}
Bevore update:
{"a": "brightness_stop", "t": 1683004163.070071}
{"a": "brightness_move_up", "t": 1683004162.884988}
{"a": "brightness_stop", "t": 1683004163.070071

@Soukyuu
Copy link

Soukyuu commented May 5, 2023

The philips hue version is affected as well - only double tap is dead

@platte-73
Copy link

Here the same. double tap not working anymore

@0wnjei
Copy link

0wnjei commented May 8, 2023

In case anyone is interested, this solution made my double-click events start working again.

@platte-73
Copy link

I have tried this for the ikea E1743 remote but this is not working

@tumtumsback
Copy link
Author

tumtumsback commented May 12, 2023

I have tried this for the ikea E1743 remote but this is not working

Yep ... I've tried to implement this new regex six ways from Sunday and no dice. I've modified the original yaml with new regex, tried completing replacing the yaml, tried completely deleting all automations related to this blueprint, completely deleting the blueprint, reinstalling the blueprint, then updating the regex, then recreating the automations from scratch, absolutely no dice with these E1743. I am still stuck at 2023.4.6 until this gets fixed.

@jempo
Copy link

jempo commented May 16, 2023

Hi, for me this regex works perfectly with zigbee2mqtt:
regex_match("^\{((\"a\":\".*\"|\"t\":\d+\.\d+)(,)?){2}\}$"))
HA version 2023.5.3

@tumtumsback
Copy link
Author

For anyone with Deconz who is having problems, use this regex:

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

@anthonylavado
Copy link

Hrm. I don't use double tap, but my long presses don't work correctly on the new version. It behaves like #547, where a king press doesn't "stop" when I let go of the button and instead just goes all the way to 0%/100% brightness on a light, depending on which direction I'm trying to dim.

Using ZHA.

I'll see if any of these help me as well. If not, I'll have a look at the events and helper, and probably open a new issue.

@Soukyuu
Copy link

Soukyuu commented May 22, 2023

I have tried this for the ikea E1743 remote but this is not working

Yep ... I've tried to implement this new regex six ways from Sunday and no dice. I've modified the original yaml with new regex, tried completing replacing the yaml, tried completely deleting all automations related to this blueprint, completely deleting the blueprint, reinstalling the blueprint, then updating the regex, then recreating the automations from scratch, absolutely no dice with these E1743. I am still stuck at 2023.4.6 until this gets fixed.

I did the following:

  • edit the blueprint yaml as @0wnjei suggested
  • disable the double tap event in the automation
  • save the automation
  • go to developer settings -> reload automations
  • enable the double tap event in the automation
  • save the automation

Now it works. In my case, for the philips hue dimmer, though.

@tumtumsback
Copy link
Author

tumtumsback commented May 22, 2023

I have tried this for the ikea E1743 remote but this is not working

Yep ... I've tried to implement this new regex six ways from Sunday and no dice. I've modified the original yaml with new regex, tried completing replacing the yaml, tried completely deleting all automations related to this blueprint, completely deleting the blueprint, reinstalling the blueprint, then updating the regex, then recreating the automations from scratch, absolutely no dice with these E1743. I am still stuck at 2023.4.6 until this gets fixed.

I did the following:

  • edit the blueprint yaml as @0wnjei suggested
  • disable the double tap event in the automation
  • save the automation
  • go to developer settings -> reload automations
  • enable the double tap event in the automation
  • save the automation

Now it works. In my case, for the philips hue dimmer, though.

Thanks for your input.

I got this working in Deconz with my E1743's and 2023.5+ by using the following regex:
regex_match("^{(("a":.*|"t":\d+.\d+)(,)?){2}}$"))

@anthonylavado
Copy link

Though this is mainly about double tap, I wanted to add that my ZHA long press issue with E1743 was fixed by #545. In short, it looks like all the events are now processed with spaces removed, so that's why all these functions break until we change the blueprint regex to account for this.

@danleongjy
Copy link

danleongjy commented May 26, 2023

I can confirm that making the changes in #545 in the following blueprints will restore the double-press functionality via ZHA:
ikea_e1524_e1810.yaml
ikea_e1743.yaml
ikea_e1766.yaml
ikea_e2001_e2002.yaml

@platte-73
Copy link

Working now E1743 zigbee2mqtt 😄

@tumtumsback
Copy link
Author

I can confirm that making the changes in #545 in the following blueprints will restore the double-press functionality: ikea_e1524_e1810.yaml ikea_e1743.yaml ikea_e1766.yaml ikea_e2001_e2002.yaml

you have to say which integration you're using, though (ZHA, Deconz, Z2M) ... I had to do something different to get my Deconz working: regex_match("^{(("a":.*|"t":\d+.\d+)(,)?){2}}$"))

@GazzaHazza
Copy link

Hi, for me this regex works perfectly with zigbee2mqtt: regex_match("^\{((\"a\":\".*\"|\"t\":\d+\.\d+)(,)?){2}\}$")) HA version 2023.5.3

Where did you change the regex? What line?
Sorry super new to HA automations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blueprint An issue related to a blueprint bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants