Random timer

For Halloween, I have a Thunderstorm strobe light. The annoying thing is it is constant and doesn’t simulate a storm very well. I was hoping somebody could help me as I have a Z-wave outlet that I would like to plug it into and make it randomly stay on from 1-4 seconds and randomly stay off for 6-10 seconds or so.

TIA

i use the fantastic plugin “countdown timer” and give it a random duration. Something like this:

luup.call_action("urn:futzle-com:serviceId:CountdownTimer1", "SetTimerDuration", { newDuration = math.random(120,500) }, TIMER_DEV)	

You could do this with PLEG

A schedule name Lightning with Interval On 1 sec + random 3 secs, Off Interval 6 Sec + ran 4 sec.
A schedule for NightDisplay (On Sunset + 30 minutes, Off at 22:00:00)

Then a condition:
LightOn Lightning and NightDisplay
LightOff !LightOn

Action for LightOn - Turn on the light
Action for LightOff - Turn off the light