This blueprint only adds the option to double and triple click on each of the five buttons. The delay between the clicks is customizable.
blueprint:
name: Z2M - IKEA five button remote (with double and triple clicks)
description: 'Control lights with an IKEA five button remote (the round ones).
Every button is fully customizable and can be double and triple clicked.
In order to do so I added a delay to check if the button is pressed again or not.
However, there is the option to trigger an action as soon as the buttons are pressed.
This can be useful for degugging purposes (checking if and when the first and second click are effectively heard)
'
domain: automation
input:
remote:
name: Remote
description: IKEA remote to use
selector:
entity:
domain: sensor
interval:
name: Max Interval between Clicks
description: Maximum time interval between two clicks. Corresponds to the delay from the last click to the triggering of the action
default: 0.5
selector:
number:
min: 0
max: 10
unit_of_measurement: "seconds"
step: 0.1
mode: box
button_center_x1:
name: Center button - single click
description: Action to run on single center button click
default: []
selector:
action: {}
button_center_x1_immediate:
name: Center button - single click (immediate response)
description: Action to run as soon as the center button is clicked, without waiting if there's a second click or not
default: []
selector:
action: {}
button_center_x2:
name: Center button - double click
description: Action to run on double center button click
default: []
selector:
action: {}
button_center_x2_immediate:
name: Center button - double click (immediate response)
description: Action to run as soon as the center button is clicked the second time, without waiting if there's a third click or not
default: []
selector:
action: {}
button_center_x3:
name: Center button - triple click
description: Action to run on triple center button click
default: []
selector:
action: {}
button_left_x1:
name: Left button - single click
description: Action to run on single left button click
default: []
selector:
action: {}
button_left_x1_immediate:
name: Left button - single click (immediate response)
description: Action to run as soon as the left button is clicked, without waiting if there's a second click or not
default: []
selector:
action: {}
button_left_x2:
name: Left button - double click
description: Action to run on double left button click
default: []
selector:
action: {}
button_left_x2_immediate:
name: Left button - double click (immediate response)
description: Action to run as soon as the left button is clicked the second time, without waiting if there's a third click or not
default: []
selector:
action: {}
button_left_x3:
name: Left button - triple click
description: Action to run on triple left button click
default: []
selector:
action: {}
button_left_hold:
name: Left button - hold
description: Action to run on left button hold
default: []
selector:
action: {}
button_left_release:
name: Left button - release
description: Action to run on left button release
default: []
selector:
action: {}
button_right_x1:
name: Right button - single click
description: Action to run on single right button click
default: []
selector:
action: {}
button_right_x1_immediate:
name: Right button - single click (immediate response)
description: Action to run as soon as the right button is clicked, without waiting if there's a second click or not
default: []
selector:
action: {}
button_right_x2:
name: Right button - double click
description: Action to run on double right button click
default: []
selector:
action: {}
button_right_x2_immediate:
name: Right button - double click (immediate response)
description: Action to run as soon as the right button is clicked the second time, without waiting if there's a third click or not
default: []
selector:
action: {}
button_right_x3:
name: Right button - triple click
description: Action to run on triple right button click
default: []
selector:
action: {}
button_right_hold:
name: Right button - hold
description: Action to run on right button hold
default: []
selector:
action: {}
button_right_release:
name: Right button - release
description: Action to run on right button release
default: []
selector:
action: {}
button_up_x1:
name: Up button - single click
description: Action to run on single up button click
default: []
selector:
action: {}
button_up_x1_immediate:
name: Up button - single click (immediate response)
description: Action to run as soon as the up button is clicked, without waiting if there's a second click or not
default: []
selector:
action: {}
button_up_x2:
name: Up button - double click
description: Action to run on double up button click
default: []
selector:
action: {}
button_up_x2_immediate:
name: Up button - double click (immediate response)
description: Action to run as soon as the up button is clicked the second time, without waiting if there's a second click or not
default: []
selector:
action: {}
button_up_x3:
name: Up button - triple click
description: Action to run on triple up button click
default: []
selector:
action: {}
button_up_hold:
name: Up button - hold
description: Action to run on up button hold
default: []
selector:
action: {}
button_up_release:
name: Up button - release
description: Action to run on up button release
default: []
selector:
action: {}
button_down_x1:
name: Down button - single click
description: Action to run on single down button click
default: []
selector:
action: {}
button_down_x1_immediate:
name: Down button - single click (immediate response)
description: Action to run as soon as the down button is clicked, without waiting if there's a second click or not
default: []
selector:
action: {}
button_down_x2:
name: Down button - double click
description: Action to run on double down button click
default: []
selector:
action: {}
button_down_x2_immediate:
name: Down button - double click (immediate response)
description: Action to run as soon as the down button is clicked the second time, without waiting if there's a third click or not
default: []
selector:
action: {}
button_down_x3:
name: Down button - triple click
description: Action to run on triple down button click
default: []
selector:
action: {}
button_down_hold:
name: Down button - hold
description: Action to run on down button hold
default: []
selector:
action: {}
button_down_release:
name: Down button - release
description: Action to run on down button release
default: []
selector:
action: {}
mode: single
max_exceeded: silent
variables:
time: " {{ as_timestamp(now()) }} "
interval: !input "interval"
remote: !input "remote"
trigger:
- platform: state
entity_id: !input "remote"
attribute: action
not_to: ""
action:
- variables:
command: " {{ trigger.to_state.attributes.action }} "
- choose:
- conditions:
- "{{ command == 'toggle' }}"
sequence:
- choose: []
default: !input "button_center_x1_immediate"
- wait_for_trigger:
- platform: state
entity_id: !input "remote"
attribute: action
to: "toggle"
timeout: '{{interval}}'
continue_on_timeout: true
- if:
- condition: template
value_template: "{{(as_timestamp(now()) - time ) >= interval }}"
then: !input "button_center_x1"
else:
- variables:
time: " {{ as_timestamp(now()) }} "
- choose: []
default: !input "button_center_x2_immediate"
- wait_for_trigger:
- platform: state
entity_id: !input "remote"
attribute: action
to: "toggle"
timeout: '{{interval}}'
continue_on_timeout: true
- if:
- condition: template
value_template: "{{(as_timestamp(now()) - time ) >= interval }}"
then: !input "button_center_x2"
else: !input "button_center_x3"
- conditions:
- "{{ command == 'brightness_up_click' }}"
sequence:
- choose: []
default: !input "button_up_x1_immediate"
- wait_for_trigger:
- platform: state
entity_id: !input "remote"
attribute: action
to: "brightness_up_click"
timeout: '{{interval}}'
continue_on_timeout: true
- if:
- condition: template
value_template: "{{(as_timestamp(now()) - time ) >= interval }}"
then: !input "button_up_x1"
else:
- variables:
time: " {{ as_timestamp(now()) }} "
- choose: []
default: !input "button_up_x2_immediate"
- wait_for_trigger:
- platform: state
entity_id: !input "remote"
attribute: action
to: "brightness_up_click"
timeout: '{{interval}}'
continue_on_timeout: true
- if:
- condition: template
value_template: "{{(as_timestamp(now()) - time ) >= interval }}"
then: !input "button_up_x2"
else: !input "button_up_x3"
- conditions:
- "{{ command == 'brightness_up_hold' }}"
sequence: !input button_up_hold
- conditions:
- "{{ command == 'brightness_up_release' }}"
sequence: !input button_up_release
- conditions:
- "{{ command == 'brightness_down_click' }}"
sequence:
- choose: []
default: !input "button_down_x1_immediate"
- wait_for_trigger:
- platform: state
entity_id: !input "remote"
attribute: action
to: "brightness_down_click"
timeout: '{{interval}}'
continue_on_timeout: true
- if:
- condition: template
value_template: "{{(as_timestamp(now()) - time ) >= interval }}"
then: !input "button_down_x1"
else:
- variables:
time: " {{ as_timestamp(now()) }} "
- choose: []
default: !input "button_down_x2_immediate"
- wait_for_trigger:
- platform: state
entity_id: !input "remote"
attribute: action
to: "brightness_down_click"
timeout: '{{interval}}'
continue_on_timeout: true
- if:
- condition: template
value_template: "{{(as_timestamp(now()) - time ) >= interval }}"
then: !input "button_down_x2"
else: !input "button_down_x3"
- conditions:
- "{{ command == 'brightness_down_hold' }}"
sequence: !input button_down_hold
- conditions:
- "{{ command == 'brightness_down_release' }}"
sequence: !input button_down_release
- conditions:
- "{{ command == 'arrow_left_click' }}"
sequence:
- choose: []
default: !input "button_left_x1_immediate"
- wait_for_trigger:
- platform: state
entity_id: !input "remote"
attribute: action
to: "arrow_left_click"
timeout: '{{interval}}'
continue_on_timeout: true
- if:
- condition: template
value_template: "{{(as_timestamp(now()) - time ) >= interval }}"
then: !input "button_left_x1"
else:
- variables:
time: " {{ as_timestamp(now()) }} "
- choose: []
default: !input "button_left_x2_immediate"
- wait_for_trigger:
- platform: state
entity_id: !input "remote"
attribute: action
to: "arrow_left_click"
timeout: '{{interval}}'
continue_on_timeout: true
- if:
- condition: template
value_template: "{{(as_timestamp(now()) - time ) >= interval }}"
then: !input "button_left_x2"
else: !input "button_left_x3"
- conditions:
- "{{ command == 'arrow_left_hold' }}"
sequence: !input "button_left_hold"
- conditions:
- "{{ command == 'arrow_left_release' }}"
sequence: !input "button_left_release"
- conditions:
- "{{ command == 'arrow_right_click' }}"
sequence:
- choose: []
default: !input "button_right_x1_immediate"
- wait_for_trigger:
- platform: state
entity_id: !input "remote"
attribute: action
to: "arrow_right_click"
timeout: '{{interval}}'
continue_on_timeout: true
- if:
- condition: template
value_template: "{{(as_timestamp(now()) - time ) >= interval }}"
then: !input "button_right_x1"
else:
- variables:
time: " {{ as_timestamp(now()) }} "
- choose: []
default: !input "button_right_x2_immediate"
- wait_for_trigger:
- platform: state
entity_id: !input "remote"
attribute: action
to: "arrow_right_click"
timeout: '{{interval}}'
continue_on_timeout: true
- if:
- condition: template
value_template: "{{(as_timestamp(now()) - time ) >= interval }}"
then: !input "button_right_x2"
else: !input "button_right_x3"
- conditions:
- "{{ command == 'arrow_right_hold' }}"
sequence: !input "button_right_hold"
- conditions:
- "{{ command == 'arrow_right_release' }}"
sequence: !input "button_right_release"