renames, fixes , and other fun schtuff

This commit is contained in:
CeeWeasel
2025-08-09 23:34:29 -04:00
parent d60b56b37a
commit c5e740a895
78 changed files with 2050 additions and 2700 deletions
@@ -1,544 +0,0 @@
blueprint:
name: Aqara Magic Cube
description: Control anything using Aqara Magic Cube.
domain: automation
input:
remote:
name: Magic Cube
description: Select the Aqara Magic Cube device
selector:
device:
integration: zha
manufacturer: LUMI
flip_90:
name: Flip 90 degrees
description: 'Actions to run when cube flips 90 degrees.
This cancels all specific 90 degrees functions.
e.g From side 1 to side 2 will be the same as from side 6 to side 2'
default: false
selector:
boolean: {}
cube_flip_90:
name: Flip cube 90 degrees
description: Action to run when cube flips 90 degrees. This only works if 'Flip
90 degrees' is toggled
default: []
selector:
action: {}
flip_180:
name: Flip 180 degrees
description: 'Actions to run when cube flips 180 degrees.
This cancels all specific 180 degrees functions
e.g From side 1 to side 4 will be the same as from side 5 to side 2'
default: false
selector:
boolean: {}
cube_flip_180:
name: Flip cube 180 degrees
description: Action to run when cube flips 180 degrees. This only works if 'Flip
180 degrees' is toggled
default: []
selector:
action: {}
slide_any_side:
name: Slide any side
description: 'Actions to run when cube slides on any side.
This cancels all specific ''slide'' functions
e.g Slide on side 1 will be the same as slide on side 2'
default: false
selector:
boolean: {}
cube_slide_any:
name: Slide cube on any side
description: Action to run when cube slides on any slide. This only works if
'Slide any side' is toggled
default: []
selector:
action: {}
knock_any_side:
name: Knock on any side
description: 'Actions to run when knocking cube regardless of the side.
This cancels all specific ''knock'' functions
e.g Knock on side 1 will be the same as knocking side 2'
default: false
selector:
boolean: {}
cube_knock_any:
name: Knock cube on any side
description: Action to run when knocking cube on any side. This only works if
'Knock on any side' is toggled
default: []
selector:
action: {}
one_to_two:
name: From side 1 to side 2
description: Action to run when cube goes from side 1 to side 2
default: []
selector:
action: {}
one_to_three:
name: From side 1 to side 3
description: Action to run when cube goes from side 1 to side 3
default: []
selector:
action: {}
one_to_four:
name: From side 1 to side 4
description: Action to run when cube goes from side 1 to side 4
default: []
selector:
action: {}
one_to_five:
name: From side 1 to side 5
description: Action to run when cube goes from side 1 to side 5
default: []
selector:
action: {}
one_to_six:
name: From side 1 to side 6
description: Action to run when cube goes from side 1 to side 6
default: []
selector:
action: {}
two_to_one:
name: From side 2 to side 1
description: Action to run when cube goes from side 2 to side 1
default: []
selector:
action: {}
two_to_three:
name: From side 2 to side 3
description: Action to run when cube goes from side 2 to side 3
default: []
selector:
action: {}
two_to_four:
name: From side 2 to side 4
description: Action to run when cube goes from side 2 to side 4
default: []
selector:
action: {}
two_to_five:
name: From side 2 to side 5
description: Action to run when cube goes from side 2 to side 5
default: []
selector:
action: {}
two_to_six:
name: From side 2 to side 6
description: Action to run when cube goes from side 2 to side 6
default: []
selector:
action: {}
three_to_one:
name: From side 3 to side 1
description: Action to run when cube goes from side 3 to side 1
default: []
selector:
action: {}
three_to_two:
name: From side 3 to side 2
description: Action to run when cube goes from side 3 to side 2
default: []
selector:
action: {}
three_to_four:
name: From side 3 to side 4
description: Action to run when cube goes from side 3 to side 4
default: []
selector:
action: {}
three_to_five:
name: From side 3 to side 5
description: Action to run when cube goes from side 3 to side 5
default: []
selector:
action: {}
three_to_six:
name: From side 3 to side 6
description: Action to run when cube goes from side 3 to side 6
default: []
selector:
action: {}
four_to_one:
name: From side 4 to side 1
description: Action to run when cube goes from side 4 to side 1
default: []
selector:
action: {}
four_to_two:
name: From side 4 to side 2
description: Action to run when cube goes from side 4 to side 2
default: []
selector:
action: {}
four_to_three:
name: From side 4 to side 3
description: Action to run when cube goes from side 4 to side 3
default: []
selector:
action: {}
four_to_five:
name: From side 4 to side 5
description: Action to run when cube goes from side 4 to side 5
default: []
selector:
action: {}
four_to_six:
name: From side 4 to side 6
description: Action to run when cube goes from side 4 to side 6
default: []
selector:
action: {}
five_to_one:
name: From side 5 to side 1
description: Action to run when cube goes from side 5 to side 1
default: []
selector:
action: {}
five_to_two:
name: From side 5 to side 2
description: Action to run when cube goes from side 5 to side 2
default: []
selector:
action: {}
five_to_three:
name: From side 5 to side 3
description: Action to run when cube goes from side 5 to side 3
default: []
selector:
action: {}
five_to_four:
name: From side 5 to side 4
description: Action to run when cube goes from side 5 to side 4
default: []
selector:
action: {}
five_to_six:
name: From side 5 to side 6
description: Action to run when cube goes from side 5 to side 6
default: []
selector:
action: {}
six_to_one:
name: From side 6 to side 1
description: Action to run when cube goes from side 6 to side 1
default: []
selector:
action: {}
six_to_two:
name: From side 6 to side 2
description: Action to run when cube goes from side 6 to side 2
default: []
selector:
action: {}
six_to_three:
name: From side 6 to side 3
description: Action to run when cube goes from side 6 to side 3
default: []
selector:
action: {}
six_to_four:
name: From side 6 to side 4
description: Action to run when cube goes from side 6 to side 4
default: []
selector:
action: {}
six_to_five:
name: From side 6 to side 5
description: Action to run when cube goes from side 6 to side 5
default: []
selector:
action: {}
one_to_one:
name: Knock - Side 1
description: Action to run when knocking on side 1
default: []
selector:
action: {}
two_to_two:
name: Knock - Side 2
description: Action to run when knocking on side 2
default: []
selector:
action: {}
three_to_three:
name: Knock - Side 3
description: Action to run when knocking on side 3
default: []
selector:
action: {}
four_to_four:
name: Knock - Side 4
description: Action to run when knocking on side 4
default: []
selector:
action: {}
five_to_five:
name: Knock - Side 5
description: Action to run when knocking on side 5
default: []
selector:
action: {}
six_to_six:
name: Knock - Side 6
description: Action to run when knocking on side 6
default: []
selector:
action: {}
slide_on_one:
name: Slide - Side 1 up
description: Action to run when slides with Side 1 up
default: []
selector:
action: {}
slide_on_two:
name: Slide - Side 2 up
description: Action to run when slides with Side 2 up
default: []
selector:
action: {}
slide_on_three:
name: Slide - Side 3 up
description: Action to run when slides with Side 3 up
default: []
selector:
action: {}
slide_on_four:
name: Slide - Side 4 up
description: Action to run when slides with Side 4 up
default: []
selector:
action: {}
slide_on_five:
name: Slide - Side 5 up
description: Action to run when slides with Side 5 up
default: []
selector:
action: {}
slide_on_six:
name: Slide - Side 6 up
description: Action to run when slides with Side 6 up
default: []
selector:
action: {}
cube_wake:
name: Wake up the cube
description: Action to run when cube wakes up
default: []
selector:
action: {}
cube_drop:
name: Cube drops
description: Action to run when cube drops
default: []
selector:
action: {}
cube_shake:
name: Shake cube
description: Action to run when you shake the cube
default: []
selector:
action: {}
rotate_right:
name: Rotate right
description: Action to run when cube rotates right
default: []
selector:
action: {}
rotate_left:
name: Rotate left
description: Action to run when cube rotates left
default: []
selector:
action: {}
source_url: https://community.home-assistant.io/t/aqara-magic-cube-zha-51-actions/270829
mode: restart
max_exceeded: silent
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input 'remote'
action:
- variables:
command: '{{ trigger.event.data.command }}'
value: '{{ trigger.event.data.args.value }}'
flip_degrees: '{{ trigger.event.data.args.flip_degrees }}'
relative_degrees: '{{ trigger.event.data.args.relative_degrees }}'
flip_90: !input 'flip_90'
flip_180: !input 'flip_180'
slide_any_side: !input 'slide_any_side'
knock_any_side: !input 'knock_any_side'
flip90: 64
flip180: 128
slide: 256
knock: 512
shake: 0
drop: 3
activated_face: "\n{% if command == \"slide\" or command == \"knock\" %}\n\n \
\ {% if trigger.event.data.args.activated_face == 1 %} 1\n\n {% elif trigger.event.data.args.activated_face\
\ == 2 %} 5\n\n {% elif trigger.event.data.args.activated_face == 3 %} 6\n\n\
\ {% elif trigger.event.data.args.activated_face == 4 %} 4\n\n {% elif trigger.event.data.args.activated_face\
\ == 5 %} 2\n\n {% elif trigger.event.data.args.activated_face == 6 %} 3\n\n\
\ {% endif %}\n\n{% elif command == 'flip' %}\n\n {{ trigger.event.data.args.activated_face\
\ | int }}\n\n{% endif %}\n"
from_face: "\n{% if command == \"flip\" and flip_degrees == 90 %}\n\n {{ ((value\
\ - flip90 - (trigger.event.data.args.activated_face - 1)) / 8) + 1 | int }}\n\
\n{% endif %}\n"
- choose:
- conditions:
- '{{ command == ''rotate_right'' }}'
sequence: !input 'rotate_right'
- conditions:
- '{{ command == ''rotate_left'' }}'
sequence: !input 'rotate_left'
- conditions:
- '{{ command == ''checkin'' }}'
sequence: !input 'cube_wake'
- conditions:
- '{{ value == shake }}'
sequence: !input 'cube_shake'
- conditions:
- '{{ value == drop }}'
sequence: !input 'cube_drop'
- conditions:
- '{{ command == ''knock'' and knock_any_side }}'
sequence: !input 'cube_knock_any'
- conditions:
- '{{ command == ''slide'' and slide_any_side }}'
sequence: !input 'cube_slide_any'
- conditions:
- '{{ flip_degrees == 90 and flip_90 }}'
sequence: !input 'cube_flip_90'
- conditions:
- '{{ flip_degrees == 180 and flip_180 }}'
sequence: !input 'cube_flip_180'
- conditions:
- '{{ flip_degrees == 90 and activated_face == 1 }}'
sequence:
- choose:
- conditions: '{{ from_face == 2 }}'
sequence: !input 'two_to_one'
- conditions: '{{ from_face == 3 }}'
sequence: !input 'three_to_one'
- conditions: '{{ from_face == 5 }}'
sequence: !input 'five_to_one'
- conditions: '{{ from_face == 6 }}'
sequence: !input 'six_to_one'
- conditions:
- '{{ flip_degrees == 90 and activated_face == 2 }}'
sequence:
- choose:
- conditions: '{{ from_face == 1 }}'
sequence: !input 'one_to_two'
- conditions: '{{ from_face == 3 }}'
sequence: !input 'three_to_two'
- conditions: '{{ from_face == 4 }}'
sequence: !input 'four_to_two'
- conditions: '{{ from_face == 6 }}'
sequence: !input 'six_to_two'
- conditions:
- '{{ flip_degrees == 90 and activated_face == 3 }}'
sequence:
- choose:
- conditions: '{{ from_face == 1 }}'
sequence: !input 'one_to_three'
- conditions: '{{ from_face == 2 }}'
sequence: !input 'two_to_three'
- conditions: '{{ from_face == 4 }}'
sequence: !input 'four_to_three'
- conditions: '{{ from_face == 5 }}'
sequence: !input 'five_to_three'
- conditions:
- '{{ flip_degrees == 90 and activated_face == 4 }}'
sequence:
- choose:
- conditions: '{{ from_face == 2 }}'
sequence: !input 'two_to_four'
- conditions: '{{ from_face == 3 }}'
sequence: !input 'three_to_four'
- conditions: '{{ from_face == 5 }}'
sequence: !input 'five_to_four'
- conditions: '{{ from_face == 6 }}'
sequence: !input 'six_to_four'
- conditions:
- '{{ flip_degrees == 90 and activated_face == 5 }}'
sequence:
- choose:
- conditions: '{{ from_face == 1 }}'
sequence: !input 'one_to_five'
- conditions: '{{ from_face == 3 }}'
sequence: !input 'three_to_five'
- conditions: '{{ from_face == 4 }}'
sequence: !input 'four_to_five'
- conditions: '{{ from_face == 6 }}'
sequence: !input 'six_to_five'
- conditions:
- '{{ flip_degrees == 90 and activated_face == 6 }}'
sequence:
- choose:
- conditions: '{{ from_face == 1 }}'
sequence: !input 'one_to_six'
- conditions: '{{ from_face == 2 }}'
sequence: !input 'two_to_six'
- conditions: '{{ from_face == 4 }}'
sequence: !input 'four_to_six'
- conditions: '{{ from_face == 5 }}'
sequence: !input 'five_to_six'
- conditions:
- '{{ value == flip180 + activated_face - 1 }}'
sequence:
- choose:
- conditions: '{{ activated_face == 1 }}'
sequence: !input 'four_to_one'
- conditions: '{{ activated_face == 2 }}'
sequence: !input 'five_to_two'
- conditions: '{{ activated_face == 3 }}'
sequence: !input 'six_to_three'
- conditions: '{{ activated_face == 4 }}'
sequence: !input 'one_to_four'
- conditions: '{{ activated_face == 5 }}'
sequence: !input 'two_to_five'
- conditions: '{{ activated_face == 6 }}'
sequence: !input 'three_to_six'
- conditions:
- '{{ value == knock + activated_face - 1 }}'
sequence:
- choose:
- conditions: '{{ activated_face == 1 }}'
sequence: !input 'one_to_one'
- conditions: '{{ activated_face == 2 }}'
sequence: !input 'two_to_two'
- conditions: '{{ activated_face == 3 }}'
sequence: !input 'three_to_three'
- conditions: '{{ activated_face == 4 }}'
sequence: !input 'four_to_four'
- conditions: '{{ activated_face == 5 }}'
sequence: !input 'five_to_five'
- conditions: '{{ activated_face == 6 }}'
sequence: !input 'six_to_six'
- conditions:
- '{{ value == slide + activated_face - 1 }}'
sequence:
- choose:
- conditions: '{{ activated_face == 1 }}'
sequence: !input 'slide_on_one'
- conditions: '{{ activated_face == 2 }}'
sequence: !input 'slide_on_two'
- conditions: '{{ activated_face == 3 }}'
sequence: !input 'slide_on_three'
- conditions: '{{ activated_face == 4 }}'
sequence: !input 'slide_on_four'
- conditions: '{{ activated_face == 5 }}'
sequence: !input 'slide_on_five'
- conditions: '{{ activated_face == 6 }}'
sequence: !input 'slide_on_six'
@@ -1,787 +0,0 @@
blueprint:
name: Aqara Magic Cube Zigbee2MQTT - 2022-05-05
description: "This Blueprint uses a Zigbee2MQTT built sensor to sort out the 38(+54)
unique commands available from the Xiaomi Magic Cube Remote. (Some unique commands
are available thru templating only. See the related document.)\nThe split out
of functions gives you the ability to assign local scripts or functions to do
the things you want the remote to do.\nFunctions that are left empty will simply
do nothing.\n\n### \U0001F34E There is a set of 36 event functions that will trigger
on specific actions on specific sides that are listed as **Group 1 actions \U0001F34E**.\n\n###
\U0001F34A There is a set of 6 event functions that will trigger on specific actions
on *ANY* side that are listed as **Group 2 sctions \U0001F34A**.\n\n### \U0001F350
There is a set of 30 event functions that will trigger on cube flips to & froma
specific sides that are listed as **Group 3 sctions \U0001F350**.\n\n### \U0001F369
There are 2 actions (shake and drop) that only occur once and are OK to be combined
with any other group.\n\nPlease be aware that ALL actions except the 2 listed
above,\n\U0001F369 will trigger an action in **ALL 3 groups at the same time**
every time. Therefore I suggest if you just have a couple of things you want this
remote to do that you choose the *ANY / Group 2 / \U0001F34A* events.\nIf you
want more than a few events, you should select actions in **Group 1 / \U0001F34E
OR Group 3 / \U0001F350**.\nWith careful selection you can use mixed groups, but
you run the risk of a single cube action triggering more than 1 Home Assistant
action and making a mess of things \U0001F371.\n\n#### NOTICE: This cube *can*
be triggered 124 ways, but only 38(+54) of them are unique (with templating).\n\nThere
is sample code to make the template sensor in the help file on GitHib named [Zigbee2MQTT
- Xiaomi Cube Controller.md](https://github.com/SirGoodenough/HA_Blueprints/blob/master/Automations/Zigbee2MQTT%20-%20Xiaomi%20Cube%20Controller.md)
& in the [community page related to this](https://community.home-assistant.io/t/zigbee2mqtt-xiaomi-cube-controller/393203).\n\nWithin
this blueprint there is an event handler that will latch the last command that
the blueprint finds and sends that to the event buss. From there a simple Template
sensor can grab it and show you the last action sent. Thie will help when setting
up new functions and to troubleshoot strange behaviours.\n\n> This was forked
from https://community.home-assistant.io/t/z2m-xiaomi-cube-controller/263006 1.2
project authored by luckypoppy and the friends he pulled together to create the
base. I sincerely thank Him (Them) for their work. I felt there needed to be more
documentation for rookie users to properly set this up. I had quite a few questions
and when I saw a few questions in that chat from people struggling, I wanted to
help. I also had a better idea for troubleshooting info.\n"
source_url: https://github.com/SirGoodenough/HA_Blueprints/blob/master/Automations/Zigbee2MQTT%20-%20Xiaomi%20Cube%20Controller.yaml
domain: automation
homeassistant:
min_version: 2022.5.2
input:
remote:
name: Remote
description: 'The entity to put here is the sensor that Z2M imported which is
named like this> sensor.XXYour_HameXX_action.
The other 4 sensors can be disabled, they will not be used.'
selector:
entity:
integration: mqtt
domain: sensor
multiple: false
slide_face_0:
name: "Group 1 actions \U0001F34E Slide the cube with face 0 up"
description: Face 0 is the one with the 'Aqara' LOGO
default: []
selector:
action: {}
doubletap_face_0:
name: "Group 1 actions \U0001F34E Double tap the cube with face 0 up"
description: Face 0 is the one with the 'Aqara' LOGO
default: []
selector:
action: {}
flipped90_face_0:
name: "Group 1 actions \U0001F34E Flip the cube 90 degrees to face 0"
description: Face 0 is the one with the 'Aqara' LOGO
default: []
selector:
action: {}
flipped180_face_0:
name: "Group 1 actions \U0001F34E Flip the cube 180 degrees to face 0"
description: '**NOTE:** This action is trick to master, and should be used sparingly...
Face 0 is the one with the ''Aqara'' LOGO'
default: []
selector:
action: {}
rotate_cw_face_0:
name: "Group 1 actions \U0001F34E Rotate cube clockwise with face 0 up"
description: Face 0 is the one with the 'Aqara' LOGO
default: []
selector:
action: {}
rotate_ccw_face_0:
name: "Group 1 actions \U0001F34E Rotate cube counter clockwise with face 0
up"
description: Face 0 is the one with the 'Aqara' LOGO
default: []
selector:
action: {}
slide_face_1:
name: "Group 1 actions \U0001F34E Slide the cube with face 1 up"
default: []
selector:
action: {}
doubletap_face_1:
name: "Group 1 actions \U0001F34E Double tap the cube with face 1 up"
default: []
selector:
action: {}
flipped90_face_1:
name: "Group 1 actions \U0001F34E Flip the cube 90 degrees to face 1"
default: []
selector:
action: {}
flipped180_face_1:
name: "Group 1 actions \U0001F34E Flip the cube 180 degrees to face 1"
description: '**NOTE:** This action is trick to master, and should be used sparingly...'
default: []
selector:
action: {}
rotate_cw_face_1:
name: "Group 1 actions \U0001F34E Rotate cube clockwise with face 1 up"
default: []
selector:
action: {}
rotate_ccw_face_1:
name: "Group 1 actions \U0001F34E Rotate cube counter clockwise with face 1
up"
default: []
selector:
action: {}
slide_face_2:
name: "Group 1 actions \U0001F34E Slide the cube with face 2 up"
default: []
selector:
action: {}
doubletap_face_2:
name: "Group 1 actions \U0001F34E Double tap the cube with face 2 up"
default: []
selector:
action: {}
flipped90_face_2:
name: "Group 1 actions \U0001F34E Flip the cube 90 degrees to face 2"
default: []
selector:
action: {}
flipped180_face_2:
name: "Group 1 actions \U0001F34E Flip the cube 180 degrees to face 2"
description: '**NOTE:** This action is trick to master, and should be used sparingly...'
default: []
selector:
action: {}
rotate_cw_face_2:
name: "Group 1 actions \U0001F34E Rotate cube clockwise with face 2 up"
default: []
selector:
action: {}
rotate_ccw_face_2:
name: "Group 1 actions \U0001F34E Rotate cube counter clockwise with face 2
up"
default: []
selector:
action: {}
slide_face_3:
name: "Group 1 actions \U0001F34E Slide the cube with face 3 up"
default: []
selector:
action: {}
doubletap_face_3:
name: "Group 1 actions \U0001F34E Double tap the cube with face 3 up"
default: []
selector:
action: {}
flipped90_face_3:
name: "Group 1 actions \U0001F34E Flip the cube 90 degrees to face 3"
default: []
selector:
action: {}
flipped180_face_3:
name: "Group 1 actions \U0001F34E Flip the cube 180 degrees to face 3"
description: '**NOTE:** This action is trick to master, and should be used sparingly...'
default: []
selector:
action: {}
rotate_cw_face_3:
name: "Group 1 actions \U0001F34E Rotate cube clockwise with face 3 up"
default: []
selector:
action: {}
rotate_ccw_face_3:
name: "Group 1 actions \U0001F34E Rotate cube counter clockwise with face 3
up"
default: []
selector:
action: {}
slide_face_4:
name: "Group 1 actions \U0001F34E Slide the cube with face 4 up"
default: []
selector:
action: {}
doubletap_face_4:
name: "Group 1 actions \U0001F34E Double tap the cube with face 4 up"
default: []
selector:
action: {}
flipped90_face_4:
name: "Group 1 actions \U0001F34E Flip the cube 90 degrees to face 4"
default: []
selector:
action: {}
flipped180_face_4:
name: "Group 1 actions \U0001F34E Flip the cube 180 degrees to face 4"
description: '**NOTE:** This action is trick to master, and should be used sparingly...'
default: []
selector:
action: {}
rotate_cw_face_4:
name: "Group 1 actions \U0001F34E Rotate cube clockwise with face 4 up"
default: []
selector:
action: {}
rotate_ccw_face_4:
name: "Group 1 actions \U0001F34E Rotate cube counter clockwise with face 4
up"
default: []
selector:
action: {}
slide_face_5:
name: "Group 1 actions \U0001F34E Slide the cube with face 5 up"
default: []
selector:
action: {}
doubletap_face_5:
name: "Group 1 actions \U0001F34E Double tap the cube with face 5 up"
default: []
selector:
action: {}
flipped90_face_5:
name: "Group 1 actions \U0001F34E Flip the cube 90 degrees to face 5"
default: []
selector:
action: {}
flipped180_face_5:
name: "Group 1 actions \U0001F34E Flip the cube 180 degrees to face 5"
description: '**NOTE:** This action is trick to master, and should be used sparingly...'
default: []
selector:
action: {}
rotate_cw_face_5:
name: "Group 1 actions \U0001F34E Rotate cube clockwise with face 5 up"
default: []
selector:
action: {}
rotate_ccw_face_5:
name: "Group 1 actions \U0001F34E Rotate cube counter clockwise with face 5
up"
default: []
selector:
action: {}
shake:
name: "Shake the cube \U0001F369"
description: 'This trigger only occurs once in the set-up.
It can be combined in any group.'
default: []
selector:
action: {}
fall:
name: "Drop the cube \U0001F369"
description: 'This trigger only occurs once in the set-up.
It can be combined in any group.'
default: []
selector:
action: {}
slide_any:
name: "Group 2 actions \U0001F34A Slide the cube with any side"
description: "Side doesn't matter on this one.\n**!!Warning!!** The automations
for the specific side will also trigger. \U0001F34E\U0001F350\nI suggest using
only one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
doubletap_any:
name: "Group 2 actions \U0001F34A Double tap the cube with any side"
description: "Side doesn't matter on this one.\n**!!Warning!!** The automations
for the specific side will also trigger. \U0001F34E\U0001F350\nI suggest using
only one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
flipped90_any:
name: "Group 2 actions \U0001F34A Flip the cube 90 degrees to any side"
description: "Side doesn't matter on this one.\n**!!Warning!!** The automations
for the specific side will also trigger. \U0001F34E\U0001F350\nI suggest using
only one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
flipped180_any:
name: "Group 2 actions \U0001F34A Flip the cube 180 degrees any side"
description: "NOTE: This action is trick to master, and should be used sparingly...
Side doesn't matter on this one.\n**!!Warning!!** The automations for the
specific side will also trigger. \U0001F34E\U0001F350\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
rotate_cw_any:
name: "Group 2 actions \U0001F34A Rotate cube clockwise with any side"
description: "Side doesn't matter on this one.\n**!!Warning!!** The automations
for the specific side will also trigger. \U0001F34E\U0001F350\nI suggest using
only one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
rotate_ccw_any:
name: "Group 2 actions \U0001F34A Rotate cube counter clockwise with any side"
description: "Side doesn't matter on this one.\n**!!Warning!!** The automations
for the specific side will also trigger. \U0001F34E\U0001F350\nI suggest using
only one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
0_from_1:
name: "Group 3 actions \U0001F350 Flip the cube to side 0 from side 1"
description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 0
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
0_from_2:
name: "Group 3 actions \U0001F350 Flip the cube to side 0 from side 2"
description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 0
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
0_from_3:
name: "Group 3 actions \U0001F350 Flip the cube to side 0 from side 3"
description: "**!!Warning!!** The flip 180 automations \U0001F34E for side 0
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
0_from_4:
name: "Group 3 actions \U0001F350 Flip the cube to side 0 from side 4"
description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 0
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
0_from_5:
name: "Group 3 actions \U0001F350 Flip the cube to side 0 from side 5"
description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 0
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
1_from_0:
name: "Group 3 actions \U0001F350 Flip the cube to side 1 from side 0"
description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 1
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
1_from_2:
name: "Group 3 actions \U0001F350 Flip the cube to side 1 from side 2"
description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 1
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
1_from_3:
name: "Group 3 actions \U0001F350 Flip the cube to side 1 from side 3"
description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 1
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
1_from_4:
name: "Group 3 actions \U0001F350 Flip the cube to side 1 from side 4"
description: "**!!Warning!!** The flip 180 automations \U0001F34E for side 1
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
1_from_5:
name: "Group 3 actions \U0001F350 Flip the cube to side 1 from side 5"
description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 1
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
2_from_0:
name: "Group 3 actions \U0001F350 Flip the cube to side 2 from side 0"
description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 2
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
2_from_1:
name: "Group 3 actions \U0001F350 Flip the cube to side 2 from side 1"
description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 2
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
2_from_3:
name: "Group 3 actions \U0001F350 Flip the cube to side 2 from side 3"
description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 2
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
2_from_4:
name: "Group 3 actions \U0001F350 Flip the cube to side 2 from side 4"
description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 2
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
2_from_5:
name: "Group 3 actions \U0001F350 Flip the cube to side 2 from side 5"
description: "**!!Warning!!** The flip 180 automations \U0001F34E for side 2
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
3_from_0:
name: "Group 3 actions \U0001F350 Flip the cube to side 3 from side 0"
description: "**!!Warning!!** The flip 180 automations \U0001F34E for side 3
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
3_from_1:
name: "Group 3 actions \U0001F350 Flip the cube to side 3 from side 1"
description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 3
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
3_from_2:
name: "Group 3 actions \U0001F350 Flip the cube to side 3 from side 2"
description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 3
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
3_from_4:
name: "Group 3 actions \U0001F350 Flip the cube to side 3 from side 4"
description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 3
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
3_from_5:
name: "Group 3 actions \U0001F350 Flip the cube to side 3 from side 5"
description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 3
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
4_from_0:
name: "Group 3 actions \U0001F350 Flip the cube to side 4 from side 0"
description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 4
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
4_from_1:
name: "Group 3 actions \U0001F350 Flip the cube to side 4 from side 1"
description: "**!!Warning!!** The flip 180 automations \U0001F34E for side 4
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
4_from_2:
name: "Group 3 actions \U0001F350 Flip the cube to side 4 from side 2"
description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 4
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
4_from_3:
name: "Group 3 actions \U0001F350 Flip the cube to side 4 from side 3"
description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 4
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
4_from_5:
name: "Group 3 actions \U0001F350 Flip the cube to side 4 from side 5"
description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 4
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
5_from_0:
name: "Group 3 actions \U0001F350 Flip the cube to side 5 from side 0"
description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 5
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
5_from_1:
name: "Group 3 actions \U0001F350 Flip the cube to side 5 from side 1"
description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 5
and the ANY \U0001F34A automations will also trigger. \U0001F34E\U0001F350\nI
suggest using only one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
5_from_2:
name: "Group 3 actions \U0001F350 Flip the cube to side 5 from side 2"
description: "**!!Warning!!** The flip 180 automations \U0001F34E for side 5
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
5_from_3:
name: "Group 3 actions \U0001F350 Flip the cube to side 5 from side 3"
description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 5
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
5_from_4:
name: "Group 3 actions \U0001F350 Flip the cube to side 5 from side 4"
description: "**!!Warning!!** The flip 90 automations \U0001F34E for side 5
and the ANY \U0001F34A automations will also trigger.\nI suggest using only
one of the three groups of triggers, not multiple groups..."
default: []
selector:
action: {}
mode: single
max_exceeded: silent
trigger:
- platform: state
entity_id: !input remote
condition:
condition: template
value_template: '{{ trigger.to_state.attributes.action in (''rotate_right'', ''rotate_left'',
''flip90'', ''flip180'', ''slide'', ''tap'', ''shake'', ''fall'') }}'
action:
- variables:
action: '{{ trigger.to_state.attributes.action }}'
side: '{{ trigger.to_state.attributes.side }}'
last_side: '{{ trigger.from_state.attributes.side }}'
entity_id: !input remote
friendly_name: '{{ trigger.to_state.attributes.friendly_name }}'
- alias: Fire Last Action event
event: cube_last_action
event_data:
action: '{{ action }}'
side: '{{ side }}'
last_side: '{{ last_side }}'
entity_id: '{{ entity_id }}'
friendly_name: '{{ friendly_name }}'
- alias: "Group 2 \U0001F34A and No Group \U0001F369 These are action events for ANY
Side"
choose:
- conditions: '{{ action == "slide" }}'
sequence: !input slide_any
- conditions: '{{ action == "tap" }}'
sequence: !input doubletap_any
- conditions: '{{ action == "flip90" }}'
sequence: !input flipped90_any
- conditions: '{{ action == "flip180" }}'
sequence: !input flipped180_any
- conditions: '{{ action == "rotate_right" }}'
sequence: !input rotate_cw_any
- conditions: '{{ action == "rotate_left" }}'
sequence: !input rotate_ccw_any
- conditions: '{{ action == "shake" }}'
sequence: !input shake
- conditions: '{{ action == "fall" }}'
sequence: !input fall
- alias: "Group 1 \U0001F34E These are action events based on the action broken down
by side"
choose:
- conditions: '{{ action == "slide" }}'
sequence:
- alias: These are slide events
choose:
- conditions: '{{ side == 0 }}'
sequence: !input slide_face_0
- conditions: '{{ side == 1 }}'
sequence: !input slide_face_1
- conditions: '{{ side == 2 }}'
sequence: !input slide_face_2
- conditions: '{{ side == 3 }}'
sequence: !input slide_face_3
- conditions: '{{ side == 4 }}'
sequence: !input slide_face_4
- conditions: '{{ side == 5 }}'
sequence: !input slide_face_5
- conditions: '{{ action == "tap" }}'
sequence:
- alias: These are doubletap events
choose:
- conditions: '{{ side == 0 }}'
sequence: !input doubletap_face_0
- conditions: '{{ side == 1 }}'
sequence: !input doubletap_face_1
- conditions: '{{ side == 2 }}'
sequence: !input doubletap_face_2
- conditions: '{{ side == 3 }}'
sequence: !input doubletap_face_3
- conditions: '{{ side == 4 }}'
sequence: !input doubletap_face_4
- conditions: '{{ side == 5 }}'
sequence: !input doubletap_face_5
- conditions: '{{ action == "flip90" }}'
sequence:
- alias: These are flipped90 events
choose:
- conditions: '{{ side == 0 }}'
sequence: !input flipped90_face_0
- conditions: '{{ side == 1 }}'
sequence: !input flipped90_face_1
- conditions: '{{ side == 2 }}'
sequence: !input flipped90_face_2
- conditions: '{{ side == 3 }}'
sequence: !input flipped90_face_3
- conditions: '{{ side == 4 }}'
sequence: !input flipped90_face_4
- conditions: '{{ side == 5 }}'
sequence: !input flipped90_face_5
- conditions: '{{ action == "flip180" }}'
sequence:
- alias: These are flipped180 events
choose:
- conditions: '{{ side == 0 }}'
sequence: !input flipped180_face_0
- conditions: '{{ side == 1 }}'
sequence: !input flipped180_face_1
- conditions: '{{ side == 2 }}'
sequence: !input flipped180_face_2
- conditions: '{{ side == 3 }}'
sequence: !input flipped180_face_3
- conditions: '{{ side == 4 }}'
sequence: !input flipped180_face_4
- conditions: '{{ side == 5 }}'
sequence: !input flipped180_face_5
- conditions: '{{ action == "rotate_right" }}'
sequence:
- alias: These are rotate CW events
choose:
- conditions: '{{ side == 0 }}'
sequence: !input rotate_cw_face_0
- conditions: '{{ side == 1 }}'
sequence: !input rotate_cw_face_1
- conditions: '{{ side == 2 }}'
sequence: !input rotate_cw_face_2
- conditions: '{{ side == 3 }}'
sequence: !input rotate_cw_face_3
- conditions: '{{ side == 4 }}'
sequence: !input rotate_cw_face_4
- conditions: '{{ side == 5 }}'
sequence: !input rotate_cw_face_5
- conditions: '{{ action == "rotate_left" }}'
sequence:
- alias: These are rotate CCW events
choose:
- conditions: '{{ side == 0 }}'
sequence: !input rotate_ccw_face_0
- conditions: '{{ side == 1 }}'
sequence: !input rotate_ccw_face_1
- conditions: '{{ side == 2 }}'
sequence: !input rotate_ccw_face_2
- conditions: '{{ side == 3 }}'
sequence: !input rotate_ccw_face_3
- conditions: '{{ side == 4 }}'
sequence: !input rotate_ccw_face_4
- conditions: '{{ side == 5 }}'
sequence: !input rotate_ccw_face_5
- alias: "Group 3 \U0001F350 Side to side jump events"
choose:
- conditions: '{{ side == 0 }}'
sequence:
- alias: To side 0 from any events
choose:
- conditions: '{{ last_side == 1 }}'
sequence: !input 0_from_1
- conditions: '{{ last_side == 2 }}'
sequence: !input 0_from_2
- conditions: '{{ last_side == 3 }}'
sequence: !input 0_from_3
- conditions: '{{ last_side == 4 }}'
sequence: !input 0_from_4
- conditions: '{{ last_side == 5 }}'
sequence: !input 0_from_5
- conditions: '{{ side == 1 }}'
sequence:
- alias: To side 1 from any events
choose:
- conditions: '{{ last_side == 0 }}'
sequence: !input 1_from_0
- conditions: '{{ last_side == 2 }}'
sequence: !input 1_from_2
- conditions: '{{ last_side == 3 }}'
sequence: !input 1_from_3
- conditions: '{{ last_side == 4 }}'
sequence: !input 1_from_4
- conditions: '{{ last_side == 5 }}'
sequence: !input 1_from_5
- conditions: '{{ side == 2 }}'
sequence:
- alias: To side 2 from any events
choose:
- conditions: '{{ last_side == 0 }}'
sequence: !input 2_from_0
- conditions: '{{ last_side == 1 }}'
sequence: !input 2_from_1
- conditions: '{{ last_side == 3 }}'
sequence: !input 2_from_3
- conditions: '{{ last_side == 4 }}'
sequence: !input 2_from_4
- conditions: '{{ last_side == 5 }}'
sequence: !input 2_from_5
- conditions: '{{ side == 3 }}'
sequence:
- alias: To side 3 from any events
choose:
- conditions: '{{ last_side == 0 }}'
sequence: !input 3_from_0
- conditions: '{{ last_side == 1 }}'
sequence: !input 3_from_1
- conditions: '{{ last_side == 2 }}'
sequence: !input 3_from_2
- conditions: '{{ last_side == 4 }}'
sequence: !input 3_from_4
- conditions: '{{ last_side == 5 }}'
sequence: !input 3_from_5
- conditions: '{{ side == 4 }}'
sequence:
- alias: To side 4 from any events
choose:
- conditions: '{{ last_side == 0 }}'
sequence: !input 4_from_0
- conditions: '{{ last_side == 1 }}'
sequence: !input 4_from_1
- conditions: '{{ last_side == 2 }}'
sequence: !input 4_from_2
- conditions: '{{ last_side == 3 }}'
sequence: !input 4_from_3
- conditions: '{{ last_side == 5 }}'
sequence: !input 4_from_5
- conditions: '{{ side == 5 }}'
sequence:
- alias: To side 5 from any events
choose:
- conditions: '{{ last_side == 0 }}'
sequence: !input 5_from_0
- conditions: '{{ last_side == 1 }}'
sequence: !input 5_from_1
- conditions: '{{ last_side == 2 }}'
sequence: !input 5_from_2
- conditions: '{{ last_side == 3 }}'
sequence: !input 5_from_3
- conditions: '{{ last_side == 4 }}'
sequence: !input 5_from_4
- alias: Delay ⏱ for debounce so toggle functions work. Also blueprint is in single
mode.
delay: 00:00:01
@@ -1,755 +0,0 @@
blueprint:
name: Aqara Magic Cube
description: Control anything using Aqara Magic Cube.
domain: automation
input:
remote:
name: Magic Cube
description: Select the Aqara Magic Cube device
selector:
device:
integration: zha
manufacturer: LUMI
multiple: false
active_face:
name: Active Face
description: Select the number input for tracking active face
selector:
entity:
domain: input_number
multiple: false
flip_90:
name: Flip 90 degrees
description: 'Actions to run when cube flips 90 degrees.
This cancels all specific 90 degrees functions.
e.g From side 1 to side 2 will be the same as from side 6 to side 2'
default: false
selector:
boolean: {}
cube_flip_90:
name: Flip cube 90 degrees
description: Action to run when cube flips 90 degrees. This only works if 'Flip
90 degrees' is toggled
default: []
selector:
action: {}
flip_180:
name: Flip 180 degrees
description: 'Actions to run when cube flips 180 degrees.
This cancels all specific 180 degrees functions
e.g From side 1 to side 4 will be the same as from side 5 to side 2'
default: false
selector:
boolean: {}
cube_flip_180:
name: Flip cube 180 degrees
description: Action to run when cube flips 180 degrees. This only works if 'Flip
180 degrees' is toggled
default: []
selector:
action: {}
flip_any:
name: Flip cube to any side
description: 'Actions to run when cube flips to any side.
This cares about the end side, but cancels all specific flip functions.
e.g From side 1 to side 2 will be the same as from side 6 to side 2
but different than side 1 to side 5'
default: false
selector:
boolean: {}
cube_flip_1:
name: Flip cube to side 1
description: Action to run when cube flips to side 1. This only works if 'Flip
any' is toggled
default: []
selector:
action: {}
cube_flip_2:
name: Flip cube to side 2
description: Action to run when cube flips to side 2. This only works if 'Flip
any' is toggled
default: []
selector:
action: {}
cube_flip_3:
name: Flip cube to side 3
description: Action to run when cube flips to side 3. This only works if 'Flip
any' is toggled
default: []
selector:
action: {}
cube_flip_4:
name: Flip cube to side 4
description: Action to run when cube flips to side 4. This only works if 'Flip
any' is toggled
default: []
selector:
action: {}
cube_flip_5:
name: Flip cube to side 5
description: Action to run when cube flips to side 5. This only works if 'Flip
any' is toggled
default: []
selector:
action: {}
cube_flip_6:
name: Flip cube to side 6
description: Action to run when cube flips to side 6. This only works if 'Flip
any' is toggled
default: []
selector:
action: {}
slide_any_side:
name: Slide any side
description: 'Actions to run when cube slides on any side.
This cancels all specific ''slide'' functions
e.g Slide on side 1 will be the same as slide on side 2'
default: false
selector:
boolean: {}
cube_slide_any:
name: Slide cube on any side
description: Action to run when cube slides on any side. This only works if
'Slide any side' is toggled
default: []
selector:
action: {}
knock_any_side:
name: Knock on any side
description: 'Actions to run when knocking cube regardless of the side.
This cancels all specific ''knock'' functions
e.g Knock on side 1 will be the same as knocking side 2'
default: false
selector:
boolean: {}
cube_knock_any:
name: Knock cube on any side
description: Action to run when knocking cube on any side. This only works if
'Knock on any side' is toggled
default: []
selector:
action: {}
one_to_two:
name: From side 1 to side 2
description: Action to run when cube goes from side 1 to side 2
default: []
selector:
action: {}
one_to_three:
name: From side 1 to side 3
description: Action to run when cube goes from side 1 to side 3
default: []
selector:
action: {}
one_to_four:
name: From side 1 to side 4
description: Action to run when cube goes from side 1 to side 4
default: []
selector:
action: {}
one_to_five:
name: From side 1 to side 5
description: Action to run when cube goes from side 1 to side 5
default: []
selector:
action: {}
one_to_six:
name: From side 1 to side 6
description: Action to run when cube goes from side 1 to side 6
default: []
selector:
action: {}
two_to_one:
name: From side 2 to side 1
description: Action to run when cube goes from side 2 to side 1
default: []
selector:
action: {}
two_to_three:
name: From side 2 to side 3
description: Action to run when cube goes from side 2 to side 3
default: []
selector:
action: {}
two_to_four:
name: From side 2 to side 4
description: Action to run when cube goes from side 2 to side 4
default: []
selector:
action: {}
two_to_five:
name: From side 2 to side 5
description: Action to run when cube goes from side 2 to side 5
default: []
selector:
action: {}
two_to_six:
name: From side 2 to side 6
description: Action to run when cube goes from side 2 to side 6
default: []
selector:
action: {}
three_to_one:
name: From side 3 to side 1
description: Action to run when cube goes from side 3 to side 1
default: []
selector:
action: {}
three_to_two:
name: From side 3 to side 2
description: Action to run when cube goes from side 3 to side 2
default: []
selector:
action: {}
three_to_four:
name: From side 3 to side 4
description: Action to run when cube goes from side 3 to side 4
default: []
selector:
action: {}
three_to_five:
name: From side 3 to side 5
description: Action to run when cube goes from side 3 to side 5
default: []
selector:
action: {}
three_to_six:
name: From side 3 to side 6
description: Action to run when cube goes from side 3 to side 6
default: []
selector:
action: {}
four_to_one:
name: From side 4 to side 1
description: Action to run when cube goes from side 4 to side 1
default: []
selector:
action: {}
four_to_two:
name: From side 4 to side 2
description: Action to run when cube goes from side 4 to side 2
default: []
selector:
action: {}
four_to_three:
name: From side 4 to side 3
description: Action to run when cube goes from side 4 to side 3
default: []
selector:
action: {}
four_to_five:
name: From side 4 to side 5
description: Action to run when cube goes from side 4 to side 5
default: []
selector:
action: {}
four_to_six:
name: From side 4 to side 6
description: Action to run when cube goes from side 4 to side 6
default: []
selector:
action: {}
five_to_one:
name: From side 5 to side 1
description: Action to run when cube goes from side 5 to side 1
default: []
selector:
action: {}
five_to_two:
name: From side 5 to side 2
description: Action to run when cube goes from side 5 to side 2
default: []
selector:
action: {}
five_to_three:
name: From side 5 to side 3
description: Action to run when cube goes from side 5 to side 3
default: []
selector:
action: {}
five_to_four:
name: From side 5 to side 4
description: Action to run when cube goes from side 5 to side 4
default: []
selector:
action: {}
five_to_six:
name: From side 5 to side 6
description: Action to run when cube goes from side 5 to side 6
default: []
selector:
action: {}
six_to_one:
name: From side 6 to side 1
description: Action to run when cube goes from side 6 to side 1
default: []
selector:
action: {}
six_to_two:
name: From side 6 to side 2
description: Action to run when cube goes from side 6 to side 2
default: []
selector:
action: {}
six_to_three:
name: From side 6 to side 3
description: Action to run when cube goes from side 6 to side 3
default: []
selector:
action: {}
six_to_four:
name: From side 6 to side 4
description: Action to run when cube goes from side 6 to side 4
default: []
selector:
action: {}
six_to_five:
name: From side 6 to side 5
description: Action to run when cube goes from side 6 to side 5
default: []
selector:
action: {}
one_to_one:
name: Knock - Side 1
description: Action to run when knocking on side 1
default: []
selector:
action: {}
two_to_two:
name: Knock - Side 2
description: Action to run when knocking on side 2
default: []
selector:
action: {}
three_to_three:
name: Knock - Side 3
description: Action to run when knocking on side 3
default: []
selector:
action: {}
four_to_four:
name: Knock - Side 4
description: Action to run when knocking on side 4
default: []
selector:
action: {}
five_to_five:
name: Knock - Side 5
description: Action to run when knocking on side 5
default: []
selector:
action: {}
six_to_six:
name: Knock - Side 6
description: Action to run when knocking on side 6
default: []
selector:
action: {}
slide_on_one:
name: Slide - Side 1 up
description: Action to run when slides with Side 1 up
default: []
selector:
action: {}
slide_on_two:
name: Slide - Side 2 up
description: Action to run when slides with Side 2 up
default: []
selector:
action: {}
slide_on_three:
name: Slide - Side 3 up
description: Action to run when slides with Side 3 up
default: []
selector:
action: {}
slide_on_four:
name: Slide - Side 4 up
description: Action to run when slides with Side 4 up
default: []
selector:
action: {}
slide_on_five:
name: Slide - Side 5 up
description: Action to run when slides with Side 5 up
default: []
selector:
action: {}
slide_on_six:
name: Slide - Side 6 up
description: Action to run when slides with Side 6 up
default: []
selector:
action: {}
cube_wake:
name: Wake up the cube
description: Action to run when cube wakes up
default: []
selector:
action: {}
cube_drop:
name: Cube drops
description: Action to run when cube drops
default: []
selector:
action: {}
cube_shake:
name: Shake cube
description: Action to run when you shake the cube
default: []
selector:
action: {}
rotate_any_side:
name: Rotate any side
description: 'Actions to run when rotating cube regardless of the side.
This cancels all side-specific ''rotate'' functions
e.g Rotate on side 1 will be the same as rotating side 2'
default: false
selector:
boolean: {}
rotate_right:
name: Rotate right
description: Action to run when cube rotates right on any side. This only works
if 'Rotate any side' is toggled
default: []
selector:
action: {}
rotate_left:
name: Rotate left
description: Action to run when cube rotates left on any side. This only works
if 'Rotate any side' is toggled
default: []
selector:
action: {}
rotate_left_side_1:
name: Rotate cube left with side 1 up
default: []
selector:
action: {}
rotate_left_side_2:
name: Rotate cube left with side 2 up
default: []
selector:
action: {}
rotate_left_side_3:
name: Rotate cube left with side 3 up
default: []
selector:
action: {}
rotate_left_side_4:
name: Rotate cube left with side 4 up
default: []
selector:
action: {}
rotate_left_side_5:
name: Rotate cube left with side 5 up
default: []
selector:
action: {}
rotate_left_side_6:
name: Rotate cube left with side 6 up
default: []
selector:
action: {}
rotate_right_side_1:
name: Rotate cube right with side 1 up
default: []
selector:
action: {}
rotate_right_side_2:
name: Rotate cube right with side 2 up
default: []
selector:
action: {}
rotate_right_side_3:
name: Rotate cube right with side 3 up
default: []
selector:
action: {}
rotate_right_side_4:
name: Rotate cube right with side 4 up
default: []
selector:
action: {}
rotate_right_side_5:
name: Rotate cube right with side 5 up
default: []
selector:
action: {}
rotate_right_side_6:
name: Rotate cube right with side 6 up
default: []
selector:
action: {}
source_url: https://gist.github.com/rvaidya/3fe8a5f3b1d113ffa8625cf5ff2c88a3
mode: restart
max_exceeded: silent
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input remote
action:
- variables:
command: '{{ trigger.event.data.command }}'
value: '{{ trigger.event.data.args.value | default(0) }}'
flip_degrees: '{{ trigger.event.data.args.flip_degrees | default(0) }}'
flip_any: !input flip_any
flip_90: !input flip_90
flip_180: !input flip_180
slide_any_side: !input slide_any_side
knock_any_side: !input knock_any_side
rotate_any_side: !input rotate_any_side
flip90: 64
flip180: 128
slide: 256
knock: 512
shake: 0
drop: 3
active_face_entity: !input active_face
active_face: '{{ states(active_face_entity) | int }}'
activated_face: "\n{% if command == \"slide\" or command == \"knock\" %}\n\n {%
if trigger.event.data.args.activated_face == 1 %} 1\n\n {% elif trigger.event.data.args.activated_face
== 2 %} 5\n\n {% elif trigger.event.data.args.activated_face == 3 %} 6\n\n
\ {% elif trigger.event.data.args.activated_face == 4 %} 4\n\n {% elif trigger.event.data.args.activated_face
== 5 %} 2\n\n {% elif trigger.event.data.args.activated_face == 6 %} 3\n\n
\ {% endif %}\n\n{% elif command == 'flip' %}\n\n {{ trigger.event.data.args.activated_face
| int }}\n\n{% endif %}\n"
from_face: "\n{% if command == \"flip\" and flip_degrees == 90 %}\n\n {{ ((value
- flip90 - (trigger.event.data.args.activated_face - 1)) / 8) + 1 | int }}\n\n{%
endif %}\n"
relative_degrees: "\n{% if command == \"rotate_right\" or command == \"rotate_left\"
%}\n\n {{ trigger.event.data.args.relative_degrees | float }}\n\n{% endif %}\n"
- choose:
- conditions:
- '{{ command == ''checkin'' }}'
sequence: !input cube_wake
- conditions:
- '{{ command == ''flip'' }}'
sequence:
- service: input_number.set_value
target:
entity_id: '{{ active_face_entity }}'
data:
value: '{{ activated_face | int }}'
- choose:
- conditions: '{{ flip_any }}'
sequence:
- choose:
- conditions: '{{ activated_face == 1 }}'
sequence: !input cube_flip_1
- conditions: '{{ activated_face == 2 }}'
sequence: !input cube_flip_2
- conditions: '{{ activated_face == 3 }}'
sequence: !input cube_flip_3
- conditions: '{{ activated_face == 4 }}'
sequence: !input cube_flip_4
- conditions: '{{ activated_face == 5 }}'
sequence: !input cube_flip_5
- conditions: '{{ activated_face == 6 }}'
sequence: !input cube_flip_6
- conditions:
- '{{ flip_degrees == 90 and flip_90 }}'
sequence: !input cube_flip_90
- conditions:
- '{{ flip_degrees == 180 and flip_180 }}'
sequence: !input cube_flip_180
- conditions:
- '{{ flip_degrees == 90 and activated_face == 1 }}'
sequence:
- choose:
- conditions: '{{ from_face == 2 }}'
sequence: !input two_to_one
- conditions: '{{ from_face == 3 }}'
sequence: !input three_to_one
- conditions: '{{ from_face == 5 }}'
sequence: !input five_to_one
- conditions: '{{ from_face == 6 }}'
sequence: !input six_to_one
- conditions:
- '{{ flip_degrees == 90 and activated_face == 2 }}'
sequence:
- choose:
- conditions: '{{ from_face == 1 }}'
sequence: !input one_to_two
- conditions: '{{ from_face == 3 }}'
sequence: !input three_to_two
- conditions: '{{ from_face == 4 }}'
sequence: !input four_to_two
- conditions: '{{ from_face == 6 }}'
sequence: !input six_to_two
- conditions:
- '{{ flip_degrees == 90 and activated_face == 3 }}'
sequence:
- choose:
- conditions: '{{ from_face == 1 }}'
sequence: !input one_to_three
- conditions: '{{ from_face == 2 }}'
sequence: !input two_to_three
- conditions: '{{ from_face == 4 }}'
sequence: !input four_to_three
- conditions: '{{ from_face == 5 }}'
sequence: !input five_to_three
- conditions:
- '{{ flip_degrees == 90 and activated_face == 4 }}'
sequence:
- choose:
- conditions: '{{ from_face == 2 }}'
sequence: !input two_to_four
- conditions: '{{ from_face == 3 }}'
sequence: !input three_to_four
- conditions: '{{ from_face == 5 }}'
sequence: !input five_to_four
- conditions: '{{ from_face == 6 }}'
sequence: !input six_to_four
- conditions:
- '{{ flip_degrees == 90 and activated_face == 5 }}'
sequence:
- choose:
- conditions: '{{ from_face == 1 }}'
sequence: !input one_to_five
- conditions: '{{ from_face == 3 }}'
sequence: !input three_to_five
- conditions: '{{ from_face == 4 }}'
sequence: !input four_to_five
- conditions: '{{ from_face == 6 }}'
sequence: !input six_to_five
- conditions:
- '{{ flip_degrees == 90 and activated_face == 6 }}'
sequence:
- choose:
- conditions: '{{ from_face == 1 }}'
sequence: !input one_to_six
- conditions: '{{ from_face == 2 }}'
sequence: !input two_to_six
- conditions: '{{ from_face == 4 }}'
sequence: !input four_to_six
- conditions: '{{ from_face == 5 }}'
sequence: !input five_to_six
- conditions:
- '{{ value == flip180 + activated_face - 1 }}'
sequence:
- choose:
- conditions: '{{ activated_face == 1 }}'
sequence: !input four_to_one
- conditions: '{{ activated_face == 2 }}'
sequence: !input five_to_two
- conditions: '{{ activated_face == 3 }}'
sequence: !input six_to_three
- conditions: '{{ activated_face == 4 }}'
sequence: !input one_to_four
- conditions: '{{ activated_face == 5 }}'
sequence: !input two_to_five
- conditions: '{{ activated_face == 6 }}'
sequence: !input three_to_six
- conditions:
- '{{ command == ''knock'' }}'
sequence:
- service: input_number.set_value
target:
entity_id: '{{ active_face_entity }}'
data:
value: '{{ activated_face | int }}'
- choose:
- conditions: '{{ knock_any_side }}'
sequence: !input cube_knock_any
- conditions: '{{ activated_face == 1 }}'
sequence: !input one_to_one
- conditions: '{{ activated_face == 2 }}'
sequence: !input two_to_two
- conditions: '{{ activated_face == 3 }}'
sequence: !input three_to_three
- conditions: '{{ activated_face == 4 }}'
sequence: !input four_to_four
- conditions: '{{ activated_face == 5 }}'
sequence: !input five_to_five
- conditions: '{{ activated_face == 6 }}'
sequence: !input six_to_six
- conditions:
- '{{ command == ''slide'' }}'
sequence:
- service: input_number.set_value
target:
entity_id: '{{ active_face_entity }}'
data:
value: '{{ activated_face | int }}'
- choose:
- conditions: '{{ slide_any_side }}'
sequence: !input cube_slide_any
- conditions:
- '{{ value == slide + activated_face - 1 }}'
sequence:
- choose:
- conditions: '{{ activated_face == 1 }}'
sequence: !input slide_on_one
- conditions: '{{ activated_face == 2 }}'
sequence: !input slide_on_two
- conditions: '{{ activated_face == 3 }}'
sequence: !input slide_on_three
- conditions: '{{ activated_face == 4 }}'
sequence: !input slide_on_four
- conditions: '{{ activated_face == 5 }}'
sequence: !input slide_on_five
- conditions: '{{ activated_face == 6 }}'
sequence: !input slide_on_six
- conditions:
- '{{ command == ''rotate_left'' and rotate_any_side }}'
sequence: !input rotate_left
- conditions:
- '{{ command == ''rotate_left'' and active_face == 1 }}'
sequence: !input rotate_left_side_1
- conditions:
- '{{ command == ''rotate_left'' and active_face == 2 }}'
sequence: !input rotate_left_side_2
- conditions:
- '{{ command == ''rotate_left'' and active_face == 3 }}'
sequence: !input rotate_left_side_3
- conditions:
- '{{ command == ''rotate_left'' and active_face == 4 }}'
sequence: !input rotate_left_side_4
- conditions:
- '{{ command == ''rotate_left'' and active_face == 5 }}'
sequence: !input rotate_left_side_5
- conditions:
- '{{ command == ''rotate_left'' and active_face == 6 }}'
sequence: !input rotate_left_side_6
- conditions:
- '{{ command == ''rotate_right'' and rotate_any_side }}'
sequence: !input rotate_right
- conditions:
- '{{ command == ''rotate_right'' and active_face == 1 }}'
sequence: !input rotate_right_side_1
- conditions:
- '{{ command == ''rotate_right'' and active_face == 2 }}'
sequence: !input rotate_right_side_2
- conditions:
- '{{ command == ''rotate_right'' and active_face == 3 }}'
sequence: !input rotate_right_side_3
- conditions:
- '{{ command == ''rotate_right'' and active_face == 4 }}'
sequence: !input rotate_right_side_4
- conditions:
- '{{ command == ''rotate_right'' and active_face == 5 }}'
sequence: !input rotate_right_side_5
- conditions:
- '{{ command == ''rotate_right'' and active_face == 6 }}'
sequence: !input rotate_right_side_6
- conditions:
- '{{ command == ''shake'' or value == shake }}'
sequence: !input cube_shake
- conditions:
- '{{ command == ''drop'' or value == drop }}'
sequence: !input cube_drop