Deconz - IKEA Tradfri On/Off Button to control input_select

Sharing my blueprint to select the previous/next/first/last value of an input_select. This is used by some people to cycle through a set of scenes.

Functions:

  • Long Press On: Select first
  • Short Press On: Select previous
  • Long Press Off: Select last
  • Short Press Off: Select next

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

blueprint:
  name: deCONZ - IKEA Tradfri on/off scene switch via input_select
  description: '"Set Home Assistant scenes with IKEA Tradfri on/off switch


    Select the Tradfri remote and your input_select.

    You can select next or previous value of your input_select doing a short press
    on the remote. Pressing long will select the first or last value."

    '
  domain: automation
  input:
    remote:
      name: Remote
      description: The remote that will control the selector
      selector:
        device:
          integration: deconz
          manufacturer: IKEA of Sweden
          model: TRADFRI on/off switch
    input_select:
      name: Input Select Field
      description: The input_select that will be changed
      selector:
        target:
          entity:
            domain: input_select
  source_url: https://community.home-assistant.io/t/deconz-ikea-tradfri-on-off-button-to-control-input-select/348984
mode: restart
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:
    - service: input_select.select_previous
      target: !input 'input_select'
      data:
        cycle: false
  - conditions:
    - '{{ event == 2002 }}'
    sequence:
    - service: input_select.select_next
      target: !input 'input_select'
      data:
        cycle: false
  - conditions:
    - '{{ event == 1001 }}'
    sequence:
    - service: input_select.select_first
      target: !input 'input_select'
  - conditions:
    - '{{ event == 2001 }}'
    sequence:
    - service: input_select.select_last
      target: !input 'input_select'