I have openweathermap generating the current weather once a minute. That part works just fine. However, I would like to know if rain is in the forecast so that I can turn off my lawn sprinklers. I've tried creating a second OWM node and new API key for that node, and all I get is "invalid API key".
I tried changing the currently working node: "Current weather for.." to "5-Day forecast for..", but I can't find where in the JSON response I would find out if it's going to rain or not. And yes, I've read the API docs.
It appears that probability for precipitation is not included in the JSON API So it looks like the best you can get is by hooking your setup to weather.main and look for the text values such as "Rain", "Drizzle" and "Snow". Furthermore, you can use msg.data to page through the full API response, which gives the amount of precipitation already fallen in the last hour if needed
However, it appears the XML API does have some information about precipitation available, which in my opinion is odd that they didn't make those available in the JSON api as well.
This is the forecast for 5 hours from now, and it does show rain. Do you have any clue what this means?
"rain":{
"3h":0.5
}
Also, do you have any clue which object in an array of ten objects within an array of 40 objects should I be looking at? And there's two of these arrays of 40 objects of ten objects. I get dizzy trying to understand basic objects, so you can see why this has me puzzled.
This is the 5 day/3 hour forecast right? That means each of the items in the payload array contains 1 forecast every 3 hours for a period of 5 days. That's 8 a day, times 5 is 40 items total. Each of the objects has a timestamp for when it's going to be, I don't know from mind if the one nearest is shown first or last, but I can imagine in position 0. Each of those objects will have the same kind of formatting. Meaning you can use a JSONAta to get out what you want. I'm bad at writing those, but I know others on this forum are genius at that.
I think this depends on what the API docs say for it. Could be probability, like 50% chance for rain... can be 0.5mm of rainfall. Look it up in the OWM api docs, that's all I can advise. I use a completely different API for my own forecasting needs, so I'm not able to help you there without looking up those things in the same place myself too.
Yes, from the 5 day/3 hour forecast. But there is no current weather, (but a second node with "Current Weather" selected does work with the same API key).
The objects are not formatted the same. Object 0 in array 0 contains no rain object. The rest do.