bencevans / node-sonos

šŸ”ˆ Sonos Media Player Interface/Client
https://www.npmjs.com/package/sonos
MIT License
700 stars 146 forks source link

Change Sub gain #495

Closed tboudri closed 3 years ago

tboudri commented 3 years ago

I'am using Node-sonos to control Sonos from my home-automation system. I can change nearly everything i want, source selection, volume, bass, treble, loudness. All is working fine.

But I can't find a way to change the Sub level and Sub on/off. Do you know how to change these?

AlexMaghen commented 3 years ago

Dear @tboudri - This is a total abuse because I don't have an answer for your question, but I'm desperate and as you've obviously got a lot further than I, I wanted to ask if you can help. I have a setup with 5 Sonos (S1) devices. I need to do the following "pseudo codeā€:

Get a device by its Name If the device is grouped with other devices, unlink it from that group Set the deviceā€™s volume to 75% Play one of the Sonos Favorites by its name on that device

Again, apologies for the exploitation but Iā€™d love any help I can get! Happy New Year!

Alex

hklages commented 3 years ago

@tboudri , subgain level is currently not implemented.

The parameter would be: server: your sonos with port 1400- http://xx.xx.xx:port endpoint: '/MediaRenderer/RenderingControl/Control' Action: 'SetEQ' Args: { 'InstanceID': 0, 'EQType': 'SubGain', 'DesiredValue': value } where value is integer in range -15 to +15.

If your are familiar with UPNP you can use these data to send a SOAP request.

What homeautomation do you use? If it supports Node-RED I can help you out with a solution.

hklages commented 3 years ago

@AlexMaghen - this is the wrong topic. I added a second example to your first topic. Hope that helps.

tboudri commented 3 years ago

Thanks @hklages, I just found the command set by using wireshark. I am now able to control the sub gain the same way as bass and treble and loudness (via the _render object) and also added these 4 to the sonos object.

This is working very nice. I can now have different EQ profiles for different inputs (TV, Music, radio) automatically selected and based on different activities. i.e. wakeup, listening music, indoor training, watching tv etc.

Met vriendelijke groet,

Tjeerd Boudri

On 27 Dec 2020, at 19:10, H. Klages notifications@github.com wrote:

ļ»æ @tboudri , subgain level is currently not implemented.

The parameter would be: server: your sonos with port 1400- http://xx.xx.xx:port endpoint: '/MediaRenderer/RenderingControl/Control' Action: 'SetEQ' Args: { 'InstanceID': 0, 'EQType': 'SubGain', 'DesiredValue': value } where value is integer in range -15 to +15.

If your are familiar with UPNP you can use these data to send a SOAP request with that content.

What homeautomation do you use? If it supports Node-RED I can help you out with a solution.

ā€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

hklages commented 3 years ago

Great. For TV's there are two other EQ Values -DialogLevel also known as speech enhancement (as TV is more about speech then music) and NightMode (for your neighboars :-). We started to document all information here. You can search for "SetEQ". Feel free to add your knowledge.

Regarding wireshark: I failled to find out what command SONOS internally uses to add one speaker to a group - is it either AddMember or just setting the source with SetAVTransport or ... . Maybe you can tell me?

viele GrĆ¼ĆŸe :-) Henning

pascalopitz commented 3 years ago

I do it with SetAvTransportUri, see https://github.com/pascalopitz/unoffical-sonos-controller-for-linux/blob/3049267159680d9116951a65312559adde5e4523/src/ui/reduxActions/GroupManagementActions.js#L46

svrooij commented 3 years ago

@tboudri is your issue solved? I vote for closing this issue because @hklages provided a working answer.

tboudri commented 3 years ago

@svrooij, yes my issue is solved. You can close it. Thank you