1

I'm developing a hybrid app (using PhoneGap) for openHAB. At the moment I'm struggling to build a connection from my hybrid to the OpenHAB runtime. Any suggestions?

Johan
  • 11
  • 4
  • Do you have any example code that you have tried? We cant help debug without knowing what you have tried already. – wolffer-east Aug 25 '14 at 20:26
  • I have tried to run the openHAB demo on the openhab runtime. And I created a phoneGap project.I don't have any code example to build the connection. because I still try to find a way/solution. – Johan Aug 25 '14 at 20:33

2 Answers2

1

The intended way to connect to the openHAB runtime is the REST API which is described in detail in the wiki (see https://github.com/openhab/openhab/wiki/REST-API).

You could also have a look at the implementations of the native Android client (see https://github.com/openhab/openhab.android) or the greenT HTML5 application based on Sencha Touch (see https://github.com/openhab/openhab/tree/master/distribution/openhabhome/webapps/greent).

Hope this helps,

Thomas E.-E.

thomasee
  • 90
  • 1
  • 7
0

The openhab has a REST API implemented as a bundle. this can be accessed via the URL "http://openhabip:8080/rest/".

If you want to access the items and implemet your own UI you can use "http://openhabip:8080/rest/items" with HTTP GET, POST ,PUT.

Otherwise you can use the "http://:8080/rest/sitemaps" and use the openhab provided sitemaps.

The details are in https://github.com/openhab/openhab/wiki/REST-API

Adarshlal
  • 77
  • 1
  • 9