|
Re: Management of the binding's webservice [message #1720286 is a reply to message #1720138] |
Fri, 15 January 2016 22:54 |
Karel Goderis Messages: 198 Registered: March 2014 |
Senior Member |
|
|
Jan,
I am not sure I fully understand what you try to do, but you have in essence two options:
1. Integrate the web service into a Bridge, and have all Things pass trough commands to that Bridge. That can be done through an API you define adapted to the "cloud" you want to connect to
2. Integrate the web service directly into the Thing, if the web service itself is better represented by a Thing, e.g. physical device like
There are a few bindings out there you can look at to see how this can be done. For example, the Tesla binding uses web services to access Tesla's servers, and control the Tesla Model S vehicle. Here the web service is directly embedded in the ThingHandler. Another example is the Helios binding (see https://github.com/kgoderis/openhab2/blob/helios/addons/binding/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/handler/HeliosHandler213.java , as it not yet part of the official repo). And if you want a really wild example, have a look at https://github.com/kgoderis/openhab2/tree/atsadvanced/addons/binding/org.openhab.binding.atsadvanced , where Things use a Bridge that is both a web service client, as well as a web service end point that is called by a remote (proprietary) software that sits between the Handlers and the actual hardware.
In short, you do not have to implement a web service as a Thing, rather define the Thing (e.g. real world replication of a thing), and leverage the web service to talk to the device.
Regards
K
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03663 seconds