I am trying to use the RESP API to figure out how to change the user codes in a z-wave lock
This is what the code looks like
UID: zwave:device:8577461f51:node49
label: Z-Wave Node 049 (0090:0811:13A8:7.13)
thingTypeUID: zwave:kwikset_ks620_00_000
configuration:
usercode_code_139: “”
usercode_code_135: “”
usercode_code_136: “”
usercode_code_137: “”
usercode_code_138: “”
long list of user codes and user names
I don’t have any zwave locks, but is there an usercode_code_6? I’m assuming this
is from a GET?
Anyway one option I use to get the format right is to use the GET /things/thingUID, copy it and paste into a PUT /things/thingUID and carefully edit what I want to change.
The list of user codes is from the code tab of the THING, I don’t know why it is not sorted but there are 250 codes and 250 names in some sort of quasi random listing…
If I understand your reply, you are saying that I have to send the whole configuration, everything that is in the code tab to change 1 or 2 values, I can’t send only the line/s I want to change?
I’m just saying I have done that when I have had a problems (like getting the format right) just changing 1 or 2 lines. I’m not an experienced REST API person, so resort to what I know should work. Someone else in the forum may be able to help with just updating the 2 lines.
My other question is whether “6” is one of the 250 options or do they start at 100?
Edit: Also did you just try to change on the code tab?
Thank you.
The list starts at 1 and I have already populated 1-5. For some reason the listing in the code tab is not sorted. If I look at the THING tab, everything is sorted there.
I will play with the GET and PUT statements, I just thought using the REST-API explorer would help me figure out what to do.
Not very knowledgeable on this subject, but look at settings–>API----> Advanced tab and then the documentation openHAB REST API | openHAB on how this is supposed to work.