[SHARE] CoRE - show & tell all about Pistons

@alanrosesf: I have a very basic CoRE question. How are you entering “When true…” actions on each separate condition? I must just be missing something in the UI, but I can’t for the life of me figure out how to do this. The only place I see to add an action is after the conditions have all been evaluated.

I’m also curious that you have an AND between two conditions that seem mutually exclusive.


Open the settings for CoRE and enable expert mode. You will then see when true and when false.

After you add 2 or more conditions/triggers you can select the OR then you can change it to AND as well as other options.

I’ll try and break it down for you as best I can.

Each condition has it’s own Individual Actions When True or When False. You will find these as you scroll down toward the bottom of a condition under the banner ‘Individual actions’ and before ‘Advanced options’. Once you press either ‘When true, do…’ or ‘When false, do…’, you will be presented with a card to select your actions.

As far as the AND in the Buglight example above, since the test on the sensor is set to ‘changes to’, a constant cycle is created whereby one or the other is going to be true. I might have used XOR where one but not both can be true at the same time. Many ways…

I hope this has answered your questions. Please let me know if you need further assistance I am capable of providing.


Thanks @c1arkbar. Expert mode was the key. I kept seeing all these pistons and couldn’t for the life of me figure out how to get there via the UI. Now we’re really cooking with gas!

@alanrosesf Thanks for the answer, but “Expert mode” is what I was missing.

1 Like

Ah, so sorry. One of those ‘set and forget’ features you never think about.

Maintain80 - Example CoRE Piston To Keep Light Levels at 80%

Ok, Here is a simple core piston, that I am really liking.

Background: I have an Echo. Amazon just updated the Echo’s (not the dot) last week to allow it to work through an external Bluetooth speaker like the dot. My echo and my vizio soundbar are in the same room. While the echo cannot be connected to the sound bar while you are using HDMI or any other inputs, it can be connected when you’re not watching anything, which is what I decided to do.

I created a new Harmony activity called “volume Reset”. Device is soundbar only, It sets the input to Bluetooth, then sends 20 volume down commands and then 18 volume up commands (takes about 15-20 seconds to complete). I find that my normal volume level is around 15-18, so 20 volume down ensures starting from 0. I set up an Core Piston automation using Smarthings , the Harmony hub and a Smartthings Virtual Switch.

It works like this, when I am watching any normal Activity, such as TV, or Netflix, the Harmony Hub turns off the virtual Switch “Volume Reset”, when the Activities are turned off the virtual Switch is “volume Reset” is turned on. The Piston checks the state of the “volume reset” virtual switch. If it’s on for one minute (I do this in case you accidently turned off your activity), then turn on the Harmony “volume Reset” activity. This does the Bluetooth input, and volume down and volume up, and then 30 seconds later the piston turns off the activity, but as mentioned the soundbar is still on. Not only is this cool for the echo, but it also ensures the volume is always the same every time I turn on any activity. So far I am loving it. The smallest very minor issue is that when the echo connects, it “beeps” so one minute after turning everything off, I get the beep. I’m still getting used to it.

So, when TV is off, Echo comes through speaker, when TV is on, Echo comes through the Echo. Bonus, the volume is always reset to 18 every time I start watching any harmony activity. Additionally If I did want the echo to be louder or quieter, I can just do that using the echo itself.


beginning to understand core more and more. so I’m going through the long over haul of removing routines even though they work I just think core has that extra ability a may want.

I made this basic piston to to replace my shutdown routine. if there’s any logic I could add or remove I would love to hear opinions.

my goal is to incorporate modes instead of shm. I will be making some security pistons once I get my shutdown, I’m home, and some other routines correct.

I hope this piston will work alright. I think my logic should result in the home staying in home mode, no alarm and lights on as long as me or my wife are home or if we leave and a guest without presence sensor should be able to walk around the house or garage which will activate I’m home…I think.
does this sound and look right.

IMG 5719
Up until a couple of days ago I was using Rule Machine… it really delivered everything I needed. But time marches on and in the interest of staying current I downloaded Core. So for no real reason other than checking out Core’s functionality I set up this piston to log and report to me the number of times my motion sensor triggers per day. My first setup was done in 2 pistons, one to count and one to send the daily total in an SMS. It worked great. This morning I combined them into one And-If piston as shown… tomorrow I’ll see if it works as well as with 2 pistons.

Well if it sends you a 0 then it is because you are zeroing out your variable at the same time you are sending your message.

If you want to rectify this then combine the two location actions. Will look like this:

To achieve this result you should delete the second action and then click on the first. Scroll down to where you add a task.

I had it set up this way when I was using separate pistons to count and to send the result, and the tasks fired sequentially. I would receive the total and the count would be zeroed afterward. But I’ll keep this in mind in case it zeros before sending in the future.

I was having an issue with the I’m Back automation because it did not differentiate between before and after sunset. so I wanted a different setup depending on whether I came home before or after sunset, so here is the piston that is working for me.


dont use a latching piston, use or-if

its working, i was just sharing because I’m Back Automation in ST doesn’t have options for before and after sunset

Oh ok, well that is good. You can really ramp up creativity if you decide to try out webCoRE.

Is web CoRE separate? or add on to CoRE?

seperate. Takes all the editing and allows you to do it from a computer or mobile browser. And while it looks like the code is written out that is not the case. Everything is click this click that and the view I showed you just allows you to see an overall view of the piston

trying to find it in GitHub now but not having any luck

Link to github

Community thread covering it

1 Like