EDIT: 9/10/16 updated some key info not mentioned in the install links

I’ve started this not because I know a bunch about CoRE (Community’s own Rules Engine), in fact it’s quite the opposite. Instead I’m just pulling together some helpful tips which got me get started and got me up and running with this outstanding rule engine for Smartthings.

There is a lot info out there mainly designed to help people do amazing things with CoRE, but it was hard to find the “for Dummies” type info. And very hard for me (a true noob) to get started. Hopefully this post will help others who may not have ever added a custom smartapp to the IDE or maybe never even have had to log into the IDE before.

If you are looking for really basic info on CoRE and how to get started, hopefully this will be the place for you. If you are very knowledgeable about the IDE, smartapp coding, etc. this is NOT the thread for you. This is noob-land. And we wear that title with honor.

What is CoRE?

Per the wiki, CoRE is …“a rule engine that takes events and states as input and executes actions based on the relationships between these events and states.” CoRE refers to what I would call “a rule” a Piston. Again per the wiki a Piston is “…a decisional unit in CoRE that does the heavy lifting of subscribing to events, performing conditional evaluation, and executing required actions.” Ahhh, yea, right, forgot we’re dealing with very smart developers here, but basically Pistons are those trigger/action things, If/Then stuff, you know (notice I didn’t say “rules”) that automate your stuff.

This CoRE project is absolutely amazing and the best thing I’ve seen in the very short time I’ve been using Smartthings. Actually it’s been a couple of years but I’m still a noob. It is completely open source and completely free, but the work is so outstanding I highly recommend that if you do end up using it and enjoy it that you donate to the developers (direct link available at the beta milestone thread listed below)

CoRE also plays well with others

Also note that CoRE can be used in conjunction with @MichaelS great Alexa smartapp AskAlexa. AskAlexa is not exactly as easy for noobs to implement like CoRE is, however it is doable. And tying them together is very very cool.

Wait!!! there’s a wiki?

Yes, which is located here but understand that the CoRE project (as of Sept '16) is still in beta and thus the wiki may not answer all questions. However, it is a good place to look.

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.

Additionally you can follow the beta milestone thread here to find more info (bugs, etc.). This also has a direct link to donate to the developer.

UPDATE 1/12/2017: CoRE is now in the process of being heavily streamlined (reference to @bamarayne) into a web controllable app. There will be no updates to this version of CoRE other than critical updates. An update will be posted here when the new SE (Streamlined Edition LOL) version is available for the public. We're close to hitting alpha stage.
UPDATE 9/28/2016: CoRE has moved on to Release Candidate. Please kindly follow us here.
Continuing in the BETA process of CoRE (milestone 1 topic here), we've now moved to BETA MILESTONE 2. This is all about crushing those bugs and speeding up those pistons you're having trouble with. While absolutely necessary additions will occur here and there, adding features is NOT the main focus of M2.
WARNING: As mentioned before, this SmartApp is …

Okay. How do I start?

You need to login to your Smartthings IDE. If you have never done this before head to the following link below and enter your login and password for your Smartthings account. This will log you into your own IDE showing all your devices, apps, etc.

Install the CoRE app, following the instructions in the wiki, here’s the link again (I did the GitHub install which was super easy but you do need to get an account at GitHub first, just FYI). The instructions here are great with pics so if you are a noob like me, don’t worry you can do this.

SUPER IMPORTANT NOTE: This doesn’t seem to be mentioned anywhere but after you follow the above steps to install CoRE into your ST IDE, you will need to actually load it onto your mobile app to use it. This is merely done by adding the smartapp as you would any other. The only difference is that on your mobile app (the ST app on your phone) the CoRE smartapp you created is located in the Marketplace under “My Apps” which is at the bottom of the list of apps

Start building your rules…er…pistons. I’ve created a super simple one here as an example.

There are many ways to create pistons but I’m going to walk thru just doing it via the Smartthings mobile app.

First, open the app (that makes sense).

Then regardless what bottom tab you are currently on (Dashboard, My Home, Routines, Marketplace) select the Menu icon on the very top right of the app. This will slide right a screen that should look like this

Select SmartApps and you should see CoRE if you installed it correctly. If you have any other smartapps you will see them as well. Note: In the pic here you see the other smartapps I’ve installed so your screen will undoubtedly look different.

Select CoRE and you will now see options to view the “CoRE Dashboard” or “Add a Core piston” and the apps Settings. Until you have a piston setup the dashboard shows nothing of interest.

For now, just select “Add a Core piston”. Once you select that and you’ll see this.

We’ll create a super simple one so we’ll leave the “Piston Mode” to Basic. For more info on all the things you can do with CoRE remember to look at the wiki and the peer assistance threads. But for now, let’s just get started with something easy.

We’re just going to create a very simple IF/THEN piston to turn the lights on in the downstairs hallway in my house, 10 minutes before sunset on the weekends only. We’ll start by creating the IF statement.

select “If…” which will open this new screen

This is going to be a very simple one so we’re just going to select “Add a condition” for information about “Add a group” or any of the other options please visit the links I mentioned above for help.

select “Add a condition”, which will open the following screen…

select “Capability” and then on the next screen we’ll select “Date & Time” radio button which now should look like this…

tap “Done” at the top right of the screen we now have a new option called “Comparison” and when we select that we get a few options, we’ll select “happens at” since we want the condition to be at sunset. Tap “Done” again.

we now have a new variable (and notice that each of the variables we MUST select in order to get our piston in a working state have a red bar next to them until we set the variable in which case the bar becomes blue). Anyway, select the “Value” variable and then the “sunset” radio button and once again the “Done” at the top right corner, you should see this…

we’re going to get a little sophisticated here and set the “Offset (+/- minutes)” variable for our If trigger. Tapping the number (currently 0) under the “Offset (+/- minutes)” we’ll set it to a negative 10 (so -10) to represent 10 minutes prior to sunset.

tap “Done” in the top right corner and then “Done” again to get us back to this screen (NOTE: in the pic I’ve scrolled down just a bit to show more info, so this is not the top of the screen)

Note at the bottom it will show the “Trigger Overview” as well as the current status (as I type this at 2pm it shows “Current evaluation: false” because it has not hit 10 minutes before sunset here in Northern California). It also shows below that the “Next schedule event” which does show the dates and times of 10 minutes before sunset in my area.

now let’s create our Then, select “Then…” which brings up a screen to select our actions

for my lights which are controlled by a switch I’ll select “Select lights, outlets, or switches” and then select the appropriate radio button (in my case Downstairs Hallway Lights) and then tap “Done” in the top right corner

tap on “Done” once again and now I can add a task, selecting “Add a task” we’ll select the “Turn on” radio button and tap our favorite “Done”

We’re going to get sophisticated again and now we can select the options of "Only on these days"
12) select Saturday and Sunday radio buttons and (you guessed it) “Done” and “Done”

we get to select “Done” one more time (yippee) which now shows us our first piston. Tap “Done” again and a pull down screen will say it’s adding and automating your piston.

After that you will get back to the main CoRE screen and see your brand new piston brilliantly called “CoRE Piston #1”

to change the name of your piston to something a bit easier to identify what it really does (or to make edits to your piston) just select it. Name and Description options are towards the bottom of the screen once you’ve selected it. And as mentioned you can also edit it as you see fit. At the very bottom you can also remove the piston completely. Note: again in this pic I’ve scrolled down a bit so you can see where the variables are

Well, hopefully that helps you get started, as mentioned look thru the “CoRE - Get peer assistance here with setting up Pistons” thread for help, ideas, examples and more. And just another plug to donate, if you look at the code in the IDE you will see something like over 10,000 lines!!! Clearly a lot of work by the developer who is giving this away for free.

What exactly do you mean by “overhead”? If it’s tied to the second question, I’d really have to say that rolling your own app can be easy or can be significantly difficult. It will depend on variables like how much coding experience you have. Groovy is fairly easy to learn if you have had really any type of coding experience. I personally have (VERY BASIC) knowledge of C++ and Obj C and can follow things I’ve seen others do. It will of course also depend on how sophisticated your program needs to be.

I’d certainly first look into CoRE as it is pretty full of rule options, and probably as close to “everything but the kitchen sink” as anything out there presently.

And of course with most open source projects with the ST community, you can adjust and tinker with the code to suit your personal needs. Hopefully finding something new and cool in your own fork that can be rolled back into the core (no pun intended) code.

I now have a couple of pistons running, I like CoRE. As a simple logic engine it works well. And is fairly easy to build with.
Overhead is the amount of resources it occupies that are there regardless of your pistons. Overhead is why I don’t run Windows.

The lack of documentation on CoRE is the only downfall as far as I can tell. It’s kind of difficult to find examples.

bamarayne
(Jason "The Enabler" as deemed so by @Smart)
2016-08-29 22:04:45 UTC
#8

Ac7ss:

I now have a couple of pistons running, I like CoRE. As a simple logic engine it works well. And is fairly easy to build with. Overhead is the amount of resources it occupies that are there regardless of your pistons. Overhead is why I don’t run Windows.

The lack of documentation on CoRE is the only downfall as far as I can tell. It’s kind of difficult to find examples

Have you done a search and noticed the literally thousands of posts about CoRE, along with the hundreds of examples?

You’re best bet for examples are in the “CoRE - Get peer assistance here with setting up Pistons” link I have in the top of the post. There are tons in there and I’ve found some interesting ideas and things that got me thinking about new ideas for my own situation.

The documentation is a little bare, but I think it’s more because the smartapp is still in beta and the guy(s) writing it are of course doing it on their own time and giving it away for free. But it was hard for me to find info about it which of course is why I opted to create this post, hopefully giving people some basic info.

I do find what I can do with this smartapp to be great (compared to other rule engines I’ve tried). But like any other beta software it’s not going to be perfect. Scratch that, after working with computers since my very first Apple IIe…NO software is going to be perfect.

Thousands of posts is a daunting number. Needle in a haystack daunting. The poor choice in forum software doesn’t help either. Has anyone put together a Wiki for user examples and documentation of the app? This could help take some of the load off of the developers.

I do learn best by doing. But I also have a hard time figuring out just what is possible. Is there a notification option in the “Then” section? Can I change the color of a HUE lamp using the engine?

I now see what my main use for it will be, simple logic switches. “One off” apps as it were. It is simpler to do a “If everyone is gone and it’s daytime, turn off all lights.” with CoRE than an app. It is better, for me, to write an attic fan controller than use CoRE. (Deeper logic tree).

I could not figure out how to nest logic in CoRE for the first couple of days. “If (X && (Y || Z))” for example.

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.

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.

My thread is just a very basic primer and I’m afraid is just not intended to answer all questions you might have with CoRE. Whereas the other thread is viewed by the developer and he often provides help and answers. And I totally understand that thread is a bit long (number of posts) but it is the better place to go IMO.

bamarayne
(Jason "The Enabler" as deemed so by @Smart)
2016-08-31 01:27:48 UTC
#19