CoRE - Get peer assistance here with setting up Pistons

Triggers are events, you cannot have all doors close at the same exact time, which explains the lack of All. Try using a condition (is closed) instead.

This was a very helpful tip. I have my Intermatic PE653 pool controller (partially) run by CoRE pistons and its switches, in particular, my pool light, at the DTH level do not update reliably. This was causing CoRE to not always turn it off consistently. I disabled command optimization and haven’t seen the failure in limited testing.

As it happens, I used Smart Lighting to turn it on, from which I’ve not observed a failure. My conclusion is that SL does not attempt to optimize, i.e. skip redundant, commands but CoRE does, in default mode.

Does that make sense?

@ady624 Do you recommend turning off command optimization liberally in cases where the DTH synchronization is problematic?

1 Like

Got another Piston I trying to get working with little success. This is what I have


If: Pool Aux Multisensor acceleration did not change in the last 360 minutes.
Then: Send Push notification ’ Pool Aux Pump did not turn on within the last six hours.’

Basically I am using a smartthings multipurpose sensor to verify my pump actually ran. It’s stuck right to the pump and the accelerometer shows up as being active when its running. I decreased the time to 5 minutes to test it out, and it worked when I first created the piston. However, it never worked again after that, no matter what I changed the minutes too.

Disable away. Only benefit of the optimizations is that it seems that ST is faster to check the state of a switch than execute a command, thus saving time. But there’s no time to save where it doesn’t need saving :slight_smile:

1 Like

Ah, where’s that thumbs down haha .

Thanks for the response. Hmm, how do you distinguish between a Condition vs a Trigger in the UI? Is a solid dot a trigger, but a hollow circle a condition? (Screenshot attached)

If that’s the case, if I create a Condition that just says “Each of (my presence sensors) --> IS NOT --> Present”, will that fire as soon as they both go away? And will it constantly fire until they come back?

Nothing constantly fires in ST. Except for the power outlets that flood ST with power updates :smiley:

Both conditions (empty circle) and triggers (full dots) work exactly the same, in how they respond to events. But some triggers are more contextual (stays x for y minutes for example, it adds time as a second dimension). When triggers and conditions are mixed together, triggers can listen for events, conditions will take a secondary role of “restrictions” for when the triggers receive an event. To answer your question, Each of sensors is not present will fire any time one of the selected sensors changes presence, either arrives or leaves. If all sensors are away, the condition will be true, otherwise false. But it will only “fire” when a presence sensor changes.

Will this turn on the light when one of the doors is opened or there is motion and the light is already off and the time is between 10:30 and sunrise?
Could’ve I created this with a simple piston?

@Ross

Yes, this can be done with a simple piston. Just place the to three conditions in the IF block with AND separating them.
You do not need the "light is off"condition.

The “light is off” condition is there because I don’t want to turn it off after the 20 minutes if it was already on. So I figured the way to keep that from happening would be to only run this if its off? Make sense or am I over complicating things.

I’m pretty sure it will turn off anyway. If you want it to stay remove the turn off command. Then you have to turn it off manually.

You can put the turn off in the else block, then all of the conditions must be false before it will turn off

@Ross one problem you’ll have is that if you stay in the room for 20 minutes, the light will turn off at the end and leave you in the dark. Motion sensors won’t send any events if you keep moving, allowing the 20 minutes to elapse and the light to turn off. You need to turn the light off on a motion inactive event, this way the light will be on as long as you’re in the room. This is what I did for my kitchen:

It’s a bit more complicated because:

  1. I have two motion sensors that need to go quiet for lights to go off - but only one turns the light on - this is because the left sensor sees into the dining room too and I don’t want the kitchen lights on if I pass through there
  2. if I turn the lights on manually, they’ll stay on indefinitely - that’s what the variable does there - I could have used a local variable as well (without the @)
  3. at night, lights come on dimmed, for obvious reasons - may be looking for a beer, not for a white flash :smiley:
1 Like

Oh I like that idea of the autolight variable
that’s way easier than what I’m doing. Manually flicking the lights won’t disrupt it once it’s true though, do you have another piston that on physical switch set’s the variable to false? Then another portion to do a timeout after a long time just to make sure the light does get shut off? Hum
more ideas coming into the gray matter.

hi, i really appreciate the core smart app. i just started automating with it a few days ago and have a basic piston setup. i have a few questions tho:

  1. what is the difference between the two capabilities ‘location mode’ and ‘mode’?
  2. every screen change (even going back a screen) results in a spinning wheel icon before displaying the screen - is core fetching data on every screen change?

Hi Matt,

  1. no difference, just there because some people look for Mode, some for Location Mode
  2. CoRE submits data most of the time when you change values in fields because they may change the content of the page - all forms are dynamic

@ady624

Do you know why this piston keeps repeating, even after the variable is reset?

The BREAK only works inside an IF - END IF block. You’re missing the END IF. You’re also using the repeat action - which is not inside the IF - END IF.

Example please?

Use a begin IF block. Put condition in it.
Optionally use a break if task - you should not need it - it exits IFs and WHILEs
Add whatever tasks are conditioned
Add an end IF block

But mostly, try a follow up instead of repeat all actions

Follow won’t work due to the triggers above.