Created At

Sep 26, 2020

Last Update

Aug 25, 2021


HC 3 Lite, Z-box Hub, Yubii Home Pro, Yubii Home, Venture WISE, HC 3





Type Quick App

Sonos Player v0.2 (c) tinman


This QA provides all the simple functionality one might need to simply play something without any overhead of things that might be not necessary for lot of situations.
The idea behind : keep it simple!


  IPAddress -> the IP of your Sonos (master if any) speaker

  interval-volume -> refresh time for volume slider (and "volume" property). If you don't need to watch volume update set to 0 (value in second)

  interval-status -> refresh time for "state" property (see below). If you don't need the status, set it to 0 (value in seconds)


 - 0.1 - initlial release
 - 0.2 - fixed bug with volume, duplicated QA BUI controls removed


  This QA shows up in block scene with "play", "stop", "pause", "next", "prev", "mute" and "setVolume" functionality. You might use them of course from LUA as well.

  Additionally to these you might call below function (LUA only) to play from URI or CFIS like:

  play from radio source:, "playFromUri","")

  play from http source:, "playFromUri","")

  play from network share source:, "playFromCIFS"," and My Girlfriend.mp3")


You can get the current player status (PLAYING, STOPPED, PAUSED_PLAYBACK, TRANSITIONING) from your LUA code, to get some more control, like "when playing do stop", or e.g. when "TRANSITIONING" after "PLAYING" change source (e.g. ding dong played once, than radio/cifs stream)

       fibaro.getValue(SonosQAID, "state")

You can get the current URI (to play it later, e.g. after ding-dong.mp3) with code below. I decided to not update it automatically, to save resources. When you need it, call it:, "getCurrentSourceURI")
fibaro.sleep(1000) -- if necessary
fibaro.getValue(SonosQAID, "currentSourceURI")

You can even trigger in LUA scenes based on Sonos state, to e.g. turn party light on when Sonos is playing like this (1234 is the Sonos QA id)

  conditions = { {
      id = 1234,
      isTrigger = true,
      operator = "anyValue",
      property = "state",
      type = "device"
    } },
  operator = "all"

 trigger = sourceTrigger
if trigger.type=='device' then
    if trigger.value == "PLAYING" then
        print("sonos playing something, let's turn on some party lights")
    elseif trigger.value == "PAUSED_PLAYBACK" or trigger.value == "STOPPED" then
        print("sonos not playing, let's turn off party lights now")


For comments and questions visit: 

Oder hier:

Btw, if you need much more advanced Sonos Zone Controller, check


0 Comments,  Want to add comment please login
Load more comments
© 2024. Nice-Polska Sp. z o.o.Privacy policyTerms & ConditionsFeedback