I would probably pass arguments at the end of the External URL.
- Create a piston in webCoRE.
- Take note of the External URL
- Each shortcut can have a different argument added to the end of the URL
For example, the External URL for the piston may be:
https://api.smartthings.com/api/token/123abc/smartapps/installations/456def/execute/:789abc:
You can add an argument (?FanTimer=one) to the end of the URL. Such as:
https://api.smartthings.com/api/token/123abc/smartapps/installations/456def/execute/:789abc:?FanTimer=one
The four shortcuts can all have slightly different endings:
- ?FanTimer=one
- ?FanTimer=two
- ?FanTimer=four
- ?FanTimer=eight
Then, back inside that piston, you can structure it something like this:
IF {$args.FanTimer} is 'one'
Then With Fan (TCP set to Never)
Turn on
Wait 1 hour
Turn off
END IF
IF {$args.FanTimer} is 'two'
Then With Fan (TCP set to Never)
Turn on
Wait 2 hours
Turn off
END IF
IF {$args.FanTimer} is 'four'
Then With Fan (TCP set to Never)
Turn on
Wait 4 hours
Turn off
END IF
IF {$args.FanTimer} is 'eight'
Then With Fan (TCP set to Never)
Turn on
Wait 8 hours
Turn off
END IF
Basically, each of the shortcuts triggers
the same piston, but depending on the end of the URL, it only activates one of the IF blocks.