Controlling Sonos using HTTP requests?

  • @thomas204 Sure, I havn't tried to group or ungroup players using requests, but here is the request that selects Line-In as input:


    Method: POST

    Body: <s:Envelope xmlns:s="" s:encodingStyle=""><s:Body><u:SetAVTransportURI xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><InstanceID>0</InstanceID><CurrentURI>x-rincon-stream:RINCON_000E5887151E01400</CurrentURI><CurrentURIMetaData /></u:SetAVTransportURI></s:Body></s:Envelope>

    Content type: text/xml


    Value: "urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI"

    You will have to replace with the IP address of your Sonos device, and RINCON_000E5887151E01400 with the identifier assigned to your Sonos device (I think the last part is the MAC address).


  • @bambi2000 Any chance you could post an example with the exact contents of (one of) your internet request settings?

    I would like to have (for a start):

    • A Flic button group 3 players, then start a specific radio station
    • Another button that ungroups if grouped and then starts playback of a different favorite on a single player
      Is that possible?

    I am sure if I could get an example of the basic "framework" needed then i should be able to tweak the commands myself


  • @anton Custom headers was implemented some time ago, and I have successfully created requests that allows me to toggle between playing from line in, the queue and radio stations -- my own preset button for Sonos! :-)


  • Anything happening here?

  • Hi Anton,

    I'm jumping in on this topic.
    Since I have Sonos in multiple rooms I got myself 4 flic's but the options are not sufficient for what I thought would be possible.

    The scenario's I was thinking about;

    1. Leaving the house;
      I placed a Flic at our entrance. By pressing it, it should stop all Sonos players from playing. Some of them may be in a group, some stand alone.
      There is an option for "toggle" but that would start not-playing speakers.

    The I thought of using "pause". Same problem here. When there's another sonos not playing, that one would start playing.

    It would be wonderfull to have an option like "Stop all playing speakers"

    1. Turn on specific channel or spotify playlist on set-volume

    In the morning we listen to a news radio station. I intended to put a button in the bathroom which, when clicked once, would a) remove the bathroom speaker from any groups (so music only plays there) b) select the desired radiostation c) set the speaker to a fixes volume.

    At the same time I would also like to be able to do the same for a Spotify playlist and have it play my "Starred" list on shuffle.

    I was thinking of solving it on my own by installing a Raspberry Pi and running something like but seeing you're looking into this I was thinking it might help to share my ideas with you.

    Kind regards,


  • FlicTeam

    @johan213 @mail174 Thanks for the suggestions! We are looking at it.

  • @anton I would love to see some more Sonos actions. These are the tasks I do everyday:

    • With bedroom, Replace queue with Sonos playlist "good night Ebba"
    • With bedroom, Set Volume to 10
    • With Lukas, Replace queue with Sonos favorite "goodnight.mp3"
    • With Lukas, Set Volume to 15
    • With Lukas, Set Crossfade to On
    • With Lukas, Set Repeat On
    • With Lukas, Set sleep timer to 45 min

    And on my wish list I also would like to have a toggle button for two different Volume levels for the Sonos playing my TV sound. Watching movies when the kids are asleep I always have to turn the volume up and down (slow) when there is loud music or car crashes or someone whispers. TV remotes miss the button "Semi mute" and having this option with the press of a button would be super awesome!

  • @anton features request for Sonos integration:

    • support grouping of speakers
    • allow to play saved favorites
    • support to set the volume level for playing favorites/playlist
    • set the max play duration (sleep timer)
    • let you inspire by features of Macronos

  • FlicTeam

    @bambi2000 Btw, are there any particular features that you are looking for when it comes to the Sonos integration? I am actually working on it at the moment, so if you have any suggestions (beyond those already mentioned) then let me know!

  • @anton Thanks for the update!


  • FlicTeam

    @bambi2000 Improvement to the Internet Request action is in our roadmap, but I can not comment on when it will be released. Although custom headers it is a commonly requested feature so I hope we will be able to add it soon. We are currently also looking at making improvements to the Sonos action itself in order to extend the features there. For example to select songs and playlists.

  • My Sonos devices already have a button for play/pause/next, so I would like to use my Flic to select what to play, like a predefined radio station, the line-in or the queue.

    I thought I saw a post saying that custom headers for the Internet request was added recently, but apparently it isn't true. Is it in the works?


  • FlicTeam


    Although it should be possible to do this, the Internet Request action doesn't have support for adding custom request headers, which is needed for Sonos. It would also be a real pain to set Sonos up like this.

    May I ask why you are not using the Sonos action? Is it something you are missing?

Log in to reply