Mi Magic Cube

its a Zigbee Cube

and it works with the Conbee II

you have pair it in deCONZ as a switch

once paired

goto events and put deconz_event in the listening to

I drop on the desk with the Aqara logo on the top

mark that face as 1 then turn it one face over

note the event 5001
now turn it back
image
note the event 1005

base on that maths

1005 mean cude has side 1 on top and came from side 5
so
5001 means cude has side 5 on top and same from side 1

so

you get the picture

if double tap side 1

i get event 1001

now i turn to side 5
event says 5001
do double tap
event say 5005

now the fun bit
automation time

some of my double taps


- alias: 'Magic Cube 1001'
  initial_state: 'on'
  trigger:
    platform: event
    event_type: deconz_event
    event_data:
      id: magic_cube
      event: 1001 
  action:
    service: switch.toggle
    entity_id: switch.lava_lamp


- alias: 'Magic Cube  2002'
  initial_state: 'on'
  trigger:
    platform: event
    event_type: deconz_event
    event_data:
      id: magic_cube
      event: 2002
  action:
    service: switch.toggle
    entity_id: switch.scentsy_wax



- alias: 'Magic Cube 3003'
  initial_state: 'on'
  trigger:
    platform: event
    event_type: deconz_event
    event_data:
      id: magic_cube
      event: 3003
  action:
    service: switch.toggle
    entity_id: switch.salt_lamp

- alias: 'Magic Cube 6006'
  initial_state: 'on'
  trigger:
    platform: event
    event_type: deconz_event
    event_data:
      id: magic_cube
      event: 6006
  action:
    service: light.toggle
    entity_id: light.office

doing the rotations are hard to get head around
so i ended up painting each side differance colours

just got to think of what i want to do when i change cube
red(3) blue (6)

4 Likes

Works with zigbee2mqtt too.

This thing gives A LOT of possibilities, I’m just wondering if it is not too complex to use for other family members ?

I was thinking today that using a laser etching machine to put logos on the faces of these, to give a clue on usage.

1 Like

I was thinking of putting stickers on the sides.
Rotation to control Spotify/Kodi volume based on what side it is on.

Didn’t know there was a double tap event as well.

1 Like

Stickers would be more flexible. Laser etching is kinda permanent :slight_smile:

Laser etch acrylic and attach to the sides? Could have some contrasting colours going on then too?

doing the spinning like clock wise on face
it a bit of hit and miss well more miss than hits
like the stickers idea

The rotation works quite well. The fact is that the cube only sends the event once the rotation has ended, which is a pity.

What I do is I just change the volume with 5% for every rotation event, you usually don’t want a lot more than 5 or 10% change.

Here you have a quite interesting script for AppDaemon working with Xiaomi Cube and deconz

I’m looking for ideas what you control with this thing…

Mine is currently underway, it adds a nice touch to the whole home automation stuff.

I’ve had one for a couple of years now and I still haven’t come up with any use for it. I also searched several times for good examples but haven’t found any ether. :slight_smile:

So if someone has a good idea, I’m all ears. :smiley:

I use to let my 75+ years old parents in law switch off my alarm. Everything from computer to mobile phone is to hard for them to understand. So I just let them shake the cube…:slight_smile:

1 Like

I got one and have set it up to control the lounge lights (shake for on-dimmed-off), and TV/amplifier input (upward side switches to TV / Wii / XBox / Computer / AppleTV / Music. I also have a Harmony Companion, but you have to remember what each button does. Much better with stickers on the sides.

2 Likes

If only I could stream Belgian TV channels to my ChromeCast enabled TV from HomeAssistant - I could then also give it too my parents so they can watch the TV they want when they come babysit.

Kodi has VRT.nu and (if you have Telenet) Yelo plugins, I use those to watch TV, the telenet account does need to have a TV subscription (but you could just as well use your parents’ credentials if they have it and you don’t).

1 Like

Thx but I am a real fan of Plex… also, I’m on Proximus.

How do you know if 1002 is a change from 2 to 1 or it is a rotation with value 1002?

I cannot find a way to separate the many normal events from rotation

Its bas on the event been fired not event been change

Hope that make cents

Yes. I know I need to listen for events. That is the same for all deconz switches.

But the issue is that there is nothing that separates rotation from other events and a rotation can have the same value as a move or turn of the cube.

I have noticed something new.

I deleted my Magic Cube and cleaned manually the core.device_registry and core.entity_registry.

And then restarted HA and repaired the cube.

It then gets recorded as switch_81 and switch_82. 81 is battery sensor also.

Then I restart Home Assistant and the switch_82 autorenames (I did nothing) to Mi Magic Cube. The battery sensor stays as switch_81.

Now turning the cube is switch_82. And rotation are events from mi_magic_cube.

Then I rename the device in Phoscon and all events become the new name and you cannot separate the events again. The problem is that the Cube gets registered as two different switches by default but the minute you rename the cube to something else they merge to one. If the event names has a suffix auto appended it would work.