originallyus / node-red-contrib-better-sonos Goto Github PK
View Code? Open in Web Editor NEWThis project forked from rolf-m/node-red-contrib-sonos
NodeRed node for controlling Sonos Players
License: MIT License
This project forked from rolf-m/node-red-contrib-sonos
NodeRed node for controlling Sonos Players
License: MIT License
Getting a crash.
22 Oct 16:09:02 - [red] Uncaught Exception:
22 Oct 16:09:02 - TypeError: Cannot read property 'destroy' of null
at C:\Users\max.node-red\node_modules\node-red-contrib-better-sonos\sonos\SonosHelper.js:74:27
at C:\Users\max.node-red\node_modules\sonos\lib\sonos.js:795:7
at Parser. (C:\Users\max.node-red\node_modules\sonos\node_modules\xml2js\lib\xml2js.js:489:18)
at emitOne (events.js:96:13)
at Parser.emit (events.js:188:7)
at Object.onclosetag (C:\Users\max.node-red\node_modules\sonos\node_modules\xml2js\lib\xml2js.js:447:26)
at emit (C:\Users\max.node-red\node_modules\sax\lib\sax.js:624:35)
at emitNode (C:\Users\max.node-red\node_modules\sax\lib\sax.js:629:5)
at closeTag (C:\Users\max.node-red\node_modules\sax\lib\sax.js:889:7)
at Object.write (C:\Users\max.node-red\node_modules\sax\lib\sax.js:1436:13)
Hi Im traying to play a local .mp3 file that i have created from google tts
i have made a http endpoint but when i try to play it on sonos it says cant play wrong coded
im getting Error: HTTP response code 500 for "urn:schemas-upnp-org:service:AVTransport:1#Seek"
Hi,
thanks for taking up this project. And thanks for taking my code fork.
I was not the author, but had the same problem, the original author doesn't seem to react any more. I needed the volume "up and down" functionality and was able to code this.
Could you check/implement the grouping and ungrouping, this seems to be implemented in the underlaying node-js, but I was not able to implement this.
I'm not the good coder, but will continue to help where I can :-)
By the way, you didn't copy my "get_volume" node, to read the current volume setting.
Regards, Rolf
Hi There, thank you for maintaining this node!
I have been tinkering around a bit and find myself getting errors when adding songs from spotify.
So from my sonos Controller it looks like this:
Then I went to node and got myself the status from the current playlist which looks like this:
So I thought to add a track from Spotify, the only thing to do would be executing a node that plays a song from this uri: x-sonos-spotify:spotify%3atrack%3a20nDYyRNL4u5Kukzy1pL6z?sid=9&flags=8224&sn=2
But when I Try this the only result is:
Do you have any Idea, what I am doing wrong?
Without changing anything on SONOS side (playing different songs, stopping or starting something or changing the volume of any speaker) I receive different results by the node.
Sometimes i get this wrong result:
{"topic":"","payload":"4WRJh9","_msgid":"85e03441.410e28","track":{"title":"4WRJh9","artist":null,"album":null,"albumArtURI":null,"position":0,"duration":0,"albumArtURL":null,"uri":"x-rincon-mp3radio://http://addrad.io/4WRJh9"},"volume":27,"normalized_volume":0.27,"state":"stopped","muted":false}
This is a radio stream.
sometimes i get the correct result:
{"topic":"","payload":"Folge 2: Mama geht zur Arbeit - Teil 1","_msgid":"ea301846.8655e8","track":{"title":"Folge 2: Mama geht zur Arbeit - Teil 1","artist":"Leo Lausemaus","album":"Folge 2","albumArtURI":"/getaa?s=1&u=x-sonos-spotify%3aspotify%253atrack%253a0I2lEtYmvaoq6LqKN3Cuiv%3fsid%3d9%26flags%3d8224%26sn%3d3","position":92,"duration":149,"albumArtURL":"http://192.168.178.58:1400/getaa?s=1&u=x-sonos-spotify%3aspotify%253atrack%253a0I2lEtYmvaoq6LqKN3Cuiv%3fsid%3d9%26flags%3d8224%26sn%3d3","uri":"x-sonos-spotify:spotify%3atrack%3a0I2lEtYmvaoq6LqKN3Cuiv?sid=9&flags=8224&sn=3"},"volume":37,"normalized_volume":0.37,"state":"paused","muted":false}
This is the latest song in the player in status "paused".
Is there an issue with sonos players which are sometimes linked to a group?
The nodes are set to allow the overwriting of the defined dialog values with msg properties.
This is the not the prefered way for node-red nodes which is where you can only send a msg property if the defined dialog value has been left unset (blank)
See https://groups.google.com/forum/#!topic/node-red/ZFca1eslzog
The Information box states for Output:
status string | playing/stopped/paused
current playing state
But it's actually returned in the msg.state, not msg.status
When pressing the "search Button", no device is found/show.
Manualy entering the Sonos ID will let me control the device, but randomly not only the chosen but all sonos devices are addressed
I have a flow configured so that I can ask Alexa to join a zone to another that is already playing, however, this will generate the following error if the zone isn't the group leader / co-ordinator:
Error: HTTP response code 500 for "urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI"
It's not really possible to keep track of the leader, especially if I use another flow to leave the group as the leader then passes to another unpredictable zone.
Great plugin, started using it few days, no issues so far. Really looking forward to the playlist and TTS functionality.
One thing that I see it not able to do and not on the todo list is the seek position of the song (like to be able to set it with with a slider, right now I can only read and display it)
First, thank you for this great module.
It miss only a group function. Is there a way to do this?
I'd like to use one control node to control any of my sonos speakers. I'd like to be able to specify which speaker as an input parameter to the control node. So { topic: "B8-E9-37-83-10-26:2", payload: "playpause" } or { topic: "Sonos One", payload: "playpause" } should affect the specified speaker.
How can I use the join function?
I was able to use leave but not the join function.
Would it be possible to provide an example (code)
kind regards
Andreas
Volume Down control not working. In file sonos-control.js line 128 change " _volfkt = "vol_up"; " to " _volfkt = "vol_down"; "
Hi,
Is it possible to imlplement the save state & restore state functions ?
4 Nov 22:28:22 - [info] Installing module: node-red-contrib-better-sonos, version: 0.1.9
4 Nov 22:28:56 - [info] Installed module: node-red-contrib-better-sonos
4 Nov 22:28:59 - [info] Added node types:
4 Nov 22:28:59 - [info] - node-red-contrib-better-sonos:better-sonos-config
4 Nov 22:28:59 - [info] - node-red-contrib-better-sonos:better-sonos-control : SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode (line:4)
4 Nov 22:28:59 - [info] - node-red-contrib-better-sonos:better-sonos-status : SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode (line:4)
4 Nov 22:28:59 - [info] - node-red-contrib-better-sonos:better-sonos-queue : SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode (line:4)
4 Nov 22:28:59 - [info] - node-red-contrib-better-sonos:better-sonos-get-queue : SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode (line:4)
4 Nov 22:29:28 - [info] Stopping flows
4 Nov 22:29:28 - [info] Stopped flows
4 Nov 22:29:28 - [info] Waiting for missing types to be registered:
4 Nov 22:29:28 - [info] - better-sonos-status
When hitting search button to find series number for my sonos amp nothing appears. Ive punched in my serielnumber manually but when running my flow i just get the message "device not found"
Does the songs config not work with the songs amp ?
i have a problem getting the vol_set cmd to work. i try to implement a slider vor the volume inside my dashboard. i looked over the code and dont really understand what is meant by
//Use payload values only if config via dialog is empty
i just connect the slider with the sonos control which is set to vol_up but the code under line 224 is not working as the data is in the payload and not in the node and node.volume_value is empty and never filled with any value
I have installed the package and I have 4 of the 5 nodes available in the node red palette, however the config node is missing which means I can't use the other ones. Looking in the palette manager the config node has a dashed square box next to it, indicating that there is some problem. When the node red service starts on my Rasp Pi 3 there do not seem to be any errors except for their being an issue with [serial port] is this relevant or not ?
Add a feature where you are able to form, disband or joining devices to groups.
Forgive me if I've just somehow missed the link, or I'm looking in the wrong place, but where is the latest full documentation for node-red-contrib-better-sonos.
I'm on version 0.1.21 which appears to be the latest version but the info page for the better-sonos-queue node still says "This node is currently under development to make it more user-friendly"
I'm particularly interested in how to fill in the "Song URI" field.
We've not seen an update for over a year, is this project dead now?
After pushing the Join command, NodeRed stop with this errors:
Found Sonos device B8-E9-37-5F-A7-72:6 at 192.168.20.47 1 Nov 18:47:57 - [red] Uncaught Exception: 1 Nov 18:47:57 - TypeError: Cannot read property 'find' of null at getTopology (/home/pi/.node-red/node_modules/sonos/lib/sonos.js:619:31) at /home/pi/.node-red/node_modules/sonos/lib/sonos.js:1077:7 at Parser.<anonymous> (/home/pi/.node-red/node_modules/xml2js/lib/parser.js:303:18) at emitOne (events.js:116:13) at Parser.emit (events.js:211:7) at SAXParser.onclosetag (/home/pi/.node-red/node_modules/xml2js/lib/parser.js:261:26) at emit (/home/pi/.node-red/node_modules/sax/lib/sax.js:624:35) at emitNode (/home/pi/.node-red/node_modules/sax/lib/sax.js:629:5) at closeTag (/home/pi/.node-red/node_modules/sax/lib/sax.js:889:7) at SAXParser.write (/home/pi/.node-red/node_modules/sax/lib/sax.js:1436:13) at Parser.exports.Parser.Parser.parseString (/home/pi/.node-red/node_modules/xml2js/lib/parser.js:322:31) at Parser.parseString (/home/pi/.node-red/node_modules/xml2js/lib/parser.js:5:59) at Object.exports.parseString (/home/pi/.node-red/node_modules/xml2js/lib/parser.js:354:19) at Request._callback (/home/pi/.node-red/node_modules/sonos/lib/sonos.js:1062:12) at Request.self.callback (/home/pi/.node-red/node_modules/request/request.js:185:22) at emitTwo (events.js:126:13)
This is my sketch:
[{"id":"aaeabd.e374654","type":"better-sonos-control","z":"ecc2de2b.8c965","confignode":"164fdcf2.cb59bb","name":"","mode":"","track":"","volume":"","volume_value":"","x":480,"y":160,"wires":[]},{"id":"ca4a84ea.beff28","type":"inject","z":"ecc2de2b.8c965","name":"","topic":"Bathroom","payload":"join","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":290,"y":160,"wires":[["aaeabd.e374654"]]},{"id":"164fdcf2.cb59bb","type":"better-sonos-config","z":"","name":"Bedroom","serialnum":"B8-E9-37-5F-A7-72:6","ipaddress":""}]
Where could the problem be?
Andrea
Where can I find an example of the json object to pass to the control node? You mention better documentation, where can we find said documentation? Thank you!
It would be nicer to have all the status within the msg.payload
Right now, only the current track is returned in payload. This is not so nice if you want to use the other information for further processing. Payload can carry a complete object, so it would be nicer to have everything in there
Trying to inject (as a string) an URI into Queue and it doesn't work.
Direct Play - says request success, but the song is not queued
Queue Next - says request success and basically stops playing
Hi,
When using a Sonos Queue node with a https reference to localhost (using the IP of the host) I get below error. If I point to a http address on the internet for playing a MP3 doorbell file it works fine - I would however like to have it locally to minimize latency and not to be dependent on internet connection. I can access https://1.2.3.4:8123/local/doorbell/doorbell1.mp3 in the browser and the MP3 doorbell plays fine as expected.
Hope you can help. Thanks a lot :)
KR
Torben
18 Dec 12:28:40 - [info] [better-sonos-queue:33a738af.d038b8] Direct play URI: https://1.2.3.4:8123/local/doorbell/doorbell1.mp3
18 Dec 12:28:40 - [error] [better-sonos-queue:33a738af.d038b8] Error: HTTP response code 500 for "urn:schemas-upnp-org:service:AVTransport:1#Seek"
Error: HTTP response code 500 for "urn:schemas-upnp-org:service:AVTransport:1#Seek"
at Request._callback (/config/node-red/node_modules/sonos/lib/sonos.js:216:23)
at Request.self.callback (/config/node-red/node_modules/request/request.js:185:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request. (/config/node-red/node_modules/request/request.js:1161:10)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at IncomingMessage. (/config/node-red/node_modules/request/request.js:1083:12)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:111:20)
18 Dec 12:44:16 - [info] Stopping flows
The volume up and down functions are not working.
You are giving back the wrong variables to handleSonosApi function. you are transmitting "_volume" but you should transmit "volume_val" wich would be the new calculated target volume value.
please correct...
Hi all,
I am using "Sonos Control" but it seems I am getting the following errors for the respective commands:
"Error: HTTP response code 500 for "urn:schemas-upnp-org:service:AVTransport:1#Pause""
"Error: HTTP response code 500 for "urn:schemas-upnp-org:service:AVTransport:1#Next""
"Error: HTTP response code 500 for "urn:schemas-upnp-org:service:AVTransport:1#Previous""
seem to all work. Just the others throw error messages:
22 Sep 20:49:46 - [error] [better-sonos-control:7997c9b0.f7e378] Error: HTTP response code 500 for "urn:schemas-upnp-org:service:AVTransport:1#Next"
Error: HTTP response code 500 for "urn:schemas-upnp-org:service:AVTransport:1#Next"
at Request._callback (/home/pi/.node-red/node_modules/sonos/lib/sonos.js:216:23)
at Request.self.callback (/home/pi/.node-red/node_modules/request/request.js:186:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request.<anonymous> (/home/pi/.node-red/node_modules/request/request.js:1163:10)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at IncomingMessage.<anonymous> (/home/pi/.node-red/node_modules/request/request.js:1085:12)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:111:20)
Do you have any ideas what the problem could be and how I can solve it?
Thanks!
Christoph
Hello!
I got the HTTP response error 500 as well. See picture.
I got several Sonos Players as you can see. Only the newer devices like the Sone One (with Alexa) or the Sonos Play:5 throw the error. I think the command to send a playpause to them is incorrect.
Older players like the Sonos Play:1 works fine.
Can you help please?
Regards,
David
Is it possible to switch a group to TV in (optical in of #playbar)?
It would be a great feature to select input options for devices like playbar, play 5 or others
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.