Blueprint to support the Aqara Wireless Mini Switch with Gyroscope with ZigBee2Mqtt integration.
(Based on the work of Drafted)
blueprint:
name: ZigBee2Mqtt - Xiaomi WXKG12LM Wireless Switch
description: Control anything using Xiaomi WXKG12LM (single button) remote
domain: automation
input:
action_sensor:
name: Remote
description: Zigbee2mqtt action sensor
selector:
entity:
integration: mqtt
domain: sensor
single_action:
name: Single Click Action
default: []
selector:
action: {}
double_action:
name: Double Click Action
default: []
selector:
action: {}
hold_action:
name: Hold Action
default: []
selector:
action: {}
release_action:
name: Release Action
default: []
selector:
action: {}
shake_action:
name: Shake Action
default: []
selector:
action: {}
mode: restart
max_exceeded: silent
trigger:
platform: state
entity_id: !input 'action_sensor'
attribute: action
action:
- variables:
command: '{{ trigger.to_state.state }}'
- choose:
- conditions: '{{ command == ''single'' }}'
sequence: !input 'single_action'
- conditions: '{{ command == ''double'' }}'
sequence: !input 'double_action'
- conditions: '{{ command == ''hold'' }}'
sequence: !input 'hold_action'
- conditions: '{{ command == ''release'' }}'
sequence: !input 'release_action'
- conditions: '{{ command == ''shake'' }}'
sequence: !input 'shake_action'