Skip to content

Instantly share code, notes, and snippets.

@hugalafutro
Created January 29, 2022 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hugalafutro/7c096b6af5aea4d473bba2b29fc53d97 to your computer and use it in GitHub Desktop.
Save hugalafutro/7c096b6af5aea4d473bba2b29fc53d97 to your computer and use it in GitHub Desktop.
Z2M_Aqara_Magic_Cube.yaml
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment