Webhooks - Myopenhabcloud or other method

Hi All

So I’m currently querying an external api, I’m not happy though as i cannot get refresh rates low enough without hitting limits.

I’ve been trying to read up on web hooks but the information out there is very vague.

I have a few questions which if anyone could answer that would be great.

1: We used to able able to authenticate against openhabcloud using username:password@myopenhabcloud.org, however this form of auth has been depreciated. My api provider doesnt use any form of Auth so i am limited to authenticating in the url, can this be done?

2: If we can get connected, using the rest api is there anyway to accept a custom json payload into for instance a string item as i am not able to change the response i recieve from the api?

3: How do bindings that connect to external api’s handle refreshes, i see nest has a streaming channel but what about those that dont?

4: Is there any other way to set up a webhook without using myopenhab.org, dynamicdns/portforwarding and a static html page for instance as an endpoint?

Any information on how to go about this would be most appreciated.

  1. It’s deprecated in browsers but I still think you can still do this. If not then the answer is no, you can’t authenticate in the URL.

  2. Install the REST Docs (under UIs in PaperUI) and you will see all the end points. You will want to look under Items.

  3. Depends on the technology or cloud API they are connected to. I suspect every binding handles it different based on the unique qualities they are connected to.

  4. If it ever get’s turned back on perhaps IFTTT can handle this. If you are willing to open your LAN to the internet (I strongly recommend against this) you can set up a web page that updates an Item. See OAuth2 using just OH Rules and myopenhab.org for an example. But again, I cannot state this strongly enough, do not do this.

I don’t know who to put this to but is there any chance we can implement username/password in the url for myopenhab.org?
Such as https://myopenhab.org/rest/items/ItemName?auth_token=base64username:password

Most new systems will now not accept username:password@url anymore.

This would be greatly beneficial for cloud api’s to send notifications (webhooks) to openhab.
It would cut down significantly requests having to be made by bindings/rules.
It would also allow more more accurate item states as most api’s have Limits which restrict to 10-60 second updates
It would also release threads for other purposes.

I feel this would lead to less system resource use, improved binding efficiency and support for a lot more devices going forward

The best bet to have this implemented will be to open an issue on https://github.com/openhab/openhab-cloud. See How to file an Issue

1 Like