I’ve never used anything like this but I would think if there is motion then it will store the state as you wish.
Then set the level to 100%.
Wait 5 mins and then restore the original state if no more motion is detected.
If motion is detected again in the 5 minute window the piston will re-evaluate and save the level and switch state again, which is on and 100%.
This is all an assumption as I have never done anything like this.
You may have to amend this to take this into account. Give it a try for both scenarios and see what happens.