Rain Probability App
This app will notify you each morning if rain is expected in your area and if you should bring an umbrella. It also serves as a great example on how you can retrieve information from a public API and turn it into a useful workflow for you.
Time Frequence
The default template will execute daily in the morning. You can adjust the timing and time zone under Condition
in the top action block.
HTTP Request
The HTTP action sends a request to a public API of https://open-meteo.com. The default template sends a request to:
In the request URL we are using latitude of 40.7143
and longitude of -74.006
to get weather information for New York.
Visit https://open-meteo.com/en/docs to get the coordinates for your location and just replace them in the URL.
If we make a request to that API, here’s an example of output data we receive:
The data we are interested in is precipitation_probability_max
which provides us with the highest rain probability for that specifc day. In this example the value for this is 97
, so a 97% probability for rain that day.
The following syntax let’s us access that value from response:
{{steps.get-rain-probability.outputs.Body.daily.precipitation_probability_max.0}}
Check Rain Probability
The default template uses a Switch Condition to check for the rain probability value and executes different alerts accordingly.
You can adjust the 75
, 50
or 30
cases to your preference. The switch condition will check the cases chronologically, so if case 1 is true it will be executed, no matter what has been defined in the following cases. You can change this to an If Condition if you only want to be notified if rain probability exceeds a specfific value.
The https://open-meteo.com API provides a lot of flexibility and enables you to build all sorts of weather apps for you or your users!