Ok I’m officially lost and need help.
I used Maker API and got cloud URI where XXX is my device ID.
https://cloud.hubitat.com/api/0123ec93-daf7-497d-82ba-9fa4ee18844f/apps/1479/devices/XXX?access_token=6e637ead-2026-4de6-8e84-df8dc2d1998d
If I plug that into Chrome, it returns.
{"id":"XXX","name":"OpenWeatherMap","label":"Weather","attributes":[{"name":"city","currentValue":"Sugar Grove","dataType":"STRING"},{"name":"cloudiness","currentValue":"40","dataType":"STRING"},{"name":"country","currentValue":"US","dataType":"STRING"},{"name":"humidity","currentValue":47,"dataType":"NUMBER"},{"name":"pressure","currentValue":1020,"dataType":"NUMBER"},{"name":"temperature","currentValue":77,"dataType":"NUMBER"},{"name":"weather","currentValue":"scattered clouds","dataType":"STRING"},{"name":"weatherIcons","currentValue":"03d","dataType":"STRING"},{"name":"windDirection","currentValue":0,"dataType":"NUMBER"},{"name":"windSpeed","currentValue":5.82,"dataType":"NUMBER"}],"capabilities":["TemperatureMeasurement",{"attributes":[{"name":"temperature","dataType":null}]},"RelativeHumidityMeasurement",{"attributes":[{"name":"humidity","dataType":null}]},"Refresh","Sensor"],"commands":["refresh"]}
The wind speed I’m looking for is there but I don’t know how to retrieve it in code.
The code I tried (from other messages I found) is below but the log.debug is blank . Again XXX is my device ID.
def wxURI = "https://cloud.hubitat.com/api/0123ec93-daf7-497d-82ba-9fa4ee18844f/apps/1479/devices/XXX?access_token=6e637ead-2026-4de6-8e84-df8dc2d1998d"
def requestParams =
[
uri: wxURI,
requestContentType: "application/json",
contentType: "application/json"
]
httpGet(requestParams)
{
response ->
if (response?.status == 200)
{
return response.data
}
else
{
log.warn "${response?.status}"
}
}
log.debug $response
All I want to get is a numerical value of the wind speed. Any ideas? Thanks.