SONOS API http commands

Hi all,

I want to be able to play certain favourites etc utilising the sonos API which i have running on my network.
Essentially, I want to click a imagebutton and for it to run for example:
http://localhost:5005/living room/playlist/[playlist name]

I can do this using the webbrowser and it works great but as soon as I hide the grid it works in, it stops working.
This may be a bit of a messy way of doing it so happy to hear any ideas.

Many thanks in advance,

Andy

1 Like

You can send custom HTTP requests with Plugins.

Thanks Bill, that works great.
I do have a slight problem, my lack of coding knowledge means I have managed to greate multiple switches by repeating the below, however I can’t quite work out where to put the section for the http commands for switch2, switch3 etc. Sorry I know it’s a beginnners question!

function onSynchronizeDevices() {
var switch2 = new Device();
switch2.Id = “2”;
switch2.DisplayName = “Switch 2”;
switch2.Capabilities = [“Switch”];
switch2.Attributes = [];
plugin.Devices[switch2.Id] = switch1;
}

function onPoll() {
}

SynchronizeDevices is optional. You can simply copy & paste existing device objects in the Explorer pane then edit them. You don’t need to write any code to do that.