I finally added CoRE to my Smartthings and created pistons for the Xiaomi Mi Cube. Not sure if I am doing this right, but I created one piston for turning the lights on (by flipping the cube 90 degrees) and one for turning them off (by sliding, or flipping 180 degrees). (I wonder if it’s possible to set this up with a single action to “toggle” the switch.)
This sort of works. The event logs for the cubes (I have two, one for each side of the bed) show that the cubes report the various motions quite reliably, but the switch doesn’t always respond. But the switch often fails to respond to commands sent directly from the Smartthings app as well, so the hub-switch connectivity is probably weak. (I am buying one additional repeater.)
But things go haywire when I add two more pistons, one for dimming down (clockwise rotation of the tube) and one up (counter-clockwise rotation, also called “left” rotation, which annoys me to no end). After that, all bets are off, and all commands seem to have random effects (like the dim-up rotation can turn the bulb off, and the dim-down can make the lights brighter). Has anybody run into this? I have also tried “rebuilding” the pistons (whatever that means) but it had no effect.
I am also wondering what the exact switch-hub protocol is when using the ST app directly versus using CoRE. I’ve noticed that when turning the switch on or off, the app seems to send a command, then poll the status waiting for the command to complete (the icon shows a transition from “ON” to “turning off” to “OFF”, although sometimes the app gets stuck at “turning off”). What happens then? Is the app just waiting or is it retrying? (I would expect it to be more successful if it retried). And the other question is, does CoRE do the same thing? Does it retry, or does it send one-shot commands and hopes for the best?