How to get item state update

Hi There,

How could I get event update of items (via Openhub2 REST API) when changed their state?

What exactly do you want to achieve?

You could create a rule to react if the item gets updated and use the http binding for GET/POST/PUT etc.

For example: How to send http request?

Hi Benjamin,

Thanks for your reply.

I want to get some response from openhab when its item status changed.

as example:

Currently, I m using a timer event to pull the status of item periodically as follow;

setInterval(function(){
$.get( “http://…/rest/items/zwave_device_eac0108b_node3_sensor_door/state”, function( data ) {
console.log(data);
});
}, 3000);

But I want to change that to get the response only item’s state changed.

Is there a way to implement that functionality by using subscriber or listener?

Don’t know so much about the server side evens/websockets and such but check out: SSE over REST-API , you might figure out something off that…