BETA TESTING - ZHA IKEA Tradfri Shortcut button firmware 2.3.075 or greater

This is for BETA TESTING a new version of the Blueprint found here: ZHA IKEA Tradfri Shortcut button firmware 2.3.075 or greater

Check the version number of your shortcut button

As of 2.3.075 the shortcut buttons no longer fire multiple messages for each press, and a new double press “off” command is introduced. This makes automations much simpler.

Checking software version numbers in ZHA:

  1. Device page of the device in question
  2. 3 dots next to “RECONFIGURE” → Manage Zigbee Device
  3. Clusters → Basic (Endpoint id: 1, Id: 0x0000, Type: in)
  4. Cluster Attributes → sw_build_id (id: 0x4000)
  5. Click Read Attribute
  6. If device is battery powered, trigger it somehow
  7. The version should appear in the “Value” box

If you are using an older version then you can have a look at this blueprint ZHA - IKEA Tradfri Shortcut button

If you want to update your firmware then you may find this link useful. But beware, your other Tradfri products are likely to be updated during the process and there are some breaking changes, particularly with the binding behaviour of the on/off switches.

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled. Are you sure you don’t want the release version?

blueprint:
  name: BETA ZHA - IKEA Tradfri Shortcut button
  description: Control anything with the ikea shortcut button
  source_url: https://https://community.home-assistant.io/t/zha-ikea-tradfri-shortcut-button-firmware-2-3-075-or-greater/402565
  domain: automation
  input:
    shortcut_button:
      name: Device
      description: Select an IKEA shortcut button
      selector:
        device:
          integration: zha
          manufacturer: IKEA of Sweden
          model: TRADFRI SHORTCUT Button
    button_short:
      name: Single click
      description: 'Choose action(s) when short pressed:'
      default: []
      selector:
        action: {}
    button_double:
      name: Double click
      description: 'Choose action(s) when double pressed:'
      default: []
      selector:
        action: {}
    button_long:
      name: Long click
      description: 'Choose action(s) when long pressed:'
      default: []
      selector:
        action: {}
    button_release:
      name: Release Long Click
      description: 'Choose action(s) (if any) when releasing long press. This will run in a separate call of the automation so in "single" mode it may be suppressed by the long-press action if that takes some time. It cannot easily be used to stop a long-press action, for that - use mode: "restart instead" '
      default: []
      selector:
        action: {}
    automation_mode:
      name: Automation Mode
      description: 'The [mode](https://www.home-assistant.io/docs/automation/modes/) for this automation. Default is "single" - further actions are blocked whilst the automation is running. Choose "resart" if you want the long-press action to stop on release.'
      default: single
      selector:
        select:
          options:
            - single
            - restart
            - queued
            - parallel
mode: !input 'automation_mode'
trigger:
  - platform: event
    event_type: zha_event
    event_data:
      cluster_id: 6
      device_id: !input 'shortcut_button'
  - platform: event
    event_type: zha_event
    event_data:
      cluster_id: 8
      device_id: !input 'shortcut_button'
action:
- variables:
    command: '{{ trigger.event.data.command }}'
    cluster_id: '{{ trigger.event.data.cluster_id }}'
    endpoint_id: '{{ trigger.event.data.endpoint_id }}'
    args: '{{ trigger.event.data.args }}'
- choose:
  - conditions:
    - '{{ endpoint_id == 1 }}'
    - '{{ cluster_id == 6 }}'
    - '{{ command == ''on'' }}'
    sequence:
    - choose:
      default: !input 'button_short'
  - conditions:
    - '{{ endpoint_id == 1 }}'
    - '{{ cluster_id == 6 }}'
    - '{{ command == ''off'' }}'
    sequence:
    - choose:
      default: !input 'button_double'
  - conditions:
    - '{{ endpoint_id == 1 }}'
    - '{{ cluster_id == 8 }}'
    - '{{ command == ''move_with_on_off'' }}'
    sequence:
    - choose:
      default: !input 'button_long'
  - conditions:
    - '{{ endpoint_id == 1 }}'
    - '{{ cluster_id == 8 }}'
    - '{{ command == ''stop_with_on_off'' }}'
    sequence:
    - choose:
      default: !input 'button_release'

Fork of: ZHA - IKEA Tradfri Shortcut button

Edit 1: On my install at least the ‘wait_for_trigger’ is never triggered and the automation times out.
Edit 2: 2023-07-02 Edited post instructions for checking firmeware version for the new UI

1 Like

2023-07-02 Version 2 release:

  1. Removed the - wait_for_trigger: and timeout blocks as I am not sure what they were achieving
  2. The automation will only trigger on cluster_id 6 and 8. So it will no longer trigger on device checkin which will simplify logbooks, debugging and traces.
  3. Automation mode is now user-configurable
  4. Button release action is now configurable.
    To update either see the guide here or delete all your automations that use the blueprint and then delete the blueprint and re-import with the link above.

An example of a version that dims a light until the button is released. Automation Mode: restart doing the work of ‘stopping’ here. When the button is released the automation is triggered again which interrupts the previous run which was doing the dimming.

alias: "[ZHA] Study Shortcut Button Beta test"
description: ""
use_blueprint:
  path: >-
    HarvsG/beta-testing-zha-ikea-tradfri-shortcut-button-firmware-2-3-075-or-greater.yaml
  input:
    shortcut_button: cf69732507e91ead4a2f4c7ffae3e7b5
    button_short:
      - service: light.toggle
        data: {}
        target:
          entity_id: light.study_light
    button_double:
      - service: light.toggle
        data: {}
        target:
          entity_id: light.study_lamp
    button_long:
      - repeat:
          while:
            - condition: numeric_state
              entity_id: light.study_lamp
              below: 256
              above: 3
              attribute: brightness
          sequence:
            - service: light.turn_on
              data:
                brightness_step_pct: -1
              target:
                entity_id: light.study_lamp
    button_release: []
    automation_mode: restart

If you wanted the button to switch between dimming and brightening, you could created a hidden input Boolean and toggle it in button_release.

Hi,

I get this error message MANY times in the log. Any idea of what’s wrong??

2023-07-08 19:18:31.877 WARNING (MainThread) [homeassistant.components.automation.beta_zha_ikea_tradfri_shortcut_button] BETA ZHA - IKEA Tradfri Shortcut button: Already running

Also, for some reason, my Home Assistant cannot fetch the firmware version of my shortcut button

Are you ‘waking’ the device by clicking it whilst reading the attribute? (These battery powered zigbee devices sleep unless they are sending commands, so they will never respond to a server request unless they are woken - they are probably awake for less than a second after a click)

Thanks for your response. I ran into another problem before I had the chance to test what you suggested. The battery was drained within 24 hours for some reason. Any clue of what’s causing the battery to get depleted??

I had that issue when I tried the skyconnect. I switched back to conbee II :frowning: I’m not sure what causes it but if you hunt around this forum and the github issues for HA core

What’s the status of this “beta test”? Can I help? I have a bunch of these buttons and wrote my own blueprint recently but this one looks more “complete” so I’d prefer to use this.

At the moment it is almost* the same as the linked thread at the top:

I just keep this thread open so I can test/share changes as needed.

*This version doesn’t have max_exceeded: silent to aid debugging.