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


Recommended Posts

Posted
5 minutes ago, AutoFrank said:

Hi @jimicr

 

Here's on for your players if you don't have something like it already

 

import the vd below, add your players to the main loop table

name the labels accordingly 

 

Create one variable called SonosTable

and use this scene to populate it at the start (adjust names to suit player names)

Try not having an underscore in the player name as VD labels don't seem to like them for some reason

Please login or register to see this code.

The SonosTable will track status and it has other variables like volume and favorite, etc which may prove useful in the future

You could also trigger other events off the sonos state changes such as tv on/off

 

I did publish this VD a good while back but the user had to create a block of code for each player which was not ideal

 

...end result is a status of all you players in one place :-)

 

_f

Please login or register to see this attachment.

 

Please login or register to see this link.

 

 

 

 

Please login or register to see this attachment.

Thanks!

 

Will play with it this afternoon :)

  • Topic Author
  • Posted
    2 minutes ago, jimicr said:

    Thanks!

     

    Will play with it this afternoon :)

     

    @jimicr, how the back healing coming along ?

    Posted

    Thanks for asking, a lot slower than hoped for.

     

    But will be okay :) 

  • Topic Author
  • Posted
    15 minutes ago, jimicr said:

    Thanks for asking, a lot slower than hoped for.

     

    But will be okay :) 

    Thats good to hear....

     

     

    Posted

    Got it to work, I was using your other one with this in the main loop (I added the sleep at the end)

    Please login or register to see this code.

    This works perfect aswell, what are the benefits of using the new one?

     

    Jim 

  • Topic Author
  • Posted
    6 minutes ago, jimicr said:

    Got it to work, I was using your other one with this in the main loop (I added the sleep at the end)

    Please login or register to see this code.

    This works perfect aswell, what are the benefits of using the new one?

     

    Jim 

     

    @jimicr

    its better coded (uses a table) so when you get your next few sonos zones you can just add them to the table

    The sonos table is a bit better  as well....

     

    .. plus it keep your lua skills sharp :-)

     

    Posted
    14 minutes ago, AutoFrank said:

     

    @jimicr

    its better coded (uses a table) so when you get your next few sonos zones you can just add them to the table

    The sonos table is a bit better  as well....

     

    .. plus it keep your lua skills sharp :-)

     

    You are right :) 

    Just to learn I adjusted the mainloop I added the following line:

    Please login or register to see this code.

    At line 18, I like "paused" better then "paused_playback" :)

  • Topic Author
  • Posted
    3 minutes ago, jimicr said:

    You are right :) 

    Just to learn I adjusted the mainloop I added the following line:

    Please login or register to see this code.

    At line 18, I like "paused" better then "paused_playback" :)

    Nice one @jimicr

     

    I must add that to mine as well 

     

    Thanks 

    Posted (edited)

    This works for the remote you posted in the OP:

    change this: 

    Please login or register to see this code.

    to:

    Please login or register to see this code.

     

    Edited by jimicr
    Posted

    Hi,

    Currently I`m using "SONOS Virtual Device made by Krikroff" but considering switch to this solution since there is option to use Synology NAS for this API :)

     

    The most important for me would be TTS. In Krikroff I have delay about 8 seconds so this is way too long response time to create whole logic for may use case.

    I see that using this API there are more options. How is about response time there? Which service seems to be the fastest?

     

    My internet connection should not be problem (low pings and quite fast). I would like to be able to use language PL or EN.

     

    Maybe someone switched from Krikroff solution or have both to give more info :)

     

     

  • Topic Author
  • Posted

    Hi @Bezan

    I use AWS Polly and have used VoiceRSS.  for me the TTS response time is 1-2 seconds which for me is very acceptable. I am not sure about Google TTS or what is available in Poland but perhaps others could comment on their experience 

    Posted

    @AutoFrank thanks for answer. Up to 2 seconds response time would be superb :)

    After while of research it seems that my Synology NAS does not allow Docker. On the other hand there are more issues running it this way.

    So, instead of changing NAS best would be to buy Raspberry PI and configure Sonos and other node like Alexa etc. there :)

    Do you have any step by step tutorial, website link where rookie can go through and have sonos api running on rpi? :) 

  • Topic Author
  • Posted
    3 hours ago, Bezan said:

    After while of research it seems that my Synology NAS does not allow Docker

    @Bezan, mine didnt either :-(

     

    3 hours ago, Bezan said:

    Do you have any step by step tutorial, website link where rookie can go through and have sonos api running on rpi? :) 

     

    Yes, If you go to the first post of this topic you will find the steps there 

     

     

    Posted

    I have previous Sonos VD still installed and now added sonos node api.

    After importing VD, putting IP to RPI and port 5005 it is not showing any informations. Buttons are also not working.

     

    Where should I start to look into it?

  • Topic Author
  • Posted
    2 hours ago, Bezan said:

    I have previous Sonos VD still installed and now added sonos node api.

    After importing VD, putting IP to RPI and port 5005 it is not showing any informations. Buttons are also not working.

     

    Where should I start to look into it?

     

    Hi @Bezan

    You also need to add your player name (exactly) to either the code or the VD general tab depending on which VD you have

    If you post the code from the main loop I should be able to tell from there 

  • Topic Author
  • Posted

    Hi,

    I recently had a power cut and my sonos api  (and HA bridge) got corrupted.

    Luckly I had a copy of my sd card so I was just able to swap it in.

     

    This reminded me that I never posted about making a copy of your rpi card

     

    anyway here is is 

    Please login or register to see this code.

    taken from 

    Please login or register to see this link.

     

    I always have a copy of the latest image and a spare sd card with that image

     

     

     

    Posted (edited)

    @AutoFrank,I added name exactly as in my Sonos app ( used %20 for space ).

    Now it seems to be working but not showing State. It is very important for me to control lights based on this status. Any idea why it is empty?

     

    Moreover, Sonos Players Status is also not showing status.

    Edited by Bezan
  • Topic Author
  • Posted
    1 hour ago, Bezan said:

    @AutoFrank,I added name exactly as in my Sonos app ( used %20 for space ).

    Now it seems to be working but not showing State. It is very important for me to control lights based on this status. Any idea why it is empty?

     

    Moreover, Sonos Players Status is also not showing status.

     

    Hi @Bezan

     

    Could you export your vd and include in post and I can take a look....

     

    _f

    Posted

    @AutoFrank VD attached

    Please login or register to see this attachment.

  • Topic Author
  • Posted

    @Bezan

     

    Slight change to main loop.. (this must have been an early VD)

     

    Change zoneState line to the following 

    Please login or register to see this code.

    and the status will show

     

    Please login or register to see this image.

    /monthly_2017_07/Capture.PNG.31e6696c0c1cd9e4114bd70cfaa30db2.PNG" alt="Capture.PNG.31e6696c0c1cd9e4114bd70cfaa30db2.PNG" />    

    Please login or register to see this attachment.

    Also instead of Title - you could display what they call artist (its also the radio station for internet radio)

     

    you can get this from 

     

    Please login or register to see this code.

    If you're interested the full json data for a player can be found through the browser by going to http://<ip of api:5005>/playername/state

     

    Please login or register to see this attachment.

     

    there are other parameters there that may interest you like elapsed time or station name, etc

     

    It's worth nothing that some of the data displayed is a little different depending on audio source

     

    .. anyway, hope this helps

    _f

     

    Join the conversation

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

    Guest
    Reply to this topic...

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