How to set up a trigger consisting of a switch toggling quickly between on and off?

Hi all,
I would like to set up an automation where the trigger is a binary sensor toggling quickly between on and off.
This is how my old analog alarm system shows that the security has been breached. I have created a binary sensor measuring voltage. If there is voltage, the alarm is armed, if there is no voltage the alarm is armed. If a door opens while the alarm is armed, the sensor starts to switch between on and off quickly. I want this toggling as a trigger for further action (such as siren sounding or similar).
Does anybody knowledgeable have any idea how such a trigger can be set up in Home Assistant?
I am sorry if this topic has already been discussed somewhere. I wasn’t able to find it. I am still just learning the fundaments of Home Assistant so I apologize if my question is trivial.
Thanks to anybody to steer me in the right direction.
Cheers!
Kutsua