Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

Service Discovery

dakalff edited this page Nov 22, 2013 · 5 revisions

This page describes what the service discovery feature is and how it can be used by UIs

Introduction

The Service Discovery bundle provides Multicast DNS/Bonjour functionality to openHAB. It is available in openHAB since version 1.0.0. This bundle is based on a well known java MDNS library - jmDNS. The library is included into the bundle so no additional actions are needed to make this bundle work.

How to use Service Discovery

The Service Discovery bundle was created mainly to simplify interaction between User Interface applications on different platforms (Android, iOS, etc) and openHAB. It provides service interface to register and announce different services, provided by openHAB to MDNS/Bonjour.

This interface is currently used by REST bundle to announce available REST interfaces on local network. REST application announces both HTTP and HTTPS connection points depending on their individual availability.

  • HTTP is announced as _openhab-server._tcp.local. and it's name is openHAB
  • HTTPS is announced as _openhab-server-ssl._tcp.local. and it's name is openHAB-ssl

Both service announcements include additional uri attribute which shows the path ("/rest" by default) to REST interface. User Interface applications should use this attribute to form the base URL of REST interface before connecting to openHAB.

The same java library (jmDNS) can be used to discover openHAB on local network from java applications, including Android applications. MDNS/Bonjour is built in iOS application development framework. Plenty of examples can be found in corresponding platform developers documentation and on the internet (Android example, iOS example for MDNS/Bonjour usage).

Example

To discover HTTP REST interface application must resolve _openhab-server._tcp.local. service.

Service discovery will return several parameters of openHAB:

  • IP address (like 192.168.1.20)
  • TCP port (like 8080)
  • uri attribute (like /rest)

The base URL for openHAB will look like this: http://192.168.1.20:8080/rest

Tools

We recommend using MDNS/Bonjour tools to check if openHAB announcement is available on the network for developers:

  • iStumbler - a good network tool for Mac OS which includes MDNS/Bonjour browsing functionality
  • Bonjour Browser - an iPhone/iPad application to browse MDNS/Bonjour
  • Android Bonjour Browser - an Android application to browse MDNS/Bonjour
  • Any windows tools links are welcome!

Installation


User Interfaces


Community

(link to openHAB forum)

Development



Misc


Samples

A good source of inspiration and tips from users gathered over the years. Be aware that things may have changed since they were written and some examples might not work correctly.

Please update the wiki if you do come across any out of date information.

Use case examples

Collections of Rules on a single page

Single Rules

Scripts


Release Notes

Clone this wiki locally