Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: Sonos & Idratek

  1. #11
    Automated Home Jr Member
    Join Date
    Jan 2006
    Location
    Trowbridge, England
    Posts
    40

    Default Programming Sonos

    I've looked at the possibility of linking the two. Sonos uses standard web API's, but to connect the two you would need something to act as an intermediary to translate between the two systems. This is not too difficult to do to link simple actions, e.g to connect an Idratek button to the volume for a specific zone, but if you want to set up programmable connections it rapidly gets complicated. Sonos uses UPNP and SOAP. The SOAP commands can easily be sent programmatically, but to construct them in a robust manner you really need to do UPNP discovery, which is more complicated. The simpler interfaces between Home automation systems and Sonos cheat, by omitting the UPNP element and rely on the fact that Zoneplayer ID's don't change once a system has been setup and is stable. But you still have to determine what the Zoneplayer ID's are and what IP addresses they are using to omit the UPNP element.

    The Sonos system could be used to send announcements from Cortex, but the complicated bit would be remembering the state of the system before the announcement and then restoring that state and resuming what was being played afterwards. All the functions exist in the Sonos API to do this, but programming it is not a trivial task.

    Here are some examples of what has been done:

    http://blog.travelmarx.com/2010/06/e...-via-upnp.html
    http://blog.travelmarx.com/2010/06/s...plication.html
    http://forums.sonos.com/showthread.php?t=27423&page=2
    http://jpmens.net/2010/03/16/sonos-pause-switch/

  2. #12
    Moderator Kevin's Avatar
    Join Date
    Jan 2004
    Location
    West Yorkshire
    Posts
    554

    Default

    Quote Originally Posted by Karam View Post
    Might there be a way via the xAP interface? I.e. someone already written an application to bridge between Sonos and xAP (and there on to Cortex).
    There isn't a standalone xAP <> Sonos bridge application / device . We can get Sonos onto xAP via a couple of other standalone home automation applications - that have plugins for Sonos which we then expose via xAP but Cortex users aren't likely to want to go that path, which is the the way I do this myself. The Sonos UPnP implementation is very tricky to implement in a useful/complete way as it's non standard too, although basic transport control start/stop/pause and possibly volume is much easier.

  3. #13
    Automated Home Sr Member cliffwright's Avatar
    Join Date
    Mar 2007
    Posts
    73

    Default

    Quote Originally Posted by chris_j_hunter View Post
    >I currently have an ITR module in my server room that turns on my amplifier & power to the TV when ...

    interesting - how many different devices could one ITR module cope with ...

    does every device use unique codes ...

    is every make or model of TV or DVR or whatever, distinguishable ...

    or ... ????
    It's down to Cortex rather than the module - but the cortex helpfile states it can hold upto 140 different IR frames.

    Yes - most devices will use unique codes although obviously if you've got more then 1 of any device, or if you've maybe got some devices of the same brand you may find they share codes so something to watch out for.

    The ITR just "learns" the IR packets and you assign them to a virtual remote control button in Cortex - which you can you then tinker with logic controls to trigger as you need. I've added buttons for each of the "on", "off" (where this isn't a repeat of the "on" IR packet), "Vol up", "Vol down" and a couple of the "mode" and "Tuner pre-set" options for my amp in case I wanted to set it to auto turn on and tune to my favourite radio station and switch to output to the bathroom / kitchen etc.

    It works pretty well - the only thing to watch out for is positioning of the ITR module in a clear view of the devices - mine are all rack mounted under the stairs and I've put the ITR on the wall facing them so it works flawlessly unless there happens to be someone in the cupboard reaching for a coat at the exact moment an IR frame is passed (ie never) - but if that's an issue, the ITR module has a connection for an external TX so you could position an IR blaster right in front of the device a bit like the SKy Remote extenders do . . .

  4. #14
    Automated Home Legend Karam's Avatar
    Join Date
    Mar 2005
    Posts
    817

    Default

    Quote Originally Posted by cliffwright View Post
    It's down to Cortex rather than the module - but the cortex helpfile states it can hold upto 140 different IR frames.
    Just a slight correction - it is actually the module which holds these frames (so for example can be emitted as a result of direct Reflex interaction, also a bit more efficient than Cortex sending the entire frame data each time). And yes it is 140 per module. In principle it would also be possible to send arbitrary frames from a larger store on a PC but this is not implemented.

  5. #15
    Automated Home Legend chris_j_hunter's Avatar
    Join Date
    Dec 2007
    Location
    North Lancashire
    Posts
    1,670

    Default

    interesting ...

    we're looking to have a main screen and a couple of smaller ones ...

    eg: to show what's going-on on other courts, or race position, or to keep an eye on an event that's due to start sometime ...

    multi-channel is the way things have gone ...

    plus some recording devices ...

    but, how to do it - IR blasters working through Cortex, and a home-made remote, with some buttons on a board, or a regular remote with buttons added for selecting device, or ... ???

    BTW, apologies - we seem to have strayed a fair bit from the original query about Sonos !
    Last edited by chris_j_hunter; 30th July 2013 at 08:37 PM.

  6. #16
    Automated Home Jr Member
    Join Date
    Aug 2007
    Posts
    49

    Default

    5 years on and has anyone had any success with integrating Sonos with Cortex?

    Sonos does seem keen to get in on the integrated market, with its One speaker and Alexa.....

  7. #17
    Automated Home Legend chris_j_hunter's Avatar
    Join Date
    Dec 2007
    Location
    North Lancashire
    Posts
    1,670

    Default

    as an example, how about ...

    https://jishi.github.io/node-sonos-http-api/

    https://wsvincent.com/install-node-js-npm-windows/

    which makes me wonder why the Cortex Web API Client object couldn't be used to do the job ...

    Chris
    Last edited by chris_j_hunter; 8th April 2018 at 10:44 AM.

  8. #18
    Automated Home Jr Member
    Join Date
    Aug 2007
    Posts
    49

    Default

    ..yes if I only I actually understood what any of that meant!

    Need some simple instructions to follow... :-)

  9. #19
    Automated Home Legend chris_j_hunter's Avatar
    Join Date
    Dec 2007
    Location
    North Lancashire
    Posts
    1,670

    Default

    yes, do agree ...have felt the same, all double-dutch ... but do give it a try !

    we were pretty clueless & yet managed very quickly to get the Cortex Web API Client object working Restful magic in Getting Met'Office weather forecasts into Cortex NoticeBoards (for tablet displays around the house) ...

    ie: Create a Web API Client object (in the same way as creatig any other object in Cortex), double click it, then click Add and Edit and Response etc etc ... it all looked very daunting to us, but the Help is good, and we had something working first time ... after which it was just a matter of adding in all the actions & response decoding we needed ...

    if you just want simple pause & play, maybe no decoding will be needed ...

    caveat - we've not got Sonos, so can't try any of this ourselves ... but what we did involved sending simple http: messages & decoding what came back, which seems to be much the same as (going by the links provided in my earlier reply) are needed to control Sonos ...

    NB: so far as I can see, you'll not need to install NPM & Node - just use the code information in the first link to create something similar in the Web API Client object ...

    eg; create the Web API Client object, double click it, click Add, and put (say) :

    http://localhost:5005/pauseall[/{timeout in minutes}]

    in the URL column - where localhost is the name of your Sonos network & 5005 is the port you need to use, and try it out, with each of the various Action options ...

    Chris
    Last edited by chris_j_hunter; 8th April 2018 at 09:49 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •