CoRE - Get peer assistance here with setting up Pistons


(Jason "The Enabler" as deemed so by @Smart) #1

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

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

(Fast, Good, Cheap...pick two.) #3

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:

(Gil) #4

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:

(Jason "The Enabler" as deemed so by @Smart) #5

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.

(Jason "The Enabler" as deemed so by @Smart) #6

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.


(Jason "The Enabler" as deemed so by @Smart) #7

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.

(Gil) #8

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

Gil :slight_smile:

( I hate Mondays) #9

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.

(Jason "The Enabler" as deemed so by @Smart) #10

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.

(Gil) #12

Thank you, I will try this one as well…

Gil :slight_smile:


I fixed my double count

(Jason "The Enabler" as deemed so by @Smart) #14


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?

(Michael Hess) #15

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!

(Hobbyboy) #16

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.


( I hate Mondays) #17

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

(Gil) #18

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:

(might be my fake name?) #19

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?

(Jon) #20

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