CoRE - Get peer assistance here with setting up Pistons

I’m having some trouble setting up a Piston that will play a specific track through my Sonos. Everything triggers just fine, however I’m using the Spotify URL/URI for the track in my rule. For some reason this doesn’t seem to do anything. If I change the rule to just Play and not try and specify a track it works just fine.

I do exactly this but with SHM and Rule Machine. It’s been 100% solid, only thing on this system that has been, hence not migrating to CoRE, don’t fix what ain’t broke.

I have a virtual contact called Front Door and a contact sensor called Front Door Sensor, here’s how I’d do it in CoRE, figured I’d build and pause it in case RM goes TU:

Have not tested, as that would require me killing the RM rule, not want to do!!!

Good luck!

Show the piston from the dashboard please. I suspect this is what I’ve mentioned a few times lately, you need an OR in the IF section (sub grouped) that ONLY has “If motion is active” with no other activities. This requires the THEN to not be used and instead use When True in the appropriate group for the actions. Trying to find my recent explanation, gimme a minute. Added:

Can you try to change the condition from
"If each of Light Family Rm and Light Family Rm Lamp is off"
to
"If each of dimmable Light Family Rm and Light Family Rm Lamp is less than 100"

Ton

Thanks for the reply. It looks like you are trying to do exactly what I want, but I’m not quite following…

Firstly, I tried to post the screenshots of the piston… I think perhaps it just showed up in my original Post? I’ll attach them again. Unless I don’t know what the dashboard is…

I already have ‘if motion: Active’.
Are you saying that I should have ‘if Motion: Active’ OR ‘if Motion: Starts’?

Where do i add “Cancel on piston state change”?

Yes, that would work… not perfectly elegant, but it would work as long as I didn’t manually lower the brightness.

Don’t worry about the cancel on piston state change yet, that will go into the actions wherever you have them. Open CoRE and hit the top thing that says Dashboard. You can get a link to it on your computer as well if you go into the IDE and logging, it shows up when you access the Dashboard in CoRE. Even have a Chrome plugin for it.

Did you check my examples up around that one I linked? Ya know what it’s not showing the actual link is it? Stupid forum, gimme a sec.

Edit: Look at post 3254. You’ll probably want to create from scratch to save time. Everything in your THEN would move to under an IF group under When True. Make sure you have expert mode turned on as well.

Oh, that’s cool. How did I not know I can do this on my computer?

Here’s some screenshots of the dashboard:

I’m heading to bed, will give more complete answer tomorrow, but you want to do a Latching Piston. IF will have groupings that contain your conditions, the first level groupings will have OR between them, the second level will be AND, that second level, use When True to turn the lights on. Don’t put anything in the THEN of the IF section, the second section of the latching is where you’ll group your conditions for turning them off, and you can use the THEN in that section if needed, but in my opinion, using When True/False will allow more flexibility. With Latching, you use the Cancel on Piston State Change to make an action (on, or off) stop if the other part of the piston becomes true. So the IF would have a motion only condition with NO action, that way if the second half of the Piston is True, but motion occurs, it will flip the piston back. Study what I had in the post I mentioned, and follow the lines to see what happens. Your Piston is SUPER simple and won’t do what you want even though it appears to work partially.

1 Like

Thanks, I’ve looked over your piston. I think I understand what you are doing. But I don’t see one step. The purpose of me using CoRE is that I want the light to not turn off if I manually turn it on. I’m not sure how your piston will do that.

If I’m understanding the piston right wouldn’t it turn off the light after 2 minutes if I turn it on manually? (I want it to stay on when turned on manually.)

“But if hall motion is inactive and light is on then wait for 2 minutes and turn off.” What makes that not happen if it’s turned on manually?

At what point do you want to turn your lights off? If you don’t want them to turn off if you turned them on then you need to have something in the piston saying BUT IF Light IS ON and Motion is Inactive stay on. But you also want the light to turn off if there is no motion and the light is on. I am not sure how the piston will differentiate between the light being turned on by the piston and it being turned on manually.

Hey, if you can figure this out, I would like to know how you did it. I can’t get sonos to do this at all.

Because it dims the light down to 10% automatically, you can set the condition as
"If each of dimmable Light Family Rm and Light Family Rm Lamp is less than 11"
In that case, you can dim your light manually down to 11% and the piston still works.

1 Like

After working on it for a couple hours I gave up. I think it has something to do with the Spotify track/radio not being local or native to Sonos maybe. I did get it working with TuneIn radio stations and/or a specific Spotify track that Smartthings is aware of however I had to use the Mood Music SmartApp.

I created a simulated switch and told the SmartApp to trigger when it turned on. Then put the simulated switch control into my CoRE Piston. I’m not thrilled about it but I have a lot more things to do still.

Yea, I gave this a try. The problem is thais need to add the lights off restriction in the ‘then’ section. The ‘then’ section has a restriction that says "if all lights are off. But there isn’t one for dimming.

If I add that the light needs to be off in the first ‘if’ section it will become ‘false’ as soon as the light turns on. So if the movement sensor stays active. The light would still turn off.

The only difference here is, I dont want someone to kick the door open and it disarm the alarm. Triggering off the door unlocking is what Im trying to do. Using the delay in the virtual contact as the “delayed entry” of X seconds for the system to disarm itself.

Since Im trying to trigger off the unlock, someone could kick my door in and since the door wasnt unlocked, the alarm would sound.

Looking at all the “or” statements, wouldnt yours do exactly that? If I come over and kick your door in, the alarm wouldnt go off, it would disarm. Or am I reading that completely wrong?

Can you post a picture of the piston. You can do this by going to the dashboard, then tap on the piston. Once it shows there are 3 little black buttons on the right hand side. Tap on those and it will drop down a pause and camera icons. Tap on the camera icon and it will tell you to tap and hold. It will take the picture that you can upload. Your pictures above don’t show the whole piston.

I am looking for assistance in setting up a piston that would notify me if I left any doors or windows open when the mode switches to away. I would like the window or door name to be listed in the message. Is there a way to do this without creating separate push messages for each door/window? I have a very basic understanding of variables but from my understanding I cannot use ($currenteventvalue) for this piston since the trigger is the mode changing and the sensor open status is just a condition.

Right now what I have set up (that isn’t working):
Home changes to Night
AND
Any of (listing of all doors and window sensors) contact is open

Then

Using Location Switch ({CurrentEventValue}) DO
CASE ‘open’
Send Push Notification
’({CurrentEventValue}) was left open’
END SWITCH

Thank you, any help is greatly appreciated. Still trying to get Core figured out beyond the basics but thanks again for everyone who has contributed to this.

That requires another condition and a switch that has a Physical/Programmatic ability. Here’s mine, I know @ady624 had a different way of doing it.

It uses a variable, here’s the main Piston:

And here’s what sets the variable if a switch is physically actuated:

Sorry. Here is my current piston.