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

@ady624

In a piston, if I have this…

(Trigger A AND condition A)
Or
(Trigger B)
Or
(Condition B)

Then…
Do cool stuff

Currently this piston would never be true unless the condition was true first.

Can you make it so we can have, while using groups, triggers and conditions with with the OR?

I don’t understand, cool stuff should happen if trigger b happens, or if trigger A happens while condition A is true, or if any of the two triggers happen while condition B is true. Isn’t this happening?

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.

2 Likes

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.

Example:

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)
OR
(There is motion in the kitchen)

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

OR

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?

Thanks!

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

Thanks!

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?