25.10.2016, 23:13
(This post was last modified: 25.10.2016, 23:29 by Erwin van der Zwart.)
Just a tip for everyone:
If you use the Sonos app HTTP api with LUA script, and you have password enabled on your app section ( like Andreas (: ) you need to send the password in the URL when you call the api.
You can also use localhost 127.0.0.1 in the URL instead of the controller IP address.
Commands would be like this:
--Basic controls examples:
--http://admin:password@127.0.0.1/apps/data/sonos/sonos.lp?name=Office&action=play
--http://admin:password@127.0.0.1/apps/data/sonos/sonos.lp?name=Living_Room&action=play -- use _ for spaces in the name
--http://admin:password@127.0.0.1/apps/data/sonos/sonos.lp?ip=192.168.10.31&action=stop
--http://admin:password@127.0.0.1/apps/data/sonos/sonos.lp?ip=192.168.10.31&action=mute-
--http://admin:password@127.0.0.1/apps/data/sonos/sonos.lp?ip=192.168.10.31&action=unmute
--http://admin:password@127.0.0.1/apps/data/sonos/sonos.lp?ip=192.168.10.31&action=next
--http://admin:password@127.0.0.1/apps/data/sonos/sonos.lp?ip=192.168.10.31&action=previous
--http://admin:password@127.0.0.1/apps/data/sonos/sonos.lp?ip=192.168.10.31action=setvolume&volume=10
--http://admin:password@127.0.0.1/apps/data/sonos/sonos.lp?name=Office&action=setvolumeup&step=10
--http://admin:password@127.0.0.1/apps/data/sonos/sonos.lp?ip=192.168.10.31&action=setvolumedown&step=10
--Play item from Queue / Favorites / Playlist examples:
--http://admin:password@127.0.0.1/apps/data/sonos/sonos.lp?name=Office&action=playuri&listtype=queue&listnumber=1
--http://admin:password@127.0.0.1/apps/data/sonos/sonos.lp?ip=192.168.10.31&action=playuri&listtype=favorites&listnumber=3
--http://admin:password@127.0.0.1/apps/data/sonos/sonos.lp?ip=192.168.10.31&action=loadplaylist&listnumber=9&autoplay=true
BR,
Erwin
If you use the Sonos app HTTP api with LUA script, and you have password enabled on your app section ( like Andreas (: ) you need to send the password in the URL when you call the api.
You can also use localhost 127.0.0.1 in the URL instead of the controller IP address.
Commands would be like this:
--Basic controls examples:
--http://admin:password@127.0.0.1/apps/data/sonos/sonos.lp?name=Office&action=play
--http://admin:password@127.0.0.1/apps/data/sonos/sonos.lp?name=Living_Room&action=play -- use _ for spaces in the name
--http://admin:password@127.0.0.1/apps/data/sonos/sonos.lp?ip=192.168.10.31&action=stop
--http://admin:password@127.0.0.1/apps/data/sonos/sonos.lp?ip=192.168.10.31&action=mute-
--http://admin:password@127.0.0.1/apps/data/sonos/sonos.lp?ip=192.168.10.31&action=unmute
--http://admin:password@127.0.0.1/apps/data/sonos/sonos.lp?ip=192.168.10.31&action=next
--http://admin:password@127.0.0.1/apps/data/sonos/sonos.lp?ip=192.168.10.31&action=previous
--http://admin:password@127.0.0.1/apps/data/sonos/sonos.lp?ip=192.168.10.31action=setvolume&volume=10
--http://admin:password@127.0.0.1/apps/data/sonos/sonos.lp?name=Office&action=setvolumeup&step=10
--http://admin:password@127.0.0.1/apps/data/sonos/sonos.lp?ip=192.168.10.31&action=setvolumedown&step=10
--Play item from Queue / Favorites / Playlist examples:
--http://admin:password@127.0.0.1/apps/data/sonos/sonos.lp?name=Office&action=playuri&listtype=queue&listnumber=1
--http://admin:password@127.0.0.1/apps/data/sonos/sonos.lp?ip=192.168.10.31&action=playuri&listtype=favorites&listnumber=3
--http://admin:password@127.0.0.1/apps/data/sonos/sonos.lp?ip=192.168.10.31&action=loadplaylist&listnumber=9&autoplay=true
BR,
Erwin