node-red-contrib-sonos-plus icon indicating copy to clipboard operation
node-red-contrib-sonos-plus copied to clipboard

unable to tell a specific player to set its volume

Open stoneobscurity opened this issue 1 year ago • 5 comments

Description

how come the set.volumes only accept a number value? shouldn't it be TWO values, one for the volume and one for the speaker name i want to adjust?

background: the group volume averaging is dumb. i want to set all the speaker sets to one a specific volume, then group them.

What node/command (topic)/state (payload)

node: command: state:

In case of a bug: Are you able to reproduce the error

Versions and Infrastructure

yeah,yeah, latest everything.

what system: node-red-contrib-sonos-plus version: Node-RED version: NodeJS version:

see: [https://flows.nodered.org/flow/a5c42641bf33dd0da9bfd4426a06950a]

stoneobscurity avatar Jun 26 '23 21:06 stoneobscurity

Hi, instead of "group.set.volume" you can use "player.set.volume". All prefix "player." commands act on a single player.

On Mon, Jun 26, 2023, 23:37 stone @.***> wrote:

Description

how come the set.volumes only accept a number value? shouldn't it be TWO values, one for the volume and one for the speaker name i want to adjust?

background: the group volume averaging is dumb. i want to set all the speaker sets to one a specific volume, then group them. What node/command (topic)/state (payload)

node: command: state: In case of a bug: Are you able to reproduce the error Versions and Infrastructure

yeah,yeah, latest everything.

what system: node-red-contrib-sonos-plus version: Node-RED version: NodeJS version:

see: [https://flows.nodered.org/flow/a5c42641bf33dd0da9bfd4426a06950a]

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

hklages avatar Jun 27 '23 04:06 hklages

how can you set volume on aplayer without first defining a specific player? i see no mechanism for that.

stoneobscurity avatar Jun 27 '23 05:06 stoneobscurity

There are many options: parallel, serial, using config nodes for each player or specifying playerName. Here are 2 examples:

[{"id":"995d61d116ec4909","type":"inject","z":"2023f4bcc3371cb5","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":300,"y":160,"wires":[["ae443a9a4aab5b93"]]},{"id":"ae443a9a4aab5b93","type":"sonos-universal","z":"2023f4bcc3371cb5","confignode":"5a07e409.17a1ec","command":"player.set.volume","state":"30","stateType":"str","avoidCheckPlayerAvailability":false,"name":"","x":510,"y":160,"wires":[["483f33b2ba0df255"]]},{"id":"483f33b2ba0df255","type":"sonos-universal","z":"2023f4bcc3371cb5","confignode":"f166c7c9.fa00c8","command":"player.set.volume","state":"20","stateType":"str","avoidCheckPlayerAvailability":false,"name":"","x":750,"y":160,"wires":[[]]},{"id":"c8158d82ee51dc61","type":"inject","z":"2023f4bcc3371cb5","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":300,"y":260,"wires":[["2377c3b473b99cc7","eee636f7cd64a00b"]]},{"id":"2377c3b473b99cc7","type":"sonos-universal","z":"2023f4bcc3371cb5","confignode":"5a07e409.17a1ec","command":"player.set.volume","state":"10","stateType":"str","avoidCheckPlayerAvailability":false,"name":"","x":510,"y":240,"wires":[[]]},{"id":"eee636f7cd64a00b","type":"sonos-universal","z":"2023f4bcc3371cb5","confignode":"f166c7c9.fa00c8","command":"player.set.volume","state":"10","stateType":"str","avoidCheckPlayerAvailability":false,"name":"","x":510,"y":300,"wires":[[]]},{"id":"eff711315ba06e51","type":"comment","z":"2023f4bcc3371cb5","name":"serial","info":"","x":290,"y":120,"wires":[]},{"id":"9dc891491aeceb35","type":"comment","z":"2023f4bcc3371cb5","name":"parallel","info":"","x":290,"y":220,"wires":[]},{"id":"5a07e409.17a1ec","type":"sonos-config","name":"yourPlayer","serialnum":"","ipaddress":"192.168.178.51"},{"id":"f166c7c9.fa00c8","type":"sonos-config","name":"hkBathRoom","serialnum":"","ipaddress":"192.168.178.52"}]

Just use the import feature and have a look at the nodes. This is the example using config nodes for every speaker.

Does it help?

hklages avatar Jun 27 '23 06:06 hklages

okay so you are running a new config for each named speaker set. means i need to go set them all to static IPs. what about speaker pairs? i assume one is a master and one is a slave, how would i know which is which?

stoneobscurity avatar Jun 27 '23 15:06 stoneobscurity

See the full documentation here

so you are running a new config for each named speaker set. means i need to go set them all to static IPs.

We need at least 1 config node per household, but you can create any number of config nodes. It is not a bad idea to create config node for each SONOS-Player. You don't need to use static IPs - you can use DNS names defined in your router (DNS server).

Another option is to define 1 config node and use the SONOS-Playername (given in the SONOS-App). If you prefer that, you have to use the msg.playerName and "redirect" the command from the config node to that SONOS-Player.

What about speaker pairs? i assume one is a master and one is a slave, how would i know which is which?

What kind of speaker do you want to pair? If you pair 2 Sonos One to a single stereo speaker then one SONOS One is hidden and the other acts as stereo speaker.

If you want to group 2 SONOS-Player (they play both the same song in sync) then you can easily use group.* commands and send it to any player in that group. The software takes care that it is redirected to the coordinator (master) - that's one of the benefit of group commands.

Understandable?

hklages avatar Jun 27 '23 17:06 hklages

no response - closed.

hklages avatar Apr 15 '24 14:04 hklages