Open a Popup without a component event

I’m trying to create some alarm popups for my perspective project. I’m using a component change script to monitor the change in value to set off an alarm popup using system.perspective.openPopup. My issue is that to use openPopup I need to have a pop up id from a configured pop up event. I don’t want to use a configured event to open it. I want it just to be triggered from a value change. I thought about using a message handler but I would still need to use system.perspective.openPopup. I have it set with an onWheel event just to create the pop up id i can use to call from the change script. Is there another way to create a pop up id or any way around using it? the popup works as i want it to but just curious if there is a better way or if I'm missing something?

Thanks!!

The id is only to identify the popup instance, for example:

Id = 'Temp Alarm'
view = 'someView'
system.perspective.openPopup(Id, view)

#from some other event/script you can close the popup using
system.perspective.closePopup('Temp Alarm')

If you want a random popup uid you can use this function I got from the exchange

from java.security import SecureRandom
from java.util import Base64

def generateIdentifier():
    """Generates a popup identifer following the existing IA style

    Returns:
        A random base64 string
    """

    random = SecureRandom()
    encoder = Base64.getUrlEncoder().withoutPadding()

    randId = random.getSeed(6)
    return encoder.encodeToString(randId)