[SHARE] CoRE - show & tell all about Pistons

Could someone maybe tell me how to set up a simple Play/Pause piston for Core. I am simply trying to use one button that will toggle play or pause for music.

Thanks

1 Like

Over on CoRE Variables 101

Case Study - Revolving Counter

A Turnstile Example

1 Like

Case Study - Flash Lights For Approximate Time

Case Study - Buglight (Capture and Restore State)

This piston is useful where you have flying insects that are drawn to light. It will dim the lights down to 10% while the door contact is open, then restore the lights to their original levels. This piston will demonstrate the use of capturing and restoring states of lights.

Required:
1 sensor
At least 1 bulb

Before starting, set for expert mode: Settings->ExpertFeatures turn ON Expert Mode

Piston Mode: Basic

3 Likes

I’m digging the various pistons you’re posting, good stuff to learn from!

I’m happy I can share knowledge. Thank you.

@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.

Thanks.

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.

Alan

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.

3 Likes

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.