From 5b328a0ed4d2955eec273b9b031bcde21a934767 Mon Sep 17 00:00:00 2001 From: Nate Harris Date: Fri, 24 Mar 2023 16:33:50 -0600 Subject: [PATCH] Create aqara_h1_rotary_dial_remote.yaml --- .../aqara_h1_rotary_dial_remote.yaml | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 home_assistant/blueprints/automations/aqara_h1_rotary_dial_remote.yaml diff --git a/home_assistant/blueprints/automations/aqara_h1_rotary_dial_remote.yaml b/home_assistant/blueprints/automations/aqara_h1_rotary_dial_remote.yaml new file mode 100644 index 0000000..71292c9 --- /dev/null +++ b/home_assistant/blueprints/automations/aqara_h1_rotary_dial_remote.yaml @@ -0,0 +1,96 @@ +# This blueprint allows you to map actions to the different controls on an Aqara H1 Rotary Dial (https://homekitnews.com/2020/11/02/aqara-reveal-smart-rotary-dimmer-switch/) +# This ZigBee device is not currently supported by ZHA, and requires a custom ZHA quirk: https://gist.github.com/oxc/754d6436ce62d92af660d3671acd9346 +# This ZigBee device is already supported by Z2M: https://github.com/zigpy/zha-device-handlers/issues/2266 + +blueprint: + name: Aqara H1 Rotary Dial - Remote + + description: >- + This automation allows using an Aqara H1 Rotary Dial (ZigBee) to trigger actions. + Requires a custom quirk if using with ZHA. + + domain: automation + + input: + dial: + name: Aqara H1 Rotary Dial + description: Select the rotary dial you wish to use + selector: + device: + integration: zha + manufacturer: LUMI + model: lumi.remote.rkba01 + single: + name: Single Press + description: The action to perform on a single press of the dial button + selector: + action: + default: [] + double: + name: Double Press + description: The action to perform on a double press of the dial button + selector: + action: + default: [] + long: + name: Long Press + description: The action to perform on a long press of the dial button + selector: + action: + default: [] + left: + name: Left Turn + description: The action to perform on rotating the dial to the left + selector: + action: + default: [] + right: + name: Right Turn + description: The action to perform on rotating the dial to the right + selector: + action: + default: [] + +mode: restart +max_exceeded: silent + +trigger: + - platform: event + event_type: zha_event + event_data: + device_id: !input dial + +action: + - choose: + # Single press on the button + - conditions: + - condition: template + value_template: '{{ trigger.event.data.command == "1_single" }}' + sequence: !input single + + # Double press on the button + - conditions: + - condition: template + value_template: '{{ trigger.event.data.command == "1_double" }}' + sequence: !input double + + # Long press on the button + - conditions: + - condition: template + value_template: '{{ trigger.event.data.command == "1_hold" }}' + sequence: !input long + + # Rotate dial to the left + - conditions: + - condition: template + value_template: '{{ trigger.event.data.command == "stop_rotation" and trigger.event.data.args.rotation_direction == -1 }}' + sequence: !input left + + # Rotate dial to the right + - conditions: + - condition: template + value_template: '{{ trigger.event.data.command == "stop_rotation" and trigger.event.data.args.rotation_direction == 1 }}' + sequence: !input right + + # Any other event will cancel the repeat loops. + default: []