Skip to content

Instantly share code, notes, and snippets.

@nielswind
Created February 2, 2023 13:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nielswind/37da780a9a9f877617a39106de06b259 to your computer and use it in GitHub Desktop.
Save nielswind/37da780a9a9f877617a39106de06b259 to your computer and use it in GitHub Desktop.
blueprint:
name: deCONZ - Tradfri Shortcut Button - 4 state
description: 'Control anything using Tradfri Shortcut Button remote'
domain: automation
input:
remote:
name: Remote
description: Tradfri Shortcut Button to use
selector:
device:
integration: deconz
manufacturer: IKEA of Sweden
model: TRADFRI SHORTCUT Button
button_single_press:
name: Button single press
description: Action to run on single press button
default: []
selector:
action: {}
button_double_press:
name: Button double press
description: Action to run on double press button
default: []
selector:
action: {}
button_long_press:
name: Button long press
description: Action to run on hold button
default: []
selector:
action: {}
button_long_release:
name: Button long when release
description: Action to run on release of hold 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_single_press'
- conditions:
- '{{ event == 2004 }}'
sequence: !input 'button_double_press'
- conditions:
- '{{ event == 1001 }}'
sequence: !input 'button_long_press'
- conditions:
- '{{ event == 1003 }}'
sequence: !input 'button_long_release'
@nielswind
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment