Sonos Sub Audio Level

After looking at the full dump, I realized the extra stuff I was seeing in the file shouldn’t be a problem to post, however, the whole thing is too long to post. If you need any other specific sections, please let me know.

One thing I did notice…I was wrong earlier when I stated that all of my Sonos units have a sub attached. One of them doesn’t. That’s the one in the garage. Looking through the dump, the garage unit has “sub_enabled”: “1” just like all of the others. That’s disappointing as I thought that might be the key.

I wondered if maybe the third party SW could be discovered via error; for example, grab the current sub level and test setting it to the same level to see if it would throw an error for not having a sub, but I tried that on the garage unit and it produced no error.

There HAS to be something though as the Sonos App hides the subwoofer controls if nothing is plugged into to the subwoofer output.

Sorry, been a bit busy and just looked at your diagnostic output. Unfortunately you got unlucky when you grabbed it as it doesn’t contain the ZoneGroupState payload. Can you grab it using this script? This should show what speakers/capabilities are in each room. It doesn’t matter which speaker you point at–it will get the layout of the complete Sonos system.

import soco
amp = soco.SoCo("10.6.9.224")
zgs = amp.zoneGroupTopology.GetZoneGroupState()["ZoneGroupState"]
print(zgs)

Here you go:

<ZoneGroupState>
    <ZoneGroups>
        <ZoneGroup Coordinator="RINCON_C438755A43BE01400" ID="RINCON_C438755A43BE01400:509930175">
            <ZoneGroupMember UUID="RINCON_C438755A43BE01400"
                Location="http://192.168.1.202:1400/xml/device_description.xml"
                ZoneName="Family Room" Icon="" Configuration="1" SoftwareVersion="71.1-38240"
                SWGen="2" MinCompatibleVersion="70.0-00000" LegacyCompatibleVersion="58.0-00000"
                BootSeq="4" TVConfigurationError="1" HdmiCecAvailable="1" WirelessMode="0"
                WirelessLeafOnly="0" ChannelFreq="2437" BehindWifiExtender="0" WifiEnabled="1"
                EthLink="1" Orientation="0" RoomCalibrationState="4" SecureRegState="3"
                VoiceConfigState="0" MicEnabled="0" AirPlayEnabled="1" IdleState="1"
                MoreInfo="TargetRoomName:Family Room" SSLPort="1443" HHSSLPort="1843"/>
        </ZoneGroup>
        <ZoneGroup Coordinator="RINCON_C438755A442A01400" ID="RINCON_C438755A442A01400:2317453485">
            <ZoneGroupMember UUID="RINCON_C438755A442A01400"
                Location="http://192.168.1.174:1400/xml/device_description.xml" ZoneName="Game Room"
                Icon="" Configuration="1" SoftwareVersion="71.1-38240" SWGen="2"
                MinCompatibleVersion="70.0-00000" LegacyCompatibleVersion="58.0-00000" BootSeq="4"
                TVConfigurationError="1" HdmiCecAvailable="1" WirelessMode="0" WirelessLeafOnly="0"
                ChannelFreq="2437" BehindWifiExtender="0" WifiEnabled="1" EthLink="1"
                Orientation="0" RoomCalibrationState="4" SecureRegState="3" VoiceConfigState="0"
                MicEnabled="0" AirPlayEnabled="1" IdleState="1" MoreInfo="" SSLPort="1443"
                HHSSLPort="1843"/>
        </ZoneGroup>
        <ZoneGroup Coordinator="RINCON_C438755A43D301400" ID="RINCON_C438755A43D301400:1513275005">
            <ZoneGroupMember UUID="RINCON_C438755A43D301400"
                Location="http://192.168.1.223:1400/xml/device_description.xml" ZoneName="Garage"
                Icon="" Configuration="1" SoftwareVersion="71.1-38240" SWGen="2"
                MinCompatibleVersion="70.0-00000" LegacyCompatibleVersion="58.0-00000" BootSeq="4"
                TVConfigurationError="1" HdmiCecAvailable="1" WirelessMode="0" WirelessLeafOnly="0"
                ChannelFreq="2437" BehindWifiExtender="0" WifiEnabled="1" EthLink="1"
                Orientation="0" RoomCalibrationState="4" SecureRegState="3" VoiceConfigState="0"
                MicEnabled="0" AirPlayEnabled="1" IdleState="1" MoreInfo="TargetRoomName:Garage"
                SSLPort="1443" HHSSLPort="1843"/>
        </ZoneGroup>
        <ZoneGroup Coordinator="RINCON_C438755A444E01400" ID="RINCON_C438755A444E01400:4163158355">
            <ZoneGroupMember UUID="RINCON_C438755A444E01400"
                Location="http://192.168.1.203:1400/xml/device_description.xml" ZoneName="Office"
                Icon="" Configuration="1" SoftwareVersion="71.1-38240" SWGen="2"
                MinCompatibleVersion="70.0-00000" LegacyCompatibleVersion="58.0-00000" BootSeq="4"
                TVConfigurationError="1" HdmiCecAvailable="1" WirelessMode="0" WirelessLeafOnly="0"
                ChannelFreq="2437" BehindWifiExtender="0" WifiEnabled="1" EthLink="1"
                Orientation="0" RoomCalibrationState="4" SecureRegState="3" VoiceConfigState="0"
                MicEnabled="0" AirPlayEnabled="1" IdleState="1" MoreInfo="TargetRoomName:Office"
                SSLPort="1443" HHSSLPort="1843"/>
        </ZoneGroup>
        <ZoneGroup Coordinator="RINCON_C438755A444B01400" ID="RINCON_C438755A444B01400:2098002004">
            <ZoneGroupMember UUID="RINCON_C438755A445101400"
                Location="http://192.168.1.207:1400/xml/device_description.xml" ZoneName="Patio"
                Icon="" Configuration="1" SoftwareVersion="71.1-38240" SWGen="2"
                MinCompatibleVersion="70.0-00000" LegacyCompatibleVersion="58.0-00000" BootSeq="4"
                TVConfigurationError="1" HdmiCecAvailable="1" WirelessMode="0" WirelessLeafOnly="0"
                ChannelFreq="2437" BehindWifiExtender="0" WifiEnabled="1" EthLink="1"
                Orientation="0" RoomCalibrationState="4" SecureRegState="3" VoiceConfigState="0"
                MicEnabled="0" AirPlayEnabled="1" IdleState="1" MoreInfo="TargetRoomName:Patio"
                SSLPort="1443" HHSSLPort="1843"/>
            <ZoneGroupMember UUID="RINCON_C438755A444B01400"
                Location="http://192.168.1.200:1400/xml/device_description.xml" ZoneName="Pool"
                Icon="" Configuration="1" SoftwareVersion="71.1-38240" SWGen="2"
                MinCompatibleVersion="70.0-00000" LegacyCompatibleVersion="58.0-00000" BootSeq="4"
                TVConfigurationError="1" HdmiCecAvailable="1" WirelessMode="0" WirelessLeafOnly="0"
                ChannelFreq="2437" BehindWifiExtender="0" WifiEnabled="1" EthLink="1"
                Orientation="0" RoomCalibrationState="4" SecureRegState="3" VoiceConfigState="0"
                MicEnabled="0" AirPlayEnabled="1" IdleState="1" MoreInfo="TargetRoomName:Pool"
                SSLPort="1443" HHSSLPort="1843"/>
        </ZoneGroup>
        <ZoneGroup Coordinator="RINCON_C438755A440F01400" ID="RINCON_C438755A440F01400:211335073">
            <ZoneGroupMember UUID="RINCON_C438755A440F01400"
                Location="http://192.168.1.139:1400/xml/device_description.xml"
                ZoneName="Living Room" Icon="" Configuration="1" SoftwareVersion="71.1-38240"
                SWGen="2" MinCompatibleVersion="70.0-00000" LegacyCompatibleVersion="58.0-00000"
                BootSeq="4" TVConfigurationError="1" HdmiCecAvailable="1" WirelessMode="0"
                WirelessLeafOnly="0" ChannelFreq="2437" BehindWifiExtender="0" WifiEnabled="1"
                EthLink="1" Orientation="0" RoomCalibrationState="4" SecureRegState="3"
                VoiceConfigState="0" MicEnabled="0" AirPlayEnabled="1" IdleState="1"
                MoreInfo="TargetRoomName:Living Room" SSLPort="1443" HHSSLPort="1843"/>
        </ZoneGroup>
        <ZoneGroup Coordinator="RINCON_B8E937AB5E2E01400" ID="RINCON_B8E937AB5E2E01400:4081399224">
            <ZoneGroupMember UUID="RINCON_B8E937AB5E2E01400"
                Location="http://192.168.1.234:1400/xml/device_description.xml"
                ZoneName="Master Bath" Icon="" Configuration="1" SoftwareVersion="71.1-38240"
                SWGen="2" MinCompatibleVersion="70.0-00000" LegacyCompatibleVersion="58.0-00000"
                BootSeq="4" TVConfigurationError="0" HdmiCecAvailable="0" WirelessMode="0"
                WirelessLeafOnly="0" ChannelFreq="2437" BehindWifiExtender="0" WifiEnabled="0"
                EthLink="1" Orientation="0" RoomCalibrationState="4" SecureRegState="3"
                VoiceConfigState="0" MicEnabled="0" AirPlayEnabled="0" IdleState="1"
                MoreInfo="TargetRoomName:Master Bath" SSLPort="1443" HHSSLPort="1843"/>
        </ZoneGroup>
    </ZoneGroups>
    <VanishedDevices>
        <Device UUID="RINCON_C438755A439701400" ZoneName="Master Bedroom" Reason="UNKNOWN"
            ModelInfo="S16" Mac="C4:38:75:5A:43:97" LastKnownIP="192.168.1.165"
            LastSeenUTC="2023-03-10T21:07:59Z" MoreInfo="TargetRoomName:Master Bedroom" SWGen="2"/>
    </VanishedDevices>
</ZoneGroupState>

Sorry, this doesn’t seem to have the info I hoped it would. Which of the “rooms” have a 3rd party subwoofer?

Normally in a “bonded” system the speaker layout is described in fields like ChannelMapSet or HTSatChanMapSet and none of your zones have that.

All of my rooms, with the exception of the garage, have the 3rd party subwoofer attached.

At this point it will just take some experimenting.

The Sonos docs say that it will automatically detect if an external sub is connected: Use a third-party subwoofer with Amp or Connect:Amp | Sonos

Perhaps run the original script above and see if anything happens when disconnecting/connecting the RCA cable? Similarly in the official Sonos app.

I believe it’s going to end up being similar to the surround level. I have zero sonos units set up with surround speakers, but all of them show up in HA with controls for the surround level. I would think that a third party subwoofer could be set up the same way…include the sub volume and crossover controls, and if someone doesn’t want to use them, they leave them disabled. I don’t believe there is anything in the soco integration that allows for the 3rd party subwoofer recognition. There does HAVE to be something that’s telling the actual Sonos app that there’s a 3rd party subwoofer, but I’ve scanned all of the things you’ve asked me to pull as well as the soco documentation, and I see nothing for the 3rd party subwoofer.

Yes, I was asking because soco definitely doesn’t have any support today, but if we find it we can add it. I don’t have an Amp to test with, so it’s a bit tricky to track down the behavior.

I just tested it and I believe you are correct.

The sub is “enabled” by default – irrespective of whether a sub is plugged in or not. The option to disable/enable only appears once it is plugged in.

It did react when I disabled it and when I re-enabled it:

2023-03-15 06:40:49.863781 - 172.16.69.10 [RenderingControl]:
{   'audio_delay': '5',
    'audio_delay_left_rear': '2',
    'audio_delay_right_rear': '1',
    'bass': '0',
    'dialog_level': '0',
    'height_channel_level': '0',
    'loudness': {'Master': '1'},
    'music_surround_level': '-15',
    'mute': {'LF': '0', 'Master': '0', 'RF': '0'},
    'night_mode': '0',
    'output_fixed': '0',
    'preset_name_list': 'FactoryDefaults',
    'sonar_calibration_available': '0',
    'sonar_enabled': '0',
    'speaker_size': '1',
    'sub_crossover': '90',
    'sub_enabled': '1',
    'sub_gain': '-2',
    'sub_polarity': '0',
    'surround_enabled': '1',
    'surround_level': '0',
    'surround_mode': '0',
    'treble': '0',
    'volume': {'LF': '100', 'Master': '16', 'RF': '100'}}
2023-03-15 06:40:56.499398 - 172.16.69.10 [RenderingControl]:
{'speaker_size': '1', 'sub_crossover': '90', 'sub_enabled': '0', 'sub_gain': '-2', 'sub_polarity': '0'}
2023-03-15 06:41:01.158149 - 172.16.69.10 [RenderingControl]:
{'speaker_size': '1', 'sub_crossover': '90', 'sub_enabled': '1', 'sub_gain': '-2', 'sub_polarity': '0'}

Still seems non-deterministic. I’ve just submitted a change to soco to unconditionally enable subwoofer controls for Amp devices: Unconditionally enable `has_subwoofer` on Amp devices by jjlawren · Pull Request #947 · SoCo/SoCo · GitHub.

Maybe we’ll find a better way to detect this in the future. :man_shrugging:

@rosshenning it’s been a while, but the underlying feature has finally been merged to the library we use. I just opened Add subwoofer crossover support to Sonos Amp devices by jjlawren · Pull Request #106290 · home-assistant/core · GitHub which should add native support to the Sonos integration. Based on your original research, I’m 99% sure this will work even though I don’t have an Amp myself to test with.