Rule to trigger plug for a few minutes and then off

Is there a way to create a rule that uses motion detected by the Wyze camera to turn on the Wyze plug for 10 minutes and then turn it off during certain hours (ex: 2200 to 0700) ?

Did you ever find a solution to this? I seem to be able to make mine do it by using the trigger rule:

WHEN: Plug_Name has been on for xx:xx:xx (time)

DO: Action Plug_Name Turns Off

IF: Time (turn this on) - Start Time xx:xx - End Time xx:xx

It will complain every time you save a rule like that that you have the “trigger and action for the same device”, so you have to declare that you know what you are doing and are not creating an infinite loop… or something like that. But it’s working pretty well. I’m not sure it works every time… because I find the light on at strange times. That may be a haywire vacation mode (which is now turned off)