Skip to content

Instantly share code, notes, and snippets.

@kristofer84
Last active March 19, 2023 23:01
Show Gist options
  • Save kristofer84/917fe88461cf3dd2a0bf6dfa04daaf67 to your computer and use it in GitHub Desktop.
Save kristofer84/917fe88461cf3dd2a0bf6dfa04daaf67 to your computer and use it in GitHub Desktop.
Home Assistant Flic button integration
blueprint:
name: Flic button
description: |
Create automations to react to Flic button clicks. Triggered by event type 'flic_click'.
The event data should contain flic_name and click_type (single/double/hold).
domain: automation
input:
flic_name:
name: Flic name
description: Name of the Flic button sent in the event.
default: "flic"
single:
name: Button pressed 1 time
description: Actions to run for a single click.
default: []
selector:
action:
double:
name: Button pressed 2 times
description: Actions to run for a double click.
default: []
selector:
action:
hold:
name: Button hold
description: Actions to run when holding the button.
default: []
selector:
action:
mode: parallel
max: 10
max_exceeded: silent
trigger:
platform: event
event_type: flic_click
event_data:
button_name: !input flic_name
condition:
action:
- variables:
click_type: "{{ trigger.event.data.click_type }}"
- choose:
- conditions: "{{ click_type == 'single' }}"
sequence: !input single
- choose:
- conditions: "{{ click_type == 'double' }}"
sequence: !input double
- choose:
- conditions: "{{ click_type == 'hold' }}"
sequence: !input hold
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment