Weird CoRE behavior with multiple pistons

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?

Use webCoRE as it is the more modern and updated solution with a living and thriving community.


I concur with Ron. CoRE is old. Use the latest and greatest in webCoRE.

1 Like

Thank you for the advice. I will give webCoRE a try!

So I installed WebCoRE and it was a bit painful because of this “shard” nonsense… it seems that there are TWO (at least) databases in my IDE for smartthings apps, only one of which is visible from the mobile app. Apparently when I log on, I am placed on the wrong database (the invisible one), so after installing the various WebCoRE programs I could not see them. Visiting “My Locations” and then “Home” (the only choice I have) puts me on the right “shard”, but it sure is confusing.

Just to continue my complaint, I was not happy that I had to register to yet another web service, and give it permission to access who knows what capabilities of my home system. I don’t even understand if any of these programs (core, webcore, or samsung-provided apps) reside on the hub, or do they run on some server? I guess it would be easy enough to test this by turning off my AP. The large latency suggests a server, but who knows.

In any case, I recreated my simple CoRE pistons (Mi Cube turns lights on and off) on WebCoRE… and they didn’t work—nothing happened after cube actions. Rather than trying to figure out how to debug them, I went back to CoRE.

I also added another Z-wave repeater in the path between the hub and the bedroom, and it may have made the system more reliable, but I ran out of time and could not test it thoroughly. I will report later.

I have to say this is extremely tantalizing because this stuff almost works, and it is great when it does. (The Mi cubes are both clever and practical.) But I fail to see how “normal” people deal with setting up this stuff. I work on system software (chrome OS kernel) and am familiar with many of the concepts (but the devil is always in the details) and have high tolerance for stuff that doesn’t work, but I suspect that 99.9 of consumers would give up a lot sooner than I and a lot of people on this forum do.

Always use to login to IDE :slight_smile:

Thanks! Using that URL doesn’t seem to help—I run into the same exact issue.

OTOH everything works now—woo-hoo! I am using WebCoRE. It’s likely that I was making some programming errors earlier with CoRE, like having the same button trigger multiple pistons. (I think so because I made that error with some of the WebCoRE pistons.)

Anyway, I have two Xiaomi Mi Cubes controlling a z-wave bedroom light dimmer. I added two z-wave repeaters and reliability now is acceptable. Interesting how the cubes didn’t need repeaters.

I set up the commands like this:

  • flip 90 degrees: turn light on at full brightness
  • flip 180 degrees: turn light on at 1% brightness
  • slide: turn light off
  • twist clockwise (like shutting off a faucet): dim 10%
  • twist counterclockwise: increase brightness by 10%

It’s pretty impressive when everything works. There’s a variable lag from a cube action to the beginning of the switch state change, between 1 to 3 seconds I estimate.

I still don’t know if folks at the webcore site can tell every time I turn the light on and off.