OH3:HTTP Binding to IP Vario

Dear all,
after my OH3 update, the Helios Binding isn’t working anymore. (Bug was reported)
The binding is very important for me, because it’s the only possiblity to trigger my doorbell.
Therefore I started to get it running via REST/http binding.I have to say it’s the first time I’m using the http binding, and these are the first tries with a REST API.
I managed to get a JSON output to a channel/item:

  1. Opened the URL in my browser: api/log/subscribe?filter=KeyPressed
  2. Copied the subscription id out of the JSON code
{
  "success" : true,
  "result" : {
    "id" : 999999999
  }
}
  1. Pasted the URL to the OH HTTP channel: /api/log/pull?id=999999999

What was working:
I received a value in the channel like

{
  "id" : 4,
  "tzShift" : 0,
  "utcTime" : 1437987888,
  "upTime" : 794,
  "event" : "KeyPressed",
  "params" : {
    "key" : "5"
  }
}

What was NOT working:

  • I didn’t get values extracted out of the JSON code, by http binding channel state transformation
  • It’s working only a limited time, then the subscription id expieres And I have to redo the step above manually.

Is this subscribtion thing a common thing for REST APIs?
Do I have the right approach or am I wrong?
How to solve my issues?

Doku of API IP Verso

Maybe in that case using HTTP requests in a rule would be the best solution here. First get the subscription (or only if it expired), then do the actual request and postUpdate or sendCommand it to your item. Trigger the rule with a cron trigger with the same frequency as the refresh rate.

That means, that the rule has to run every 1 or 2 seconds? Isn’t it an issue for the performance?

Polling with the http binding at that frequency might not work either, depending on the implementation on the other side.

Is that the only possibility? No websockets or something like that?

I’m not sure.
The Helios Binding worked for OH 2.5. Therefore it is somehow possible. I’m not sure about the basic technology of the binding, if it is REST API or some other thing

I asked the 2n support for a possibility to extend the subscibtion validity. Don’t know if this is possible.
Don’t now how to get a solution

Did you use the duration parameter in the subscription call to the 2n device ? You can set a subscription validity up to 1 hour, automatically renewed every time you pull events. This is described in the documentation you linked in your first post.

In order to be notified of someone ringing at the door, the simplest (and probably most reliable way) would be to use the automation feature of 2N software, which allows you to link events on the device to various actions, in a node-red like fashion. One available action is sending an HTTP request.

I use this on 2N Access Unit devices, which share the same software as the IP Vario, to forward some events to OH3 using the REST API.

Unfortunately for you the license for the automation functions is not included in the IP Vario and must be purchased separately (list price 57€).

I had the same idea about the use of this Feature, but In want to avoid buying the license. If I didn’t get it running in the next Werks, I will buy it.