CoRE - Get peer assistance here with setting up Pistons

Hey guys,

I think I’m hitting a bug here :frowning: Here’s what I’m trying to do:
When I press a button, I was to set a variable to $now and trigger a follow up piston to set a flag after 120 minutes. Basically, I want to set a flag 2h past the button pressed.

I have a IF rule
if (button is pressed)
when true do
set variable pressedButtonTime = $now
follow up same piston
if (pressedButtonTime > 120) <---------- This condition seems to blow up
when true do
set variable aNewFlag = true

When I try to set the DateTime condition, i’m getting a Error - bad state. Unable to complete page configuration and when I try to go back, I just get You are not authorized to perform the requested operation.

Here’s how I’m trying to set it up:
Capability -> Date & Time
Comparaison: is after
value: time of variable
variable: pressedButtonTime -> As soon as I click it, i’m getting a white screen and if I click Done, i’m getting the Error - bad state. Unable to complete page configuration

Is there something i’m doing wrong here…?

Hi all!
I need a little assistance with a sequence for my motion lights with a button to disable. This is in my living room and when we are watching a movie, we don’t want the lights coming on. My goal for the button is to have the ability to disable motion by holding and enable motion by pressing OR after 2 hours. I got everything how I want except for the 2 hour timeout. I cant figure it out without creating another piston… I have only had the ST hub for about 2 weeks so I am a bit of a newb! Trying to keep things clean and efficient.

I am using Lutron Caseta dimmers, Iris Motion sensor, and the Iris Smart button.
For motion control, I have the following piston:
LivingRm Light is Off
LivingRm Motion changes to Active
Time is between sunset and sunrise
*if mode is home or night, set LivingRm level to 6%
LivingRm level is 6%
LivingRm Motion stays inactive for 5 minutes
Turn off LivingRm light

To disable the motion piston, I have this piston:
Iris smart button is held
Pause the Motion piston
Turn off LivingRm light
button is pressed
Resume motion piston

Do I have to make another piston to resume after two hours? Much appreciated!

1 Like

My suggestion would be just to create a virtual switch that you can call “movie time”. You can turn it on/off via alexa, the iris button or manually via the ST app. Add that virtual switch as a condition in your piston. If ON, then disable your light being turned on by motion.

1 Like

That is a great idea.

I have seen virtual switches mentioned around but, honestly I know nothing about it. I start tinkering with that!

Thank you, eiyer, for pointing me in the right direction!

Check this link… Just make sure you’re logging into the correct IDE shard.

1 Like

I am having a strange issue with one of my CoRE pistons. Can someone help me troubleshoot?

I have the below Piston and everything except the very first command works. “Turn On Kitsound” doesn’t work. I am not sure why this one is being skipped. It is a speaker controlled by a virtual switch in smartthings. I don’t see the on command sent to the switch under the history. I only tried this twice, but it failed both times. I have exactly the same command in another Piston which works fine. Also manually pressing on and off works fine.

Below is the Piston which works with the same command as the above Piston.

Have you tried splitting the kitsound and wakeup devices into two separate tasks?

Yes. The first time they were run, these were separate actions. The second time I put them together.

Hi all,

There is one thing I cannot do with CoRE and I can only do with SmartRules.

If movement detected
And One of my Sonos speakers is playing
Turn on this outlet

My problem comes from the speakers states that I have to enter manually, I tried: playing, Playing, play, Play

Any idea?

Thank you in advance…

Is there a chance the Kitsound or Wake Up is already on? Have you tried disabling command optimization?

Have you tried saving the Sonos status attribute to a variable and evaluating the value?

Check the device in IDE, look at the attributes section, what value does status have?

@eibyer The device is definitely off when the on command was issued. The device is mapped in smartthings as a virtual switch. The switch is in off state and I don’t see anything in the history to turn it on.

This works fine with one of the pistons, but not with one of them. Very strange.

At some point, I turned on an alert for when a certain piston ran and I can’t figure out how to turn it off. It’s not a notification inside the piston itself that I can see. What am I missing?

Anything in live logging? What does the piston do?

Logging? Did anyone say logging?!


I can’t easily check live logging, as its a piston that executes some stuff when my (or my wife’s) phone’s state changes to home.

Which is where this will come in handy (winking at @eibyer)