Rest API not working

Hi,

I cant get my Rest API to function correctly.

My rest Code in my remote device:


local WEB = Net.FHttp(“192.168.10.7”,8080);
local state ,status, err = WEB:PUT("/rest/items/sw13/state", “ON”);


The rest state of my switch is updated and in the web interface in openhab the switch changes state. But it does not trigger an event in my tellstick binding. If i press the switch in the web interface my light turns on but not via the rest API.

Thanks for any help…
//Aquilo

Use POST instead of PUT. PUT is equivalent to calling postUpdate in a rule, only OH’s internal state changes. POST is equivalent to sendCommand which causes the binding to be triggered.

1 Like

Thanks Rich!!! You made my day!!

I needed to change from using “/rest/items/sw13/state” to “/rest/items/sw13” when i switched to the POST command.