INFO
Source code here: https://github.com/jishi/node-sonos-http-api
Sonos Web Controller draft (work in progress!): https://github.com/jishi/node-sonos-web-controller
Sonos IR control (requires lircd and IR reciever): https://github.com/jishi/node-sonos-remote-control
==============================================================
I know that there already is an attempt at this by this guy: http://forums.sonos.com/showthread.php?t=32643, but I found it to be a bit lacking in functionality so I decided to write up my own.
I have created a simple web-based API using what I have, which could be useful for integrating stuff with other applications. This web based API is inspired by other RESTful APIs, however I don't think it follows the correct guidelines to be called a REST API.
IT supports most basic features like:
play, pause, seek, next, prev, volume, mute, setAVTransportURI
It also supports these advanced fatures:
State of player as JSON, zone info as JSON, Play favorite item, presets (grouping, volume, avTransportURI)
You can read more in the README for each project.
To run it as a service under linux, I suggest using pm2 (https://github.com/Unitech/pm2). You need to run it in forked mode (-x)!
For Windows, you might try Winser http://jfromaniello.github.io/winser/
Cheers!
This topic has been closed for further comments. You can use the search bar to find a similar topic, or create a new one by clicking Create Topic at the top of the page.
Page 16 / 16
Well, I don't really have an answer.... other than, I wonder if it's because of how the pandora on your side is doing the stream. It's a logical assumption that slacker or rdio are acting closer to how the spotify is functioning that J's using....
Can you try any other sources than pandora? Even say the freeby version of slacker, which I have working here?
If I'm understanding the logic.... it's the device group with the most players....
Lets say you have 10 devices total....
Groups 5 players, 3 players, and a few singles....
It would pick the 5 player group.
Userlevel 2
Yes it does work with groups only not a single player is there a way that i could force the player id in the script so it will work for a single player I am just learning here and so please excuse my lack of understanding I appreciate your patience ......Robert
Userlevel 2
I have a single player in my setup (play5) and the dashboard is operating as expected in firefox. It would be nice to have the basic controls like volume, next, previous and play/pause along the bottom. Nothing fancy, just a nice layout for listening and viewing the album art
Userlevel 2
I do not dispute single player working it is when you have many players in your system the first player only will display if none are in a group I believe he did this to help me get a handle on the code am just trying to work out how to make it work a specific zone
As I said, it was never meant to be a controllable GUI, I only made it for my personal use in the Office.
If you want to control which player you will use, you will need to modify the "topology-change" event, line 43 in index.html to make another selection based on some input parameter (#uuid or ?uuid), something like this:
/dashboard/#RINCON_0058000000
It would probably be possible to rewrite it using roomName instead, but that requires some more thinking which I'm not capable of at the moment. If someone wants to create an enhanced version of this dashboard you are welcome to fork and send a pull request to me, but I will try and focus on some other alternative controller views.
If you want to control which player you will use, you will need to modify the "topology-change" event, line 43 in index.html to make another selection based on some input parameter (#uuid or ?uuid), something like this:
/dashboard/#RINCON_0058000000
code:
socket.on('topology-change', function (data) {
var players = {};
// make a hashtable of all players
data.forEach(function (i) {
players[i.uuid] = i;
});
// find which player you are interested in
var desiredPlayer = players[location.hash.substring(1)];
// now, we want the coordinator instead
currentZone = players[desiredPlayer.coordinator];
renderInfo();
});
It would probably be possible to rewrite it using roomName instead, but that requires some more thinking which I'm not capable of at the moment. If someone wants to create an enhanced version of this dashboard you are welcome to fork and send a pull request to me, but I will try and focus on some other alternative controller views.
Userlevel 2
No problem and many thanks........ for the guidance it really helps...
Been silent the last week, been trying to reclaim some sleep.
However, got some news for you. The web controller now has a working master mute. I also re-made the content of all buttons in SVG which means that it will scale nicely when making the interface bigger. Also added some css effects for a better feeling.
I also tried to make a fix when having multiple interfaces in your computer. Now it will search for Sonos players on all networks, and use then one which find a player first. Probably not of concern for most of you, but might help some of you with more advanced setups.
Enjoy!
However, got some news for you. The web controller now has a working master mute. I also re-made the content of all buttons in SVG which means that it will scale nicely when making the interface bigger. Also added some css effects for a better feeling.
I also tried to make a fix when having multiple interfaces in your computer. Now it will search for Sonos players on all networks, and use then one which find a player first. Probably not of concern for most of you, but might help some of you with more advanced setups.
Enjoy!
Userlevel 2
A gift for the holiday thank you ....:D
I'm sorry but I broke compatibility with node 0.8 in my last changes. This is fixed now. This is mostly for rasberry Pi-users, since it's a pain upgrading from source on it.
EDIT: Actually, you can download pre-compiled version here:
http://nodejs.org/dist/v0.10.22/node-v0.10.22-linux-arm-pi.tar.gz
EDIT: Actually, you can download pre-compiled version here:
http://nodejs.org/dist/v0.10.22/node-v0.10.22-linux-arm-pi.tar.gz
Userlevel 2
A bit off topic but how does one run your code as a server on a raspberry as a service every time i redirect node server.js > robert.txt i do not return to the bash so i can run the other script .....thanks
It does run though so the install is correct.....But have no clue what I am doing yet but learning....
Thanks
It does run though so the install is correct.....But have no clue what I am doing yet but learning....
Thanks
Userlevel 2
you can use the screen command to launch individual sessions on linux. Attach and detach from sessions at will
Userlevel 2
tried the new version works well in puppy linux but not so well in FreeBSD where it worked previously. Now the IP detection for the controler no longer functions. I get the following:
- binding SSDP to port 2509
- relevant IPs {}
- info - socket.io started
- http server listening on port 8000
notification server listening on port 3500
looks like it does not detect the network interface and then scan for sonos. This worked in previous versions. Any advice??
- binding SSDP to port 2509
- relevant IPs {}
- info - socket.io started
- http server listening on port 8000
notification server listening on port 3500
looks like it does not detect the network interface and then scan for sonos. This worked in previous versions. Any advice??
- binding SSDP to port 2509
- relevant IPs {}
- info - socket.io started
- http server listening on port 8000
notification server listening on port 3500
looks like it does not detect the network interface and then scan for sonos. This worked in previous versions. Any advice??
Which version of node are you running? Apparently the interfaces aren't detected on freebsd for some reason, probably an incompatibility in node.
Userlevel 2
Thanks for the quick reply. I am running FreeBSD 9.1p5 and Node-Devel-0.9.3 the latest port that I am aware of.
The dev build and the stable build are different packages, could you try it with the stable build, which should be 0.8.x something?
I'm not sure how the package system on freebsd works, but there seems to exist ports for 0.10 as well, but maybe not for your version?http://www.freshports.org/www/node
Page 16 / 16
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.