Wind Speed data for App

I need help. I have a simple app I wrote to turn my outside water fountain on and off at certain times. I wanted to add a feature that would turn the fountain off if the wind speed got too high. I got an API from OpenWeatherMap and created a Hubitat device with a type of OpenWeatherMap. It shows the correct data for temp, wind speed, humidity, etc. I even set up a Dashboard tile which works fine.

But what I can’t figure out is how to acquire the wind speed from OWM for my app. I tried several device capabilities (sensor, temperaturemeasurement, etc) in the app code. I just don’t see how to fetch the wind speed (or any other variable).

I do not have a PWS.

Any ideas?

If I'm not mistaken OWM outputs a json and you would have to parse that string to get the windspeed. However that would be a general speed and may not even reflect your area. I would suggest getting a WS to get accurate wind speed.

I have a Netatmo weather station with rain and wind meter. I use both to control the pump in my garden pond. Don't know about your setup but with the Netamo it works very well.

1 Like

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.

Using mine for all kinds of stuff. Like that I can use it to disable notifications if wind gust are slamming my garage door at a certain angle. Using this driver: [RELEASE - UPGRADE] Netatmo (Connect) - Simple netatmo interface

Works great.