Noobie Question: Execute Piston or Time happens at


#1

I’ve been using WebCore since day one, I feel I’ve gotten fairly experienced with it…until now…LOL. I’ve run into what I feel is like a day one question, and I’m confused. I’ve searched previous posts, and there are lots similar, but I didn’t find one for exactly what I was looking for. And the few I found that were very close, were at least a year or two old, so the answers may have changed since.

I have a piston that controls all of the lights in my house, it runs at many different times of day, it can be triggered by a routine, or a location change, etc.
download%20(1)

How do I add the ability for this piston to be executed by another piston? When I try executing it, it fails because none of the conditions in the screenshot are met. I was hoping there would be some way to add another OR clause to the condition that says OR executed by another piston…but I don’t see that option.

How do I go about doing this? Am I missing something super simple? I realize that I can strip out all of the conditional logic into a separate piston and make it so that the piston is only ever executed by other pistons. But I don’t know if there’s other ways to do it.


#2

hi @chadbaldwin,
I am not sure what you are trying to accomplish or mean by executing this piston that will be executed by timers?
and I hear that you’ve been using webCore for a while now. So i am just going to shoot blind here :)))

How do I add the ability for this piston to be executed by another piston?
Do you want to control your lights from another piston regardless of timers?
or do you want to stop these timers and start again at will?
Have you tried PAUSE PISTON??? (And you can resume this piston from another piston)
or just like “location change trigger” you can add a simulated switch and when it’s ON it will be triggered.

IF Routine executes set bulb defaults
OR
Location mode changes
OR
Simulated swtich changes to ON
OR
Time happens daily at
so on…

Sorry I am not 100% clear on what you want…


#3

In the other piston, you could pass the URL with arguments at the end of it. Such as:

https://api.smartthings.com/api/token/123/smartapps/installations/abc/execute/:def:?from=piston

(I added “?from=piston” to the end of the URL)

Then in this piston, just add another condition:

IF {$args.from} is ‘piston’

Here is a sample snippet from one of mine:

temp


#4

So I just realized that all I need to do is tell my other piston to run the “Set Bulb Defaults” routine and that will accomplish what I need in this instance. But yeah…So it sounds like there isn’t really a direct way to do this. I like that method of passing in the URL though…


#5

One simple way to do what I think you want is take all the action out of the ‘if’ statement. Just put a noop there to get the triggers to execute your piston but then any time the piston is executed either by a trigger or forced execution, the actions will always happen. Is that what you want?

e.g.
IF Routine executes set bulb defaults
OR
Location mode changes
OR
Simulated swtich changes to ON
OR
Time happens daily at
then
NOOP
endif
Set lights