Last active
January 8, 2024 13:50
-
-
Save farridav/1ed8632a0fdcd2427a3476190b9790a5 to your computer and use it in GitHub Desktop.
simple blueprint for aqara cube
This file contains 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: Aqara Magic Cube [Simple] (Z2M) | |
description: Aqara Magic Cube [Simple] (Z2M) | |
domain: automation | |
input: | |
cube: | |
name: Aqara Magic Cube action | |
description: Aqara Magic Cube to use | |
selector: | |
entity: | |
integration: mqtt | |
domain: | |
- sensor | |
multiple: false | |
flipped90: | |
name: Flip the cube 90 degrees | |
default: [] | |
selector: | |
action: {} | |
flipped180: | |
name: Flip the cube 180 degrees | |
default: [] | |
selector: | |
action: {} | |
throw: | |
name: Throw the cube | |
default: [] | |
selector: | |
action: {} | |
slide: | |
name: Slide the cube | |
default: [] | |
selector: | |
action: {} | |
tap: | |
name: Tap the cube | |
default: [] | |
selector: | |
action: {} | |
rotate_cw: | |
name: Rotate cube clockwise | |
default: [] | |
selector: | |
action: {} | |
rotate_ccw: | |
name: Rotate cube counter clockwise | |
default: [] | |
selector: | |
action: {} | |
shake: | |
name: Shake the cube | |
default: [] | |
selector: | |
action: {} | |
fall: | |
name: Drop the cube | |
default: [] | |
selector: | |
action: {} | |
mode: queued | |
max: 5 | |
max_exceeded: silent | |
trigger: | |
- platform: state | |
entity_id: !input cube | |
condition: | |
- condition: template | |
value_template: '{{ trigger.to_state.state in ("shake", "throw", "fall", "tap", "slide", "flip180", "flip90", "rotate_left", "rotate_right") }}' | |
action: | |
- variables: | |
action: "{{ trigger.to_state.state }}" | |
- choose: | |
- conditions: '{{ action == "slide" }}' | |
sequence: !input slide | |
- conditions: '{{ action == "tap" }}' | |
sequence: !input tap | |
- conditions: '{{ action == "flip90" }}' | |
sequence: !input flipped90 | |
- conditions: '{{ action == "flip180" }}' | |
sequence: !input flipped180 | |
- conditions: '{{ action == "rotate_right" }}' | |
sequence: !input rotate_cw | |
- conditions: '{{ action == "rotate_left" }}' | |
sequence: !input rotate_ccw | |
- conditions: '{{ action == "shake" }}' | |
sequence: !input shake | |
- conditions: '{{ action == "fall" }}' | |
sequence: !input fall | |
- conditions: '{{ action == "throw" }}' | |
sequence: !input throw |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment