http://www.pubnub.com

305 views
Skip to first unread message

Karel Goderis

unread,
Nov 7, 2012, 11:48:08 AM11/7/12
to ope...@googlegroups.com
All

Anyone knows this? (apparently used by connxit.com)

Could be interesting not only to connect devices to openHAB, but rather have openHAB, similar to connxit) publish updates on/off devices to pubnub. Imagine remote monitoring of your openHAB server, or, interconnect openHAB instances.....

K

blum.s...@gmail.com

unread,
Nov 9, 2012, 12:58:46 PM11/9/12
to ope...@googlegroups.com
Good idea! - http://www.eragy.com/

Victor Belov

unread,
Nov 9, 2012, 1:08:10 PM11/9/12
to ope...@googlegroups.com
Karel,

PubNub itself will not solve it. It's just an engine. To do it we need to create a full featured cloud service for openHAB which, yes, can be based on PubNub :-)
I already talked about simple ways how to do the same without cloud with Kai and Thomas but they are still thinking over it :-)

Best regards,
Victor Belov



K

--
You received this message because you are subscribed to the Google Groups "openhab" group.
To post to this group, send email to ope...@googlegroups.com.
To unsubscribe from this group, send email to openhab+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/openhab?hl=en.


Karel Goderis

unread,
Nov 9, 2012, 1:27:12 PM11/9/12
to ope...@googlegroups.com
I was aware that some development would be required but that's the fun part :-)

What do you have in mind as a solution?

K

Sent from my iPhone

Victor Belov

unread,
Nov 12, 2012, 1:08:56 PM11/12/12
to ope...@googlegroups.com
Hi Karel,

I would quote the message I've sent to Kai about it:

I've spent a lot of time thinking on how to make the remote connection
to openHAB easier for a regular user.
We both understand that currently you have to manually configure a
hole in your home router/gateway to do that. Apart from that most of
broadband connections provide a dynamic ip address which changes time
to time, which hopefully can be fixed with DynDNS, but makes the whole
setup even more complicated - you need a router which supports dyndns
and sometimes router is managed by ISP, so… A most visible option is
to create a cloud service which will be contacted by openHAB and then
you connect to the same cloud service from mobile client and this
cloud service works as a message bus for information exchange between
your openHAB installation and mobile client.
A great idea, but means a lot of serious server-side coding,
supporting infrastructure which will grow together with openHAB user
base and a lot of other headaches for an non-commercial open-source
project. Though it is exactly the way it should be done, I was
thinking of a less complicated and easy to code and manage solution
which can be handled by openHAB team. And it seems to me that I found
one.
You probably know about UPNP. It is most known as part of DLNA which
gives you access to media between different devices on you home LAN.
But apart from that there is a section of UPNP which gives consumer
applications and devices control on your home router/gateway to
establish that bloody hole in the firewall which is needed for 'back
to my openhab' solution. So we can integrate a UPNP client into
openHAB which will, during startup process, check if security is
enabled (no way of using this without username/password), SSL is on,
and then use UPNP to make a hole in your router (of cause if it
supports UPNP and if it is enabled, but it typically does support UPNP
and it is enabled cause it is used by multiplayer games, torrent
clients and so on…). But this is only the first half of the story,
cause now we need to give our user a transparent mechanism to find
openHAB home address when he is out of the house.
So this 'back to my openhab' module still needs a cloud service, but a
much easier one. We just need a DNS server backed by some database
backend (PowerDNS with MongoDB backend seems to be the best solution)
and with a small and light web-service, which will provide openHAB a
registration interface. Once openHAB installation connects to this
web-service a new DNS record is created, which will consist from UUID
of openHAB installation (you asked me why do we need it? :-), like
oh-d519e6ac-5c9f-43c2-89e9-0a60e524608f.dynamic.openhab.org. The port
can be the same for all openhabs, or it may be randomized for security
reasons, or dynamically allocated by UPNP API of the home
router/gateway. It can be posted to web-service too and we can create
an additional record, in the way we do it for mDNS discovery, but a
unicast one - _openhab-server-ssl._tcp.oh-d519e6ac-5c9f-43c2-89e9-0a60e524608f.dynamic.openhab.org
which will resolve to appropriate port.
The whole dynamic.openhab.org zone will be hidden from dns transfers,
so nobody will be able to discover all possible openhabs in the world
to go for cracking them.
Now, knowing openHAB UUID from discovery process at home LAN mobile
client can connect to your openHAB from anywhere on the internet,
without a need to do any manual configurations or router/DynDNS
tricks.
Of cause this module should send regular (5-10 minutes) updates to the
cloud service to track ip address changes.
Requests to web-service need to be authorized somehow, so the user
will have to register some account to do that.
It seems to me that the most popular reason why people use solutions
like iridium, aycontrol and openhab is to be able to connect back to
your house when you are away, not for controlling your living room
lights from your phone when you are at home :-)
Additionally this cloud service could implement a simple redirect
service for web-interface. If you connect to this cloud service from a
regular browser you can then be redirected to your openhab web
interface, directly, or inside an iframe.
This process should be polished a little bit of cause, but what do you
think about it in general? I don't think that this will need a lot of
processing power cause a single mobile client launch will cause a
single DNS query. Updating openHAB information will not consume a lot
of horse powers too. I think that your demo setup on amazon server
will be quite enough to handle that, at least at the beginning.

So, anybody have any ideas on that? :-)

Best regards,
Victor Belov

Karel Goderis

unread,
Nov 12, 2012, 1:17:49 PM11/12/12
to ope...@googlegroups.com
Victor

I had to read it twice to understand. ;-)

Why not create a dyndns client in openhab? could be done via http easily. There are SOAP enabled websites to discover your own IP address, then update a chosen myhost.dyndns.org AAAA record, and you are done.  (maybe there exists already a java lib to do it...)

On the UPNP bit: easy to do with Cling (Cling = lib I used for the Sonos binding), there is even sample code if I remember well...

That being said, you can even be very smart by for example using Cling to make an entry in the firewall, then use the dyndns client to update your IP address, and for example, update a CNAME that simply holds the port number to use. The mobile client does a regular DNS lookup and has all the info to get back to the OH instance....

just my 2 cents

K

Karel Goderis

unread,
Nov 12, 2012, 1:19:44 PM11/12/12
to ope...@googlegroups.com

Kai Kreuzer

unread,
Nov 12, 2012, 1:20:45 PM11/12/12
to ope...@googlegroups.com
Hi,

I already talked about simple ways how to do the same without cloud with Kai and Thomas but they are still thinking over it :-)

Just to correct that statement from Victor: I think his concept is excellent and would like to see this happening! All that stands in the way is the lack of time…

Regards,
Kai

Victor Belov

unread,
Nov 12, 2012, 1:50:18 PM11/12/12
to ope...@googlegroups.com
Hi,

Karel, cling is good. External dyndns service is not. First - it will require additional effort from user to register an account somewhere with some dyndns service. This is not much easier then just using router built-in dyndns functionality. Second - security. Some dyndns providers list dynamic hosts for dns zone transfer. Third - doesn't give openHAB users a centralised portal for web-interface access with browser from the internet.
I can write a spec for all of that but my java skills are not advanced enough to write this web-service. Probably I will be able to write openhab part including cling cause it is pretty simple. I also can do the setup of db-driven dns server. So if somebody agrees on doing the web-server part for openhab.org it can be done pretty much fast.

Best regards,
Victor Belov

Karel Goderis

unread,
Nov 12, 2012, 1:55:02 PM11/12/12
to ope...@googlegroups.com
I agree that dyndns like services are not optimal, but do you really need an external centralised web-service to browse you OH setup? e.g you can make the client connect directly to your home setup, no?

If we choose well the dyn dns provider (e.g. a secure one and so forth), the fact that it takes a simple registration might be better than someone having to develop a lot of code... jsut q question of balancing the efforts....
Reply all
Reply to author
Forward
0 new messages