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

Working SONOS VD and TTS workaround - quick install guide


Question

Posted (edited)

hello all.

i have just bought some Sonos speakers and wanted to integrate with home center 2. 

first part is to control then second part text-to-speech workaround

 

whilst i was going through the forums i found the info i needed scattered around different threads and the original thread was very long, so i have thought i might make it easier by creating a small quick guide:

 

First thing is all credit to the virtual device goes to krikroff for the VD, original thread here -  

Please login or register to see this link.

 

I have created a video demo instead as it was easier to show rather than write.

 

 

 

video link is as above.

 

enjoy...

 

download link here:    

Please login or register to see this link.

Edited by morpheus75
update video link
  • Like 2

Recommended Posts

  • 0
Posted

Thanks for this!

I do have one question, I hope you can help me with that.

When a file has played, I lost my playlist. So I cannot simply press the play button on my Sonos.

Is there a way to "save" the playlist in a variable or something like that?

  • 0
  • Inquirer
  • Posted

    I know, that is the issue at the moment. I am going to have a look to see if I can find anything on this or try something myself. Theory of creating a play list file and use that in a variable is what I will be exploring

    • 0
    Posted

    Thanks, this is great !!!!

     

    Looking forward to the solution of the "playlist" issue.

     

    maybe you can add the link to the download at your post, it took me a while to get the url right. .... (my English is not so very good

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />  )

    • 0
  • Inquirer
  • Posted

    amended thread and added link here.

    • 0
    Posted

    Thanks! Looking forward to it, if you can find a solution for it.

    • 0
  • Inquirer
  • Posted

    ive been doing some reading and it looks like the playlist files cannot be extracted from sonos. there is no way to backup a sonos playlist either. so at the moment i cannot 'read' what playlist is currently being played before we send our notification file.

    however we can add a playlist file so that after an announcement it can play a playlist .m3u file.

    the issues with this is that you have to create your own separate m3u playlist file and store it with your music, once you have refreshed the sonos library using the sonos app you can store the path for this file into a variable and call it to play using the krikroff VD so that it plays all the tracks and not just 30 secs worth.

    you will not see a list in the queue, only the single m3u file but whilst it is playing the music you will see the track name that is being played.

     

    so unfortunately looks like the existing playlist is effectively lost and has to be restarted manually after using notifications this way comapred to TTS.  so hopefully TTS funcionality will be restored soon and we can go back to that method where it will not disturb our playlists.

     

    on the plus side it does give us a way to send a playlist to the Sonos.  

    Create a new variable and a VD with how many buttons you need.

    create your playlist files and assign each 1 to a VD.

    code each button to 'setGlobalValue' to your new variable and press play button on the krikroff VD instead

    this way you can use fibaro to start your specified playlist by pressing a VD button or using a scene...

     

    hope that all makes sense. 

    • 0
    Posted

    I also DO have the problem with TTS, so that's not different for me.

     

    You can see the playlist in Fibaro. If I go to "

    Please login or register to see this link.

     then I see an " ui.playlist.value" with my current playlist in Sonos.

    Maybe we can do something with that? I really don't now.

     

    Thanks for your effort!

    • 0
  • Inquirer
  • Posted

    ok i will look into that when i get home and see if anything can be done. thanks

    • 0
    Posted

    Great! Let us know

    Please login or register to see this image.

    /emoticons/default_icon_wink.gif" alt=";-)" />

    • 0
    Posted

    Thanks morpheus75

    You have maid my day, thanks for the video.

    It works great, Thanks

    • 0
  • Inquirer
  • Posted

    I also DO have the problem with TTS, so that's not different for me.

     

    You can see the playlist in Fibaro. If I go to "

    Please login or register to see this link.

     then I see an " ui.playlist.value" with my current playlist in Sonos.

    Maybe we can do something with that? I really don't now.

     

    Thanks for your effort!

    hi

    im not getting the ui.playlist.value appearing in my options

    also been testing the m3u file in the variable and it is working almost perfectly.

     

    after changing the variable to point to a m3u file intsead of the mp3 file it pre-loads the playlist with multiple files instead of a single file.

    you still have to let it play with the TTS VD first before you can set it to play again with the main VD

    the forward track and previous track still works fine

     

    here is example of what i tried:

     
    line 1 -  fibaro:setGlobal('frontsonos','//Diskstation/Music/frozenTest.m3u')
    line 2 - fibaro:call(190, "pressButton", "1")  
    line 3 - fibaro:sleep(30*1000)
    line 4 - fibaro:call(187, "pressButton", "7")
     
    line 1 sets up the playlist file in the variable
    line 2 loads the file from variable into Sonos and plays roughly 30 secs at the pre-determined volume level ( 50% in my video)
    line 3 the LUA code waits 30 secs
    line 4 it then presses Play again on the main VD app and starts the playlist from beginning at the existing sound level
     
    so far this is the only way i have managed to get the playlists to play

     

    im open to suggestions for better ways, im not a fully fledged programmer but understand the basics only

    • 0
    Posted

    You don't? Hmm. It's in the Sonos Plugin, not in a VD.

     

    Attached a screenshot how it looks at me.

    Please login or register to see this attachment.

    • 0
  • Inquirer
  • Posted

    i havent installed the sonos plugin. i will do that now and check again

     

    EDIT

     

    installed and checked. i can pull the playlist info and on checking the data it remembers the full path of the music files. 

    i have saved to a variable aswell.

    problem is getting it back into the sonos plugin

    • 0
    Posted

    I guessed that could be a problem. I really appreciate it, you looking into this so far, thanks.

    • 0
    Posted

    Nice Compilation of data, and great youtube walkthrough .. this is why Fibaro IMHO needs a wiki ! ..or more morpheus75's

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

    Cheers,

    al.

    • 0
    Posted

    Hi. Nice video. I have one question. To use the radio buttons i the VD. Where do i but in the radio url ?

    Thanks,

    Velle

    • 0
  • Inquirer
  • Posted

    hi

    i didnt put any URL for the radio into the VD itself. instead i chose 5 faviourite stations in the Sonos App itself and the VD just picked them up automatically.

    • 0
    Posted

    This is great , got it going so quickly ,but how do I get it to return to whatever was playing before this event on the Sonos. Any help much appreciated

    • 0
  • Inquirer
  • Posted

    This is great , got it going so quickly ,but how do I get it to return to whatever was playing before this event on the Sonos. Any help much appreciated

     

    that is the question. i cant work that bit out just yet....

    • 0
    Posted

    Hey there,

     

    looks like all works perfect but i have a problem with my alarm system with the tts workaround.

     

    I have a .mp3 alarm file that last for 3 Minutes.

     

    My problem is that the file get played from both sonos players, but after 30 seconds it stops. Is this a limit for the tts workaround?

     

    So i was thinking it just allows 30 seconds so i just tried to do a while and play the sound again. The problem is that it does just play the sound on one speaker and it ignores the others. Again after 30 seconds it happens that they switch sometimes and so on so it does not work as i want.

    Please login or register to see this code.

    I really hope someone can help me here..

    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...