diff --git a/bundles/org.openhab.binding.remoteopenhab/src/main/java/org/openhab/binding/remoteopenhab/internal/handler/RemoteopenhabBridgeHandler.java b/bundles/org.openhab.binding.remoteopenhab/src/main/java/org/openhab/binding/remoteopenhab/internal/handler/RemoteopenhabBridgeHandler.java index b6324ca66c7..93ec8bfd490 100644 --- a/bundles/org.openhab.binding.remoteopenhab/src/main/java/org/openhab/binding/remoteopenhab/internal/handler/RemoteopenhabBridgeHandler.java +++ b/bundles/org.openhab.binding.remoteopenhab/src/main/java/org/openhab/binding/remoteopenhab/internal/handler/RemoteopenhabBridgeHandler.java @@ -324,7 +324,7 @@ public class RemoteopenhabBridgeHandler extends BaseBridgeHandler updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "OH 1.x server not supported by the binding"); } else if (getThing().getStatus() != ThingStatus.ONLINE) { - List items = restClient.getRemoteItems(); + List items = restClient.getRemoteItems("name,type,groupType,state,stateDescription"); createChannels(items, true); setStateOptions(items); diff --git a/bundles/org.openhab.binding.remoteopenhab/src/main/java/org/openhab/binding/remoteopenhab/internal/rest/RemoteopenhabRestClient.java b/bundles/org.openhab.binding.remoteopenhab/src/main/java/org/openhab/binding/remoteopenhab/internal/rest/RemoteopenhabRestClient.java index 85c4da43776..84ded57155e 100644 --- a/bundles/org.openhab.binding.remoteopenhab/src/main/java/org/openhab/binding/remoteopenhab/internal/rest/RemoteopenhabRestClient.java +++ b/bundles/org.openhab.binding.remoteopenhab/src/main/java/org/openhab/binding/remoteopenhab/internal/rest/RemoteopenhabRestClient.java @@ -149,9 +149,12 @@ public class RemoteopenhabRestClient { } } - public List getRemoteItems() throws RemoteopenhabException { + public List getRemoteItems(@Nullable String fields) throws RemoteopenhabException { try { String url = String.format("%s?recursive=false", getRestApiUrl("items")); + if (fields != null) { + url += "&fields=" + fields; + } String jsonResponse = executeUrl(HttpMethod.GET, url, "application/json", null, null); if (jsonResponse.isEmpty()) { throw new RemoteopenhabException("JSON response is empty");