Adaptation of my Hue Dimmer+Z2M custom actions Blueprint to work with Aqara Magic Cube (https://www.zigbee2mqtt.io/devices/MFKZQ01LM.html)
Supports user definable action for each of following cube triggers:
flip90
rotate_left
rotate_right
tap
slide
shake
If you wish to ignore a trigger, define its action as Wait for time to pass (delay) of 0 seconds.
github gist here & import button:
blueprint:
name: Zigbee2Mqtt Aqara Magic Cube control
description: ''
domain: automation
input:
cube_action:
name: Magic Cube MQTT topic
description: 'type in your Magic Cube MQTT topic (i.e. zigbee2mqtt/Magic Cube/action)'
selector:
text:
action_flip:
name: flip
description: select action to run when you flip the cube
selector:
action:
action_rotate_left:
name: rotate_left
description: select action to run when you rotate the cube counter-clockwise
selector:
action:
action_rotate_right:
name: rotate_right
description: select action to run when you rotate clockwise
selector:
action:
action_tap:
name: tap
description: select action to run when you double-tap the cube
selector:
action:
action_slide:
name: slide
description: select action to run when you slide the cube
selector:
action:
action_shake:
name: shake
description: select action to run when you shake the cube
selector:
action:
trigger:
- platform: mqtt
topic: !input cube_action
payload: flip90
id: flip
- platform: mqtt
topic: !input cube_action
id: rotate_left
payload: rotate_left
- platform: mqtt
topic: !input cube_action
id: rotate_right
payload: rotate_right
- platform: mqtt
topic: !input cube_action
id: tap
payload: tap
- platform: mqtt
topic: !input cube_action
id: slide
payload: slide
- platform: mqtt
topic: !input cube_action
payload: shake
id: shake
action:
- choose:
- conditions:
- condition: trigger
id: flip
sequence:
!input action_flip
- conditions:
- condition: trigger
id: rotate_left
sequence:
!input action_rotate_left
- conditions:
- condition: trigger
id: rotate_right
sequence:
!input action_rotate_right
- conditions:
- condition: trigger
id: tap
sequence:
!input action_tap
- conditions:
- condition: trigger
id: slide
sequence:
!input action_slide
- conditions:
- condition: trigger
id: shake
sequence:
!input action_shake
default: []
mode: single