CoRE - Get peer assistance here with setting up Pistons

Thanks again you’re a star :slight_smile:
I don’t actually know how you add a OR separator though lol and where do i insert the condition is it before or after the motion sensor part
Cheers

1 Like

When using Expert Mode, you can use groups and conditions and put a When True to either a single condition or the group. I like using Groups, add a When True to the Group then add another Group for another argument within the same Piston.

The “In Between” groups separator will default to AND, but you can change this to OR effectively having the ability for 1 Piston to accomplish multiple task.

Look at my ORs in the Piston I posted. Follow the lines on the side and you will see how each Argument is separated by an OR.

You can’t choose where to put a condition in a group if it’s after-the-fact. It will just default to the next available slot. Just remember that Triggers have precedence over Conditions. Triggers are the solid bullet actions such as changes to, stays and such. Conditions are the hollow bullets like is, was and such.

Doesn’t really matter where they are in the group as the group will entertain all conditions equally but will not entertain conditions if the trigger is not met. You should not have multiple triggers in one argument as this will typically always result to a false state and the Piston will not work.

Thanks that made more sense :slight_smile:
How did you get that screensot btw are you using a different CoRE app

Enable the Dashboard in CoRE. Once you do that, you can view your piston “live” in a browser via an url. There, you can tap the picture icon, then save it to your phone or computer.

1 Like

Thanks for all your help.
I have a far better understanding now :slight_smile:

1 Like

What’s the best way to accomplish this:

  • If Motion Sensor is inactive for 10 minutes AND Lamp 1 OR Lamp 2 is on then Set Level of Lamp to 30%. I only want to set the level on the lamp(s) that were already on.

  • And then if Motion is active AND Lamp 1 OR Lamp 2 are on, Set Level to 70% but again only on the lamp(s) that were already on. This is basically to undo the dimming that the above may have done. I guess it does not matter if the lamp(s) had been dimmed or not for this rule to fire.

I have a SmartLighting rule that turns on the lamps and turning off is done manually.

I’m hoping one of you fine people can tell me what an idiot i’m being and explain why this (what looked) simple load attribute from variable is not working.

I’ve setup a Core piston that reads a setpoint from a heating thermostat and stores that in a variable. I then create a new variable which is OriginalVariable+3 and now i’m trying to pass that to a DTH but the value always seems to be null.

The DTH defines the attribute:

attribute "corenextHeatingSetpoint", "number"

and i’ve defined a command which all i want right now is to log debug the message into Live Logging.

Code for command is:

def CoreUpdate() {
	log.debug "Core Updated Setpoint to:$corenextHeatingSetpoint"
}

All i get from Live Logging is
19:18:09: debug Core Updated Setpoint to:null

I know the Local Variables are populated in Core, at the moment “LivingRoomTemp” = 21 & “MasterTemp” = 18 as they show up when checked in Core so could someone please point me in the right direction to what i’m doing wrong

Since you have conditions that are not the same for both lights then I would break it up so that each light has it’s own rules but still combined in the same Piston. You could also use 2 latching pistons. One for each light. However, the below should work. The only problem is that some switches reports levels even if the switch is off. So the “Group within the Group” should fix that issue. Seems like a lot but it’s a good exercise!

Basic Piston in Expert Mode

Add Group
Add Conditions
If Motion Sensor IS inactive
AND
Add Sub Group
Add Conditions
Lamp 1 IS Greater Than 30%
And
Lamp 1 IS ON
When True (for Entire Group)<—back out until you see all of the conditions above and then add the When True
Using Lamp 1
Wait 10 minutes
Set Level to 30%
Cancel on Piston State Change

OR (used to separate scenarios)

Add Group
Add Conditions
If Motion Sensor IS inactive
AND
Add Sub Group
Add Conditions
Lamp 2 IS Greater Than 30%
And
Lamp 2 IS ON
When True (for Entire Group)<—back out until you see all of the conditions above and then add the When True
Using Lamp 2
Wait 10 minutes
Set Level to 30%
Cancel on Piston State Change

OR

Add Group
Add Conditions
If Motion Sensor IS active
AND
Add Sup Group
Add Conditions
Lamp 1 IS Less Than 70%
And
Lamp 1 IS on
When True (for entire group)
Using Lamp 1
Set Level to 70%

OR

Add Group
Add Conditions
If Motion Sensor IS active
AND
Add Sup Group
Add Conditions
Lamp 2 IS Less Than 70%
And
Lamp 2 IS on
When True (for entire group)
Using Lamp 2
Set Level to 70%

Awesome. I’ll give this a try as soon as I can. Thanks!

Hi @rontalley i think ive got all that set up now will see in the morning thanks pal

Hmmm…somethings off here.

In your primary IF you don’t have the And Variable {Test} (as number) is less than 2…

OH, wait I see. You need to put all 3 conditions in the Primary IF

The When True need to be for all 3 conditions

If
Add Group
Add the 3 conditions
Back out until you see the Condition 1 and Condition 2 and Condition 3…this is where you put the When True stuff

Then you need to change the AND before Time is before midnight (Should be Time Happens at Midnight) to OR

It should look something like this. Notice how the red line follows the logic. The When True is for when all 3 conditions are met. When they are true, the line turns blue.

1 Like

That was genius. Working great.

Your instructions were easy to follow as well.

Thanks!

1 Like

Thanks @DarellCraighead. I forgot about latching. Here’s what I have now with all my doors in one piston. Seems to work better now but I’ll test some more. Virtual door will always open 20 second after physical door even if the physical door is quickly opens and closes.

@twodaend, yeah, I’d like to have them all in one piston - I have 8 separate pistons for my vDoors (and vMotions). Let me know how your testing goes - at first glance I suspect the logic may not quite work.

Try this. Open one door and leave it open. Then open another door and close it (before the first door has been open 20 seconds). My suspicion is when the piston changes state any pending actions in the first half will stop and the first vDoor will not ever change to open.

From your previous piston I walked around opening and closing doors and got some really weird results.

But hey, if your solution does work - I’ll do the work to put all 8 of mine into one piston :slight_smile:

@DarellCraighead

Sorry for the long post. I did a couple of test and it looks like it works. With the quick open and close, the times are not exactly 10 seconds apart for closing, but it does to que up the command to open and close in order

  1. Open Sliding Door
    2017-04-25 8:15:03.432 PM CDT

  2. Open Front Door
    2017-04-25 8:15:10.784 PM CDT

  3. Closed Front Door
    2017-04-25 8:15:12.459 PM CDT

  4. Closed Sliding Door
    2017-04-25 8:15:20.387 PM CDT

  5. vSliding Door Open App Command
    2017-04-25 8:15:24.697 PM CDT

5a) vSlding Door Open
2017-04-25 8:15:24.710 PM CDT

  1. vFront Door Open App Command
    2017-04-25 8:15:31.675 PM CDT

6a) vFront Door Open
2017-04-25 8:15:31.689 PM CDT

  1. vFront Door Closed App Command
    2017-04-25 8:15:42.723 PM CDT

7a) vFront Door Closed
2017-04-25 8:15:42.798 PM CDT

  1. vSliding Door Closed App Command
    2017-04-25 8:15:42.880 PM CDT

8a) vSlding Door Closed
2017-04-25 8:15:42.896 PM CDT

@ady624, Does CoRE/ST do some sort of scheduling que? Just trying to figure out why this works, not that I’m complaining because it seems as though it does.

I’d like to do the following; but not quite sure the best way

If Button is Pressed
| Using Bedroom Light
| | Toggle()
Else If Button is Held
| Using Bedroom Light
| | If Level > 40%
| | | Adjust Level -20%
| | Else
| | | Adjust Level To 100%

But when I try to do an if statement within the Do block I have access to lots of variables, but none of them appear to be the bulb level.
Also “using” Button I cannot seem to access the Bedroom Light variables, but even if I could then I cannot work out how to do multiple if statements to make it work.
I know I can do it with 2 seperate Pistons, but trying to keep CoRe as clean as possible

Thanks @rontalley I didn’t see your post till just now.
Yeah I figured i had it wrong this morning as i set it to 2 mins to test and it came on then went off as it should but then did it again twice more when my wife and son walked down the stairs.
I’ll alter it to your suggestion thanks :slight_smile:

1 Like

Use a Basic Piston in Expert Mode. You have to go to CoRE setting to enable expert mode…

If
Add Condition
Button is Pressed
When True
Using Bedroom Light
Toggle

OR (Used as a separator for multiple arguments)

If
Add Group
Add Conditions
Button is Held
AND
Light Level is Greater Than 40%
When True (for Group…back out until you see the above 2 conditions. This is where you use When True)
Using (Dimmable Light) Bedroom Light
Set Level Level to 20%

OR

If
Add Group
Add Conditions
Button is Held
AND
Light Level is Less Than 40%
When True (for Group…back out until you see the above 2 conditions. This is where you use When True)
Using (Dimmable Light) Bedroom Light
Set Level Level to 100%

1 Like

I think I’ve cracked it. I had to make a normal basic piston, then go back in and create a group. To be honest I hadn’t noticed or used the group option so that’s what threw me off. Now I now how to use groups I might have to go through and tidy up some of my other Pistons, that’s another evening lost!

1 Like

Yeah, I mostly use Basic Pistons for most of what I do. They are really powerful in expert mode. Here is an example of a Piston for one of my minimotes. I get ALOT out of a cheap $10 remote.

2 Likes