hklages / node-red-contrib-sonos-plus

A set of Node-RED nodes to control SONOS player in your local network.
MIT License
75 stars 14 forks source link

volume limit support #232

Open jonathananolan opened 1 year ago

jonathananolan commented 1 year ago

It would be great to have support to listen for changes to volume limit and change the volume limit. thanks!

hklages commented 1 year ago

... please have a look at the sister package node-red-contribut-sonos-events. There you äre able to subscribe to many events. Both packages work well together

nyjan commented 7 months ago

I would also greatly appreciate this feature. This seems to be the one single setting that no project out there exposes programatically, I've only found it accessible in the official app.

For me, one potential use case is to 'soft-mute' players, based on the occupancy of the room they are in, by setting a very low volume limit of 5-10%. I prefer this over a full mute because when occupancy of a room is dected late or not at all, the music or podcast playing will still be somewhat audible and you won't miss anything. Both muting and reducing the volume limit preserve the volume set for the player by the user, reducing the need to cache, track or snapshot volume settings in automations.

There are a lot of other use cases this opens up, if you think of the volume limit as a scale factor between 0.01 and 1 that is applied to the user-requested volume: It could be used to temporarily drop the volume of music and sound playback by 90% during voice prompts to voice assistants or maybe when the doorbell rings, or for slowly ramping down the volume to a max of 50% during the evening/night (without taking over the actual volume of the players and without giving up half of the precision of the volume slider), or for limiting the volume of speakers in teenagers rooms and immediately reverting changes made through the sonos app by said teenagers, etc...

I have not had the time to look into the technical side of things yet and I can only imagine the reason that none of the open source solutions expose this setting is that it's not straight forward to implement. But if you get around to looking into it, I certainly think it would be a useful addition that could greatly simplify a lot of volume-related automations.

hklages commented 6 months ago

Hi Jan.

This node uses the SONOS build in SOAP functionality. Unfortunately the "maximum" is not exposed. You can check at: https://sonos.svrooij.io/ Alternatively you can try to catch the command with a packet sniffer - I am not able to do that.

It could also be that this command is implemented in the SONOS cloud with the cloud api - same as the new notification function.

I searched the internet for the SOAP maximum command but could find anything.

As soon as we know the SOAP command or maybe even the cloud api commad I can try to add it to the node.

best regards, Henning

On Sun, Dec 3, 2023 at 8:30 AM Jan @.***> wrote:

I would also greatly appreciate this feature. This seems to be the one single setting that no project out there exposes programatically, I've only found it accessible in the official app.

For me, one potential use case is to 'soft-mute' players, based on the occupancy of the room they are in, by setting a very low volume limit of 5-10%. I prefer this over a full mute because when occupancy of a room is dected late or not at all, the music or podcast playing will still be somewhat audible and you won't miss anything. Both muting and reducing the volume limit preserve the volume set for the player by the user, reducing the need for cache, track or snapshot volume settings in automations.

There are a lot of other use cases this opens up, if you think of the volume limit as a scale factor between 0.01 and 1 that is applied to the user-requested volume: It could be used to temporarily drop the volume of music and sound playback by 90% during voice prompts to voice assistants or maybe when the doorbell rings, or for slowly ramping down the volume to a max of 50% during the evening/night (without taking over the actual volume of the players and without giving up half of the precision of the volume slider), or for limiting the volume of speakers in teenagers rooms and immediately reverting changes made through the sonos app by said teenagers, etc...

I have not had the time to look into the technical side of things yet and I can only imagine the reason that none of the open source solutions expose this setting is that it's not straight forward to implement. But if you get around to looking into it, I certainly think it would be a useful addition that could greatly simplify a lot of volume-related automations.

— Reply to this email directly, view it on GitHub https://github.com/hklages/node-red-contrib-sonos-plus/issues/232#issuecomment-1837396212, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEDZCHZUSVI4ROSJRVX7GF3YHQTCHAVCNFSM6AAAAAASSPTD6KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZXGM4TMMRRGI . You are receiving this because you were assigned.Message ID: @.***>