diff --git a/new_rodret.yaml b/new_rodret.yaml new file mode 100644 index 0000000..7684539 --- /dev/null +++ b/new_rodret.yaml @@ -0,0 +1,394 @@ +blueprint: + name: IKEA Rodret Triple Click with Click/Hold Functionality + description: " + IKEA Rodret Dimmer Remote + + Only for use with [ZHA] + (https://www.home-assistant.io/integrations/zha/) + + Available Controls: + + - Single Click the **on** or **off** buttons + - Double Click the **on** or **off** buttons + - Triple Click the **on** or **off** buttons + - Hold the **on** or **off** buttons + - Click then Hold the **on** or **off** buttons + + " + source_url: https://git.vanderbye.stream/andrew.vanderbye/HA_Blueprints/raw/branch/main/rodret_test.yaml + domain: automation + input: + # REMOTE DEVICE + remote_device: + name: Remote + description: IKEA Rodret dimmer to use + default: "" + selector: + device: + filter: + integration: zha + manufacturer: IKEA of Sweden + model: RODRET Dimmer + multiple: false + # CLICK & HOLD OPTIONS + on_single_click_action: + name: On - Single Click Action + description: Choose action(s) to run when **on** button is clicked + default: [] + selector: + action: {} + on_double_click_action: + name: On - Double Click Action + description: Choose action(s) to run when **on** button is double clicked + default: [] + selector: + action: {} + on_triple_click_action: + name: On - Triple Click Action + description: Choose action(s) to run when **on** button is triple clicked + default: [] + selector: + action: {} + on_hold_action: + name: On - Hold Action + description: Choose action(s) to run when **on** button is held + default: [] + selector: + action: {} + on_click_hold_action: + name: On - Click Hold Action + description: Choose action(s) to run when **on** button is held after being clicked + default: [] + selector: + action: {} + off_single_click_action: + name: Off - Single Click Action + description: Choose action(s) to run when **off** button is clicked + default: [] + selector: + action: {} + off_double_click_action: + name: Off - Double Click Action + description: Choose action(s) to run when **off** button is double clicked + default: [] + selector: + action: {} + off_triple_click_action: + name: Off - Triple Click Action + description: Choose action(s) to run when **off** button is triple clicked + default: [] + selector: + action: {} + off_hold_action: + name: Off - Hold Action + description: Choose action(s) to run when **off** button is held + default: [] + selector: + action: {} + off_click_hold_action: + name: Off - Click Hold Action + description: Choose action(s) to run when **off** button is held after being clicked + default: [] + selector: + action: {} + # HELPERS + helper_multi_click_delay: + name: Helper - Multi Click Delay + description: Max time (in milliseconds) between clicks. 500ms min to allow for click/hold event. + default: 500 + selector: + number: + unit_of_measurement: milliseconds + min: 100.0 + max: 5000.0 + step: 10.0 + mode: slider + helper_hold_max_loops: + name: Helper - Max Loops + description: Maximum Number of Loops with **Hold** action + default: 20 + selector: + number: + min: 1.0 + max: 1000.0 + step: 1.0 + mode: slider + helper_hold_loop_delay: + name: Helper - Hold Action Delay + description: Delay between looped repeats of **hold** action + default: 250 + selector: + number: + unit_of_measurement: milliseconds + min: 100.0 + max: 5000.0 + step: 10.0 + mode: slider +mode: single +max_exceeded: silent +trigger_variables: + zha_remote: !input remote_device +trigger: + # ON CLICK + - platform: event + event_type: zha_event + event_data: + device_id: "{{ zha_remote }}" + command: "on" + cluster_id: 6 + endpoint_id: 1 + id: on-click-zha + # ON HOLD + - platform: 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: on-hold-zha + # OFF CLICK + - platform: event + event_type: zha_event + event_data: + device_id: "{{ zha_remote }}" + command: "off" + cluster_id: 6 + endpoint_id: 1 + id: off-click-zha + # OFF HOLD + - platform: 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: off-hold-zha +action: + - choose: + - conditions: # ON CLICK ENTRY POINT + - condition: trigger + id: + - on-click-zha + sequence: + - wait_for_trigger: + - platform: event # ON DOUBLE CLICK TRIGGER + event_type: zha_event + event_data: + device_id: "{{ zha_remote }}" + command: "on" + cluster_id: 6 + endpoint_id: 1 + id: on-double-click + - platform: event # ON CLICK HOLD TRIGGER + 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: on-click-hold + timeout: + milliseconds: !input helper_multi_click_delay + continue_on_timeout: true + - choose: + - conditions: # ON SINGLE CLICK ACTION + - condition: template + value_template: '{{ wait.trigger == none }}' + sequence: !input on_single_click_action + - conditions: # ON DOUBLE CLICK ACTION + - condition: template + value_template: '{{ wait.trigger.id == "on-double-click" }}' + sequence: + - wait_for_trigger: + - platform: event # ON TRIPLE CLICK TRIGGER + event_type: zha_event + event_data: + device_id: "{{ zha_remote }}" + command: "on" + cluster_id: 6 + endpoint_id: 1 + id: on-triple-click + timeout: + milliseconds: !input helper_multi_click_delay + continue_on_timeout: true + - choose: + - conditions: # ON DOUBLE CLICK ACTION + - condition: template + value_template: '{{ wait.trigger == none }}' + sequence: !input on_double_click_action + - conditions: # ON TRIPLE CLICK ACTION + - condition: template + value_template: '{{ wait.trigger.id == "on-triple-click" }}' + sequence: !input on_triple_click_action + # !input on_double_click_action + - conditions: # ON CLICK HOLD ACTION + - condition: template + value_template: '{{ wait.trigger.id == "on-click-hold" }}' + sequence: # !input on_click_hold_action + - repeat: + count: !input helper_hold_max_loops + sequence: + - parallel: + - sequence: !input on_click_hold_action + - sequence: + - wait_for_trigger: + - platform: event # ON BUTTON RELEASE + event_type: zha_event + event_data: + device_id: "{{ zha_remote }}" + command: "stop_with_on_off" + cluster_id: 8 + endpoint_id: 1 + id: on-click-hold-release + timeout: + milliseconds: !input helper_hold_loop_delay + continue_on_timeout: true + - if: + - condition: template + value_template: '{{ wait.trigger.id == "on-click-hold-release" }}' + then: + - stop: button released + - conditions: # ON HOLD ENTRY POINT + - condition: trigger + id: + - on-hold-zha + sequence: + - repeat: + count: !input helper_hold_max_loops + sequence: + - parallel: + - sequence: !input on_hold_action + - sequence: + - wait_for_trigger: + - platform: event # ON BUTTON RELEASE + event_type: zha_event + event_data: + device_id: "{{ zha_remote }}" + command: "stop_with_on_off" + cluster_id: 8 + endpoint_id: 1 + id: on-hold-release + timeout: + milliseconds: !input helper_hold_loop_delay + continue_on_timeout: true + - if: + - condition: template + value_template: '{{ wait.trigger.id == "on-hold-release" }}' + then: + - stop: button released + - conditions: # OFF CLICK ENTRY POINT + - condition: trigger + id: + - off-click-zha + sequence: + - wait_for_trigger: + - platform: event # OFF DOUBLE CLICK TRIGGER + event_type: zha_event + event_data: + device_id: "{{ zha_remote }}" + command: "off" + cluster_id: 6 + endpoint_id: 1 + id: off-double-click + - platform: event # OFF CLICK HOLD TRIGGER + event_type: zha_event + event_data: + device_id: "{{ zha_remote }}" + command: "move" + cluster_id: 8 + endpoint_id: 1 + args: [1, 83, 0, 0] + id: off-click-hold + timeout: + milliseconds: !input helper_multi_click_delay + continue_on_timeout: true + - choose: + - conditions: # OFF SINGLE CLICK ACTION + - condition: template + value_template: '{{ wait.trigger == none }}' + sequence: !input off_single_click_action + - conditions: # OFF DOUBLE CLICK ACTION + - condition: template + value_template: '{{ wait.trigger.id == "off-double-click" }}' + sequence: # !input off_double_click_action + - wait_for_trigger: + - platform: event # OFF TRIPLE CLICK TRIGGER + event_type: zha_event + event_data: + device_id: "{{ zha_remote }}" + command: "off" + cluster_id: 6 + endpoint_id: 1 + id: off-triple-click + timeout: + milliseconds: !input helper_multi_click_delay + continue_on_timeout: true + - choose: + - conditions: # OFF DOUBLE CLICK ACTION + - condition: template + value_template: '{{ wait.trigger == none }}' + sequence: !input off_double_click_action + - conditions: # OFF TRIPLE CLICK ACTION + - condition: template + value_template: '{{ wait.trigger.id == "off-triple-click" }}' + sequence: !input off_triple_click_action + - conditions: # OFF CLICK HOLD ACTION + - condition: template + value_template: '{{ wait.trigger.id == "off-click-hold" }}' + sequence: # !input off_click_hold_action + - repeat: + count: !input helper_hold_max_loops + sequence: + - parallel: + - sequence: !input off_click_hold_action + - sequence: + - wait_for_trigger: + - platform: event # OFF BUTTON RELEASE + event_type: zha_event + event_data: + device_id: "{{ zha_remote }}" + command: "stop_with_on_off" + cluster_id: 8 + endpoint_id: 1 + id: off-click-hold-release + timeout: + milliseconds: !input helper_hold_loop_delay + continue_on_timeout: true + - if: + - condition: template + value_template: '{{ wait.trigger.id == "off-click-hold-release" }}' + then: + - stop: button released + - conditions: # OFF HOLD ENTRY POINT + - condition: trigger + id: + - off-hold-zha + sequence: + - repeat: + count: !input helper_hold_max_loops + sequence: + - parallel: + - sequence: !input off_hold_action + - sequence: + - wait_for_trigger: + - platform: event # OFF BUTTON RELEASE + event_type: zha_event + event_data: + device_id: "{{ zha_remote }}" + command: "stop_with_on_off" + cluster_id: 8 + endpoint_id: 1 + id: off-hold-release + timeout: + milliseconds: !input helper_hold_loop_delay + continue_on_timeout: true + - if: + - condition: template + value_template: '{{ wait.trigger.id == "off-hold-release" }}' + then: + - stop: button released \ No newline at end of file