Ikea Tradfri 2 Button On/Off Switch Long and Short Presses

As per the title.
Allows you to set actions based on long and short presses of the ikea 2 button switch.

blueprint:
  name: deCONZ - IKEA two button remote
  description: 'Control anything using IKEA two button remote

    '
  domain: automation
  input:
    remote:
      name: Remote
      description: IKEA remote to use
      selector:
        device:
          integration: deconz
          manufacturer: IKEA of Sweden
          model: TRADFRI on/off switch
    button_on_short:
      name: On button short press
      description: Action to run on press on button
      default: []
      selector:
        action: {}
    button_on_long:
      name: On button long press
      description: Action to run on hold on button
      default: []
      selector:
        action: {}
    button_off_short:
      name: Off button short press
      description: Action to run on press on button
      default: []
      selector:
        action: {}
    button_off_long:
      name: Off button long press
      description: Action to run on press off button
      default: []
      selector:
        action: {}
    
mode: restart
max_exceeded: silent
trigger:
- platform: event
  event_type: deconz_event
  event_data:
    device_id: !input 'remote'
action:
- variables:
    event: '{{ trigger.event.data.event }}'
- choose:
  - conditions:
    - '{{ event == 1002 }}'
    sequence: !input 'button_on_short'
  - conditions:
    - '{{ event == 1001 }}'
    sequence: !input 'button_on_long'
  - conditions:
    - '{{ event == 2002 }}'
    sequence: !input 'button_off_short'
  - conditions:
    - '{{ event == 2001 }}'
    sequence: !input 'button_off_long'

1 Like

Got the blueprint in. Reports no devices found. I have access to them through other automations. Has something changed?

Worked flawlessly, many thanks. Sadly, the 2-button remotes are hard to get these days.