Skip to content

Instantly share code, notes, and snippets.

@Gaff
Last active March 14, 2026 10:46
Show Gist options
  • Select an option

  • Save Gaff/debf6459da0a815b7ee6b3b06a7b9570 to your computer and use it in GitHub Desktop.

Select an option

Save Gaff/debf6459da0a815b7ee6b3b06a7b9570 to your computer and use it in GitHub Desktop.
Aquara Magic Cube - Spotify Helper
blueprint:
name: Aquara Cube - Spotify Blueprint (Scene, Flip & Gestures)
description: Gestures for Spotify. Faces 1-5 = Playlists, Face 6 = pause. Slide = play/pause. Rotate = next/prev. Shake = shuffle.
domain: automation
input:
cube_device:
name: Magic Cube Device
description: Select your Aqara Magic Cube
selector:
device:
integration: zha
manufacturer: LUMI
speaker:
name: Spotify Speaker
selector:
entity:
domain: media_player
playlist_1:
name: Face 1 Playlist
selector:
text:
default: "spotify:playlist:your_playlist_uri_here"
playlist_2:
name: Face 2 Playlist
selector:
text:
default: ""
playlist_3:
name: Face 3 Playlist
selector:
text:
default: ""
playlist_4:
name: Face 4 Playlist
selector:
text:
default: ""
playlist_5:
name: Face 5 Playlist
selector:
text:
default: ""
mode: single
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input cube_device
variables:
speaker: !input speaker
command: '{{ trigger.event.data.command | default("") }}'
face: '{{ trigger.event.data.args.activated_face | default(0) | int }}'
playlists:
- !input playlist_1
- !input playlist_2
- !input playlist_3
- !input playlist_4
- !input playlist_5
action:
- choose:
# Face 6 = pause (Supports both 'scene' and 'flip')
- conditions: "{{ command in ['scene', 'flip'] and face == 6 }}"
sequence:
- service: media_player.media_pause
target:
entity_id: '{{ speaker }}'
# Face 1-5 = play playlist
- conditions: "{{ command in ['scene', 'flip'] and face >= 1 and face <= 5 and playlists[face-1] != '' }}"
sequence:
- service: media_player.play_media
target:
entity_id: '{{ speaker }}'
data:
media_content_type: playlist
media_content_id: '{{ playlists[face-1] }}'
# Slide = play/pause toggle
- conditions: "{{ command == 'slide' }}"
sequence:
- service: media_player.media_play_pause
target:
entity_id: '{{ speaker }}'
# Rotate right = next track
- conditions: "{{ command == 'rotate_right' }}"
sequence:
- service: media_player.media_next_track
target:
entity_id: '{{ speaker }}'
# Rotate left = previous track
- conditions: "{{ command == 'rotate_left' }}"
sequence:
- service: media_player.media_previous_track
target:
entity_id: '{{ speaker }}'
# Shake = shuffle (Turns shuffle on)
- conditions: "{{ command == 'shake' }}"
sequence:
- service: media_player.shuffle_set
target:
entity_id: '{{ speaker }}'
data:
shuffle: true
default:
# <reserved for future expansion>
- delay: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment