Logic Machine Forum
SONOS app - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Application Store (https://forum.logicmachine.net/forumdisplay.php?fid=11)
+--- Thread: SONOS app (/showthread.php?tid=415)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18


RE: SONOS app - balatis - 05.04.2018

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


RE: SONOS app - Erwin van der Zwart - 05.04.2018

Hi,

Try changing ftp into http and use a valid user like admin:password@ or use credentials from a created user. FTP will nor work for Sonos.

Test first from browser if http://admin:password@192.168.1.50/user/yourfilename.mp3 does work then use this url in the command you already have.

BR,

Erwin


RE: SONOS app - balatis - 05.04.2018

in the url i have that with http

here i have upload the mp3


RE: SONOS app - Erwin van der Zwart - 05.04.2018

Hi,

This is good, file is reachable, have you tried this combined with the sonos say command URL?

BR,

Erwin


RE: SONOS app - balatis - 05.04.2018

hi

i tried and this but nothing
-- 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.6&audiofile=http:admin:sonos123@192.168.1.50/user/Meditation-bell-sound.mp3.mp3&volume=50&duration=10')
log(reply)


RE: SONOS app - Erwin van der Zwart - 05.04.2018

Hi,

You are missing // after http: and the filename has .mp3 extention twice.

BR,

Erwin


RE: SONOS app - balatis - 05.04.2018

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


RE: SONOS app - admin - 06.04.2018

You must escape the audio file parameter:
Code:
require('socket.url')
require('socket.http')

file = socket.url.escape('http://admin:sonos123@192.168.1.50/user/Meditation-bell-sound.mp3')
socket.http.TIMEOUT = 5
reply = socket.http.request('http://admin:sonos123@127.0.0.1/apps/data/sonos/sonos.lp?action=say&ip=192.168.1.6&audiofile=' .. file .. '&volume=50&duration=10')
log(reply)



RE: SONOS app - balatis - 06.04.2018

goodmorning
thanks for the help it working!


RE: SONOS app - Daniel - 11.04.2018

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


RE: SONOS app - Mr.D - 04.05.2018

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! Smile


RE: SONOS app - balatis - 04.05.2018

(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! Smile
hi
i have same problem a delay 20sec


RE: SONOS app - Erwin van der Zwart - 04.05.2018

Hi,

Currently the Sonos app is being re-written due to the new Sonos API. Let's wait if the problem is gone in that version..

BR,

Erwin


RE: SONOS app - Mr.D - 04.05.2018

Hi Erwin,

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).


RE: SONOS app - Erwin van der Zwart - 04.05.2018

Hi,

No idea, need to ask this..

BR,

Erwin


RE: SONOS app - Bitver - 23.05.2018

Hi,

How is it possible to change audio source to line-in (SONOS:AMP) with one command
and then play some radio from Tune-in with another command?


RE: SONOS app - Erwin van der Zwart - 23.05.2018

Hi,

Selecting line-in is not included in the Sonos app API, it should be possible with upnpcmd function.

BR,

Erwin


Balance control on SONOS:AMP - puntukas - 22.07.2018

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?

Thanks a lot!


RE: Balance control on SONOS:AMP - Erwin van der Zwart - 23.07.2018

Hi,

Not implemented at this moment

BR,

Erwin


RE: Balance control on SONOS:AMP - puntukas - 23.07.2018

(23.07.2018, 10:26)Erwin van der Zwart Wrote: Hi,

Not implemented at this moment

BR,

Erwin

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>')

Smile