Restore not restoring

I have a RM rule that when my motion sensor on the porch is triggered, it turns outside lights up full, waits 5 minutes and returns them to the previous state.

Lights are at 20% when triggered and CAPTURED. When RESTORED they turn OFF. Not back to 20% where they were.

What am I doing wrong?

You would need to post a screen shot of the "events" tab of the rule when it runs to better see what happens.

On a side note your delay set here is for 5 seconds but you state above the delay is supposed to be for 5 minutes.

Try the rule written this way and see if it helps.

I set it for 5 seconds to test. Better than waiting 5 minutes to see if it worked.

Log.
It says it has Capture the devices. But when it restores them, they are at 0%. Not the original 20%.

Make the 5 seconds longer, and grab a screenshot of Application State from the App Status page (gear icon) during the interim.

I increased delay and grabbed screens. Lights started at 25%. Triggered raised them to 100%.
After the rule ended, the lights turned off completely instead of restoring to 25%.

Well, you can see that the captured device state is switch: off, and level: 1. Which at least explains the second half of the puzzle.

So now the question is why is it seeing those values at the time of capture. Perhaps we could try to grab the values in the rule. Try this below: Notice use of Wait for Elapsed Time instead of cancellable delay and Cancel Delayed Actions. This Wait is automatically cancelled when the rule is retriggered by motion active. See that I created two local variables, and stuff the state of the dimmers in there just before the Capture, so we can see what it looks like. It would also be useful if you could post the device Events from the device page for one of these after your current rule fails.

Here is the grabbing of the dimmer state:

I tried to emulate your example. These dimmers are Zooz dimmers and I assume I need to capture the Level of the dimmers.
So instead of String I used number for the local variables. I got some error that crashed my app when I used String and couldn't edit it. Had to delete and start over.

My log appears to be capturing level of 1 from the dimmers.
When it restores, it restores to level 1 which is so dim the LED lights appear to be off.

Is this a problem with the drivers for the Zooz dimmers. https://www.amazon.com/gp/product/B074V8PG51

So it seems my Zooz dimmers are not returning the correct Level. I've tried all kinds of ways of capturing them and it always comes back as (1).

I think a workaround is to have the app that sets the dimmers also set a Global Variable. Then this app can restore lights to whatever the Global Variable is set at.