05.04.2018, 17:00 (This post was last modified: 05.04.2018, 18:21 by balatis.)
hi i would like to play a mp3 from ftp, i use that :
audiofile = socket.url.escape('ftp://apps:sonos123@192.168.1.50/user/Meditation-bell-sound.mp3')
socket.http.request('http://admin:sonos123@192.168.1.50/apps/data/sonos/sonos.lp?action=say&ip=192.168.1.6&audiofile=user/Meditation-bell-sound.mp3&volume=30&duration=20')
log(reply)
192.168.1.50 ip homelynk
192.168.1.6 ip sonos
but did not work....
can you help me
Thank you in advance
05.04.2018, 22:16 (This post was last modified: 05.04.2018, 22:18 by balatis.)
hi
badly does not work
-- Load modules
require('socket.http')
-- Set timout
socket.http.TIMEOUT = 5
socket.http.request('http://admin:sonos123@192.168.1.50/apps/data/sonos/sonos.lp?action=say&ip=192.168.1.8&audiofile=http://admin:sonos123@192.168.1.50/user/Meditation-bell-sound.mp3&volume=50&duration=10')
in the current logs i have : Event for track (32/1/2) 06.04.2018 01:13:13
* nil
thanks
Hi
I have some more info about new sonos API.
Sonos started some time ago new partner program and they created new API which is shared only with its partners. Sonos is even generating special key for each device which want to integrate with those players. Sonos will be testing and validating each 3rd party integration. Apparently this was started some times ago 2016 or something like that. Only partners were notified about this. New API will sill use upnp for discovery with some extended code. For the communication websocket will be used instead SOAP like now. This means complete rewrite of app.
It is not clear for me till when the old open API will be supported. At this moment each player support both. I heard from one source(not sure if valid) that open API will be blocked in 2-3 months from now.
SE is the owner of the sonos app and they started to work on implementation of the new API but it will take some time plus the verification.
BR
04.05.2018, 09:35 (This post was last modified: 04.05.2018, 09:44 by Mr.D.)
Balatis,
When running the script and loading the mp3 file, do you experience any lagg? I am doing the same as you, but from the time I enter the http command, and until it actually plays the file it takes more then 20-25 seconds.
What is your experience?
The lagg is driving me CRAZY!! Someone PLEASE HELP!
(04.05.2018, 09:35)Mr.D Wrote: Balatis,
When running the script and loading the mp3 file, do you experience any lagg? I am doing the same as you, but from the time I enter the http command, and until it actually plays the file it takes more then 20-25 seconds.
What is your experience?
The lagg is driving me CRAZY!! Someone PLEASE HELP!
Do you know what timeframe we are talking about?
I am using this function as a doorbell, but due to the lag it is not working all that good (people tend to believe we are not home, and leave before the doorbell rings and we get to open the door... hahaha).
Hi, browsed available api calls for SONOS app, but could not find any to control balance - i.e. change volume for Left channel say to 0 and for Right channel say to 50.
Could you advice?
Found out myself, seems to be easy:
upnpavcmd('192.168.1.126', 1400, 'SetVolume', '<Channel>LF</Channel><DesiredVolume>0</DesiredVolume>')
upnpavcmd('192.168.1.126', 1400, 'SetVolume', '<Channel>RF</Channel><DesiredVolume>100</DesiredVolume>')