Figured I'd give weather.gov a quick look this morning. I got it to connect and get the json. My problem is always getting the data out of it! lol
I can connect, download the json (even log the json data) but when I try to pull out the fields I want. I get null's. I've tried all kinds of combinations and each time I get errors like, 'No such field' or 'No such property'. But with the way I have below there are no errors but no data either, just 'null'.
My log showing the json file, 'cwa' is the field that I'm trying to get in my examples:
My Code:
Summary
httpGet(requestParams) { response ->
if(logEnable) log.info "In getPointsData - response: ${response.status}"
if(response.status == 200) {
//log.info "${response.data}"
def office = response.data.properties.cwa
log.info "Office: ${office}"
sendEvent(name: "office", value: office)
My log:
Any ideas!?
BTW, I do use this json-parser to get the json formatting.