OpenHAB REST API

Hello Community,

We are using openHAB RestAPI to fetch the current values of each items we have configured on our OpenHAB server for all sitemaps.

  1. How many parallel GET calls OpenHAB api can handle ?
  2. At some point of it is not able to handle multiple parallel calls to api how can be scale it up ?

looking forward to user answer.

Thanks

If you are interested in state changes it is better to stick with server sent events (SSE). This is part of REST api which will keep long lasting connection to broadcast updates to connected clients.
This is the way in which UI is tracking things.

In case you need even higher performance there is an open PR in openhab-core to add support for websockets.

Cheers,
Łukasz

Thanks, but our intention is not keep a long lasting connection with Client (UI). it is just to know the current state and that is on demand. In that regards do you have any Idea, how many concurrent connections to REST api OpenHAB can handle ?

Thanks

You could simply handle this with one request,

/rest/items

which will report all items and includes their states. You would just need a JSON parser to get the information you want.

We are doing that. In our case the client (who will make call to rest/items) are multiple and individually they will call “rest/items”.

My concern is, how many such clients can openHAB handle (parallel) ? the clients wont be always connected but they will make this rest call on demand.

Capture

How many clients do you expect ?

I am not aware of limitations and all my clients (smartphones, wallmountd tablets etc.) did ot report any issues so far. It all depends on the hardware running your openHAB instance and how fast it can answer the request.