CoRE - Get peer assistance here with setting up Pistons

Execute the action only on piston state change. Then the temp outside would have to dip before it goes higher again

Ahhh…thanks. I thought there would be a standard ‘stop’ trick. Here is what I have now.

Yep, should work

Interstingly, it does work. But it sends 3 text messages all at once when it does change. Do you think it is sending one for each sensor involved? Would there be a better way to manage this?

Are all three sensors updating at the same time? They may run into a race condition where the piston runs three times simultaneously, thus explaining the three texts. May I recommend using just one sensor if all three are updating at the same time? What kind of temperature sensors are they?

Hi all

I’m new to CoRE and have been trying to create a particular Piston but am unsure about how to go about it.

My setup:

What I’d like to achieve, and have setup through lighting director right now is to have the lounge lights, (can be individually and set level, using a group switch, or using a momentary scene switch), turn on when:

lux is below 20 AND there is motion
Turn off if no motion for 3 mins


If the lights are manually turned on using: hue widget/smartthings/sharptools - whatever. Then don’t worry about the former.

Any pointers would be greatly appreciated.


EDIT: actually, something close to this type of logic with an external variable looks like it may be how I should structure this? (credit to ady624)

Same here, however I know many who have issues with it, particularly with the 2nd device.

Yeah that is what I am using for my kitchen lights. It uses an internal (local) variable and works as requested by you above. You do not need the time of the day condition, but add the lux condition. And adjust the waits accordingly.

Thanks Ady, I’ll attempt to copy it word for word!

1 Like

How is this catered for in the above dashboard?.. I’m having some training in understanding the variable logic and how a manual turn on as described in my original post, comes into play here?

Well, here’s the trick: if motion is detected and the light is off, it turns it on and sets a variable to true (meaning I - the piston - turned the light on). When motion stops, if the variable is true (meaning I - the piston - turned it on), then it schedules an action to turn it off later. When the light was turned on manually or by any other means other than the piston, the light will already be on when motion is detected, so nothing will happen. That’s the whole piston logic, in plain English :wink:


Why doesn’t this work?

Just use a basic piston for what you are doing there, and I would change those conditions to solid circle triggers.

Solid circle triggers?

The wait and the set level 0% should be two tasks in the same action. You can add multiple tasks to each action…

Also, I would use a simple piston:

   Door is open
   Using light...
      > Set level to 100%
      > Turn on
   Using light...
      > Wait 5 minutes
      > Turn off

The Turn on is there because some devices may not turn on as a result of level setting, but most will.

That looks better. I guess I should clarify though. It’s not the turning off that’s the issue, it’s the turning on/setting level. The lights in question are currently at 1%, but do not raise when the door is open. I created a simple piston if door is open, then set level to 100. Nothing happens.

is there s way to trigger a virtual switch with a variable in the name? I want to do something like this.

On motion turn on scene${currentMode}

I’ve been unsuccessful with my attempts.

You can technicaly set a string variable to “scene{variable}” but not sure how you will send the variable. What device? What task?

Thanks for laying it down, it’s going to take me a while to get my head around this. I don’t understand the 2nd ‘then’ conditions and the ‘tcp cancel on…’ part… I think I may need to take some CoRE courses!

Anyway, I will persevere. Btw, is there a way to create Pistons on a web GUI, going around the smartapp can be a little cumbersome…

Thanks again for all your help!


1 Like