The SmartThings app got updated with “precondition” in App automation.
Still, there’s no documentation of “if” statement in Rules API to use “precondition”. SmartThings API (samsung.com)
Is there any way to use “if” statement with “precondition” in Rules API?
I was thinking of migrating my automation from WebCoRE to Rules API, but I was stuck with condition/trigger problem. Until now, all of “if” statement in Rules API were trigger.
But now, it seems that precondition is implemented, so I hope to use this in Rules API.
That is frustrating me too. Obviously you can do a condition with the subscription disabled but that doesn’t seem to be quite the same thing as Rules only log an activation when preconditions are met.
Also:
As Automations can do ‘if motion is inactive for ten minutes’ there must be a remains/stays capability. It is not the same as a sleep.
What about button presses? Buttons don’t change attributes so you need the webCoRE ‘gets’ type functionality if there is more than one condition. You can’t even use ‘changes’ and that isn’t documented anyway.
How do you execute Scenes or send notifications?
Having had webCoRE and STHM deleted in bizarre circumstances last night, I want Rules more than ever. Automations are not a safe option.
I was aware you’d be able to do that. However what if your rule runs when the button hasn’t just been pushed, for example you execute it manually? Or what if you want button1 and button2 to do different things? Or you also run the Rule when a contact opens? There isn’t a Ready/Standby so a single value button is always set to pushed.
You’re right, the condition for the Switch should have “Never” in the trigger property. Otherwise, the Rule would be executed even if the button wasn’t pressed.
For others to take reference, here are two samples of a similar Use Case: