Hi and welcome to the forums!
I’m not sure if I understood exactly the issue here, so apologies in advance if something isn’t correct for your use case, but if your smart home system has an API available you could use it to switch the subwoofer’s socket on whenever it’s appropriate (e.g. when you receive some data from the audio stream, from a power-on event on a local-network web interface, a bluetooth service, …).
So the general process of your application, regardless of the language you choose, would be:
- CTA to power on the socket
- signal your smart-home to power on the subwoofer’s socket
- start streaming audio to the device (it seems like you already have a way to do this though, so you don’t have to reinvent the wheel in this case)
If you need anything else, please add any more information and issues so we can try to figure it out.