[RELEASE] Xiaomi Mi Cube / Magic Controller

Hmm,

Mine seems to keep dropping off the network. I’ll give it another go.

I’m finding the same. Adds easily, drops off easily!

Apprebtly it only works with hub v2, wich hub you have

That’s not the reason in my case as I have a V2

2nd attempt at pairing it and this time it’s been functional for the whole day so far - so I might start creating some CoRE pistons.

I’ve knocked up a quick reference guide to help me remember what ‘button’ does what…

7 Likes

Thanks for your hard work in creating this DH. I was wondering if there was a way to label each button to help remember what each function does? For example, add the ability under the gear icon of the DH to add a label under Shake such as Random which will let me know that shaking the cube will give me a random color. Similarly, under Rotare Left or right, I could enter Dim- or Dim+. The labels will probably have to be short to fit the button size.

A similar function was added to the Aeon Minimote DH found here:

1 Like

This is a great idea! Imma see if I can edit the code myself to give that functionality.

Please share when you get it working. :grinning:

Hi, I’ve ordered the cube recently (still waiting) but was researching it before purchase and discovered one thing:
If I’m not mistaken swinging the Cube possibly puts it in pairing mode possibly explaining why it drops off for some people. (directions for pairing with Xiaomi Hub require swinging motion, pressing of the Link button is not required)

1 Like

Mines dropped off when sitting on a shelf untouched so dont think its movement causing it.

Mine paired first time (catchall method) and has stuck since. No swinging involved :joy:

Same for me.

Paired it using the catchall method and it has been rock solid ever since. I’m using two of the gestures though. Knock and flip. Other than that it stays on my desk.

Hi! any button smartapp that can control dimmers?

I purchased 4 of the cubes;when I received them two turned out to be light bluish in color, 2 were light rose colored. Following the procedures outlined in the thread I have been able to get all four connected, however,the blue ones both loose connection withing an hour or two; the rose colored ones seem to keep contact.

I can reconnect the blue ones by just removing and then going through the process again, but I cannot keep them connected. Any thoughts from anyone what may be going on,and how to fix it?

I am using the device from DroidSelector; no smart apps yet as I want to make sure it stays connected first.

I appreciate any thoughts or suggestions.

Ok, so I got my Cube today, started to look at the logs and noticed some patterns. After analyzing the data sent by the Cube I determined that cube doesn’t send an “angle” but other useful information.

First byte of the value contains motion type, second byte in case of flip motion contains an information about which side was flipped to and from which other side.

The second byte should be split as follows:

  • bits 1 and 2 - flip type, 01 for 90 degree, 10 for 180 degree flip
  • bits 3 to 5 - number of face motion originated on (always 0 for 180 flip)
  • bits 6 to 8 - number of face motion finished on

So for example motion from face 5 to face 4 would have value of ‘006c’ where first byte ‘00’ - points to motion type (flip or shake) and second byte ‘6c’ or ‘01101100’ in binary - 01 for 90 degree flip, flowed by 101 for ‘source’ face 5 and 100 for ‘target’ face 4.

Faces are numbered as follows:

   [0]
[4][5][1][2]
   [3]

Where face ‘5’ is the face with ‘MI’ logo (in my case, I own only one cube and can’t verify if that is true for all of them)

Thank’s to that you can tell which face is up at the moment and that should be useful for people wanting to use it as a mood cube. It would be awesome if you would be willing to modify your DTH to support this new information. If not I hope you won’t have anything against me writing my own based on yours :wink:

Below is the matrix of available flips:

[from] -> [to] - [hex value] - [binary value]

0 -> 1 - 0041 - 01 000 001
0 -> 2 - 0042 - 01 000 010
0 -> 3 - 0083 - 10 000 011
0 -> 4 - 0044 - 01 000 100
0 -> 5 - 0045 - 01 000 101

1 -> 0 - 0048 - 01 001 000
1 -> 2 - 004a - 01 001 010
1 -> 3 - 004b - 01 001 011
1 -> 4 - 0084 - 10 000 100
1 -> 5 - 004d - 01 001 101

2 -> 0 - 0050 - 01 010 000
2 -> 1 - 0051 - 01 010 001
2 -> 3 - 0053 - 01 010 011
2 -> 4 - 0054 - 01 010 100
2 -> 5 - 0085 - 10 000 101

3 -> 0 - 0080 - 10 000 000
3 -> 1 - 0059 - 01 011 001
3 -> 2 - 005a - 01 011 010
3 -> 4 - 005c - 01 011 100
3 -> 5 - 005d - 01 011 101

4 -> 0 - 0060 - 01 100 000
4 -> 1 - 0081 - 10 000 001
4 -> 2 - 0062 - 01 100 010
4 -> 3 - 0063 - 01 100 011
4 -> 5 - 0065 - 01 100 101

5 -> 0 - 0068 - 01 101 000
5 -> 1 - 0069 - 01 101 001
5 -> 2 - 0082 - 10 000 010
5 -> 3 - 006b - 01 101 011
5 -> 4 - 006c - 01 101 100

[EDIT]
BTW, rotation also returns different values every time, maybe it reruns approximate angle, I will look into it further if I find time.
Also - I disassembled it (only clips holding it together and easier to open than the battery door). Nothing in there, metal weight, pcb with 1 micro controller with integrated zigBee radio, one 3 axis gyro+accelerometer and few caps and resistors (I don’t know what I was expecting, lol). Pics below.

8 Likes

Hi,

I am not able to catch the catchall line in hub/location events.
first, I want to be sure, is this “events” page in hub tab , or is it in location tab ?
how does the line look like ?

I have lines like below , in the location events:

2017-04-18 8:11:37.762 PM EET
biraz önce	DEVICE		DeviceWatch-DeviceStatus	online		Harmony Hub device watch device status is online	true
2017-04-18 8:11:25.662 PM EET
biraz önce	DEVICE		hubInfo	IP Address: 192.168.2.2 -...		Hall Light hub info is IP Address: 192.168.254.2 - Uptime: 10 days and 22:15:6 - Configured: Yes	true
2017-04-18 8:10:46.144 PM EET
biraz önce	HUB		ssdpTerm	urn:schemas-upnp-org:device:b...		devicetype:04, mac:0017882F04CF, networkAddress:C0A8FEF4, deviceAddress:0050, stringCount:04, ssdpPath:/description.xml, ssdpU...	false
2017-04-18 8:10:46.138 PM EET
biraz önce	HUB		ssdpTerm	uuid:2f402f80-da50-1222-9b23-...		devicetype:04, mac:0017882F04CF, networkAddress:C0A8FEF4, deviceAddress:0050, stringCount:04, ssdpPath:/description.xml, ssdpU...	false

btw, should I tap the button inside or should I press and hold it for some time ?

So I want to order a few of these, but I still have a V1 hub. Is it confirmed that these do not work on a V1 hub, and only on a V2?

It looks like shake “virtual button” currently doesn’t work. I’ve added the following to like 29 for it to work, looks like it was just missing and should only affect the virtual button.

command “shake”

I have version 1 Hub and it keeps disconnecting after 30 minutes or so. I am not sure if it is specific to Ver.1 only.

I’ve seen others here posting about their difficulties getting it paired (and keeping it paired), seemingly with either hub. To put it another way, has anyone gotten it working fine with a V1?
I can’t tell if some are just struggling (possibly due to shoddy product) or if there is actual confirmation that these don’t work at all with V1