Piezo Actions: Quick Beep on contact open/close possible?

I've read through the online docs, and the forums and didn't find anything similarly answered.

Currently, the piezo stays ON until the contact is closed; I'm looking for a way to have it "chirp" 3 times consecutively/quickly on open and on close; similar to most standard alarm systems.

I have only been able to find a way in the SmartThings app to set the piezo sound ON to a minimum of 1 minute (duration WAY to long and no repeat option).

My piezo is connected to the GRD and OUT on the side (not the zone terminals) on the add-on panel.

Thanks in advance!

Did you figure this out yet? Mine beeps, but the pattern is never consistent and sometimes it stays on for like 10 seconds.  Any help would be great.

Using Hubitat. I wanted one beep for open and two quick beeps for close using a single piezo.

I edited the beep driver, assigning the original to the ‘push’ action (tone device) and a new beep2 to ‘on’ action (switch device). Default time settings changed to simulate beeps I wanted. Just edit the driver and save. Here’s a copy of the section of driver code I changed:

def on() {
beep2()
}

def push() {
beep()
}

def beep() {
parent.deviceUpdateDeviceState(device.deviceNetworkId, triggerLevel(), [
momentary : beepDuration ?: 150,
pause : beepPause ?: 150,
times : beepRepeat ?: 1
])
}

def beep2() {
parent.deviceUpdateDeviceState(device.deviceNetworkId, triggerLevel(), [
momentary : beepDuration ?: 150,
pause : beepPause ?: 50,
times : beepRepeat ?:2
])
}