deCONZ - Aqara D1 Wireless Remote Switch (2 Button) - lumi.remote.b286acn02 (WXKG07LM) - Multi Trigger

Blueprint for Aqara D1 with one Button can be found here: deCONZ - Aqara D1 Wireless Remote Switch (1 Button) - lumi.remote.b186acn02 (WXKG03LM) - Multi Trigger

I created an updated blueprint based on deCONZ - Aqara D1 Wireless Remote Switch (2 Button) - lumi.remote.b286acn02 (WXKG07LM) by @e-raser for the Aqara D2 Wireless Remote Switch.

I added support for multiple switches as trigger, thanks @lhoracek for the nice idea from Use target for trigger in blueprint? - #4 by lhoracek

grafik

Button events supported:

  • Left single press
  • Left double press
  • Left hold in
  • Right single press
  • Right double press
  • Right hold in
  • Both buttons single press
  • Both buttons double press
  • Both buttons hold in

Blueprint screenshot (empty example)

Blueprint to import

blueprint:
  name: deCONZ - Aqara D1 Wireless Remote Switch (2 Button)
  description: 'Supported actions: single, double and long press.'
  domain: automation
  source_url: https://community.home-assistant.io/t/deconz-aqara-d1-wireless-remote-switch-2-button-lumi-remote-b286acn02-wxkg07lm-multi-trigger/386890
  input:
    remote:
      name: Remote
      description: Aqara D1 remote to use
      selector:
        target:
          device:
            integration: deconz
            manufacturer: LUMI
            model: lumi.remote.b286acn02
    button_one_single_press:
      name: Left button - Single press
      description: Action on single press button
      default: []
      selector:
        action: {}
    button_one_double_press:
      name: Left button - Double press
      description: Action on double press button
      default: []
      selector:
        action: {}
    button_one_hold_in:
      name: Left button - Long in
      description: Action on long press button
      default: []
      selector:
        action: {}
    button_two_single_press:
      name: Right button - Single press
      description: Action on single press button
      default: []
      selector:
        action: {}
    button_two_double_press:
      name: Right button - Double press
      description: Action on double press button
      default: []
      selector:
        action: {}
    button_two_hold_in:
      name: Right button - Long in
      description: Action on long press button
      default: []
      selector:
        action: {}
    button_both_single_press:
      name: Both buttons - Single press
      description: Action on single press (BOTH buttons)
      default: []
      selector:
        action: {}
    button_both_double_press:
      name: Both buttons - Double press
      description: Action on double press (BOTH buttons)
      default: []
      selector:
        action: {}
    button_both_hold_in:
      name: Both buttons - Long in
      description: Action on long press (BOTH buttons)
      default: []
      selector:
        action: {}
        
mode: restart
max_exceeded: silent

variables:
  var_targets: !input remote

trigger:
- platform: event
  event_type: deconz_event
  
condition:
  - condition: template
    value_template: "{{ trigger.event.data is defined }}"
  - condition: template
    value_template: "{{ trigger.event.data.device_id in var_targets.device_id }}"
    
action:
- variables:
    event: '{{ trigger.event.data.event }}'
- choose:
  - conditions:
    - '{{ event == 1002 }}'
    sequence: !input 'button_one_single_press'
  - conditions:
    - '{{ event == 1004 }}'
    sequence: !input 'button_one_double_press'
  - conditions:
    - '{{ event == 1001 }}'
    sequence: !input 'button_one_hold_in'
  - conditions:
    - '{{ event == 2002 }}'
    sequence: !input 'button_two_single_press'
  - conditions:
    - '{{ event == 2004 }}'
    sequence: !input 'button_two_double_press'
  - conditions:
    - '{{ event == 2001 }}'
    sequence: !input 'button_two_hold_in'
  - conditions:
    - '{{ event == 3002 }}'
    sequence: !input 'button_both_single_press'
  - conditions:
    - '{{ event == 3004 }}'
    sequence: !input 'button_both_double_press'
  - conditions:
    - '{{ event == 3001 }}'
    sequence: !input 'button_both_hold_in'