josh
November 16, 2022, 11:29pm
4
Yes, there were a few other posts where people are querying the various Open Weather APIs.
Here’s a few reference threads:
You can do this with the HTTP Action in SharpTools today. I agree that it makes for a good feature request as a native integration though to simplify this process for people who don’t have weather devices attached to their SmartThings.
Let’s take the Open Weather /weather endpoint which provides the current weather. The URL is in the format:
https://api.openweathermap.org/data/2.5/weather?lat=-33&lon=96&appid={{ApiKey}}
And the response is in the format:
{
"coord":{
"lon":…
Yeah, that is overwhelming since it has all the hourly and minutely forecast data in it. You can add an &exclude=hourly,minutely option to the URL to remove those items from the response and simplify it a bit.
https://api.openweathermap.org/data/3.0/onecall?lat=40.1681&lon=-80.1987&units=imperial&appid={{API_KEY}}&exclude=minutely,hourly
Also note that if you are in the US (rather the heart of China) you’ll want to make sure your longitude has the leading negative symbol in front of…
Edit : I can’t seem to find it now, but someone had also recently done something with the Open Weather API and they were using the new expressions feature. @Jason_K_Jennings was that perhaps you?
2 Likes