Last active
March 8, 2026 06:24
-
-
Save subzero79/f944b59957b2734efcf2bcef663b77d4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| blueprint: | |
| name: ZHA - Mijia Wireless Remote Switch (WXKG01LM) by SZ | |
| description: Automate your Xiaomi Mijia Wireless Round Remote Switch using ZHA events. | |
| domain: automation | |
| input: | |
| mijia_round_switch: | |
| name: Mijia Wireless Round Switch | |
| description: Mijia Wireless Round Switch to use | |
| selector: | |
| device: | |
| integration: zha | |
| 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: zha_event | |
| event_data: | |
| device_id: !input 'mijia_round_switch' | |
| command: 'attribute_updated' | |
| action: | |
| - variables: | |
| attrname: '{{ trigger.event.data.args.attribute_name }}' | |
| value: '{{ trigger.event.data.args.value }}' | |
| - choose: | |
| - conditions: | |
| - '{{ attrname == ''on_off'' }}' | |
| - '{{ value == true }}' | |
| sequence: | |
| - wait_for_trigger: | |
| - platform: event | |
| event_type: zha_event | |
| event_data: | |
| device_id: !input 'mijia_round_switch' | |
| command: 'attribute_updated' | |
| args: | |
| attribute_id: 0 | |
| attribute_name: on_off | |
| value: false | |
| continue_on_timeout: true | |
| timeout: !input 'holdtime' | |
| - choose: | |
| - conditions: | |
| - condition: template | |
| value_template: '{{ not wait.trigger }}' | |
| sequence: !input 'remote_button_hold_press' | |
| default: !input 'remote_button_short_press' | |
| - conditions: | |
| - '{{ attrname == ''Unknown'' }}' | |
| - '{{ value == 2 }}' | |
| sequence: !input 'remote_button_double_press' | |
| - conditions: | |
| - '{{ attrname == ''Unknown'' }}' | |
| - '{{ value == 3 }}' | |
| sequence: !input 'remote_button_triple_press' | |
| - conditions: | |
| - '{{ attrname == ''Unknown'' }}' | |
| - '{{ value == 4 }}' | |
| sequence: !input 'remote_button_quadruple_press' | |
| - conditions: | |
| - '{{ attrname == ''Unknown'' }}' | |
| - '{{ value == 128 }}' | |
| sequence: !input 'remote_button_multiple_press' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment