Based on the ZHA blueprint: ZHA - Xiaomi Mijia Round Wireless Switch (WXKG01LM) - lumi.sensor_switch after realising that this blueprint wouldn’t work with Xiaomi switches connected through Deconz.
I’ve tweaked the blueprint so that it works with Deconz.
blueprint:
name: Deconz - Mijia Wireless Remote Switch (WXKG01LM)
description: Automate your Xiaomi Mijia Wireless Round Remote Switch using Deconz events.
domain: automation
input:
mijia_round_switch:
name: Mijia Wireless Round Switch
description: Mijia Wireless Round Switch to use
selector:
device:
integration: deconz
manufacturer: LUMI
model: lumi.sensor_switch
remote_button_short_press:
name: Single Press short
description: Action to run on single press
default: []
selector:
action: {}
holdtime:
name: Holdtime for hold detection
description: Time to wait until hold_press is activated
default: 1
selector:
number:
min: 0.0
max: 10.0
unit_of_measurement: seconds
step: 1.0
mode: slider
remote_button_hold_press:
name: Hold Press
description: Action to run on hold
default: []
selector:
action: {}
remote_button_double_press:
name: Double Press
description: Action to run on double press
default: []
selector:
action: {}
remote_button_triple_press:
name: Triple Press
description: Action to run on triple press
default: []
selector:
action: {}
remote_button_quadruple_press:
name: Quadruple Press
description: Action to run on quadruple press
default: []
selector:
action: {}
remote_button_multiple_press:
name: Multiple Press
description: Action to run on multiple press
default: []
selector:
action: {}
mode: restart
max_exceeded: silent
trigger:
- platform: event
event_type: deconz_event
event_data:
device_id: !input 'mijia_round_switch'
action:
- variables:
event: '{{ trigger.event.data.event }}'
- choose:
- conditions:
- '{{ event == 1002 }}'
sequence: !input remote_button_short_press
- conditions:
- '{{ event == 1003 }}'
sequence: !input remote_button_hold_press
- conditions:
- '{{ event == 1004 }}'
sequence: !input remote_button_double_press
- conditions:
- '{{ event == 1005 }}'
sequence: !input remote_button_triple_press
- conditions:
- '{{ event == 1006 }}'
sequence: !input remote_button_quadruple_press
- conditions:
- '{{ event == 1010 }}'
sequence: !input remote_button_multiple_press