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

Sonos in a scene on a HCL


coco84

Question

Hi everybody

I'm new to Fibaro and so far I love it ! I have the Home Center Lite gateway and I was wondering if somebody managed to make it work in a scene with the Sonos players ?
I've already tried importing as a VD that I found on the Fibaro Market place but it doens't work.

My speakers work fine with the Sonos plugin but this one cannot used in a scene. And as I only have the Lite gateway, I can't do LUA.... I just want, on the weekends to hit play on my speaker at a specific time, so nothing fancy ... 

Thanks !

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

only with third-party services via calling a la Rest API from VD.

otherwise - no. sorry

Link to comment
Share on other sites

  • 0
  • Inquirer
  • On 2/23/2019 at 8:24 PM, 10der said:

    only with third-party services via calling a la Rest API from VD.

    otherwise - no. sorry

    I have a raspberry that I don't use anymore, could I use that ? following this documentation ? 

     

     

    Link to comment
    Share on other sites

    • 0

    IMHO easy way as for me, raspberry + Node-red + Sonos node.

    and IMHO again, Node-red for HCL - that's just the ticket.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • OK thanks, Ill give it a try. Never used Node Red but I ll try it out. 

    And then from the VD do you know if there is a post that explains how to do it (I ve tried searching the forum but didnt find anything specific)? 

    Sorry for my question, Im really New to all of this but willing to learn :)

    Thanks 

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Ok so I found 2 ways of doing it that works for my needs and on the HCL. In case it's relevant for sombody, I'll post my findings here

     

    1. Using the Sonos PLUGIN and then using a Virtual Device to call the buttons of the Sonos Plugin. I was then able to add the Virtual Device that called the buttons of the plugin on my scenes.

    For the Play Button on my VD for example : 
     

    GET /api/plugins/callUIEvent?deviceID=73&elementName=play_Button&eventType=onReleased HTTP/1.10x0D0x0AHost:127.0.0.1 0x0D0x0AAuthorization: Basic myusername:passwodcoded

    To set the volume to a specific value :

    GET
     /api/plugins/callUIEvent?deviceID=73&elementName=volume_Slider&value=14&eventType=onReleased HTTP/1.10x0D0x0AHost:127.0.0.1 0x0D0x0AAuthorization: myusername:passwodcoded

    The device ID (Sonos Plugin) I was able to retrieve it from the HCL (http://IP-of-my-hcl/api/devices)
     

    The downside with this method is that you can only action the existing buttons of the plugins and you need to have songs in the queue or a radio station set and it can't be changed from the plugin. So it's not the best but does a basic job

     

    2. That's why I think the second solution is more flexible and I like it better but you will need a third party device to install the sonos-http-api.

     

    I have a Rapsberry Pi that I wasn't currently using so I simply installed the RPi image that's available here : 

    Please login or register to see this link.

      on my device (very quick and easy. It can also be installed of course on an existing node.js)

    Don't forget to check for updates after installing it (I didn't I had new functions like TuneIn not available).

    And once it's up and running, it's super easy to use from a Virtual Device (at least for the basic functions I needed, like play/pause, preset my favorites TuneIn radios, set the volume to a specific value, etc). 

    Create the VD using the IP of the Rpi, and the port is 5005 and then create the buttons that you need using STRING values like : 

    Refer to the documentation API to find out how to use it : 

    Please login or register to see this link.

     
     

    For PLAY : 
     

    GET /Living%20Room/play HTTP/1.1
    Host:IPofYourRpi:5005

    <empty line>
    <empty line>

    <your curser should be here if you do a Ctrl+A of your string>

     

    The tricky part was figuring out that you need to have 2 blank lines after the host/port line. It doesn't work without those two blank lines (you really need to hit ENTER three times after the Host line)

     

    To Start Playing a specific radio TuneIn (here BBC Newcastle) : 
     

    GET /Living%20Room/tunein/play/18219 HTTP/1.1 
    Host:IPofYourRpi:5005
    <empty line>
    <empty line>

    <your curser should be here if you do a Ctrl+A of your string>

    To increase the volume from +2 : 
     

    GET /Living%20Room/volume/+2 HTTP/1.1

    Host:IPofYourRpi:5005
    <empty line>
    <empty line>

    <your curser should be here if you do a Ctrl+A of your string>

     

    Etc, etc

     


     

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