ZHA - Aqara Magic Cube (24 actions)

Blueprint to automate the Aqara Magic Cube using ZHA.
Based on rvaidya ZHA - Aqara Magic Cube (69 actions) .

This blueprint supports rotating the cube per specific side, but in a much more simpler approach. Only 24 actions (6 sides * [rotate, flip, knock and slide]). Rotate returns positive or negative values depending on the direction.

This blueprint adds support for rotating the cube per specific side, by using an Input Text helper to track the side that was last activated by a side-specific action (flip, slide, knock).

Note that since this blueprint uses an input number helper to track which side is active, it will only register side changes from valid side actions (again, flip/knock/slide). If you lift the cube, rotate it freely, and then place it down on a different side, this is not registered as a valid action and the tracking variable won’t be updated.

The input number helper will need to be created independently in HomeAssistant, by going to Configuration → Helpers in the UI and adding a new “Input Text Helper”.

Supported actions

  • Slide (6 sides)
  • Rotate (6 sides)
  • Knock (6 sides)
  • Flip (6 sides)

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

This is an example of an automation. It dims a bulb only from side 1:

alias: Cube actions
use_blueprint:
  path: miguellobato84/zha-aqara-magic-cube.yaml
  input:
    remote: de7540b873b6e241ae1157c155ed1e1f
    helper_last_face: input_text.cube_current_side
    rotate_1:
      - service: light.turn_on
        target:
          device_id: 48babe39343fa4a3d2f82aed449ffd65
        data:
          brightness_step: '{{ relative_degrees | float }}'

1 Like

I’m not sure the blueprint is working currently the text helper does not update and it does not seem to do things on different sides

Ahh interesting I’ve never encountered this but the automation does not enable when you save and can’t be enabled


any idea why?

has anyone been able to get this blueprint to work? whenever I create an automation and click save, I’m unable to find the automation in the list.

The shared blueprint in the first post doesn’t work anymore, it was deleted in April 6th.

1 Like