I’ve just started with automation and I’m not able to get this to work -
Switch off a smart plug if no motion is detected for 5 minutes. If the switch is turned on manually, the automation should work again (Meaning if there’s no motion for 5 minutes, switch off the smart plug)
First off all, your indentation is not correct, but that could be the cutting and pasting.
But most important: your logic is not correct. The trigger should be : no motion detected for 5 minutes.
The condition (but not really needed) : the plug is on
Why not really needed : it does not hurt to switch off a plug which is not on.
Keep in mind: this automation will only trigger if your motion sensor detected motion, it changed its state to no motion detected, and then 30 seconds passed. If you start in a situation where the motion sensor is in the state ‘no motion detected’, you can wait a lifetime (or until the motion sensor detects motion, and then again no motion) before that automation will trigger.