Hi there,
I’m trying to write a SmartApp to enable my ST sensors to communicate with my SmartHome system (Digitalstrom). The manufacturer offers a JSON interface to do so. Looking onto the developer docs as well as examples I found online I created below code, which throws “something went wrong: java.lang.reflect.UndeclaredThrowableException” all the time…
Could anyone point me to the root cause/solution?
Thanks
Hendrik
def params = [
uri: “http://XYZ.hopto.org/api.php”,
body: [
message:“init”,
protocol:“simple”,
uniqueid:“abc123”,
name:“myDoorSensor”,
group:8,
vendorname:“SmartThings”,
iconname:“SmartThings_icon”,
inputs:[
inputtype:14,
hardwarename:“myDoorSensor2”
]
]
]
def initialize() {
try {
httpPostJson(params) { resp ->
resp.headers.each {
log.debug “${it.name} : ${it.value}”
}
log.debug “response contentType: ${resp.contentType}”
}
} catch (e) {
log.debug “something went wrong: $e”
}
}