Access Keys:
Skip to content (Access Key - 0)
blog entry  2009/06/10
Last changed: Jun 10, 2009 17:42 by Mathieu Gallissot

As I'm writing this page, UPnP has been just committed to the source repository for the OR Controller. So here are a few details for my contribution:

What is UPnP?

UPnP is a web service oriented protocol which was designed for controlling "devices". It works on IP, has a device discovery process. Each devices has attributes, and services. Each service has attributes, state variables and actions. The point is to trigger actions remotely.

I will not go further in explanations, the protocol is detailed on other places, so, if you want technical details, you may want to visit the following pages:

Why UPnP ?

Well, UPnP is at some point a standard (protocol is vendor independent) for controlling products. If the standardized services included lightning and HVAC control at original design, it has mostly been used for "brown" products (A/V). As a result, DLNA has been regrouping A/V constructors and improved A/V services for more possibilities.

Brown products are at some point ignored with home automation systems, well, at least on the KNX side. Some vendors have a few products for audio multiroom with a KNX interface (and other buses), but it is very expensive for what it is, and has some serious cabling issues.

Also, has SDKs has been made available with time, more and more public devices integrates natively UPnP. That's how I've discovered my N95 (I know, bad place for this one) has a native support for it. So, if look into your "home" devices parameters, you may find an UPnP option. That's often the case for routers and media centers (I've been using it on XBMC).

Controlling UPnP devices with OR

Integration of UPnP has been made using the cyberlink stack available on sourceforge.net (https://sourceforge.net/projects/cgupnpjava/) under BSD license. At this stage of development, the UPnP events are created in the controller.xml file. Here is an example :

<upnpEvents>
	<upnpEvent id="2" label="Pause" device="uuid:48d5fe73-8c9c-4518-b8f9-0de5775abdfc" action="Pause">
		<argument name="InstanceID" value="0" />
	</upnpEvent>
</upnpEvents>
Where :

  • "upnpEvents" tag contains a list of upnpEvent
  • "upnpEvent" declare an UPnP action to invoke. Attributes are :
    • "id" and "label" (common to all events),
    • "device" which is an identifier of the UPnP device to control (can be discovered using public third party UPnP tools)
    • "action" which is the name of the action to invoke. As actions may need one or more arguments, you can add "argument" elements as children of the "upnpEvent". This "argument" element must have 2 attributes:
      • "name" for the argument's name,
      • "value" for the argument's value.

This example triggers au "Pause" on a media renderer device.

Here is another exemple for a "Play" on the same device:

<upnpEvents>
	<upnpEvent id="7" label="Play" device="uuid:48d5fe73-8c9c-4518-b8f9-0de5775abdfc" action="Play">
		<argument name="InstanceID" value="0" />
		<argument name="Speed" value="1" />
	</upnpEvent>
</upnpEvents>
The only difference, apart the action name, is to have two arguments.

This Play and Pause actions are part of the AVTransport service standardized by UPnP. There is more actions, such as the possibility to specify a URI to play. Media renderers usually also have the RenderingControl service, which allows volume modification, mute, and other stuff such as brightness and contrast control.

Open Discussion

UPnP has been subject to a lot of issues concerning security. That's an insecure protocol, for sure. But, it's a protocol limited to a local area network. In my opinion, this lack of security is an advantage, as you would like to avoid typing a username and password for muting your TV. Without being a network expert, the default IP environment deployed in homes by ISPs are enough secured regarding this security issue. If you have WiFi enabled, just be sure it is secure to prevent your neighbor displaying private pictures on your TV....

Posted at 10 Jun @ 3:59 PM by user Mathieu Gallissot | comment 0 comments
© 2008-2011 OpenRemote Inc. OpenRemote is a trademark of OpenRemote, Inc.
Adaptavist Theme Builder (3.3.3-conf210) Powered by Atlassian Confluence 2.10.3, the Enterprise Wiki.
Free theme builder license