# Need some help with new sonos plus node

**URL:** <https://discourse.nodered.org/t/need-some-help-with-new-sonos-plus-node/37576>\
**Category:** General\
**Created:** [16 December 2020 12:06 UTC](https://discourse.nodered.org/t/need-some-help-with-new-sonos-plus-node/37576 "2020-12-16T12:06:09Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![pvanklink](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@pvanklink](https://discourse.nodered.org/u/pvanklink)\
**Post date:** [16 December 2020 12:06 UTC](https://discourse.nodered.org/t/need-some-help-with-new-sonos-plus-node/37576/1 "2020-12-16T12:06:09Z")

</div>

I need some help to update my sonos node from version 3 to 4.  
I did a node update for sonos plus and my flow was broken.  
So i did

```auto
cd ~/.node-red // home directory and then .node-red. In Docker /data/.node-red
npm uninstall node-red-contrib-sonos-plus
npm install node-red-contrib-sonos-plus@3.1.5

```

Now everything works as before. I like to update my flow so i can use the new v4 sonos plus nodes.  
Can someone help to convert this to a v4 usable format ? I tried it myself but cant find the replacements for my old sonos nodes.

I have i a very tiny submodule for sonos plus nodes.

```auto
[{"id":"50fbff2a.ae025","type":"subflow","name":"playwave","info":"","category":"","in":[{"x":60,"y":80,"wires":[{"id":"56cef9ae.4f94c8"}]}],"out":[{"x":640,"y":240,"wires":[{"id":"9fd939e8.bd0f08","port":0}]}],"env":[],"color":"#DDAA99"},{"id":"9fcead47.9d3a1","type":"sonos-manage-queue","z":"50fbff2a.ae025","confignode":"beeee955.83a368","name":"sonosaanbouw","x":460,"y":80,"wires":[["7996229f.c0b6ac"]]},{"id":"7996229f.c0b6ac","type":"change","z":"50fbff2a.ae025","name":"insert playlist","rules":[{"t":"set","p":"payload","pt":"msg","to":"insert_sonos_playlist","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":80,"wires":[["fcc96035.26705"]]},{"id":"fcc96035.26705","type":"sonos-manage-queue","z":"50fbff2a.ae025","confignode":"beeee955.83a368","name":"","x":840,"y":80,"wires":[["3154b9a6.546b66"]]},{"id":"973e1825.2af218","type":"change","z":"50fbff2a.ae025","name":"activate queue","rules":[{"t":"set","p":"payload","pt":"msg","to":"activate_queue","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":200,"y":240,"wires":[["9fd939e8.bd0f08"]]},{"id":"9fd939e8.bd0f08","type":"sonos-manage-queue","z":"50fbff2a.ae025","confignode":"beeee955.83a368","name":"","x":460,"y":240,"wires":[[]]},{"id":"b6173774.82b688","type":"sonos-control-player","z":"50fbff2a.ae025","confignode":"beeee955.83a368","name":"","x":460,"y":160,"wires":[["973e1825.2af218"]]},{"id":"3154b9a6.546b66","type":"change","z":"50fbff2a.ae025","name":"zet volume ","rules":[{"t":"set","p":"payload","pt":"msg","to":"90","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":190,"y":160,"wires":[["b6173774.82b688"]]},{"id":"56cef9ae.4f94c8","type":"change","z":"50fbff2a.ae025","name":"flush playlist","rules":[{"t":"set","p":"payload","pt":"msg","to":"flush_queue","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":190,"y":80,"wires":[["9fcead47.9d3a1"]]},{"id":"e0ddd285.dda2a","type":"comment","z":"50fbff2a.ae025","name":"speelt playlist af die door de aanroep is meegegeven. laat input en output staan!","info":"","x":380,"y":320,"wires":[]},{"id":"beeee955.83a368","type":"sonos-config","name":"sonosaanbouw","serialnum":"00-0E-58-53-B9-FE:F","ipaddress":"192.168.20.29"}]

```

1. 

I call the above submodule from different modules where the payload is defined which playlist to play.  
for example with a change node (with msg.topic = doorbell)  
or msg.topic = disable\_alarm\_sound  
Can i still use these triggering flows and do i need to change the use of msg.topic in these ?

In the attached main flow, i use the different v3 sonos plus nodes. It is a very simple flow:

a) flush the queue

- with payload = flush\_queue and then
- v3 node mng\_queue node

B) insert the playlistname (see name in part 0) before)

- with payload = insert\_sonos\_playlist and then
- v3 node mng\_queue node

c) set volume by

- payload=90 and then
- v3 node ctrl player node

d) activate the queue by

- payload= activate\_queue and then
- v3 node mng\_queue node

View:

 ![sonos1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/a/7aeff64e8ef4c535cbead76cea0f7d7c6f3e7142.png)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [16 December 2020 13:50 UTC](https://discourse.nodered.org/t/need-some-help-with-new-sonos-plus-node/37576/2 "2020-12-16T13:50:56Z")

</div>

> [@pvanklink](#):
>
> cant find the replacements for my old sonos nodes.

I haven't used that node, but the readme for the node links to instructions on how to update. It doesn't say anything about changing node types. Can you explain in more detail what issue you are having?

---

<div class="post-metadata">

**Author:** ![pvklink](https://avatars.discourse-cdn.com/v4/letter/p/46a35a/32.png) [@pvklink](https://discourse.nodered.org/u/pvklink)\
**Post date:** [16 December 2020 15:02 UTC](https://discourse.nodered.org/t/need-some-help-with-new-sonos-plus-node/37576/3 "2020-12-16T15:02:15Z")

</div>

After update, the old node types arent recognized anymore, so they are changed...  
and my flow broked...  
The wiki and documentation is way to complex (for me). The old v3 was easy

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [16 December 2020 15:50 UTC](https://discourse.nodered.org/t/need-some-help-with-new-sonos-plus-node/37576/4 "2020-12-16T15:50:00Z")

</div>

It doesn't say anything about that in the docs, I don't think. You might be best to post an issue on the node's github page and see if you get help there.

---

<div class="post-metadata">

**Author:** ![hklages](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hklages/32/23899_2.png) [@hklages](https://discourse.nodered.org/u/hklages)\
**Post date:** [16 December 2020 19:34 UTC](https://discourse.nodered.org/t/need-some-help-with-new-sonos-plus-node/37576/5 "2020-12-16T19:34:06Z")

</div>

Try the enclosed flow and let me know whether it works.

 ![doorbell](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/8/3879544e82ff2d4d5adc004bc38a84e5f2b3a5b5.png)

Please replace in your flow everything between input and output by "topic to playload" to "payload to topic". The inject nodes are only for testing.

Explanation: In Version 4 the meaning of the pair payload/topic was reversed. That's why we need the first and last change node. You can omit both if in your calling flow you set the "doorbell" to payload instead of to topic.

mysonos.export.item searches all My Sonos item (and all SONOS playlists are automatically added to the My Sonos favorites by default) and exports the relevant data for group.play.export.

group.play.export does a flush queue by default.

```auto
[{"id":"1177a985.5eedb6","type":"sonos-manage-mysonos","z":"b4a8d0e5.240a9","confignode":"beeee955.83a368","compatibilityMode":false,"command":"mysonos.export.item","state":"","stateType":"str","name":"","x":685,"y":1860,"wires":[["c23dd04f.eacf"]]},{"id":"540a3714.ed6c68","type":"inject","z":"b4a8d0e5.240a9","name":"example doorbell","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"doorbell","payloadType":"str","x":300,"y":1900,"wires":[["9e6166b.9c6e798"]]},{"id":"7866f598.d04bec","type":"change","z":"b4a8d0e5.240a9","name":"topic to payload","rules":[{"t":"move","p":"topic","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":303,"y":1860,"wires":[["9e6166b.9c6e798"]]},{"id":"c23dd04f.eacf","type":"sonos-universal","z":"b4a8d0e5.240a9","confignode":"beeee955.83a368","compatibilityMode":false,"command":"group.play.export","state":"","stateType":"str","name":"","x":906,"y":1860,"wires":[["891f0b21.cd63f8"]]},{"id":"9e6166b.9c6e798","type":"change","z":"b4a8d0e5.240a9","name":"set volume","rules":[{"t":"set","p":"volume","pt":"msg","to":"90","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":482,"y":1860,"wires":[["1177a985.5eedb6"]]},{"id":"891f0b21.cd63f8","type":"change","z":"b4a8d0e5.240a9","name":"payload to topic","rules":[{"t":"move","p":"payload","pt":"msg","to":"topic","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1107,"y":1860,"wires":[[]]},{"id":"7fc703ad.844f9c","type":"inject","z":"b4a8d0e5.240a9","name":"example doorbell","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"doorbell","x":120,"y":1840,"wires":[["7866f598.d04bec"]]},{"id":"beeee955.83a368","type":"sonos-config","name":"sonosaanbouw","serialnum":"00-0E-58-53-B9-FE:F","ipaddress":"192.168.20.29"}]

```

---

<div class="post-metadata">

**Author:** ![pvklink](https://avatars.discourse-cdn.com/v4/letter/p/46a35a/32.png) [@pvklink](https://discourse.nodered.org/u/pvklink)\
**Post date:** [17 December 2020 12:49 UTC](https://discourse.nodered.org/t/need-some-help-with-new-sonos-plus-node/37576/6 "2020-12-17T12:49:03Z")

</div>

First , thanks for your help @hklages !!!!!!

i had a lot off problems with errors like:  
sonos-manage-queue and control player are not there and that the flow is stopping  
Also my dashboards did not work because of these sonos flow erros

so i did:

1. update sonos from 3.1.5 to 4.5.3
2. i deleted all usage of sonos manage queue and sonos player nodes
3. inserted your flow et voila it works!
4. removed your test injectors

Some questions

1. i suppose that it is a better way to directly put the content in the payload instead  
of moving it from topic to payload, if yes then i can delete the move commands

2. in my original config i reset the sonos after playing the playlist with a certain volume by  
a. flush the queue  
b. setting the volume back to the default  
is this still necessary ? and if is, is the next submodule the right way to do it?

```auto
[{"id":"f0a14c4f.b8632","type":"subflow","name":"resetsonos","info":"","category":"","in":[{"x":60,"y":80,"wires":[]}],"out":[],"env":[],"color":"#DDAA99"},{"id":"5a5003ba.cd4d7c","type":"change","z":"f0a14c4f.b8632","name":"zet volume ","rules":[{"t":"set","p":"volume","pt":"msg","to":"50","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":170,"y":80,"wires":[["8dd704e7.9beb2"]]},{"id":"f6232259.32298","type":"comment","z":"f0a14c4f.b8632","name":"dit deel van de procedure zet sonos weer op een blanco playlist met een normaal volume","info":"","x":390,"y":140,"wires":[]},{"id":"8dd704e7.9beb2","type":"sonos-universal","z":"f0a14c4f.b8632","confignode":"beeee955.83a368","compatibilityMode":false,"command":"group.play.export","state":"","stateType":"str","name":"","x":370,"y":80,"wires":[["8e428f30.2e4fa"]]},{"id":"8e428f30.2e4fa","type":"sonos-universal","z":"f0a14c4f.b8632","confignode":"beeee955.83a368","compatibilityMode":false,"command":"group.clear.queue","state":"","stateType":"str","name":"","x":630,"y":80,"wires":[[]]},{"id":"beeee955.83a368","type":"sonos-config","name":"sonosaanbouw","serialnum":"00-0E-58-53-B9-FE:F","ipaddress":"192.168.20.29"}]

```

---

<div class="post-metadata">

**Author:** ![hklages](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hklages/32/23899_2.png) [@hklages](https://discourse.nodered.org/u/hklages)\
**Post date:** [17 December 2020 13:43 UTC](https://discourse.nodered.org/t/need-some-help-with-new-sonos-plus-node/37576/7 "2020-12-17T13:43:33Z")

</div>

Hi Peter  
Good to hear, that your subflow now works 👍

regarding 1.) right!

regarding 2 b) setting volume back is easy: Universal node, select `group.set.volume` and in the state field the new volume. There are multiple options. if the lock down is boring you can spend time to read the documentation here 🙂 [Wiki - Universal Node](https://github.com/hklages/node-red-contrib-sonos-plus/wiki/A.1-Universal-Node)  
Here the simple solution (you have to replace kitchen with your config node)

 ![setvolume](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/b/dbbcfd4b63a82e583323e999c17cd081448e6be5.png)

regarding 2. a) That depends on your use case. You can add a simple Universal node with `group.clear.queue`. Are the player only for playing the doorbell, etc and not being used for playing music?

Henning

---

<div class="post-metadata">

**Author:** ![pvklink](https://avatars.discourse-cdn.com/v4/letter/p/46a35a/32.png) [@pvklink](https://discourse.nodered.org/u/pvklink)\
**Post date:** [17 December 2020 17:34 UTC](https://discourse.nodered.org/t/need-some-help-with-new-sonos-plus-node/37576/8 "2020-12-17T17:34:46Z")

</div>

Hi Henning, thanks again, and yes everything works !!!  
I have cleaned-up 5 sonos submodules and have one small module doing everything based on input variables in a input msg

I have to see a working version first before understanding the wiki. 🙂  
So it is now time to read the wiki again, and perhaps i expand my flows with extra sonos functionality 🙂

I use sonos for my security system, to play sounds when

- activating the alarm
- deactivating the alarm
- playing doorbell
- when arming and leaving the house entrance/exit sounds

I use playlists for each of this events with one wave file in a list

Stille have some stuff to examine:

1. is it possible to play a file/track from sonos library without enclosing it in a playlist (my current solution) ?

---

<div class="post-metadata">

**Author:** ![hklages](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hklages/32/23899_2.png) [@hklages](https://discourse.nodered.org/u/hklages)\
**Post date:** [19 December 2020 18:12 UTC](https://discourse.nodered.org/t/need-some-help-with-new-sonos-plus-node/37576/9 "2020-12-19T18:12:51Z")

</div>

Hi Peter @pvklink

For (almost) everything there is a command 🙂

In this case: `group.play.notification`. You can set property `msg.volume` before and as state you take the Music Library name like  
`x-file-cifs://nas2019/Multimedia/Music/MyMusic/Gloria%20Estefan%20%26%20Miami%20Sound%20Machine/Let%20It%20Loose/Gloria%20Estefan%20%26%20Miami%20Sound%20Machine%20-%201-2-3.mp3`

It looks more complicated then it is: %20 stands for blank.

If you don't know this name, you can do the following

1. in the SONOS App, Browse, Music Library, search for your doorbell and use "Add to My Sonos".
2. Then use My Sonos node with command `mysonos.get.items` and have a look at the output (debug node). For your doorbell there is a uri - that (without the ") you can use.

---

<div class="post-metadata">

**Author:** ![pvklink](https://avatars.discourse-cdn.com/v4/letter/p/46a35a/32.png) [@pvklink](https://discourse.nodered.org/u/pvklink)\
**Post date:** [20 December 2020 09:37 UTC](https://discourse.nodered.org/t/need-some-help-with-new-sonos-plus-node/37576/10 "2020-12-20T09:37:30Z")

</div>

thanks !  
Sonos mission complete!  
Old version upgraded and old flows cleaned-up with the latest functionalitiies...  
I will try this and inform you (all).

---

<div class="post-metadata">

**Author:** ![pvklink](https://avatars.discourse-cdn.com/v4/letter/p/46a35a/32.png) [@pvklink](https://discourse.nodered.org/u/pvklink)\
**Post date:** [20 December 2020 13:35 UTC](https://discourse.nodered.org/t/need-some-help-with-new-sonos-plus-node/37576/11 "2020-12-20T13:35:25Z")

</div>

Works perfect...... case closed 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [3 January 2021 13:35 UTC](https://discourse.nodered.org/t/need-some-help-with-new-sonos-plus-node/37576/12 "2021-01-03T13:35:25Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
