Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save fipppi/c9145f6f3f3a93cf404cf20354bc530d to your computer and use it in GitHub Desktop.

Select an option

Save fipppi/c9145f6f3f3a93cf404cf20354bc530d to your computer and use it in GitHub Desktop.
ZHA Blueprint for IKEA RODRET Remote
blueprint:
name: IKEA Rodret Remote for ZHA
description: >
## Control anything with IKEA RODRET Dimmer remote (v2.0)
Only for use with [ZHA](https://www.home-assistant.io/integrations/zha/)
Available controls:
- Press the **on** or **off** buttons (single press)
- Double press the **on** or **off** buttons within the **Helper - Double press delay** interval (default 250ms). Single press actions are delayed by this interval to detect double presses.
- Press and hold the **on**/**off** buttons for dimming control.
source_url: https://gist.github.com/damru/b2c1c780ffb0ddc084952eb89db9573a
domain: automation
input:
remote_device:
name: Rodret Remote
description: IKEA remote to use.
default: ""
selector:
device:
filter:
integration: zha
manufacturer: IKEA of Sweden
model: RODRET Dimmer
multiple: false
on_press_action:
name: "Single Press: [ON]"
description: Choose action(s) to run when **on** button is pressed.
default: []
selector:
action: {}
off_press_action:
name: "Single Press: [OFF]"
description: Choose action(s) to run when **off** button is pressed.
default: []
selector:
action: {}
on_hold_action:
name: "Hold: [ON]"
description: Choose action(s) to run when **on** button is **pressed and held**.
default: []
selector:
action: {}
off_hold_action:
name: "Hold: [OFF]"
description: Choose action(s) to run when **off** button is **pressed and held**.
default: []
selector:
action: {}
on_double_press_action:
name: "Double Press: [ON]"
description: Choose action(s) to run when **on** button is **double pressed**.
default: []
selector:
action: {}
off_double_press_action:
name: "Double Press: [OFF]"
description: Choose action(s) to run when **off** button is **double pressed**.
default: []
selector:
action: {}
helper_double_press_delay:
name: Helper - Double press delay
description: Max delay between first and second press to trigger double press action (in milliseconds).
default: 250
selector:
number:
min: 100
max: 1000
unit_of_measurement: milliseconds
mode: single
max_exceeded: silent
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input remote_device
command: "on"
cluster_id: 6
endpoint_id: 1
id: press-btn-on
- platform: event
event_type: zha_event
event_data:
device_id: !input remote_device
command: "off"
cluster_id: 6
endpoint_id: 1
id: press-btn-off
- platform: event
event_type: zha_event
event_data:
device_id: !input remote_device
command: "move_with_on_off"
cluster_id: 8
endpoint_id: 1
args: [0, 83]
id: hold-btn-on
- platform: event
event_type: zha_event
event_data:
device_id: !input remote_device
command: "move"
cluster_id: 8
endpoint_id: 1
args: [1, 83, 0, 0]
id: hold-btn-off
# /***********************************\
# Note: The following event is also available,
# but is only here for reference; it is not used
# in this blueprint:
# \***********************************/
- platform: event
event_type: zha_event
event_data:
device_id: !input remote_device
endpoint_id: 1
cluster_id: 8
command: stop_with_on_off
id: release-zha
action:
- choose:
# ON button pressed - wait for potential double press
- conditions:
- condition: trigger
id: press-btn-on
sequence:
- wait_for_trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input remote_device
command: "on"
cluster_id: 6
endpoint_id: 1
timeout:
milliseconds: !input helper_double_press_delay
continue_on_timeout: true
- choose:
# Double press detected
- conditions:
- condition: template
value_template: "{{ wait.trigger.idx is defined }}"
sequence: !input on_double_press_action
# Single press (timeout)
default: !input on_press_action
# OFF button pressed - wait for potential double press
- conditions:
- condition: trigger
id: press-btn-off
sequence:
- wait_for_trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input remote_device
command: "off"
cluster_id: 6
endpoint_id: 1
timeout:
milliseconds: !input helper_double_press_delay
continue_on_timeout: true
- choose:
# Double press detected
- conditions:
- condition: template
value_template: "{{ wait.trigger.idx is defined }}"
sequence: !input off_double_press_action
# Single press (timeout)
default: !input off_press_action
# ON button held
- conditions:
- condition: trigger
id: hold-btn-on
sequence: !input on_hold_action
# OFF button held
- conditions:
- condition: trigger
id: hold-btn-off
sequence: !input off_hold_action
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment