CoRE - Get peer assistance here with setting up Pistons

Is this a piston restriction or an action restriction?

Unfortunatelly, the task you ask of individual actions are scheduled just like the rest of actions. This means they are “executed” later, which means the values you set won’t be available to the next condition being evaluated. This is to be able to handle 20s timeouts…

It is a Action restriction.

I’m a but confused by the explanation.

I tried something else and it looks to be working if I set a variable on the condition’s true or false evaluation.

I’m still trying to figure out how to get my bedtime fade routine running. When I use fade to, it is quite unpredictable. It was set up so that if there is no motion, begin to fade. But if there is motion, I want the fade to cancel and the light to go back to 80%.

Since it didn’t work with the ‘simple’ method… I went complicated. This one works better, but it’s unpredictable still. It faded properly on first try yesterday… then didn’t work for a while, then at night I messed with the level of the lamp manually and the fade kicked back to working. So it seems like maybe this is getting out of sync or something.

Here’s what I tried this time. I’m still looking for just the best way to get that reliable fade with fade cancellation.


So I thought I would close the loop on this question/discussion. The best you can do with my use case is 2 pistons. The first piston being used to calculate the average temperature and save it to a global variable. And then the second piston has several triggers with individual actions. And with the way the triggers are setup only one can possibly be true when the average temperature changes.

House - Calc Avg Temp

House Fans - Auto-Adjust

I tried getting it down to one piston but that isn’t possible because variables (global or local) aren’t available to later conditions within the same piston.

I may not be understanding your verbiage correctly. With that in mind, are you saying that if you save a state and then attempt to recall that state within the same piston, that it will not function?

I tried doing the same using a variable with string data type and it worked when I used it in the send SMS action, so I don’t understand why the variable I set earlier on will not work as a action restriction variable :sweat:

I am having an issue getting CoRE working at all.
I want to leave Rule Machine behind, so I installed the app, enabled OAUTH, and set off to make my first piston.
A very simple one to test. "When The time is xx:xx then turn on outlet."
Wont work. I can turn on and off via Smartthings app just fine, but CoRE will not turn it on at the time I am designating. Any ideas?
Its the Smartthings Smart Outlet.

can you show screenshot of piston?

What I’m saying is that if you save a state or attribute to a variable it can not be used in a later condition within the same piston. It can be used within an action that occurs after the initial action of saving but not a condition within the same piston. The act of saving is an action which all actions are scheduled to occur after all of the conditions have been evaluated.

So in your example saving the state is an action and the recall that state is an action. This should function as long as the recall is after the save. In my use case I was trying to use the save in a later condition within the same piston.

I hope this helps and @ady624 correct me if I’m wrong.

2 Likes

This is because the act of setting the string data type is an action. All actions occur after all conditions have been evaluated. The act of sending the SMS is also an action which I’m assuming followed the act of setting the string data type. So that’s why that worked. Action restriction are a part of the conditions evaluation so the string data type isn’t set when it’s evaluating the condition (with action restriction).

@ady624, again please correct me if I’m wrong.

2 Likes


Just tried doing something simple
I’m sure I’m missing something

Past 1259PM?

Doesn’t engage. Tried changing it to “time is after”
As well but still won’t turn it on.

The above all makes sense, but if I am setting a variable on a condition, and I do not use that variable in any other condition within the current Piston again (it will only be used to restrict an action), shouldn’t that work?

Is the restrict of an action in the same piston?

Yes, I am trying to use the variable I set in the condition to restrict an action in the same piston.

OK, let me try and explain this…

If Condition #1
Individual Action #1 (Set Variable)

Then
Action #2 (restricted by variable set in Individual Action #1)

I think this is your scenario.

So your piston fires and it evaluates Condition #1 which is true, so it schedules the Individual Action #1 to occur (doesn’t actually perform this action, just schedules it)

And because Condition #1 is true it schedules Action #2 (Since the Individual Action #1 has been schedule but not run the restriction doesn’t work).

And finally the scheduled actions (Individual Action #1 & Action #2) run. Does this help to clarify it?

2 Likes

You are very right Sir, if you would excuse my “very” :slight_smile:

1 Like