Change background color of a button when any alarm is active

Hey !

All I want is in the title. I want that when any alarm is active, the background color of the button turn to red for example and when there is no active alarm it turns back to blue.

Thanks for your help !

something like len(system.alarm.queryStatus()) > 0 on a binding to the backgroundColor style property of you button should do it

Be careful with that, it could hang your UI if the call takes a while.
I wouldn’t do this just like that, but make that call somewhere else, maybe in a timer script, and use that to write a boolean tag that indicates if there are active alarms, then bind to that tag.