, I guess I'll resume working on my driver then. It supports TTS somewhat at least but doesn't instantly report updates made from the app (and it makes use of my RPi that was feeling a bit neglected these days). I'll probably use a combination of both drivers till you guys add all the functionality needed to make it a complete driver. Still looking forward to this release though.
@mike.maxwell
So if I wanted to play a single mp3 on a webserver, can I use the following command?
speaker.playTrack(uri, duration, volume)
I want to use this for announcements in the home and already have the mp3s hosted on a lan Web server, just waiting for this integration.
Andy
Iāve just fallen at the first hurdle.
Put in command npm install --production on my RPi and got a load of error messages.
pi@raspberrypi:~ $ npm install --production
npm ERR! install Couldnāt read dependencies
npm ERR! package.json ENOENT, open ā/home/pi/package.jsonā
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm canāt find a package.json file in your current directory.
npm ERR! System Linux 4.9.35-v7+
npm ERR! command ā/usr/bin/nodejsā ā/usr/bin/npmā āinstallā āāproductionā
npm ERR! cwd /home/pi
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! path /home/pi/package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/npm-debug.log
npm ERR! not ok code 0
Tried to find file package.json and it doesnāt exist.
The play track method only accepts one parameter uri, but yes this shoud work.
The easiest way to figure out the uri is to copy it from the trackUri item in the state variable after playing something from the sonos app...
After seeing the uri prefix that sonos uses, it's straightforward to then build custom uris
@mike.maxwell
Thanks Mike
I did think that the standard http://server/file.mp3 would work as the uri so Iām grateful for the info.
Would this be the preferred method or is there an alternative?
Andy
I would attempt to help but my linux skills are next to none and I would probably cause you more problems.
Do you have node installed? I know itās required for this api to work. I already had this installed from previous setups on my Pi from a while back. Unfortunately I donāt remember the right way setup node.
That will not work without a sonos style prefix (already tried it with a few radio urls),
Radio prefix: x-rincon-mp3radio://
Another: aac://
You'll see shortly
Any luck @bobbles?
Sorry I didnāt respond.
Not yet. Googled how to install node.js and have done that.
Watching football so gave up. (Or is that soccer. Depends where your from. )
Will perhaps have another look tomorrow.
Sonos is now available in latest update .709
Yipeeeeeeeeeeeeee!
Downloading now
@mike.maxwell
Mike did you change something with the sonos implimentation?
Http call to mp3 DOES work
Found by accident as an already configured app triggered.
Andy
no, turns out it works just fine for mp3ās
Sure Doesā¦
Iāll post a little app for it in about 10 mins
Andy
App posted here...
Andy
@mike.maxwell, in ST I used the below code to pull a list of recently played uriās that could then be saved as playlist presets. It doesnāt seem to work with the new sonos device drivers. Is this possible with your integration? Specifically line 3 below. Iāve changed ātrackDataā to āenqueuedUriā but it doesnāt return anything. Ohā¦and āsonosā is the musicplayer device input variable.
def stationSelections(){ //retrieves recently played stations from sonos speaker and presents as options when choosing station in VPLs
def newOptions = state.savedPList.findAll()//{it.selected==true} //ensures previously selected stations are included in the new list
def states = sonos.statesSince("trackData", new Date(0), [max:30]) //??gets all previously played tracks from sonos speaker
states?.each{ //for each track in the fresh list
def stationData = it.jsonValue
if(!newOptions.find{fav->fav.station==stationData.station}){ //checks whether previously selected tracks(newOptions) exist in the new list and prevents adding second entry
newOptions << [uri:stationData.uri,metaData:stationData.metaData,station:stationData.station]
}
}
def options = newOptions.collect{it.station?:"N/A"}.sort()
state.savedPList = newOptions
return options
}
the trackData json isnāt currently being sent to the event stream, which is why this wonāt work currently.
Gotcha. Please let me know if that changes so I can bring this app over.
what do we need to get SONOS to talk to the hub?
Not sure what youāre asking but the simple answer is ā¦ install the Sonos App.