[SHARE] CoRE - show & tell all about Pistons

Check here for the smartapp…https://community.smartthings.com/t/release-kodi-for-smartthings-beta/38305


Thanks to @pcgirl65 I learned I can use Kodi with CoRE. My new piston now lowers my lamp using the Gentle Wake Up app in reverse to 1% from whatever it was once I start playing Kodi through ST.
Playing Kodi through the fire stick remote will not effect ST; therefore; not enable the gentle wake up app.

How did you do the piston to use the gentle wake up app?

This is the piston I made to work with the gentle wake up app (I called it very Darkness so it would be at bottom & to remind it is for dimming to 1%), but I changed it. Whenever I would pause, the light would increase to 40% then immediately return to where the gentle wake up app was interrupted.

This is my current solution until I get a better dimming method. It uses a routine to lower light to 5% and then to raise it to 60% when paused.

Hmm, I didn’t notice how you can include a ST app in a THEN. This could be useful. What parameter is it under?

To use a Routine, under the Then tasks>location>control location mode etc> select execute routine.

To use an app, under Then> Convienece> Control lights, outlets, relays or switches.

I found a that free account with “trakt.tv” makes Kodi a lot easier to search and navigate.


Here’s a really simple one:

Do - Text Speaker
Using VLCServer1…
► Speak “{@textMessage}”

Set your @textMessage and Execute Piston from any task

I’ve been doing this exact thing using the integration between CoRE and AskAlexa.

I had it set up like this…

A separate install of AskAlexa for each person in the house.
The invocation word is the name of each person.
I chose the speaker in the Piston where they were… kids were usually in their rooms.

So, I could say this…

Alexa, Tell Justin to come downstairs.

On the speaker in Justins room it would play my programmed message.

I had 30 macros and 30 pistons set up to do this. It gave me a total of 30 voice activated
messaged around the house. It also took 2 smartapps working together.

But I just deleted them all…

I have something better now… :slight_smile:

1 Like

Hi all…new to Core and so far so good.

Question on above code…how do I get the When True Block? I can’t seem to find that operator in the basic piston type…simply trying to copy above.


Have you enabled expert mode?

1 Like

Just did. Thank you!

1 Like

I have 2 pistons I’d like to share that work together.

Here is my scenario… I wanted to detect when someone walks upstairs and no one is still downstairs to turn the lights off.

I have a motion sensor at the top (Hallway Motion Sensor 1) of the stairs and one at the bottom (Hallway Motion Sensor 3). I actually have 3, it is easier to explain as just 2. For your information Motion Sensor 2 is upstairs, just down the hall from Motion Sensor 1.

Here is the piston I use to detect if someone walks upstairs between 9:30 PM and 5:30PM. Also, I check to see if one of the TV’s or Computer is on. If they are one, someone must be downstairs still. I can actually remove this check because I check it again in the second piston.

When this piston results in a TRUE it calls another piston called “Monitor - Downstairs”

Here is that piston.

What this piston does it it checks various sensors to see if someone is still downstairs.

I am using a Follow-Up piston so it doesn’t run by itself. It needs to be called by another piston. Because the flow of a Follow-Up piston is IF-THEN-ELSE I had to use the IF-ELSE IF-ELSE IF grouping mode in the IF section of the piston.

If the piston determines that someone is still downstairs through motion or power consumption (or anything else I add later) it increments a counter, logs the event to the ST Activities log, waits 1 minute and calls itself again to start the process over.

I will eventually stop after 3 tries (the first ELSE IF).

The reason I have built this is…

I want the lights to turn off when everyone walks upstairs, but I can’t just rely on motion sensors because they do not become inactive immediately. This way I can have a motion sensor 5 feet from the staircase and it can still read active as I walk up stairs. The first loop through the piston, it will not turn the lights off as it still thinks someone is downstairs. However after a minute it becomes inactive and the lights turn off.

Here is a piston that I set up for my LIFX lightbulbs outside on my front porch. It is specific to only a few weeks in October and will set the color of the bulbs to a different Halloween related color using the " individual actions" section of core.

I wonder if the dates being out of order matters?


Regarding the previously posted piston, Will having the dates out of order be OK?

Should be okay. The selector selects them like that. The restriction checks to see if current day is in that list, regardless of its order.


HI everyone

So I am developing my skills with STT and CoRE.
Firstly thanks must go to you all for making this so informative and interesting.

Right can you help me please?
I have acquired and fitted a series of Fibaro Dual Relay FGS-223’s to control the bathrooms.
They have been installed and work perfectly. Also installed and working well are STT Motion Sensors in each bathroom.

So I have connected the lights and the extractor to the Fibaro but only the lights to the physical switch.
The lights are operated either by the physical switch or by Motion using Smart Lighting.
On Motion, the lights come on and after 1 minute of No Motion they go off.
see below.


All is fine with the lights except when someone leaves the Physical Switch on but doesn’t go into the room. How can I use CoRE for this scenario? If Switch is ON AND Motion stays Inactive for 2 mins THEN Turn off Switch.
I have tried this with a BASIC piston but doesnt activate. I am assuming it is something to do with only being able to report No Motion after Motion or something similar…
Can the brainstrust here help me programme this scenario?

I am using CoRE successfully to control the extractor.
The extractor switch turns on after 1 minute of Motion in the room and then turns off immediately. The extractor also has a Humidity sensor built into it and stays on for a minimum 2 mins or until the humidity drops below a level. see below -

Any suggestions to programme the lights to turn off when the switch is ON but No Motion for a period of time.

I would value your inputs thank you

How about turning off with the “power allowance” in smart lighting, after x minutes?
Or else add if no motion… Which you may need core for.

The problem you are having is that since there was never any motion, the timer to count down from 2 minutes doesn’t start. Try…

If switch stays on for 2 minutes and motion is inactive
Turn off.

I have a similar scenario but in reverse. I have a motion sensor in my Garage pointing to the door from the house. When its dark I want the motion sensor to turn on the lights in the garage for 1 minute as we are often just getting something out of the refrigerator in the garage. Easy to do… been working for a few months using a multi sensor to detect illuminance a switch and a motion sensor.

However if I want the garage light to stay on for more than a minute I am having a brain lock on how to make this happen. The desired effect is that if the switch is pressed physically that somehow this over rides the motion sensor logic to turn if off in 1 minute after motion has stopped since the senor is not pointed towards the main part of the garage. Taking this further I would also like to prevent this light from being left on for hours as we have grow used to not having to turn it on and off.

Any ideas? … sure this is an easy one for the experts.