DLNA / UPNP binding

Dear all,

It seems like the openhab community is focused on Sonos only. I was wondering if anyone else has the need for a DLNA binding?

Unfortunately I do not have the programming skills, but I’d be happy to support this activity with testing as much as i can…

Thanks and regards

1 Like

What’s your use case?

Hi,

thanks for your reply.

I am currently controlling two Sony SA-NS310 and B&O Essence Media Players via DLNA by my Homematic.

I pretty much followed the recipes in this forum: http://homematic-forum.de/forum/viewtopic.php?f=18&t=13664&sid=eb10d2c03d1f6ca4fa8c3d2549ae0fbd http://homematic-forum.de/forum/viewtopic.php?f=18&t=13664&sid=eb10d2c03d1f6ca4fa8c3d2549ae0fbd - without fully understanding what I was doing :slight_smile: - but it is working.

During weekdays I stream a local radio station to the B&O Essence in the bedroom, set volume correctly to avoid falling out of the bed and turn it off again 30 min. later. Same in the kitchen for the SA-NS310. In the bathroom I have a motion sensor that does the same thing, turns on the internet radio Sony SA-NS310 and off again if no motion was detected for 10 min.

This is the primary thing I’d like to migrate to my openhab server like all the other stuff.

So min. needed would be:

  • stream internet radio station
  • set volume
  • start/stop

Secondly, a friend of mine is using his Sonos for text-to-speech stuff and also as an alarm if a door/window has been opened in his absence. Pretty cool stuff, but I don’t want to buy a Sonos just for that.

Any help would be much appreciated (I am surprised that no one really seems to have such a need and everyone is using Sonos only :frowning: ).

Thanks and regards
JP

I had a similar use case in mind with a Denon HEOS product, that I’m planning to buy in the near future. I was surprised as well that there was no generic UPnP binding whilst the Sonos binding uses UPnP under the hood. (https://github.com/openhab/openhab/wiki/Sonos-Binding)

IMO best to contact the author of the Sonos binding first to ask why a specific Sonos binding was written instead of a generic UPnP binding.

@digitaldan, are you the author of the Sonos binding? If so, can you give some insights why a specific Sonos binding was written instead of a generic UPnP binding?

Tnx!

Quickly reviewed the openHAB2 code base. Good to see that it supports UPnP IO “natively”!

Hi,

do you mean I won’t need an extra Binding?

Thanks

No, it does not.
It just makes it easier for developers to use UPnP to controll specific devices.

Best
Hans-Jörg

Correct, still coding required.

@hmerk, any idea if it would be feasible to eliminate coding and solely have configuration for simple use cases using UPnP?

Hi,
sorry, I have no idea.
I am trying to refactor the WeMo Bindung to make use of UPnP, which is a quite difficult task due to Belkins UPnP implementation.
For a more generic UPnP Binding one has to know, what kind of devices should be supported and what actions could be called. So the binding has to find out the device type and what actions make sense for that specific device.

Another approach would be to have the devices UDN and the action to be called as configuration parameters to the Item / channel, but this could lead into problems if one makes configurations that are senselsess, like calling non existing actions.

Just my two cents.

Best
Hans-Jörg

Hi Hans-Jörg, I am surprised to hear that basic stuff like volume, play, stop is not generic for all UPnP devices (it is supposed to be a standardized architecture :frowning: ). Anyhow, thanks for looking into this, RegardsJP

Hi,
yes and no, it is generic for UPnP audio devices, but what about other UPnP capable devices ?
You might find services and actions which are not generic. How to handle those ?

Best
Hans-Jörg

@kristofdk Sorry for the late delay, I have the forum verbosity up way to high and was loosing messages.

I have worked on the binding a little to add favorite support, but did not write it (that would be @kgoderis ) . It was the first time I had used upnp and I have to admit, it wasn’t alot of fun :wink: In order to do things like select favorites, tracks, songs, group, ungroup, ect… we ended up having to reverse engineer what the SONOS controls were sending to the units. The XML is very complicated, seemed to use very specific sonos fields and has a very fragile flow of what its expects in reply to messages. So while I would imagine you might be able to do basic play/pause types of commands by the spec, anything more complicated seemed to use non standard fields and require very specific custom code.

Is this still a work in progress?

I noticed SmartThings has a community written DLNA controller available here: https://github.com/SmartThingsUle/DLNA-PLAYER that seems to support a wide range of devices.

It only supports fairly basic control but maybe it can help shed some light on the field variation.

Thanks Erik,

looks interesting. I just need to figure out how to install it. I have no clue what “SmartThings IDE” is. Will see…

Thanks for sharing, though.

Regards
JP

The “SmartThings IDE” is an online IDE within the SmartThings environment.

The code itself will not work outside of it, but the mechanics (ie handling of DLNA) should be transferable to any language.
I thought it might be useful as a reference =)

Thanks Erik,

yes, I already realized. Unfortunately I don’t have the skills to do any coding for openhab.

Cheers
JP

7 months later :wink:

I have now “worked” with the code of the Sonos 2.0 binding and I think it should be relatively easy (maybe even very easy) to add a generic support for DLNA media renderers because there is already almost everything implemented for the Sonos.
What could be done is to simply add a new thing type for generic DLNA media renderers.
This could offer standard controls: play; pause, stop, volume, mute for all DLNA devices. And track information could be retrieved too.

@kgoderis : what do you think about that ?

PS: I have already done this extension from Sonos to generic DLNA for the Vera platform. So I know that it works well for a large panel of things supporting UPnP / DLNA.

Good idea :slight_smile: i have no clue what it entails because I do not have a dlna device in the first place, but if you have done this before, pls go ahead…

That would be really cool - Can you estimate already if it might also work with Gramofon (www.gramofon.com) players ? They support allplay by default, and in fact i’d be glad if those are supported, i have a bunch of them waiting for integration :slight_smile: