-
Notifications
You must be signed in to change notification settings - Fork 36
/
INSTALL
72 lines (44 loc) · 2.3 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
** Installation **
In order to get the bot up and running you need to do the following.
* Pre-requisit: *
1: #Slack-group with admin rights
2: A server / machine that can run node.js
3: A working Sonos player configured with Spotify
4: You need to know the IP of your Sonos player.
Note: In order to get Text-to-speach working you need to know the IP of the host running SlackONOS as well as having a TCP port (in setting) open for traffic from the Sonos to the device.
#Slack
Create a bot in #Slack.
You need to give it a name, and write down the API Token. You will need this in your setting file later.
Hit "Save Integration" and you are done in #Slack.
Optional you can give the bot some nice namne, icon etc.
For an icon, have a look in zenmusic/doc/images/ZenMusic.png
Node.js - Slackonos!
This guide assume you have git, node.js and NPM installed, and running linux =)
Run the following commands in your terminal:
cd /opt
git clone https://github.com/htilly/zenmusic.git
cd zenmusic
npm install
cp config.json.example config.json
Almost there... some simple configuration first.
Edit config.json with your favorit text editor.
Replace:
"music-admin" - with the #slack channel you want the bot to respond to admin commands.`
"music" - with the #slack channel you want the bot to be a DJ in =)`
"IP_TO_SONOS" - with the (static) IP of you sonos player / controller.`
"SLACK:TOKEN" - with the token you got for the bot in "Slack.`
"US" - with the country that you use Spotify.
75 - with the maximum volume you can set the Sonos to via "setvolume" in #Slack
And last thing... start the bot!
Type:
node index.js
You should see something like:
[Sat Apr 30 2016 21:44:10 GMT+0200 (CEST)] INFO Connecting... Welcome to Slack. You are @zenmusicbot of Schibsted Media Group You are in: #music As well as: music-admin
** Known Issues **
If you for any reason get the following 500 error in the logs:
Error: HTTP response code 500 for "urn:schemas-upnp-org:service:AVTransport:1#AddURIToQueue"
Please try to change the following code in index.js. You need to change this in three places.
Don´t know what this is happening, but it has been confirmed on at least two systems :/
// Old version.. New is supposed to fix 500 problem...
// sonos.addSpotifyQueue(spid, function (err, res) {
sonos.addSpotify(spid, function (err, res) {