Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save trilorian/ee957a682ab6a3765e8fbb19502e9bfb to your computer and use it in GitHub Desktop.

Select an option

Save trilorian/ee957a682ab6a3765e8fbb19502e9bfb to your computer and use it in GitHub Desktop.
IKEA RODRET Dimmer Remote (E2201) - ZHA
blueprint:
name: IKEA Rodret Dimmer v. 1.4
description: "## IKEA RODRET Dimmer remote (v1.87)
Only for use with [ZHA](https://www.home-assistant.io/integrations/zha/)
Available controls (optional):
- Click the **on** or **off** buttons
- Double click the **on** or **off** buttons
- Triple click the **on** or **off** buttons
- Click and hold the **on**/**off** buttons"
source_url: https://gist.github.com/trilorian/ee957a682ab6a3765e8fbb19502e9bfb
domain: automation
input:
remote_device:
name: Remote
description: IKEA Rodret dimmer remote to use.
default: ""
selector:
device:
filter:
- integration: zha
manufacturer: IKEA of Sweden
model: RODRET Dimmer
multiple: false
on_click_action:
name: On - Single click action
description: Choose action(s) to run when **on** button is clicked.
default: []
selector:
action: {}
off_click_action:
name: Off - Single click action
description: Choose action(s) to run when **off** button is **clicked**.
default: []
selector:
action: {}
on_double_click_action:
name: On - Double click action
description: Choose action(s) to run when clicking the **on** button twice.
default: []
selector:
action: {}
on_triple_click_action:
name: On - Triple click action
description: Choose action(s) to run when clicking the **on** button three times.
default: []
selector:
action: {}
off_double_click_action:
name: Off - Double click action
description: Choose action(s) to run when clicking the **off** button twice.
default: []
selector:
action: {}
off_triple_click_action:
name: Off - Triple click action
description:
Choose action(s) to run when clicking the **off** button three
times.
default: []
selector:
action: {}
on_hold_action:
name: On - Hold action
description: Choose action(s) to run when **on** button is **clicked and held**.
default: []
selector:
action: {}
off_hold_action:
name: Off - Hold action
description: Choose action(s) to run when **off** button is **clicked and held**.
default: []
selector:
action: {}
helper_multi_click_delay:
name: Helper - Multi click delay
description:
Max delay between the button clicks for the **Multi click events**.
Change this value if you notice that the multi click action is not triggered
properly.
default: 250
selector:
number:
unit_of_measurement: milliseconds
min: 100.0
max: 5000.0
step: 10.0
mode: slider
helper_hold_delay:
name: Helper - Hold delay
description: Delay between the execution of the **Hold** action(s).
default: 250
selector:
number:
unit_of_measurement: milliseconds
min: 100.0
max: 5000.0
step: 10.0
mode: slider
helper_max_loops:
name: Helper - Max number of loops
description: Maximum number of loops when holding down a button.
default: 20
selector:
number:
min: 1.0
max: 1000.0
step: 1.0
mode: slider
mode: single
max_exceeded: silent
trigger_variables:
zha_remote: !input remote_device
triggers:
- trigger: event
event_type: zha_event
event_data:
device_id: "{{ zha_remote }}"
command: "on"
cluster_id: 6
endpoint_id: 1
id: click-on-zha
- trigger: event
event_type: zha_event
event_data:
device_id: "{{ zha_remote }}"
command: "off"
cluster_id: 6
endpoint_id: 1
id: click-off-zha
- trigger: event
event_type: zha_event
event_data:
device_id: "{{ zha_remote }}"
command: move_with_on_off
cluster_id: 8
endpoint_id: 1
args:
- 0
- 83
id: hold-on-zha
- trigger: event
event_type: zha_event
event_data:
device_id: "{{ zha_remote }}"
command: move
cluster_id: 8
endpoint_id: 1
args:
- 1
- 83
- 0
- 0
id: hold-off-zha
- trigger: event
event_type: zha_event
event_data:
device_id: "{{ zha_remote }}"
command: stop_with_on_off
cluster_id: 8
endpoint_id: 1
id: release-zha
action:
- choose:
- conditions:
- condition: trigger
id:
- click-on-zha
sequence:
- wait_for_trigger:
- trigger: event
event_type: zha_event
event_data:
device_id: "{{ zha_remote }}"
command: "on"
cluster_id: 6
endpoint_id: 1
timeout:
milliseconds: !input helper_multi_click_delay
continue_on_timeout: true
- choose:
- conditions:
- condition: template
value_template: "{{ wait.trigger == none and on_click_action != none }}"
sequence: !input on_click_action
default:
- wait_for_trigger:
- trigger: event
event_type: zha_event
event_data:
device_id: "{{ zha_remote }}"
command: "on"
cluster_id: 6
endpoint_id: 1
timeout:
milliseconds: !input helper_multi_click_delay
continue_on_timeout: true
- choose:
- conditions:
- condition: template
value_template: "{{ wait.trigger == none }}"
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ on_double_click_action != none }}"
sequence: !input on_double_click_action
default:
- choose:
- conditions:
- condition: template
value_template: "{{ on_triple_click_action != none }}"
sequence: !input on_triple_click_action
- choose:
- conditions:
- condition: trigger
id:
- click-off-zha
sequence:
- wait_for_trigger:
- trigger: event
event_type: zha_event
event_data:
device_id: "{{ zha_remote }}"
command: "off"
cluster_id: 6
endpoint_id: 1
timeout:
milliseconds: !input helper_multi_click_delay
continue_on_timeout: true
- choose:
- conditions:
- condition: template
value_template: "{{ wait.trigger == none and off_click_action != none }}"
sequence: !input off_click_action
default:
- wait_for_trigger:
- trigger: event
event_type: zha_event
event_data:
device_id: "{{ zha_remote }}"
command: "off"
cluster_id: 6
endpoint_id: 1
timeout:
milliseconds: !input helper_multi_click_delay
continue_on_timeout: true
- choose:
- conditions:
- condition: template
value_template: "{{ wait.trigger == none }}"
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ off_double_click_action != none }}"
sequence: !input off_double_click_action
default:
- choose:
- conditions:
- condition: template
value_template: "{{ off_triple_click_action != none }}"
sequence: !input off_triple_click_action
- conditions:
- condition: trigger
id:
- hold-on-zha
sequence:
- repeat:
count: !input helper_max_loops
sequence:
- parallel:
- sequence: !input on_hold_action
- sequence:
- choose:
- conditions:
- condition: trigger
id:
- hold-on-zha
sequence:
- wait_for_trigger:
- trigger: event
event_type: zha_event
event_data:
device_id: "{{ zha_remote }}"
command: stop_with_on_off
cluster_id: 8
endpoint_id: 1
timeout:
milliseconds: !input helper_hold_delay
continue_on_timeout: true
- if:
- condition: template
value_template: "{{ wait.trigger.idx is defined }}"
then:
- stop: button released
- conditions:
- condition: trigger
id:
- hold-off-zha
sequence:
- repeat:
count: !input helper_max_loops
sequence:
- parallel:
- sequence: !input off_hold_action
- sequence:
- choose:
- conditions:
- condition: trigger
id:
- hold-off-zha
sequence:
- wait_for_trigger:
- trigger: event
event_type: zha_event
event_data:
device_id: "{{ zha_remote }}"
command: stop_with_on_off
cluster_id: 8
endpoint_id: 1
timeout:
milliseconds: !input helper_hold_delay
continue_on_timeout: true
- if:
- condition: template
value_template: "{{ wait.trigger.idx is defined }}"
then:
- stop: button released
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment