Aqara Cube ZHA - Simplified face-based device control

Just to isolate the parts, in order to help us finding the issue, could you please try to run it without the if clause and confirm if it does what you are expecting?

Something like this:

  - service: media_player.turn_on
    data: {}
    target:
      entity_id: media_player.telecomando_jvc
  - service: media_player.turn_on
    data: {}
    target:
      device_id: ccacf2caf9f620ad7d9a3188184ae33d
  - service: scene.turn_on
    data: {}
    target:
      entity_id: scene.relax
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - service: media_player.select_source
    data:
      source: MPlay
    target:
      device_id: ccacf2caf9f620ad7d9a3188184ae33d
  - service: media_player.turn_on
    data: {}
    target:
      device_id: aeb8570f8bd33d8d211583bfcb230583
  - delay:
      hours: 0
      minutes: 1
      seconds: 0
      milliseconds: 0
  - service: light.turn_off
    data: {}
    target:
      entity_id: light.piantana

Also, could you please go to Developer Tools, then click on State tab and search for media_player.denon_avr_x3100w, then take not for the different states when that device is on, off or in standby (if supported)?

That’s exactly what I’ve been looking for! Using it to control kitchen/diner lights but I wanted to only dim the lights related to the face showing. Spent ages trying different things but this saved me hours/days of working out. Top marks Ed!

1 Like

To anyone using the PRO T1 version of the cube…

The cube has a scene mode, a throw action, a hold action, and other features that are NOT being exported thru zigpy into ZHA.
I suggest that you go to

And ask for the new features to be installed.

1 Like

Hi guys, I’ve got the original cube and with this automation and helper (thanks @EdwardTFN) it works fine but is reporting the 2-5, 3-6 issue. Does not affect rotation, (2 is 2, 3 is 3 etc) but does affect knock and slide. I see there are definite issues on GitHub, this forum and Reddit about this but no obvious resolution that I can see. Have I missed something? I’m using the cube directly with HA on a ConBee stick so no Aqara Hub.

Could you please detail a bit more? I’m not sure if I understood which problem you are having.

If you want to switch between the modes of the cube, press the link button five times. Before, it wouldn’t register the active side for me.

1 Like

There are a few posts (various forums, some referring to ZHA) that say that the cube has an issue with mixing up sides 2 & 5, and 3 & 6.

I’ve set up the helper which recognises when i have flipped the cube and registers the correct face, for example:

Flipping from side 1 to side 2, the allocated lights come on correctly. When I rotate the cube with side 2 facing up, the lights allocated to side 2 increase/decrease brightness. When I knock the cube with side 2 facing up, it operates the blind which is allocated to side 5.

I can see this action in the logs or a page somewhere (it escapes me where it is for now) and i see last face as 2 and when i rotate the cube it switches to side 5

Mmmm
Thanks for the details. I will investigate this and come back to you.

In Z2M you can do that, or just go to the device in Home Assistant, change the mode, do a ‘throw’ action with the cube, and it changes…
The throw action that you don’t have here…
You also are missing the hold command, the drop command is listed but no longer available. then there is the 52 other scene based actions that ZHA has no access to. If I knew how to write a quirk I could do something about it, but I looked into it and honestly have no clue…

We need someone with a new cube and the knowledge on how to write a quirk…

I suspect that is a zigpy induced problem or something happening with operator movement, but if you monitor the zha events OR do your own event like I do here and monitor that as a sensor on the dashboard you can easily see what the BP sees. (real time)

@EdwardTFN, I made an error in explaining. The rotate function also switches to the wrong side. I don’t think it’s your coding, it looks like an issue with the Cube mis-reporting. If you go into the “last number’ Helper and select it to show the log files then you can clearly see it happening. I’ll try and get a short video of it happening.

1 Like

Which model of cube are you using? The new one (Pro?) or the old one?

The old one.

1 Like

Has anyone had the same issue with the Cube v1?

1 Like

I have the “same” issue, knocking and slide is not working right…BUT Ha can see it but the blueprint don’t …???

If you are flipping it that gently it may not be registering as a flip…
I know I can do it and mention it as a secret triggering method on my blueprints with a way to automate against that.
If you want it to register the flip you need to flip it hard enough that it makes a noise at the end of the move against the table.

since a while ago im having issues with my cube not recognising clock and counterclockwise rotations. Anyone else have this issue?

Maybe it is recognising it, it just doesn’t register the correct side like mine.

It’s not that, the video was to show it clearly happening. It isn’t the way it is being used, it is something registering the wrong side for the action. Trust me, I’ve done a lot of testing.