Will REST API change in OH2 or Eclipse SmartHome?

642 views
Skip to first unread message

m herbert

unread,
Jun 26, 2015, 4:06:22 PM6/26/15
to open...@googlegroups.com
I wrote a bridge between openhab and the ROS Robot operating system, called iot_bridge (formerly openhab_bridge).   This uses the OH REST API, polling for updates from openhab/rest/items/ROS (e.g. any changes to items that are put in the ROS group).  It also allows you to send a command or do a set value to an item in ROS.  I installed OH2 and it appears to work fine without any changes.   However, when I look at the REST API documentation for SmartHome, it looks very different smarthome/rest:

- It doesnt look like you can get updates for a group
- It doesnt look like you can set an item or send it a command
- The response format is different.

Will the OH1 REST api's continue in OH2 and Smarthome?

Kai Kreuzer

unread,
Jul 8, 2015, 9:06:30 AM7/8/15
to open...@googlegroups.com
Hi,

Well, the chapter https://www.eclipse.org/smarthome/documentation/features/rest.html#rest-endpoints is actually still empty, so you cannot get much info out from this page :-)
But what is already available is an interactive Swagger documentation on openHAB 2, see http://demo.openhab.org:9080/doc/index.html#!/items.

The general answer to your question is: I try to keep the REST API as similar as possible, but there are breaking changes. I listed a few of them on https://github.com/openhab/openhab2/blob/master/docs/sources/intro.md:

  • the REST API does NOT support XML nor JSON-P anymore. It is now fully realized using JSON.
  • the REST API does not support websocket access anymore - it actually completely drops "push" support and only has a simple long-polling implementation to provide a basic backward-compatibility for clients.
If JSON instead of XML is fine for you, there should not be much impact.
The new SSE support for push events is actually imho a very valuable feature if you want to receive updates (having to use long-polling on sitemap pages instead is rather nasty).

Hope this helps!

Best regards,
Kai


--
You received this message because you are subscribed to the Google Groups "openhab2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab2+u...@googlegroups.com.
To post to this group, send email to open...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openhab2/e1af5dc6-cbc6-4bc4-a9e9-4d7b7015cf5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

m herbert

unread,
Jul 14, 2015, 6:04:56 PM7/14/15
to open...@googlegroups.com
Thanks.  i'm fine with JSON and any cleanup changes.  I guess the biggest thing I was worried about was whether it would continue to allow you to "set" an item or send a command to an item.  I was worried this might be removed due to security concerns.

--
You received this message because you are subscribed to a topic in the Google Groups "openhab2" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab2/5khfy_hzZJI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab2+u...@googlegroups.com.

To post to this group, send email to open...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages