Hi all,
I am trying to create a way to use a rule to add a code and label to a z-wave door lock. Since these settings are in the thing configuration I am using REST api to trigger them. I can trigger them using curl but I can’t seem to get the rule to work no matter what I do. When doing it through the rule I am getting an error 405: Method Not Allowed error but not sure where I am going wrong.
rule "Received Guest Name & Code"
when
Item guest_5 received command ON
then
val String URL = "http://192.168.1.152:8080/rest/things/zwave:device:*:node10/config"
var String guestlabel = "testcode"
var String contenttype = "application/json"
var String jsondata = '{"usercode_label_4": '+guestlabel+', node_id: 10}'
val headers = newHashMap("Authorization" -> "Bearer oh.RestCall.TokenCode", "WWW-Authenticate"-> "Basic")
logInfo("Door Guest Name", "Programming:" + URL + " , " + contenttype + " , " + headers)
sendHttpPostRequest(URL, contenttype, jsondata, headers, 1000)
end
Thanks,