Streamdeck - Change Button Appearance on press?

Is there a way (using BTT) to toggle the color of a streamdeck button on press? I'm trying to configure so that the background color of a button changes when pressed.

Here is what I've done so far:

  1. I've created a folder that includes various Zoom meeting controls
  2. Within this folder, I've included a button for Mute and also a button for Video On/Off
  3. When either of these buttons is pressed, a keyboard shortcut is sent for the (global) zoom mute/unmute command or video on/off command

The problem is that I don't know the current state of mute or video unless I switch over to zoom and look. I'd like for the buttons to change color when pressed.

Here are the solutions I've considered:

  1. Having multiple groups with different colored icons and on button press switching to a different group (ie - Switch to "Zoom - Mute Red Background"), but this gets tricky when I try to solve for the independent state of two toggles (mute/video)
  2. Applescript + RegEx - A bit over my head but with time I think I could eventually get it working, but wanted to see if there is an easier option before I embark on this quest

I was hoping to see something like a set of if/then commands I could implement, ie: If mute button is green and its pressed, then change to red.

Thanks in advance!

This might help …

I had similar issue to define a stream deck button to show the "play" and "stop" state in Ableton Live.

With the "Apple Script Widget" you can define two buttons which will change when the regex value ( =off ) is matched/not matched.
A java script is used to return a different value for the regex match (on or off in my case) depending on the play state.

The script runs every 2 seconds so the button is updated if the state changes.

Thanks for the tips! Spent some time with this and couldn't quite get it working, but I found a solution using Keyboard Maestro:

It doesn't change the color on Streamdeck, but changing the desktop background to red when muted gives an effective visual queue so it works for me.