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. Manage Clusters
  3. “Basic (Endpoint id: 1, Id: 0x0000, Type: in)”
  4. Cluster Attributes → “sw_build_id (id: 0x4000)”
  5. Click “Get Zigbee 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.

blueprint:
  name: ZHA - IKEA Tradfri Shortcut button
  description: Control anything with the ikea shortcut button
  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: {}
  source_url: https://community.home-assistant.io/t/zha-ikea-tradfri-shortcut-button/261936
mode: single
max_exceeded: silent
trigger:
- platform: event
  event_type: zha_event
  event_data:
    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:

  # short click
  - conditions:
    - '{{ endpoint_id == 1 }}'
    - '{{ cluster_id == 6 }}'
    - '{{ command == ''on'' }}'
    sequence:
    - choose:
      default: !input 'button_short'
    - wait_for_trigger:
      - platform: event
        event_type: zha_event
        event_data:
          device_id: !input 'shortcut_button'
          endpoint_id: 1
          cluster_id: 6
          command: "on"
      timeout:
        seconds: 1

  # double click
  - conditions:
    - '{{ endpoint_id == 1 }}'
    - '{{ cluster_id == 6 }}'
    - '{{ command == ''off'' }}'
    sequence:
    - choose:
      default: !input 'button_double'
    - wait_for_trigger:
      - platform: event
        event_type: zha_event
        event_data:
          device_id: !input 'shortcut_button'
          endpoint_id: 1
          cluster_id: 6
          command: "off"
      timeout:
        seconds: 1

  # long click
  - conditions:
    - '{{ endpoint_id == 1 }}'
    - '{{ cluster_id == 8 }}'
    - '{{ command == ''move_with_on_off'' }}'
    sequence:
    - choose:
      default: !input 'button_long'
    - wait_for_trigger:
      - platform: event
        event_type: zha_event
        event_data:
          device_id: !input 'shortcut_button'
          endpoint_id: 1
          cluster_id: 8
          command: "move_with_on_off"
      timeout:
        seconds: 1

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.

1 Like

Thank you for this! Just noticed my double click actions stopped working, and the new “off” events coming from the button. Was about ready to rewrite this thing myself, but glad to see your working fix beat me to it :slight_smile: