REST API: Only update the state of an item

Hi,

I wrote a script that will monitor my domotica setup (http://www.velbus.eu/).
Whenever an item is changed, I use the REST API to push this change openHAB.
At the same time, the item has a http binding configured so when the item is changed when you click in the GUI of openHAB, this change triggers a webservice to commit this change to the velbus modules.

This is working fine, but it can cause a loop because the REST API update also triggers the webservice to commit this change to the velbus modules. And this in turns triggers a REST API call and so on.

I solved this by storing the state in a MySQL database and only let the webservice do something when the change is really changing.
But still, this can go wrong.

So, is it possible to use the REST API to update the state of an item (so without sending a command to the item)?
Or is there an other way I can update the state of an item without triggering the http binding?

Stef

To update the Item without it also triggering the binding use PUT on https://<ip of OH server>:8080/rest/items/<item name>/state with the new state as the body.

Argh, I used POST and that gave an error.
PUT is working :slight_smile:

Stef

POST to sendCommand uses a slightly different URL, mainly you omit the /state part of the URL.

Indeed, but when I tried the url with /state at the end the first time, I got an error.
Because I did a POST and it should be a PUT.

Stef