API call from OpenHab

I’m currently integrating your excellent Bond Bridge Pro product into a whole of house automation based on OpenHab.

I am trying to send HTTP commands using the openhab http binding but am having some difficulty getting the syntax right for the http call.

Openhab doesn’t allow for a separate body so I’m not sure how to write the URL to incorporate the command body e.g. where to put and how to write {“argument”:3} at the end of the http://192.168.1.117/v2/devices/1234567/SetSpeed so that the url includes the command arguments.

Note that attempts with Postman succeed when using SetSpeed with a separate body for the arguments so the end-to-end is working

Thanks in advance

Regards
Ian Carson

P.S. A specific OpenHab binding for Bond might be a good idea

Hi Ian, welcome!

Bond API doesn’t support any way of encoding the body of the request into the URL. I guess you’d expect something like PUT http://IP/v2/devices/1234567812345678/actions/SetSpeed?argument=3 ? That’s something we do not support. However, just about any HTTP library should allow bodies in the requests… that’s standard REST API design.

Maybe take a look at @SDamiano 's work? OpenHAB Integration

Thanks for the response.

In the end I did find an OpenHAB binding to Bond Bridge (the one by SDamiano as it turns out). It works very well - integrating status changes into the OH event system and passing commands as well.

It’s added as a separate jar file into /usr/share/openhab/addons on the server running openhab.

Regards

Ian Carson

2 Likes