Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

Quick App - Sonos Zone Controller


Krikroff

Question

Current version: 1.4.0
Date: 15/03/2021

 

Please login or register to see this image.

/monthly_2020_10/Preview_1.3.1.PNG.07af3ad8f4e892c6f2a00a8452a48bde.PNG" />

 

FUNCTIONS


The functions of this Quick App are:

Allowing to control Sonos Player from Home Center 3. It does support basic and advanced functions:

 

  • Basic Transport Control
    • Initiate playback
    • Toogle, Pause or Stop playback
    • Skip to the previous or Next track
  • Basic Rendering Control
    • Get player volume and mute state
    • Set player volume to a specific level and unmute the player if muted
    • Increase or decrease player volume
    • Get or Set or Toggle player mute state (Mute or unmute the player)
    • Get or Set or Toggle player loudness state
  •  Device Properties
    • Get or Set group LED state
  • Restart the QA Device
  • Enable Debug Mode

 

See Changelog / Manual for basic and advanced available actions

 

Examples:

  • Set player volume to a specific level and unmute the player if muted.
    fibaro.call(ID_QUICKAPP, "setVolume", 10, "Master")
  • Increase or decrease player volume.
    fibaro.call(ID_QUICKAPP, "setRelativeVolume", -5, "Master")
  • Initiate playback.
    fibaro.call(ID_QUICKAPP, "play")
  • Play a file at volume 10 with snapshot/revert process to restore previous state
    fibaro.call(ID_QUICKAPP, "playFile", "35HTGV34R7S/CD/Album/song.flac", true, 10)
  • Play a stream at volume 20 & 8s duration with snapshot/revert process to restore previous state
    fibaro.call(ID_QUICKAPP, "playStream", "https://s3.amazonaws.com/smartapp-media/sonos/bell1.mp3", true, 20, 8000)

 

Version 1.4.0

Tested with Sonos Sonos OS: S2 - Version 13 (number 62186220)
Tested with HC3 & HC3Lite v5.050.13 -> v5.063.30

  • Fix for Sonos firmware version 13
  • Fix for Sonos ARC getPositionInfo and malformed xmlsoap (hope full supoport soon)
  • Add playNextRadio command to navigate the radios
  • Add play mode control from QA button (loop in NORMAL,REPEAT_ALL,REPEAT_ONE,SHUFFLE_NOREPEAT,SHUFFLE,SHUFFLE_REPEAT_ONE)
  • Fix Radio metadata strange behaviors in some situations

 

 


 

Version 1.3.8

Tested with Sonos Sonos OS: S2 - Version 12.2.2 (number 61183220)

 

  • Improved support for albumArt, now work with Sonos Radio, Amazon Music, Spotify, TuneIn, Music library
  • Add option 'protect' to playFile and playStream for disallow to restart a playing
  • Add Crossfade mode support with getCrossfadeMode, setCrossfadeMode and toggleCrossfadeMode commands
  • Add sleepTimer command
  • Add setPlayMode command, support: NORMAL,REPEAT_ALL,REPEAT_ONE,SHUFFLE_NOREPEAT,SHUFFLE,SHUFFLE_REPEAT_ONE
  • Add selectLineIn command
  • Add in variables panel, "notification" variable to enable or disable the "Device notification error", if disabled QA trace the message in QA console only
  • Various improvement

 

Version 1.3.1 RC

Tested with Sonos Software Version: 56.0-76060 / Sonos OS: S2 - Version 12.0.5 & 12.1

 

  • Add support to use in block scenes (Play, Pause, Stop, Next, Prev, Set Volume, Set mute) 
  • Support for album covers when available (cf. music library)
  • Performance improvement when initiating a playback
  • Improved radio playback and track information
  • Increase the number of supported radio stations (with auto configuration up to 9)
  • Support for Sonos playlists (with auto configuration up to 6 saved queues)
  • Add playFile command
  • Add playStream command
  • Add playSavedQueue command
  • Add startQueue command
  • Add clearQueue command
  • Add seek command
  • Add snapshot command
  • Add revert command
  • Add getListSavedQueues command
  • Add addURIToQueue command
  • Add checkForUpdate command
  • Add getTreble and setTreble commands
  • Add getBass and setBass commands
  • Various Bug fixes (Polling when not configured, parsing ...)

 

Version 1.1.1

  • Support for TuneIn "My radio stations" (with auto configuration up to 6 radios)
  • Deletion of the variable variable "isConfigured" used by internal FTI Configuration
  • Minor bug fixes (No route to host cause wrong configuration status)
  • Tested with Sonos Software Version:55.1-74250 and 56.0-76060
  • Performance improvement

 

Version 1.0.3

  • Fix a problem with internal zoneGroups and ZoneGroupMembers parsing (Thanks to jgab, Alan Klepacz and robw)

 

Version 1.0.2

  • Minor bug fixes (Thanks to Macschimmi, Bodyart, minsad79) 

 

Version 1.0.0

  • Based on my HC2 virtual Device and completely rewriten for HC3 v5.030.45 or highter
  • Very low latency and more robust device (commands execution, processing)
  • Easy installation with auto configuration assist
  • Support standard capabilities (AVTransport, RenderingControl)
  • Displaying information on the currently playing or media loaded
  • Fully controllable from the LUA scenarios (see available command list)

 

 

You can download it from the Fibaro market: 

Please login or register to see this link.

 

 hope you will be pleased with it

 

 

ROADMAP

  • Support for multi-devices in group used for triggering in scene and prepare for group-ungroup
  • Support for TV source (if supporteed by device)
  • Support for Group
  • Support for TTS
Edited by Krikroff
Version 1.4.0
  • Like 16
  • Thanks 2
Link to comment
Share on other sites

Recommended Posts

  • 0
  • Inquirer
  • Happy Holidays - joyeuses fêtes - Wesołych Świąt - Frohe Weihnachten ! ?

     

    Small update today with new 1.3.8 (in review on market since yesterday)

    • Improved support for albumArt, now work with Sonos Radio, Amazon Music, Spotify, TuneIn, Music library
    • Add option 'protect' to playFile and playStream for disallow to restart a playing
    • Add Crossfade mode support with getCrossfadeMode, setCrossfadeMode and toggleCrossfadeMode commands
    • Add sleepTimer command
    • Add setPlayMode command, support: NORMAL,REPEAT_ALL,REPEAT_ONE,SHUFFLE_NOREPEAT,SHUFFLE,SHUFFLE_REPEAT_ONE
    • Add selectLineIn command
    • Add in variables panel, "notification" variable to enable or disable the "Device notification error", when disabled the QA trace the message in QA console only
    • Various improvement
    • Tested with Sonos Sonos OS: S2 - Version 12.2.2 (number 61183220)

     

    I wish you a Happy Holiday season.

     

    Best regards,

    Jean-Christophe

    • Like 5
    • Thanks 1
    Link to comment
    Share on other sites

    • 0
    On 12/24/2020 at 3:13 PM, Krikroff said:

    Happy Holidays - joyeuses fêtes - Wesołych Świąt - Frohe Weihnachten ! ?

     

    Small update today with new 1.3.8 (in review on market since yesterday)

    • Improved support for albumArt, now work with Sonos Radio, Amazon Music, Spotify, TuneIn, Music library
    • Add option 'protect' to playFile and playStream for disallow to restart a playing
    • Add Crossfade mode support with getCrossfadeMode, setCrossfadeMode and toggleCrossfadeMode commands
    • Add sleepTimer command
    • Add setPlayMode command, support: NORMAL,REPEAT_ALL,REPEAT_ONE,SHUFFLE_NOREPEAT,SHUFFLE,SHUFFLE_REPEAT_ONE
    • Add selectLineIn command
    • Add in variables panel, "notification" variable to enable or disable the "Device notification error", when disabled the QA trace the message in QA console only
    • Various improvement
    • Tested with Sonos Sonos OS: S2 - Version 12.2.2 (number 61183220)

     

    I wish you a Happy Holiday season.

     

    Best regards,

    Jean-Christophe

    Looking forward to test - I guess i need to wait for the markedplace release ?

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • The latest version has been under review since Dec 23.

    Hello @A.Socha, can you do something?

     

    Happy holidays season :)

     

    • Thanks 3
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Posted (edited)

    Available on the Fibaro Markeplace ?

     

    Always in review on the Fibaro marketplace.

    Available directly here: 

    Please login or register to see this link.

     

    @tinman, You can grab it and post on your site ?

    Edited by Krikroff
    • Like 4
    • Thanks 2
    Link to comment
    Share on other sites

    • 0

    cool thanks, got it and updated site!

    Link to comment
    Share on other sites

    • 0

    thanks krikoff best of best

    Edited by minsad79
    Link to comment
    Share on other sites

    • 0
    On 12/21/2020 at 1:41 PM, jgab said:

    Yes, in ER4 you can do anything :-)

    You can always trigger on centralSceneEvents from the Matrix and send appropriate commands to the Sonos QA

    Instead of send startLevelIncrease and stopLevelIncrease you could have a rule that repeat sound level increase starting when it sees 'HeldDown' to it sees a 'Released'.

     

    Please login or register to see this code.

     

    Hi Jan - I tried this

    Please login or register to see this code.

    HI Jan

    The two togglePlay works fine.

    the volume control has an issue, at least on my HC3. When Helddown for lets say 2 seconds and then release, it has cued up so many Helddown commands, so is continue incVolume or decVolume for at least 10 seconds.

    My HC3 runs Children of Hue, EV4 - 3-4 other QA and around 50zwave devices. NO Scenes - they are all migrated to EV4

    Would that be something you have heard about?

     

    Link to comment
    Share on other sites

    • 0
    19 minutes ago, ChristianSogaard said:

    Hi Jan - I tried this

    Please login or register to see this code.

    HI Jan

    The two togglePlay works fine.

    the volume control has an issue, at least on my HC3. When Helddown for lets say 2 seconds and then release, it has cued up so many Helddown commands, so is continue incVolume or decVolume for at least 10 seconds.

    My HC3 runs Children of Hue, EV4 - 3-4 other QA and around 50zwave devices. NO Scenes - they are all migrated to EV4

    Would that be something you have heard about?

     

     

    Well, it kind of makes sense. It takes some times for the sonos QA to send the command, but ER4 process key events as fast as possible. 

    So, either the sonos QA implements startLevelIncrease and friends, making it simple - or ER4 can listen to the sonos QA actually changing the volume and pace the commands accordingly.

    Let me come back with a rule that should fix that,.

    • Thanks 1
    Link to comment
    Share on other sites

    • 0
    1 hour ago, jgab said:

     

    Well, it kind of makes sense. It takes some times for the sonos QA to send the command, but ER4 process key events as fast as possible. 

    So, either the sonos QA implements startLevelIncrease and friends, making it simple - or ER4 can listen to the sonos QA actually changing the volume and pace the commands accordingly.

    Let me come back with a rule that should fix that,.

    ohhh - Yes Please? and my COH also have a little afterslip - but not as close as the SONOS

    Link to comment
    Share on other sites

    • 0
    On 4/25/2020 at 11:16 AM, Krikroff said:

    Hello @olekenneth,

     

    Behind the scene in the Sonso Upnp world, a complete environment consists of ZoneGroups, the details:

     

    ZoneGroups = a set of ZoneGroup

    ZoneGroup = a room, composed of one or more members (ZoneGroupMember) with a dedicated ID
    ZoneGroupMember = One Sonos device (Only one member can be the coordinator of the group to which he belongs) identified by unique ID (UUID)

     

    In real life for example, if in your living room you have a stereo pair (Play:1) with a sub:

     

    ZoneGroup: "Living Room" - Coordinator: Play:1 - L

    1. ZoneGroupMember: Play:1 - L (group coordinator, its IP must be declared in the Quick App)

    2. ZoneGroupMember: Play:1 - R

    3. ZoneGroupMember: SUB

    1 room = 1 zone group = 1 Quick App :)

     

    NB: The features for grouping rooms, volume, party mode, making it visible or invisible, etc. are different things

     

     

    You have a set of ZoneGroup (your rooms composed with members aka your physical devices) in ZoneGroups.

    Room 1 = 1 Quick App

    Room 2 = 1 Quick App

    Room 3 = 1 Quick App

    Room 4 = 1 Quick App

     

     

    Thank you for developing the SONOS QA.

    I'm looking for Scene or EV4 examples setting up "party mode" that would be used for internal Alarm.

    I see getCommands for ZoneGroups 

    I found some description at .

    Please login or register to see this link.

     

    Please login or register to see this code.

     

    I'm using a setup like this

    You have a set of ZoneGroup (your rooms composed with members aka your physical devices) in ZoneGroups.

    Room 1 = 1 Quick App

    Room 2 = 1 Quick App

    Room 3 = 1 Quick App

    Room 4 = 1 Quick App

     

    Just saw this comment in the markedplace - so i will probably need to wait :-)

    ROADMAP

    Support for multi-devices in group used for triggering in scene and prepare for group-ungroup
    Support for TV source (if supporteed by device)
    Support for Group
    Support for TTS

    Edited by ChristianSogaard
    P
    • Like 1
    Link to comment
    Share on other sites

    • 0
    On 4/20/2020 at 12:14 PM, Krikroff said:
    • Please login or register to see this link.

    • Please login or register to see this link.

    • Please login or register to see this link.

    • Please login or register to see this link.

    Current version: 1.3.8
    Date: 24/12/2020

     

    Please login or register to see this link.

     

    FUNCTIONS


    The functions of this Quick App are:

    Allowing to control Sonos Player from Home Center 3. It does support basic and advanced functions:

     

    • Basic Transport Control
      • Initiate playback
      • Toogle, Pause or Stop playback
      • Skip to the previous or Next track
    • Basic Rendering Control
      • Get player volume and mute state
      • Set player volume to a specific level and unmute the player if muted
      • Increase or decrease player volume
      • Get or Set or Toggle player mute state (Mute or unmute the player)
      • Get or Set or Toggle player loudness state
    •  Device Properties
      • Get or Set group LED state
    • Restart the QA Device
    • Enable Debug Mode

     

    See Changelog / Manual for basic and advanced available actions

     

    Examples:

    • Set player volume to a specific level and unmute the player if muted.
      fibaro.call(ID_QUICKAPP, "setVolume", 10, "MASTER")
    • Increase or decrease player volume.
      fibaro.call(ID_QUICKAPP, "setRelativeVolume", -5, "MASTER")
    • Initiate playback.
      fibaro.call(ID_QUICKAPP, "play")
    • Play a file at volume 10 with snapshot/revert process to restore previous state
      fibaro.call(ID_QUICKAPP, "playFile", "35HTGV34R7S/CD/Album/song.flac", true, 10)
    • Play a stream at volume 20 & 8s duration with snapshot/revert process to restore previous state
      fibaro.call(ID_QUICKAPP, "playStream", "https://s3.amazonaws.com/smartapp-media/sonos/bell1.mp3, true, 20, 8000)

     

    Version 1.3.8

    Tested with Sonos Sonos OS: S2 - Version 12.2.2 (number 61183220)

     

    • Improved support for albumArt, now work with Sonos Radio, Amazon Music, Spotify, TuneIn, Music library
    • Add option 'protect' to playFile and playStream for disallow to restart a playing
    • Add Crossfade mode support with getCrossfadeMode, setCrossfadeMode and toggleCrossfadeMode commands
    • Add sleepTimer command
    • Add setPlayMode command, support: NORMAL,REPEAT_ALL,REPEAT_ONE,SHUFFLE_NOREPEAT,SHUFFLE,SHUFFLE_REPEAT_ONE
    • Add selectLineIn command
    • Add in variables panel, "notification" variable to enable or disable the "Device notification error", if disabled QA trace the message in QA console only
    • Various improvement

     


     

    Version 1.3.1 RC

    Tested with Sonos Software Version: 56.0-76060 / Sonos OS: S2 - Version 12.0.5 & 12.1

     

    • Add support to use in block scenes (Play, Pause, Stop, Next, Prev, Set Volume, Set mute) 
    • Support for album covers when available (cf. music library)
    • Performance improvement when initiating a playback
    • Improved radio playback and track information
    • Increase the number of supported radio stations (with auto configuration up to 9)
    • Support for Sonos playlists (with auto configuration up to 6 saved queues)
    • Add playFile command
    • Add playStream command
    • Add playSavedQueue command
    • Add startQueue command
    • Add clearQueue command
    • Add seek command
    • Add snapshot command
    • Add revert command
    • Add getListSavedQueues command
    • Add addURIToQueue command
    • Add checkForUpdate command
    • Add getTreble and setTreble commands
    • Add getBass and setBass commands
    • Various Bug fixes (Polling when not configured, parsing ...)

     

    Version 1.1.1

    • Support for TuneIn "My radio stations" (with auto configuration up to 6 radios)
    • Deletion of the variable variable "isConfigured" used by internal FTI Configuration
    • Minor bug fixes (No route to host cause wrong configuration status)
    • Tested with Sonos Software Version:55.1-74250 and 56.0-76060
    • Performance improvement

     

    Version 1.0.3

    • Fix a problem with internal zoneGroups and ZoneGroupMembers parsing (Thanks to jgab, Alan Klepacz and robw)

     

    Version 1.0.2

    • Minor bug fixes (Thanks to Macschimmi, Bodyart, minsad79) 

     

    Version 1.0.0

    • Based on my HC2 virtual Device and completely rewriten for HC3 v5.030.45 or highter
    • Very low latency and more robust device (commands execution, processing)
    • Easy installation with auto configuration assist
    • Support standard capabilities (AVTransport, RenderingControl)
    • Displaying information on the currently playing or media loaded
    • Fully controllable from the LUA scenarios (see available command list)

     

     

    You can download it from the Fibaro market: 

    Please login or register to see this link.

     

     hope you will be pleased with it

     

     

    ROADMAP

    • Support for multi-devices in group used for triggering in scene and prepare for group-ungroup
    • Support for TV source (if supporteed by device)
    • Support for Group
    • Support for TTS
    • Please login or register to see this link.

    • Please login or register to see this link.

    • Please login or register to see this link.

    • Please login or register to see this link.

    Thanks again Kirkoff!

     

    Is there a way I can upgrade an existing QuickApp Sonos device from 1.3.1 to 1.3.8, without having to create a new DeviceID & deleting the old one?

     

    Would going into the original Device, entering the edit mode and replacing the main set of 1.3.1 code with the ones from a 1.3.8 work, or is there an alternative?

     

    Thanks again!

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • No alternative, I had asked Fibaro if it was possible to integrate an update mechanism but I believe that it is not in the priorities ;)

    • Like 1
    Link to comment
    Share on other sites

    • 0
    On 1/2/2021 at 6:12 PM, jgab said:

     

    Well, it kind of makes sense. It takes some times for the sonos QA to send the command, but ER4 process key events as fast as possible. 

    So, either the sonos QA implements startLevelIncrease and friends, making it simple - or ER4 can listen to the sonos QA actually changing the volume and pace the commands accordingly.

    Let me come back with a rule that should fix that,.

    Hi Jan - wondering if this is possible to solve? . I tried myself, but no luck

    Link to comment
    Share on other sites

    • 0
    19 hours ago, ChristianSogaard said:

    Hi Jan - wondering if this is possible to solve? . I tried myself, but no luck

    My thinking was that when the Sonos controller updates its volume property there will be a trigger

    Please login or register to see this code.

    Then we can set a flag that the volume have been changed, and only update volume in the loop if volume changed?

    It may actually turn out to be too slow

    Please login or register to see this code.

     

    If it's too slow, you could try to make the loop faster

    incVolume = rule("@@0.5 ......

    that would set the loop to 500ms 

     

    I haven't tried it myself.

    Link to comment
    Share on other sites

    • 0
    1 minute ago, jgab said:

    My thinking was that when the Sonos controller updates its volume property there will be a trigger

    Please login or register to see this code.

    Then we can set a flag that the volume have been changed, and only update volume in the loop if volume changed?

    It may actually turn out to be too slow

    Please login or register to see this code.

     

    If it's too slow, you could try to make the loop faster

    incVolume = rule("@@0.5 ......

    that would set the loop to 500ms 

     

    I haven't tried it myself.

    Merci ? - I will test, and get back with the result :-)

    Link to comment
    Share on other sites

    • 0
    On 1/11/2021 at 6:31 PM, Krikroff said:

    No alternative, I had asked Fibaro if it was possible to integrate an update mechanism but I believe that it is not in the priorities ;)

    I think @jgab did an update mechanism in his EV4?

    Link to comment
    Share on other sites

    • 0
    On 1/11/2021 at 5:54 PM, michaelash said:

    Thanks again Kirkoff!

     

    Is there a way I can upgrade an existing QuickApp Sonos device from 1.3.1 to 1.3.8, without having to create a new DeviceID & deleting the old one?

     

    Would going into the original Device, entering the edit mode and replacing the main set of 1.3.1 code with the ones from a 1.3.8 work, or is there an alternative?

     

    Thanks again!

    Thank you @Krikroff for developing this!

    I had some issues earlier with - Increase or decrease player volume - just want to mention.
    fibaro.call(ID_QUICKAPP, "setRelativeVolume", -5, "MASTER"). - this dont work for me

    fibaro.call(ID_QUICKAPP, "setRelativeVolume", -5, "Master") - this works for me

    If findings are correct, i think its only documentation needed to be updated.

    Edited by ChristianSogaard
    P
    • Thanks 1
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • I’ll check asap?

    Link to comment
    Share on other sites

    • 0
    3 hours ago, jgab said:

    My thinking was that when the Sonos controller updates its volume property there will be a trigger

    Please login or register to see this code.

    Then we can set a flag that the volume have been changed, and only update volume in the loop if volume changed?

    It may actually turn out to be too slow

    Please login or register to see this code.

     

    If it's too slow, you could try to make the loop faster

    incVolume = rule("@@0.5 ......

    that would set the loop to 500ms 

     

    I haven't tried it myself.

     

     

    3 hours ago, jgab said:

    My thinking was that when the Sonos controller updates its volume property there will be a trigger

    Please login or register to see this code.

    Then we can set a flag that the volume have been changed, and only update volume in the loop if volume changed?

    It may actually turn out to be too slow

    Please login or register to see this code.

     

    If it's too slow, you could try to make the loop faster

    incVolume = rule("@@0.5 ......

    that would set the loop to 500ms 

     

    I haven't tried it myself.

    Hi @jgab - thank you for this EV4 rule.

    I tested it - an it didn't work at first try.

    Problem was this rule

    rule("#device{id=sonos_kitchen,property='volume',value='$new',old='$old'} & new~=old => VC=true")

    never triggered, but i got you idea, and made this small change

    and now it works - Great work Jan, Thank you...

     

    Please login or register to see this code.

     

    Edited by ChristianSogaard
    P
    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...