CoRE - Get peer assistance here with setting up Pistons

Welcome to the CoRE Logic Thread. Here you will find many community members that are more than willing to help you with the Logic and Programming of your Pistons.

**There will be another thread for “How are you using CoRE?” and “How are you using the CoRE/AskAlexa integration?”.

So, this is the place to ask your questions and the place to get the answers.

CoRE and Piston Rules Engine, first design steps
CoRE and Piston Rules Engine, first design steps
Sonos Welcome Home Message
CoRE for Dummies (How to get started and make your first Piston)
[SHARE] CoRE - show & tell all about Pistons
[RELEASE CANDIDATE] CoRE (Community's own Rule Engine)
CoRE for Dummies (How to get started and make your first Piston)
CoRE - Help with piston - Set dimmer to 100% if the switch is already on
How to add DIM WITH ME to MySmart Apps in IDE
CoRE and Piston Rules Engine, first design steps
Room control and Osram White Tuning?
Using an open/close sensor to send notice if open at time X
[RELEASE] Aeon Labs Multifunction Siren
How to control TV volume with Alexa, Harmony Hub & Smartthings
Writing CoRE Logic
Google Home
New user struggling with automating switch with presense
Remind me if I forget something at home?
Harmony Ultimate Home and Z-Wave Duplex Outlet?
SHM - Scount Alarm - Cleaning Lady?
Help Needed with leaving/returning from work automations
Turn on zwave switch, delay 5 seconds change hue color to xxx and dim to 20%?
Turn on a switch but under specific conditions?
Smart Lights turn on only if off feature?
Using Motion Detector to keep lights on?
Capability for Ring/Bells
Smart Home Monitor - Feature Requests
Question about routine triggers
Motion Lighting
Post your working CoRE Pistons here
Smart Lighting unless light is on?
CoRE for Dummies (How to get started and make your first Piston)
[RELEASE CANDIDATE] CoRE (Community's own Rule Engine)
Returning home after sunset, would like SHM to trigger I'M BACK, then trigger EVENING when walk through door
Skybell not turning on lights in SmartThings (want a timer)
Toggle increase button?
Rotating states virtual switch
Req: notify if light left on for more than x seconds
Turn on lights if door opened and *all* lights are off?
Turn on lights if door opened and *all* lights are off?
Options on Hue Lighting Integration - Scenes etc
Lighting Automation with Stages
Alexa ST Combined Routine [Newbie]
Iris Motion Sensor (2nd gen, 3326-L)
Help Needed: Logic for A or B or C
Z Wave Blinds controlled depending on weather?
N00bs guide to ST & GD00Z (Garage Door Controller)
Smart app to control group of lights with motion sensor and not turn on those that were off originally?
Raise or lower relative temperature on multiple thermostats at once?
Automation Dim Below 10%?
Connect door sensor to socket?
Fibaro Smoke Sensor Actions
Push buttons to select light scene for Lifx bulbs?
Door Open Alert - does this exist?
CoRE http local request help
2 doors open (not 1) triggers immediate Echo/Google voice warning?
How to Use HVAC Thermostat FAN MODE as Trigger in Automations?
Simple Notify - Water Valve
Using Tempeature Differential to Activate a Switch When Above a Certain Temperature?
Play Sonos on arrival IF TV not on AND time between x and y?
Rule machine - as per the app developer, this app is no longer available for new installs, distribution, or support
Need help with a Motion Senson SmartApp
How to curl in Smart Things
Control GE Z-wave fan with a single push button?
SmartApp bounty? Can/will you write code for others?
Time scheduled events missing in Core
Lighting Control Limitations
CoRE Assistance
SmartThings Freakout last night
WeMo Switches & SmartThings
Hot Water Tank control? Jasco vs Intermatic vs?
Calling all community members: New SmartApp Ideas
FAQ: Creating a virtual Device
Requirement - Help needed (1 second button)
SimpliSafe Alarm Integration (cloud to cloud)
Triggering Smartthings From An External Program
Sonos Party Switch
Ecobee3 help
How to make SmartThings do what I need it to? Is it even possible?
Help needed creating piston with light switch override
[DEPRECATED][Alpha] Hampton Bay/Home Decorators Zigbee Ceiling Fan Controller
New Ecobee lite Thermostat - much cheaper-
Presence fails all the time--is there a CoRE solution?
Need help with motion sensor light setup (resolved)
Invisible Fence Doorman Pet Door controlled with Relay Switch--tracking its state?
How do I schedule two sets of lights independently?
FAQ: Philips Hue and Other Smart Bulbs - What sort of light switches to use with them? (Long FAQ)
<Deleted - wrong thread>
Aspire Cooper RF9500 Device Type (basic DTH in post 6)
FAQ: What is WebCoRE? (And what was CoRE?)
New to SmartThings, need some help
Date criteria
Tips for alarming that Fridge door is open
#@@##$%#$#% Help me not have this happen again (monitor wine cooler?)
Alarm On Specific (Current) State, Rather Than Change Of State
Getting started with Core (for Dummies)
Alexa flash light when timer hits zero?
Auto Close Garage Door After 15 min open?
SmartThings SkyBell HD Integration Released
Mobile Presence and iBeacon (discussion beginning 2015)
Ways to control HVAC? (Mode, presence, motion etc)
Can Samsung Multipurpose sensor detect knock ONLY when closed?
Contact Sensor Status Alert Triggered By Another Device?
Help with CoRE not triggering correctly
Color Fix? (Osram)
[OBSOLETE] [BETA MILESTONE 1] CoRE (Community's own Rules Engine)
[RELEASE] Smart Weather Station Tile Updater and Severe Weather Notifications - Fix Broken Modes and Repeat Notifications
Over riding Motion Sensors?
[RELEASE CANDIDATE] CoRE (Community's own Rule Engine)
PetSafe dog door closed IF garage door is open?
Door Code Usage Log
Using core to simulate motion?
Newbie - Need Guidance - thermostat control and other questions
Fortrezz Siren?
CoRE and Piston Rules Engine, first design steps
Control color on 2x Lightify bulbs at the same time using SmartThings?
CORE: how to set a delay before or inbetween actions?
Routine Hours Filter
Off - power allowance , less than 1minute
Dim Hue Bulb when turned on at night
Multiple voice notifications on 1 trigger issue?
3 pistons running one device does it matter
CoRE and Piston Rules Engine, first design steps
Help Configuring CoRE
Brighten light with motion then dim after motion stops
IFTTT trigger to execute a CORE piston with maker channel?
CoRE Piston state duration help
HomeSeer HS-WD100+ and more (Simple DTH in post 27, advanced feature DTH in post 32)
HomeSeer HS-WD100+ and more (Simple DTH in post 27, advanced feature DTH in post 32)
CoRE for Dummies (How to get started and make your first Piston)
CoRE - Party mode pistons
Trying to set up some simple heating and lighting scenarios
Rule Machine - Get peer assistance here with setting up rules
[BETA] Hue (Re)Connect - with scene handling
Garage door opener - delayed automatic close?
Notify when door contact is opened only during time window
CoRE and Piston Rules Engine, first design steps
CoRE - this is where you find it
[OBSOLETE: [BETA MILESTONE 2] CoRE (Community's own Rules Engine)
State Changes twice or X times?
Take a shower?
Power outlet off at zero power?
Is there a SmartApp to open/close Add-A-Motor curtains?
Is there a SmartApp to open/close Add-A-Motor curtains?
Is there a SmartApp to open/close Add-A-Motor curtains?
Skybell integration

Jason, I know you were trying to use the power meter but ran into issues, were you able to set up a piston like:

IF power greater than X
THEN do something

without firing every time the power changes above X

1 Like

I haven’t got the hang of the capture / restore state.

What I want is if lamp is off than turn on when closet door is open and off when closed (got that part easily).

What I cannot get working is using capture / restore state if the lamp is already on as the level would need to ramp from 20% to 100% and back to 20%

I tried this but no workie:

First, thank you for everything you doing for this community!

I’m trying to see I can count the number of toggles form a specific switch with in a specific time.
something like -

Switch is toggle
and then 
Switch is toggled again within 2 sec
and then 
Switch is toggled again within 2 sec

do something

I know I need to use the variables in some way, but I can’t understand how…
I did try to set a $second variable, but I don’t now how to use it…

Can you please give me some directions on where to start?

Gil :slight_smile:

I found that the power meter like to fluctuate on the reading, so when I was using the conditions “is greater than” or “is within range” the piston would evaluate every time the power reading changed.

I had to go with triggers to get it to behave.

Changes to, raises above, enters range - these triggers worked well, I just had to excitement and find the best one for my use case.

I actually used “raises above” to initiate the piston and then “enters range” turn it off.


I’ve been working on this as well, but I think there is still a bug.

I’m using a latching piston that captures the state of my bulbs when a switch turns on. It then restores them when the switch is turned off.

It does everything as programmed, but it does not restore the lights back. It is setting the levels properly, just not the colors.

Try this piston as it may work well for you.


Hi Gil! !

Take a look at this piston and see if you can modify it to work for you.

This piston counts the number of times the dog food container has been opened, sends a message when it reaches 3 times it more, and resets the counter at midnight.

****note - not positive the counter reset is working. I have this one as an example I helped someone else with and I don’t actually use it.


Thank you, I will try to see what I manage to achieve and report back.

Gil :slight_smile:

1 Like

Jason, a lot of the attributes you selected override each other. colorTemperature for example affects hue and saturation. Try using only hue, saturation and level. Those three fully describe the color. Or try color alone, though I noticed that uses RGB.

I’ll try that and let you know. Fyi - This is using Phillips hue color bulbs

I took a stab at what you want to do, see if this makes sense. You will have to edit it since it counts 2 for each toggle I tested :slight_smile:

Edit: Looking at it now, it seems I should have put the Tasks outside of the group.

1 Like

Thank you, I will try this one as well…

Gil :slight_smile:

I fixed my double count

1 Like


I can’t find a combination of the attributes that makes this work…

Not sure what’s up.

I do know when Bruce was setting this up in RM it would act differently with different brands of lights… I’m not sure what he had to do to get it to work.

Maybe there should be a dedicated capture and restore just for bulbs?

I just posted about this in the original thread, I thought it was similar to what you saw but for some reason didn’t connect the dots. Seems to me this shouldn’t be an issue with historical conditions vs current conditions. Like CoRE is evaluating the conditions as “did it change” followed by “is it in bounds” instead of the historical “did this go over/under in time specified.” Will try my other rule with trigger instead, thank you!

1 Like

This was for me :slight_smile: I added it but couldn’t get it to work. My biggest problem in troubleshooting - how do I check the value of the variable? I can’t find anywhere to read the value, thus can’t tell why it’s not firing the audio. I can tell in notifications that upon the container changing to open, the piston fires, but that is all.


The dashboard lists all variables for the piston. Also the Local Variables page in the piston

Based on the exemples of @bamarayne and @eibyer, I have managed to create something that works for me…
So far it works great!

Do I have any major mistakes in there?
Can I make it more simple?

Gil :slight_smile:

1 Like

Does anyone know why this extremely simple piston makes the light come on instantly at

100% instead of fading over 50 seconds like I programmed it to?

How is it switched off… By setting level to 0% or by switch turning off