Trigger at random intervals

Hi I was wondering if someone could help?
I wanted to setup an automation to toggle a device but at random intervals, I’d like it to toggle at maximum every 30 minutes, so say the device turns on at 12:00, the earliest it can turn off would be 12:30, but at 12:30 it could roll a random number and then maybe turn off, if not it would check again every 5 minutes?

There are ideas you can use in this topic: Turn light on/off at random time

Thanks, is there a way to get it to trigger 30 minutes from the last trigger, and then start the delay? Because if for example it takes a few attempts to trigger and comes on at 12:55, I don’t want it to go off at 13:00, it would have to be 13:25 at the earliest.

Yes you should be able to do that from the information in the linked topic.

No idea how lol