Mood Cube Modification


#1

I’ve got a new multi-sensor and have been reading about the Mood Cube app. I’m planning to utilize it with WebCoRE or just creat my own in WebCoRE, but I was curious if there is a better way.

My idea (based on what I’ve read about the Xiaomi cube) is to try to create a piston that does “When cube is turned onto its right side, then flip this switch” instead of “When this side is up, do this”. That way I could have turned to the right/left/upside down/etc as triggers instead of when specific sides are facing up. That would make it easier and more dynamic.

I hope that makes sense. Can anyone think of how to do this without creating a stupid number of statements like “if tilted from ___ to ___”?


#2

Perhaps a combination of a variable (current position) and a number of switch cases might work… will reduce the number of IF statements but still a lot of work.


#3

I haven’t used one before but like trying to come up with solutions to things like this.

What data does the cube send when it’s moved? To a different side? The name of the side facing up or something else?


#4

I’ll be using the standard SmartThings Multisensor. As far as relevant information, WebCoRE can identify which side is facing up. This part makes for easy “When top faces up, do this” triggers. It also has some information about X, Y, and Z axis orientation. I suspect my answer to more dynamic triggers may lie there but don’t know enough about it to put it to use. Unfortunately I won’t be at home to try anything out until early next week, so maybe someone else could help us understand what information is there and how it could be put to use.


#5

Gotcha. You’re using the multisensor that comes with a magnet for detecting door open/close status, and also measures temp, acceleration, etc?

If that’s what you’re using, I have a few of those and could review what information is available from it to accomplish what you’re attempting.


#6

That’s the one! Someone picked up one for me for Christmas. Anything you can discover would be great!


#7

Can you import piston code v0r0, then flip your sensor to a few different positions? I ran this against the sensor on my garage door, but the values I got back were nonsensical and I’m not home to dig into it.

I think you can do what you want to using the pre-existing outputs though.


#8

Yeah, I’ll try it out tomorrow! I’ve been away for a few days but will finally be home tomorrow to try it out.


#9

I finally had a chance to try it. I’m getting just wildly different numbers on X, Y, and Z each time. For now I’m just going to use orientation. I think that will work for what I’ve decided to do with it anyway.


#10

Sounds like what I saw, they didn’t make any sense at all. Too bad since they could have been useful.

Happy new year!