Nesting/Grouping of Actions


#1

Hello – New here to Webcore so I apologize is this is a basic question:

I want to nest/group multiple Actions under one “name” so that I can call it multiple times throughtout Webcore, without having to re-build/change the actions in multiple places, sort of like a “Virtual Switch” which triggers a “Routine” within Smarrthings, but I’m trying to get away from Smarrthings routines and logic all together.

IF iPhone X Presence changes to Away Then Execute “Z”
IF iPhone Y Presence Changes Away Then Execute “Z”
IF Sunrise Then Execute “Z”

Z= Multiple Actions
Change Mode to Away
Turn off This light
Turn off That Light
Set Temp to 0
etc etc etc.

Thoughts?


#2

Is this something like you’re looking for?


#3

My example above has only one set of actions (based on your request (I think). If, on the other hand, you have different desired actions based on different triggers, I’d use a different Boolean variable for each trigger (case) to call a different matching ‘IF’ block for each action or group of actions. You can have any number of IF’s in the same piston to handle this structure.

You can also (to further confuse you) have one piston call an other piston too.


#4

Thanks guys. I’ve endes up using multiple different pistons to execute another piston, thus only having to write the piston once. Seems like it’s working! Thanks!


#5

That would be my suggestion. I have many pistons with no triggers in the code.

The piston shows this up top:

This way, that piston can be called (executed) by any other piston.

  • Sunrise
  • Leave Home
  • etc

#6

Yes, that was my parting suggestion - as in, “You can also (to further confuse you) have one piston call another piston too.” Glad you got it solved.