ZHA - Aqara Wireless Remote Switch (Single Rocker)

Tags: #<Tag:0x00007f3264dde328> #<Tag:0x00007f3264dde210> #<Tag:0x00007f3264dde0d0> #<Tag:0x00007f3264dddf40>

This blueprint will let you create automations for the Aqara Wireless Remote Switch (Single Rocker). It uses ZHA, and supports single, double and long presses.

Requirements:

  • Aqara Wireless Remote Switch (Single Rocker)
  • ZHA integration

The blueprint is based on ZHA - Aqara Wireless Remote Switch (Double Rocker) (credit to NachtaktiverHalbaffe) and ZHA - Aqara Wireless Mini Switch (credit to SeanM). As both of them point out in their blueprints, there are multiple versions of these switches, and some of them may not work. Please make sure to check out both of their posts to be sure you have all the information you need before you purchase one! I have a compatible switch (luckily), and I am using this blueprint on my current setup with no issues so far.

Blueprint:

blueprint:
  name: ZHA - Aqara Wireless Remote Switch (Single Rocker)
  description: Automate your Xiaomi Aqara Wireless Remote Switch (Single Rocker) using ZHA events.
  domain: automation
  input:
    aqara_mini_switch:
      name: Select the Aqara Wireless Remote Switch (Single Rocker)
      description: Aqara Wireless Remote Switch (Single Rocker)
      selector:
        device:
          integration: zha
          manufacturer: LUMI
          entity:
            domain: sensor
            device_class: battery
    button_single_press:
      name: Single Press
      description: Action to run on single press
      default: []
      selector:
        action:
    button_double_press:
      name: Double Press
      description: Action to run on double press
      default: []
      selector:
        action:
    button_long_press:
      name: Long Press
      description: Action to run when button is long pressed (held down)
      default: []
      selector:
        action:

mode: restart
max_exceeded: silent

trigger:
  - platform: event
    event_type: zha_event
    event_data:
      device_id: !input aqara_mini_switch

action:
  - variables:
      command: "{{ trigger.event.data.command }}"

  - choose:
      - conditions:
          - "{{ command == 'single' }}"
        sequence: !input button_single_press
      - conditions:
          - "{{ command == 'double' }}"
        sequence: !input button_double_press
      - conditions:
          - "{{ command == 'long press' }}"
        sequence: !input button_long_press
4 Likes