Aqara Magic Cube ZHA (51 actions)

i testes out all of the triggers with service toggle light while watching zha_event.

knock, slide only works on side 1 even when “slide any side” and “knock on any side” are set to false.

when performing the action, zha_event are register and logbook shows automation triggered by zha event, however the service is not called.

im not sure if this is related to my config or only tie to this blueprint.

Where do I have to remove the lumi.sensor_cube statement? Can’t find it in the blueprint…

1 Like

Is there side specific rotate options or am I missing something? Was thinking rotate could be used for light brightness with the light chosen by side facing up?

1 Like

looking for the same feature. if ever you found it

It looks like the deconz blueprint has a double tap automation. Does ZHA not support that?

This blueprint supports double tap, its a double knock or what is listed as simply “knock” in the bullets.

I am Looking for a way to limit rotate left/right based on the activated face.
So that with face 1 rotate left/right will increase/decrease light brightness, and face 2 will change color or volume etc…

Right now the rotate trigger is global, regardless of active face.
I thought to add conditions but only battery is available as a condition.

Any hints?


@Necromancer I’ve added an input_select helper and when I put the cube down on a face, it changes the input_select to some text value (eg. Lights, Music). Then in rotate left/right triggers I’ve used a choose action. Depending on what the active face is (in the input_select), it switches between different actions.
Some sample code:

Face select
      - service: input_select.select_option
          option: Music
        entity_id: input_select.active_cube_side

You’ve got to set it up for all x_to_y parts. Here’s the rotation part:

      - choose:
        - conditions:
          - condition: state
            entity_id: input_select.active_cube_side
            state: Music
          - service: media_player.volume_up
            data: {}
            entity_id: media_player.player_name
        - conditions:
          - condition: state
            entity_id: input_select.active_cube_side
            state: Lights
          - service: light.turn_on
              brightness_step_pct: 15
            entity_id: light.light_name

Hope this helps


How do you check which face the cube is on to update the input_select helper to keep track of the active face?
In automation the only available triggers is “device slid/knocked/flipped with face 1 activated”

Quite happy that there is a blueprint for this device. So kuddos for making this!

I have owned this device since my Hubitat days and never really could find a good use-case scenario for this. Can folks share how they are using the cube in their home automations? Suggestions is appreciated!

I use the blueprint’s “From side x to side y” input to call the input_select.select_option service and change the input_select value. It sounds like you tried to make a new automation to handle this, but there is no need, everything can be done in the blueprint.

oh right, need to use automation through the blueprint.
did it a few days ago and already forgot i about it :smiley:

Do you run all of cube functions from one automation? or do you split each function to its own different automation?

1 Like

I extended this to add actions for flipping to a specific side regardless of the side it was on before: ZHA - Aqara Magic Cube (57 actions)

Please help i really want to use this blueprint template but i have cc2531.

I have succesfully added aqara cube to Ha and i see the integration and maked some manual automation and it is workimg fine.

What do i replace thinks on this template to work all actions also with cc2531 ???

1 Like

(thank you for this blueprint)

I’m reporting that my logs fill up with warning messages like the one below every time a rotate event happens:

WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'flip_degrees' when rendering '{{ }}'

Correspondigly, the same log-warning is issued but for the relative_degrees key, when the cube is flipped.

The culprit is the blanket access of those keys when setting up the initial variables.

A fix would be to check first that the key exists, like this:


  - variables:
      flip_degrees:   ' {{ | default }}'
      relative_degrees: '{{ | default }}'

[edit: for a period of time i had suggested a conditional code, above, but reverted back to default filter after testing it]

Is there any possiblity that this fix can be applied?
(and if yes, do i need then to refresh my blueprints, somehow?)

1 Like

I am getting following error on trace
Error: UndefinedError: ‘dict object’ has no attribute ‘event’
I am using zha integration , device name LUMI lumi.sensor_cube
what I am missing ?

I believe this blueprint has a way to control what rotate does with respect to the side it’s on, but I could be wrong?

I have extended this blueprint and brent’s 57 action blueprint to allow for per-side rotation actions.


Nice job, Rahul!

Awesome … works well!