My current Panasonic has a setting for this, but I seem to recall having problems with an earlier Panasonic when using with a Playbar. For various reasons I started using a Logitech Harmony Programmable remote control, which solved the issue, as I was able simply to reduce the TV volume to zero, and get the Logitech to send volume commands to the Playbar, not the TV.
You could just zero the volume and use only the Sonos app for volume on the Beam.
A workaround that has worked for some others is to put a pair of mobile phone headphones in the TV headphone socket (if there is one). That will shut some TVs up. Can't promise it would work for you.