How do I test Leviton DZPD3 via OpenHab2 REST API?

Tags: #<Tag:0x00007f61701a2808> #<Tag:0x00007f61701a2600> #<Tag:0x00007f61701a2538>

Hi All,

I am running OpenHAB2 v4.0.4 on my Raspberry Pi 3 with Raspbian Jessie using the Z-Wave Binding 2.0.0.SNAPSHOT on and a Z-Stick Gen5 USB bridge and a Leviton DZPD3 dimmable switch. These are the only two devices I have configured.

I am trying to test my Leviton DZPD3 ( via the REST interface and I can not figure out how to turn the DZPD3 off/on or set a dimming level.

Using the OpenHAB2 Swagger REST UI I used the /items GET method to get the device name which returns the item I am interested in:
{ "members": [], "link": "", "state": "NULL", "type": "GroupItem", "name": "zwave_device_eaae424f_node2", "label": "Patio Lights", "tags": [ "thing" ], "groupNames": [] }
Notice the state value is null, I am not sure that is correct.

Then I tried to use GET /items/{itemname}/state which returns HTTP 200 OK with this body:

Then I tried to use PUT /items/{itemname}/state which has a field for body with examples such as ON, OFF. With either option I get error 400 Item state null with the body of:
{ "error": { "message": "State could not be parsed: 100", "http-code": 400 } }

The OpenHAB log file contains:
Received HTTP PUT request at 'items/zwave_device_eaae424f_node2/state' with an invalid status value 'ON'.
I also tried to use POST /items/{itemname} with some of the suggested body examples and I get another 400 Item state null with the body containing HTML stating:
Problem accessing /rest/items/zwave_device_eaae424f_node2. Reason: Bad Request
OpenHAB log shows the following for the POST request:
Received HTTP POST request at 'items/zwave_device_eaae424f_node2' with an invalid status value 'ON'.

My question is what am I missing? How do I know what commands a device can accept and the structure to send them?


Well, I guess I must be way off base if there are no comments from the community…