Aqara Magic Cube - How to make the side it is on a condition for automation?

I’m trying to make automations where part of the condition is what side the cube is currently on. Anyone managed to pull this off?

Side is an attribute. It is a digit between 1 and 6 (or maybe between 0 and 5).

So you can either make a template sensor and use that as a condition, or use a template directly in your condition.

Where do you get this information from?. I got the cube myself as well, but the sides doesn’t register as an attribute (0-5). The only thing that it does register is the event that has been trigger thus the last action.

flip90, flip180, move, tap_twice, shake_air, 
swing, alert, free_fall, rotate (degrees at action_value)

If you are really certain that you can use the sides as an attribute, please show me how as im curious to how this is working. Wanna use this for my own automation :slight_smile: .

As above mentioned, the current side where the cube is on, does not register itself in HA. (with my current knowledge, hopefully @nickrout can show us otherwise). You could use the last action as a trigger. But i don’t know if this is feasible in your user case.

I have realised that this is probably because I am using zigbee2mqtt rather than the xiaomi gateway. The attributes that zigbee2mqtt exposes are

 "battery": 86,
  "voltage": 2975,
  "linkquality": 23,
  "side": 1,
  "friendly_name": "Cube",
  "icon": "mdi:gesture-double-tap"

Aaaah oke thank you for the info, That seems to clear it out.

Sorry for the post hi-jack @wgetwin. But do you fancy the zigbee2mqtt more than the mi gateway @nickrout?. Any advantages over it?.

You could send me an DM/PM though :slight_smile:

It is not a hijack, it is highly relevant.

zigbee2mqtt because

  1. It is open source
  2. It exposes more attributes on some devices (eg, this thread is an example)
  3. It is not cloud dependent
1 Like

The zigbee2mqtt has already passed me multiple times. Some quick searching seems that it doesn’t cost a thing as well. Gonna consider using it instead of my gateway.

Another disadvantage of the Mi gateway is that it’s not that reliable, as it seems to drop of the network from time to time.

Thanks for the info though

Well it costs some hardware, but not much!

I’m on zigbee2mqtt as well. Didn’t want to go with a mi gateway because of privacy concerns (paranoid) as well as being able to use zigbee2mqtt for all zigbee devices in the future.

If you want preconfigured hardware with extra range, see this thread Buy a ready2use zigbee2mqtt stick - flashed, antenna mod and printed case

Yeah i had my doubts as well. But you know, if they want the information from you they will get it. So i don’t care anymore. I just make sure that i don’t share information that i don’t want to be shared. The rest they may know from me.

I will take a look, thank you.

First impression > I like it


does this mean that with zigbee2mqtt there is tap and double-tap available on each side, ie 12 variations, plus roations left and right per side?
If so, I am running out of ideas what to do with all these options once my cube will arrive…

My zigbee2mqtt is down now, and I cannot recall sorry.

Edit: see