Automatically change device configuration (Audio input and audio output) when connected to specific hardware

I have a MBP that I use in two locations; main office and my home office. I have a CalDigit TS3Plus docking station in both locations. In my main office, I have speakers and a microphone connected to the TS3Plus and I use them for audio output and audio input. I also have a BT connected keyboard and mouse.

When I am in my home office, I only have a microphone connected to the TS3Plus (no speakers). It is not the same microphone I have in my main office. I have a wired keyboard that is also plugged in the the TS3Plus. Since I don't have speakers in my home office, I need to use the speakers on my MPB.

Is there a way to automatically detect when I am connected to a specific TS3Plus and have the audio input and output devices change automatically? Or, if a specific keyboard is detected...or a specific microphone?

I don't want to trigger on network because I don't always want to be on a given network...I only want the changes when the cable is connected.

Related: Microsoft Teams seems to not respect the default configurations in the Sound system preferences pane. Is there a way to force that to happen...or have BTT assist with that too?

Thanks for any help

Steve