The goal is to turn off smartplug if there’s no motion detected for X minutes.
I’m using “new” ST app (not classic one).
New automation rule:
If the smart plug is on
AND
no motion is detected for X minutes
THEN
it’s needed to turn off the smart plug, but it’s impossible to choose this device during this step.
Seems like it’s impossible to set the state of a device depending on its condition.
Correct, in the new app (STSC) you can’t have the same device in both “IF” and “THEN”. One quick workaround would be to create a virtual switch with a Smart Lights rule that mirrors the plug status, and substitute that as your “IF”.
Yes, it looks absolutely logic to use only no motion for X minutes in IF. And yes it works fine. Until you want to get some notifications along with turning off the smart plug.
For example, if you set up such automation rule:
IF
there’s no motion for X minutes
THEN
turn off the smart plug
AND
send notification “the smart plug is off”
you’ll get your smart plug turned off and then infinite notifications, because, yes, no motion detected for X minutes.