OH3: Changing Item via REST API has no effect on connected channel/device itself

Hi,

unfortunately changing an item status via REST API connected to an Homematic thing has no effect on the device itself.

Scenario:

  • configured Homematic binding
  • created thing for an outlet (type HM-LC-Sw1-PI-DN-R1)
  • created item (Switch) for this one and connected it to the thing

Switching the item via the UI of OpenHAB 3 works fine. Power is switched on and off at the device according to the item status.

Now the problem:
If I use the REST API to change the status of the item, then the connected thing doesn’t get the on or off command.
I see, that the item itself is changing in the UI, reflecting the correct status I set via the REST API.
I also get 202 success responses for the REST API calls.
But the device itself does not act accordingly.

If I write a rule, which acts on updates to the status of the item, then the rule is also called. But the thing/devices does not do anything.

This happens with more devices.

Do I miss something?
Any help much appreciated!

Ok, found the issue: POST instead of PUT does the trick…

To let others know the solution:

Only sets the item’s status via PUT:

curl -X PUT "http://OpenHAB-IP:8080/rest/items/ItemName/state" -H "Content-Type: text/plain" -d "ON" -i

Really execute the command via POST:

curl -X POST "http://OpenHAB-IP:8080/rest/items/ItemName" -H "Content-Type: text/plain" -d "ON" -i
1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.