[OBSOLETE] [BETA MILESTONE 1] CoRE (Community's own Rules Engine)

But it won’t fite IF just condition B is true.

Why not?

Because conditions do not subscribe to events in the presence of triggers. If you use triggers, conditions become restrictions, they don’t subscribe to anything. Replace condition B with a trigger.

Just for clarification…a condition is a trigger if it’s by itself, correct? So saying simply If switch A is on, then do cool stuff will operate the same as saying If switch A changes to on, then do cool stuff?

Correct. Conditions have an empty circle, triggers have a full circle. If you’re only using conditions, they all act as if they’re all triggers (each condition has an equivalent trigger, like is <=> changes to) Once you mix them with triggers, they take on a secondary role of “restrictions”. They won’t generate events, they’ll just limit events generated by triggers.


IMHO this is by far the most complicated thing about CoRE. I fully understand rationale behind that decision (to avoid having a lot of things with subscription, and therefore, minimizing resources at ST level), but it took me a while to rethink my pistons in order to maximize CoRE potential.

Don’t know if possible, but when mixing trigger and conditions, some kind of wording in the UI to warn about this would be great…

Thanks @ady624 for this awesome app!

1 Like

Oh, @ady624… here’s something that would really be beneficial.

Having the ability to choose one of these two actions…

Pause a Piston
Unpause a Piston

Ok, as an example of why I would like to have the ability to use triggers as well as conditions without the conditions become restrictions…

  • In block one (shower motion is inactive) - I would prefer this to be a trigger. Due to some of the things with the rest of this piston, I would only want a single firing of this, not give it the ability to set the lights at any other time. I only want it to occur when the motion changes to inactive.

  • In block two (Each of the motion sensors are inactive) This needs to be a condition… There are multiple sensors and it doesn’t work correctly when it’s a trigger… trust me… I tried.

  • In block three (Bathroom cabinet door contact is closed) - This is the same as for block one.

So, in all for the But-If part of the Latching piston I need 2 triggers and 1 condition to make it all work seamlessly. It does currently work, but it’s very clunky and there are major glitches… It just isn’t smooth. I could break this up into 3 separate pistons, but that really seems to go against the nature of CoRE.

The reason is not minimizing subscriptions. The reason is the same behind RM’s conditional triggers: allows you to select which events can lead to actions, rather than having all events do that.


Time is after sunset AND Presence is present

This will execute its actions:
a) at sunset, if you are already home
b) when you arrive, if it’s after sunset

Time is after sunset AND Presence changes to present

This will execute its actions:
a) when you arrive, if it’s after sunset

Understand the difference? The trigger allows you to specify that it is only the arriving that will turn the lights on, but if you are home when sunset comes, no need. That’s the reason for triggers

1 Like

Right, I understand that. What I mean is when you have this…

(Time is after sunset and presence changes to present)
(There is motion in the kitchen)

This would turn on the light when you arrive and it’s after sunset.


It would turn the light on anytime motion is in the kitchen, and off when there isn’t.

Two groups, one piston. Or two pistons, which is fine too.

After the OR, make that a trigger: Motion changes to active

Both triggers and conditions subscribe to attribute changes - this means when motion becomes inactive, that trigger would be false, along with the one above the OR - this will cause the ELSE to execute. So you just need to use a trigger for motion as well.

And if - I am trying to create a piston to do the following;
If it’s 10:00PM at night AND if the garage door sensor is ‘open’, then send a close command to the garage door and send a notification.

I created an And-IF piston with ‘happens at 10:00pm’ for the first IF, then under And IF I have ‘garage door sensor contact is open’ and below that under the THEN section ‘using garage door opener close, send push notification.’

This did not work. At 10:00pm I got a notification but no close command was sent. Also, every time I open/close the garage door I get the push notification. What am I doing wrong? And what would be the correct way to do this piston?


Please post a screen shot of your piston from the dashboard view.

Screenshot posted. I currently have it paused as I’m worried it will trigger while my wife is backing out of the garage.

In the screenshot it is called ‘Garage Door Close’

You don’t need the And-If piston, a Basic should work.

If (two conditions under If)
Time Happens at 10:00pm
Garage Door is Open
Then (two separate actions under Then)
Using Location send push notifiction
Using Garage Door, Close

1 Like

Thanks destructure00. When I use a basic and add two conditions it doesn’t show me an ‘and’ type option so I had no idea if that would require both conditions to be true to execute the then statement. So on a basic piston if you add multiple “if’s” then it requires all to be true to execute the ‘then’ statement?

When you add the second condition it will add the “And”, which you could later change to an “Or” or a few other things.

If you leave it as “And”, then yes, all conditions have to be met before the actions in the Then section will run.

Ahhh very cool, thank you destructure00! I’ve changed as you specified and will let it run tonight and I’ll let you know.


1 Like

Well unfortunately that didn’t work. No false positives anymore which is good, but it never executed last night. I think it has to do with the ‘happens at’ part? Should I change it to the + or - 5 minutes thing?

Was the garage door actually open at 10pm? Changing the time to +/- 5 minutes won’t do anything other than move the trigger point around, unless you have some other restrictions set somewhere in the piston. Post a pic of your piston. The screenshot you took above was of the dashboard, that doesn’t help much. If you tap on the piston name in the dashboard, that’s what we need to see. If you do it in a browser window (mobile or desktop, either will work), the camera icon at the top right corner of the screen gives you the ability to save the picture.

Yes, I opened the garage door at 9:45PM and left it open to see if it would work. At 10:05PM I gave up and closed it. I don’t have the iPhone with me at the moment so I took a screenshot from my windows 10 mobile device, but this piston was created/edited on an iPhone. How can I view the app/piston on my desktop PC or in a browser?