Close Shutter after when light sensor is 5 minutes over 30000 lx

Hey guys, i am a newbie in HA but getting better with the daily work around HA.
But now i need your help.
I have a light sensor which give me an lx value. If the value is e.g. over 30000lx the shutter from my office window will be closed with an automation(automation runs every 10 minutes). The same for opening the shutter…But my Problem is when it is a cloudy day it will open and close the shutter maybe 10 times a day, what doesnt make sense.

Is there a way to create a condition that the lx value must be 5 minutes more or less than the given trigger value?

Hope you can help.