CoRE - Get peer assistance here with setting up Pistons

You, my friend, are right too :wink:

You need to either use all triggers (full dots) or all conditions (empty circles). When mixed, only triggers actually run the piston, the conditions will only restrict the runs. When using all conditions, they all act like triggers, pretty much.

Sonif you want all those devices to trigger the ligths, either use changes for all of them, or use is for all of them. For the garage door, you can also use is one of [open, closed] <<< that will always be true and run your piston when the door opens or closes.

I would personally go with triggers… acceleration changes to active OR motion changes to active OR garage door changes

The BUT IF is independent of the IF, so you can use it all conditions, the triggers in the IF won’t interfere with it - it’s essentially two pistons sharing the same state :slight_smile:


This was what I was looking for. I couldn’t figure out how to get a random number in a variable. So the $random variable is always between 0 and 1? If so, that’ll work like I want. Thanks!

Thanks for that explanation

The garage ‘changes’ didn’t work; but garage is open / closed did…


1 Like

Anyone in here who have used CoRE for Laundry monitor?
I have a Wemo insight switch which have watt usage.

What is the best way todo this with CoRE?

I was thinking something like this:
If wattage goes below 10 and wont go above 10 next 30 minutes, it turns off, If it goes above 10 , it starts a new timer for 30 minutes If it goes below 10 again.

If this could work, anyone who can maybe explain how to setup this with CoRE? Thank you in advance :grinning:

I do this.

I just installed CoRE and I wrote my first VERY simple piston, and it doesn’t work. I created the same scenario using ST and it works fine. Maybe I didn’t install right, or ??? Anyway here’s the piston, anyone have any ideas why it does not work?

Simple if-then

If front door sensor opens then turn on test outlet.



Instead of front door sensor changes, try front door is open or closed. I ran into the same issue with my garage door…


I had tried that, but when it asked for a value, there were no parameters, so I thought I had not picked the correct one or type, so I went to a condition that was finite. Either way nothing happens when I open or close the contact sensor. I set up the same scenario in smart lighting and it works fine, so I know the hardware works. As this is my first attempt, I have no background in troubleshooting. I have no idea why this simple rule does not work.

When I go to the dashboard, it says the piston is running, but when I look at the statistics it says it never ran…but I’m not sure what that means, because I never have had one that did run correctly to compare.

So thanks for any assistance.

Need some help with logic.

Goal is to have my kid’s room lights go on using a Fibraro motion sensor (which also senses illumination) under certain conditions.


motion detected
illumination below some value (i.e., dark room)

turn lights on

lights already on
after his bedtime (and this one changes whether school night (Sun,Mon,T,W,T) vs weekend nights (Fri/Sat)

Is there a way to get the last condition (time by different dates) to work.

Originally I merely set up a basic piston to test out what might work by doing this…

motion is active
switch is off
illuminance is less than 100 lux
Time is before 9:00pm

Which of course failed because at 1:00am the lights would come on if the motion sensor went off. My gut says the new day triggered a reset to the “time is before” condition. So thinking about going with something like a “time is between” or “time is not between” just not sure which one to use (or how). And also would like to get the different days in there (school night vs weekend night, but not vital).

The piston build screen should look similar to this…

UPDATE: I was using the contact sensor as a “sensor” not “Contact Sensor.” UGH!! Got it now and the rule now works. Nubie error. Thanks for your help in showing me the light… :wink:


I need help setting up a CoRE Piston. I have a smartthings motion sensor in the kitchen to turn on the kitchen Lights. Here is my problem. To keep the lights from triggering from movement in other parts of the house I have to put the sensor by the entrance to the kitchen. I want the lights to turn on with motion and off after 3 minutes if no motion. But if I’m in the kitchen cooking I don’t want the lights to turn off. So I wanted to set it up like if the lights are on and motion is detected do nothing, and if the lights are off and motion is detected turn on, and then off after 3 minutes of no motion. I thought I had this working but I don’t. I don’t know where to plug in the conditions and actions. I don’t know how to separate them so one condition doesn’t restrict another. Also do I need to setup as a simple basic or something else? I’m sorry for all the questions I’m still kinda knew at this.

Yes, $random is a decimal between 0 and 1 inclusive.

Go to the dashboard, select any piston and then scroll down to find all the available system variables, they start with $ and are read-only.

There is a changes (changes in general) and a changes to which is specific to a new required state…

I’m pretty new to CoRE myself. For some answers you can look at my walk thru for setting up your first piston.

For some of the motion sensor stuff you need to also think about the hardware you have. Most (if not all) motion sensors will have a built in “blind time” where they don’t change their status (either motion or no motion) regardless of what the actual sensor shows. So you need to determine what your built in time is on that (and some devices allow you to change it).

But you can within CoRE also use delay times so coupled with the built in delay you should be able to achieve what you want.

Also do check out the wiki because it does explain the basics. You may want to (I typically like doing this because it really helps me) to write down your piston in logic terms (IF, THEN, WHEN, etc.) on paper just so you know the flow of the logic you’re trying to accomplish. That should help with realizing when one condition may interfere with another.

This is my kitchen lights piston. If I turn the lights on myself, they stay on until I turn them off. The time is any is just a placeholder, I was initially doing it at dusk, but am now doing it at any time of the day.

1 Like

So is your autoKitchenLights variable what you use to signal that this piston has been run and active? And thus then avoids the piston being re-run. But how do you change that variable to false to sort of restart the process (for the next day or later on that day or whatever)?

I ask because this may be what I could use in my kid’s room light on thing, maybe setting a variable to true when the lights go on and then set back to false at sunrise or something.

It gets reset in the but if. Works self-sufficiently, no reset required

So one of those two IF’s will occur at some point (the IF and the BUT IF) when run or otherwise the piston doesn’t run at all and thus your variable never gets to “true”. But once the piston gets called with the first IF, it will eventually go to the BUT IF state and thus varible goes back to false.

This is really cool, hard for me to grasp, but REALLY cool.