I’m a beginner of HA, also the first time to sign in the community and create a topic here. I recently bought a new Mijia Wireless Remote Switch (WXKG01LM) and did not find that any automation blueprint for it, as I directly use Xiaomi Gateway 3 Integration to add it to HA, instead of ZHA or MQTT.
Therefore, considered it as a challenge, I managed to ‘created’ the version by referring the ZHA version created by carlosmesquita at this link.
Anyway, hope below helps. It’s appreciated if there is anything you could share in the comments section.
blueprint:
name: Xiaomi Wireless Remote Switch (WXKG01LM) via Xiaomi Gateway 3
description: Automate your Xiaomi Mijia Wireless Round Remote Switch.
domain: automation
input:
mi_switch:
name: Mijia Wireless Round Switch
description: Mijia Wireless Round Switch to use
selector:
device:
integration: xiaomi_gateway3
manufacturer: Xiaomi
model: lumi.sensor_switch WXKG01LM
remote_button_single_press:
name: Single Press
description: Action to run on single press
default: []
selector:
action: null
remote_button_double_press:
name: Double Press
description: Action to run on double press
default: []
selector:
action: null
remote_button_triple_press:
name: Triple Press
description: Action to run on triple press
default: []
selector:
action: null
remote_button_quadruple_press:
name: Quadruple Press
description: Action to run on quadruple press
default: []
selector:
action: null
remote_button_multiple_press:
name: Multiple Press
description: Action to run on multiple press
default: []
selector:
action: null
remote_button_hold:
name: Hold
description: Action to run on hold
default: []
selector:
action: null
remote_button_release:
name: Release
description: Action to run on release
default: []
selector:
action: null
trigger:
- platform: event
event_type: state_changed
event_data:
entity_id: sensor.0x158d00073a6dba_action
action:
- variables:
action: "{{ trigger.event.data.new_state.state }}"
- choose:
- conditions: "{{ action == 'single' }}"
sequence: !input "remote_button_single_press"
- conditions: "{{ action == 'double' }}"
sequence: !input "remote_button_double_press"
- conditions: "{{ action == 'triple' }}"
sequence: !input "remote_button_triple_press"
- conditions: "{{ action == 'quadruple' }}"
sequence: !input "remote_button_quadruple_press"
- conditions: "{{ action == 'many' }}"
sequence: !input "remote_button_multiple_press"
- conditions: "{{ action == 'hold' }}"
sequence: !input "remote_button_hold"
- conditions: "{{ action == 'release' }}"
sequence: !input "remote_button_release"