If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

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.

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.

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

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.

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