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

But wouldn’t this evaluate to true constantly? (and with which timeframe) if the contact is left opened? Thats why i have the condition group after the Then IF which triggers every 5 minutes (if also opened) This way the reminder that is opened sounds every 5 minutes

I did some more testing and the problem I’m encountering has nothing to do with the IS condition. My problem is caused by trying to use the off command on a siren that already has the alarm attribute set to off.

I’ve changed it so that it uses the task speak “stop” instead and it works as expected.

Although the inability to execute the stop command is an issue and the removal of the warning that says it prevented the execution is a bug.

No, it would have just executed once when either door changed, but I didn’t realize you want it to keep reminding you.

This could probably be done with a while loop so that it’s not always running, but setting it up that way wouldn’t be easy.

I originally had RM change the mode and run a routine. That way I could easily tell if something went wrong which area it went wrong in. If the mode changed but my devices didn’t respond, it was a ST issue. If the mode didn’t change then it was a RM issue.
Now I just have CoRE run the routine and the routine does it all. Times changing for the better :slight_smile:

@ady624

Here’s the problem I’m seeing today, actually since last night.

Conditions in a group are being applied as a group, but as individual conditions.

Example:
If - (Home in night mode AND motion active AND contact sensor is closed)
If true - turn on lights
If false - turn off lights in 2 minutes

In this particular case the lights should only come on when the motion is active AND the contact sensor is closed AND it’s in night mode.

This is not currently the case. The lights are coming on and turning off based on the individual actions… Not the group as a whole.

I’ve made no changes to the piston, other than update the ver.

@ady624 - One Piston reporting “You are not authorized to perform the requested operation”.

Hi Ady - had this Piston working fine (controlling some lights based on motion sensor movement). Went back in and changed the timeouts before switching lights off if no motion after 10 mins. Then went to add a Time Trigger condition for a sunrise/sunset offset. My Android app got very jumpy (moved between pages) and now unable to access or even remove this Piston. Can get into others just fine. Running latest version v0.1.111.20160625

Sorry - have reviewed threads and seen one other recent related instance on a Windows Mobile. Mine is Android.

Noticed this in logs for this specific piston :
21:28:22: error groovy.lang.MissingMethodException: No signature of method: java.lang.String.abs() is applicable for argument types: () values: []
Possible solutions: any(), any(groovy.lang.Closure), is(java.lang.Object), wait(), wait(long), plus(java.lang.Object)

I have five feature requests and two bugs.

FR#1: It would be nice to have the ability to group pistons in order to clean up the list. I.E. I have several pistons that modify variables to determine presence status between me and my roommate, which clutter the list of pistons. Similarly, I have pistons related to my thermostat that I’d like to group together.

FR#2: During simulation, you can only simulate what the current state is. It would be nice if you could tap the item you want to “change” and have it simulate as if that item was different. I.E. Switch 1 is off. During simulation tap the item to simulate Switch 1 being turned on and then proceed through the remainder of the simulation. I often travel and cannot easily test my pistons until I get home or without being home (especially those around presence).

FR#3: Delayed action. I believe this can kind of be done already, but making it more streamlined would be nice. Some actions I’d like to have run after a 30 second wait. I.E. Wait x seconds before executing an action. The reason is that I have pistons that change variables and I want to change one variable, wait for the other pistons to execute, and in a Then-If, evaluate the value of a variable that would have been changed by another piston. (Another presence situation)

FR#4: Weather as a trigger (unless you can make weather an action): Be able to input your zip code or use location coordinates) to retrieve the weather and make decisions. I.E. If it is going to rain in the area, notify me if the windows are open.

FR#5: Copy a piston. I’m not sure if this is even possible. I’ve got pistons that are similar, but that may have one sensor different (my presence vs my roommate). It would be nice if I could duplicate the piston and then just change the one or two sensors that are different

Bug#1: When trying to create a Then-If piston, I was configuring actions and kept noticing that once I finished and clicked Done for the action, it would take me to “Add an action” without any other actions listed, including the one I just created.

Bug#2: Similar to Bug#1 (and possibly related), when creating actions for the piston, at one point I clicked the “Add an action” and it created the action under one of the conditions. (I’m in expert mode).

FR#3 → You can already do, just add the action “wait” in whatever action you are doing as the first step and then the actual action. so it would be:

Using Device…

Wait 10 seconds
Turn On

Bug#2 → This is not a Bug you can assign an action to the true state of a condition (in expert mode) this way you can have different actions to different conditions in a group (kind of like a CASE statement)

I know, and I stated that. I see it as more of an action restriction than anything, such as only executing an action when in a certain mode.

It is a bug when you are in one area setting actions and then it creates the actions somewhere else instead. I think #1 and #2 are actually related, in that when you create the action it actually returns you to the action area for a specific condition, thus when you create additional actions it is creating them for the condition, not the piston.

For some reason I can’t seem to operate any trigger based upon motion sensor inactive for [period of time].

Anyone else having this issue. I’m on 20160617.

When I go into the dashboard and you see the piston being evaluated, there is no countdown.

For example: if no activity on kitchen motion sensor (for 10 minutes) them turn off kitchen light.

Ok, I need some help here with building this scenario.

EDIT - I just realized I put this in the wrong thread… Moving it over to the Piston Help Thread…

I am going to use a basic piston (I’m not into the fancy ones). I will only use groups within the IF statements and individual group actions. Yes, there are other fancy ways to do this… If you want to share it with me, please, by all means share… I’m more than willing to see your ideas… actually that is what I’m looking for.

But, my question is this…

What do you think would process faster? Building all of this into one Piston? Or, using a separate Piston for each of the groups?

Here is the scenario -

Master Bathroom – Core Basic Piston

(Master Bath Motion Sensor 1 or 3 is active)

AND

((Morning Mode –
Mode is morning & Bath override is off
When true: Sink light 1 & 3 @ 20%
When false: Pending off 2 minutes)

OR

(Day/Weekend Mode –
Mode is Day & Bath override is off
When true: Shower light, Sink Lights 1, 2, & 3 @ 100%
When false: Pending off 2 minutes)

OR

(Evening Mode –
Mode is Evening & Bath override is off
When true: Sink light 1, 2, & 3 @ 60%
When false: Pending off 5 minutes)

OR

(Night Mode –
Mode is Night & Bath override is off
When true: Sink light 1, 2, & 3 @ 40%
When false: Pending off 2 minutes)

OR

(Late Night/Sleep –
Mode is Late Night or Sleep & Bath override is off
When true: Sink light 2 @ 20%
When false: Pending off 2 minutes))

OR

(Wendi’s Lights –
Cabinet door sensor is open
When true: cancel all pending tasks: local, turn on all lights, dim toilet & closet @ 80%, turn on
Bath override
When false: wait 15 seconds: cancel all pending tasks: local, wait 45 seconds: turn off all lights &
Turn off Bath override)

OR

(Shower Lights in Late night & Sleep –
Shower motion sensor active & Bath override is off
When true: dim toilet light @ 5%, wait 30 seconds: cancel all pending tasks – local, turn off all
Bathroom lights, Wait 1 minute: turn on fans
When false: cancel all pending tasks – local, turn off Bath override, wait 2 minutes: turn off fans,
Set sink light 2 @ 20%)

I’ve struggled with this same question. My two cents: I do them separate because that’s the only way I can sensibly debug them. When a rule fails, I know which one it is. When I want to tweak something I know where to go. Tends to be more reliable as well (though I think ady has handled this ST issue well). Seems like you have it setup to not race/fight already with exclusions so that’s good.

Just my two cents. I like to break up problems, it’s the engineer in me.

I do agree with that… I’m the same way… I’m going for an organization of each room has its own Piston.

I edited the above posting to show the groupings. I will have 3 main groups with group 1 having the sub groups.

There shouldn’t be any race issues going on either… and thanks for looking at that… that’s the info and feedback I’m looking for on this.

Also, this piston is a conversion from Rule Machine. In RM it took 9 individual rules to do the above accurately and stable… well, mostly stable.

@ady624 I’ve got a feature request for you…

When we build a group it shows the current evaluation of each group at the end then of the group… It would definitely be easier to troubleshoot if each device showed a true/false state next to each device… just like it was in RM.

Got a question…

In this part… the motion sensors are active, and based on the mode the lights do something… they have a pending off…

What is best???

Motion sensor 1 or 3 (is active) (changes to active)… which one starts the countdown when the motion sensor action stops??? and then cancels and restarts the counter if the motion is sensed again before the countdown is over?

So this would be the action waiting on some other piston action?
Could you achieve something close to this by waiting with {variable} time and change time depending on other piston action? or evaluating until the other variable has been set before taking action?

Seem a bug with this Piston,BEGIN WHILE LOOP It never execute.

I manage to fix it once I changed to Break Loop Condition

Yes, I’m waiting on an action from another couple of pistons. They build on top of each other so I can refer to different parts. I.E. I’m home, my roommate is home, everyone is home, nobody is home, only I’m home, and only my roommate is home. Each one sets a variable and the first two are the base of everything else. I am setting up a delay for arming SHM, depending on whether everyone is away or not, but I can’t tell if everyone is away because the same piston sets one person away and I have to wait for the other pistons to finish before I can check the variable.

The loops are “scheduled” all in one go, so you’ve got yourself an infinite loop right there. I don’t know what you’re trying to do, but you can either use a trigger for 1 minute, or you can just Follow Up with piston in 1 minute… But what you’re doing won’t work. I know the programmers expect things to happen, but there are so many limitations due to ST…

have you put these anywhere in the forums? If not, I would love to see these.

One reason I am using routines to control devices is I thought I read somewhere in these forums that routines run locally, or can, or will at some point? Did I dream this?

We all are dreaming for the day that happens…But for now, only locally processed smart apps are Smart Lighting and SHM.