Hi there,
I came across this issue multiple times already and want to know if there is an official extension point from the OH Architecture point of view for this.
Use Case
External Device has the feature to provide information via HTTP Push. So the device would call HTTP GET on http://configurable-url/fix-api/?somegetparameters=value&anydevicespecificthing.
Often device can be configured which endpoint to call with the IP/hostname, but usually not how the url looks.
One example is:
where the current binding is using HTTP Polling. But using the mowers push mechanism would be nicer as there is no need for an extra polling thread in the binding. Also the timing of the event of change is triggered most likely more accuratly at the event, whereas the polling always depends on an interval.
Another post I found where the concept might be required is here:
Also for the lametric binding it would be interesting to support user feedback via push buttons. The very old conversation about the topic can be found here:
The answer of @Kai at this point in time was
Having to access HTTP requests is not really ideal and should be avoided. If there is no other way of getting hold of this information, though, you could register a servlet that processes these requests (and sends according updates for a trigger channel of your Thing).
How this questions goes to the OH Architecture Team.
- If a device provides both possibilities, Push or Get, is it really preferable to have a polling thread versus exposing a servlet?
- Is there plans for any kind of transformation servlet in front of the REST API?
And of course to everybody of the community,
- do you have similar requirements?
- How did you solve it?
last but not least there is another likely question non http related but going cross binding communication.
- If my device supports mqtt for reporting status but not for triggering actions on the device, which is just supported via http. Is it a good idea to use the MQTT binding for updating the status channels and map the items also to my bindings channels to react on status updates?
Before I start any efforts in this direction I would like to know which approaches exists and what are the recommended ways to tackle such cases.
Thank you all for your input.