Aqara H1 Rotary Dimmer Switch Dial - Remote

Hey all, I finally got my hands on an Aqara H1 Rotary Dimmer Switch, a ZigBee device that makes for a neat remote.

Using an existing blueprint as a reference, I was able to put together a blueprint that allows you to trigger different actions for the five different controls on the device (single press, double press, long press, rotate left, rotate right).

NOTE: This device is not currently supported in ZHA, and requires a custom quirk (available here: Custom ZHA quirk for Aqara H1 Knob Wireless · GitHub) until official support is added.

Blueprint

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

# 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: []

Setup

Credit

Hopes this helps!

EDIT: 08-10-2023

A few days ago, I noticed that some aspects of this automation were no longer working, and discovered that my devices were now set into COMMAND mode rather than EVENT mode, which changes the triggers available for processing.

Supposedly, you can switch between COMMAND and EVENT mode by clicking the button on the device 5 times quickly, although I have been unable to switch my devices back into EVENT mode. I suspect a firmware update for these devices may have altered this behind-the-scenes.

If you also face the same issue, I have made a variant of this blueprint that works in COMMAND mode, which can be imported below:

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

The key difference between the two is that, in COMMAND mode, a single press is not registered. As a result, single press is unavailable in this blueprint. I would suggest using the original EVENT mode variant above if possible.

3 Likes

Hi Nate,
Thank you very much for this!
I’m having some trouble though, I wonder if you have any ideas:
I’ve got the rotation working to dim my lights, but I can’t get the single, double, long press to do anything…

What’s your automation config look like?

When I press the button I can see that it triggers the automation, it shows last triggered X seconds ago, but the action doesn’t happen

- id: '1683749837655'
  alias: 'Dimmer: Bathroom'
  description: ''
  use_blueprint:
    path: nwithan8/aqara_h1_rotary_dial_remote.yaml
    input:
      dial: b88196bb85f07197e531f06f534709ee
      single:
      - service: light.toggle
        data: {}
        target:
          entity_id: light.hue_ambiance_lamp_1
      left:
      - device_id: 993b58c9dd2b28d6d98c625336b5021f
        domain: light
        entity_id: light.hue_ambiance_lamp_1
        type: brightness_decrease
      right:
      - device_id: 993b58c9dd2b28d6d98c625336b5021f
        domain: light
        entity_id: light.hue_ambiance_lamp_1
        type: brightness_increase
      double:
      - service: scene.turn_on
        target:
          entity_id: scene.bathroom_concentrate
        metadata: {}
        enabled: true
      long: []

I’ve tried different actions on different devices but without any success.

Sorry for the late reply, need to turn notifications on here.

In the trace for the automation, what is the trigger.event.data.command it recognized?

I’ve just discovered this thread, having bought a bunch of these on Aliexpress.

I’ve managed to throw together a flow in node red to control mine, but I will definitely be checking out this blueprint.

cheers.

I imported the blueprint and tried to create an automation, however when I try to select a device I just get “no matching devices found”.

Running HA 2023.3 and Z2M

This blueprint only works with ZHA.

If you know the Z2M codes (or can point me in the right direction) I can make a Z2M port

wouldn’t know where to begin, that node red flow took me a couple of days to figure out.

shame it doesn’t work with Z2M as I think it’s better supported

UPDATE: See the “Edit” section of the original post

When this will be supported officially without needimg a quirck?

Is there ANY Zigbee dimmer with actually smooth operation? Is it something that’s actually doable with HA and Zigbee?

1 Like

I’ve tried a couple, but none have been particularly smooth. It all comes down to how often it sends out signals and how fast those signals can be processed by your server.

EDIT: Just picked up an IKEA Symfonisk dial again today and realized that it fires off ZigBee commands pretty consistently during rotating, so the server could be pretty responsive to it.

Can someone create blueprint for Z2M? There is super easy to bind device. In ZHA you need to use hack.

I am finally able to use Aquara DIal Switch with ZHA with quirck. Thanks.

But with this blueprint is dimming not smooth.
Can I determine dimming step value from Dial Switch?

If/when ZHA support for this device is available, where would that be announced, please?

It would be included in the ZHA Device Handlers library that Home Assistant and ZHA uses: Code search results · GitHub

1 Like