🌧️ Weather: Minute-by-minute forecasting by OpenWeatherMap (hyper-accurate short-term forecast)

My first Blueprint…

OpenWeatherMap Minute Forecast Action

v1.0

Uses the OpenWeatherMap integration to poll the API and then call a script with information on precipitation (rain / snow) over the next hour.

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

▸ GitHub link here

Introduction

Minute-by-minute forecasting (sometimes called ‘Minutely’ forecasting or ‘Nowcasting’) is hyper-local, hyper-accurate weather forecasting over a very short timeframe. Since Home Assistant 2025.3, the OpenWeatherMap integration provides precipitation forecasting for the coming 60 minutes.

Typically, the source of this information might be rain radar combined with wind direction and predictive algorithms. However, even these forecasts can be affected by local topology. For example, if you live on a hill, moist air might be driven upwards towards the peak where it expands and cools to form precipitation that was not visible sooner. Conversely, on the other side of the hill, air may become drier, leading to a rain ‘shadow’ unless a significant amount is expected.

To help adjust for these local effects, this Blueprint comes with different ‘detection’ modes. You will need to experiment for your specific location: there is no catch-all solution.

Prerequisites

Installation

  • Install the OpenWeatherMap integration: Settings → Devices & services → Integrations → + Add Integration → OpenWeatherMap
  • Ensure your location is accurate: check the OpenWeatherMap entities match the conditions you see outside
    • (Optional) Confirm Minute forecasting: `Developer Tools → Actions → openweathermap.get_minute_forecast and select your OpenWeatherMap entity
      • This should show the weather object returned, with separate properties for each minute of the next hour (all times are UTC)
  • IMPORTANT: Settings → Devices & services → Integrations → OpenWeatherMap → [3-dot menu] → System Options and disable ‘Enable polling for changes’
    • If you don’t disable this setting, OpenWeatherMap will poll the API every few minutes in addition to the polling determined by this Blueprint, increasing your API usage without processing the data, and potentially increasing / creating API costs.

Configuring

All precipitation rates are in metric (mm / hour) as supplied by OpenWeatherMap. This is not configurable.

  • OpenWeatherMap Entity: The OWM entity created for your location (probably named simply ‘OpenWeatherMap’)

  • Polling Frequency: Minutes between API polls. Remember that /1 will poll the API every minute / 1,440 times per day. /2 = 720 calls / day.

  • Detection types:
    Detection types must be enabled to be used. Static detection is enabled by default as it is the simplest to understand but probably the least accurate.

    • Static rate detection: Action will trigger if a single data point, out of 60, is higher than than the Precipitation rate.
    • Linear rate-change detection: Sets a threshold for now (T-0 minutes) and another for one hour (T-60 minutes). Uses linear interpolation to adjust the threshold for each minute. For example, setting rates of 1 mm/h (T-0 minutes) and 9 mm/h (T-60 minutes) would result in a threshold of 5 mm / h at T-30 minutes.
    • Average rate detection (coming soon)

    Note that setting both Linear rates to the same value is functionally identical to setting the Static rate to that value.

  • Action script: The script to be called after every run. Note that the script will be called whether precipitation is detected or not: this is for those use-cases where the absence of rain or snow is as important as the presence of rain or snow.

Output

The Blueprint will output an object of the following format:

precipitation:
  triggered: true
  static:
    triggered: true
	rate: 1.2
	minutes_from_now: 34
  linear:
    triggered: false
	rate: 0
	minutes_from_now: 0

precipitation.triggered will be true if either precipitation.static.triggered or precipitation.linear.triggered are true. Your script should evaluate one or more or these boolean values to determine how to proceed: the Blueprint itself will intentionally not do this.

Example script

Example script to receive notifications of incoming precipitation. Note that you will need to create a Helper of type input_datetime called openweathermap_minute_forecast_last_notified - this is used to rate-limit notifications, in this case to once per hour (60 * 60 seconds). In this case, notifications are only provided during daylight hours or when I am unlikely to be sleeping.

fields:
  precipitation:
    selector:
      object: {}
    default:
      static:
        triggered: false
        rate: 0
        minutes_from_now: 0
      linear:
        triggered: false
        rate: 0
        minutes_from_now: 0
sequence:
  - if:
      - condition: sun
        before: sunset
        after: sunrise
        enabled: false
      - before: "22:00"
        condition: time
      - after: "08:00"
        condition: time
      - alias: If more than an hour since last alert
        condition: template
        value_template: >-
          {{ as_timestamp(now()) -
          as_timestamp(states('input_datetime.openweathermap_minute_forecast_last_notified'))
          | int > (60 * 60) }}
        enabled: false
    then:
      - variables:
          precipitation: "{{ precipitation }}"
      - action: input_datetime.set_datetime
        target:
          entity_id: input_datetime.openweathermap_minute_forecast_last_notified
        data:
          datetime: "{{ now() }}"
        alias: Update 'last notified' input datetime
      - action: notify.notify
        data:
          title: ☔ Precipitation alert
          message: |-
            {% if precipitation.static.triggered %}
              {{ "▸ " ~ precipitation.static.rate ~ " mm/h of precipitation is expected in " ~ precipitation.static.minutes_from_now ~ " minutes (static detection)" }}
            {% endif %}{% if precipitation.linear.triggered %}
              {{ "▸ " ~ precipitation.linear.rate ~ " mm/h of precipitation is expected in " ~ precipitation.linear.minutes_from_now ~ " minutes (linear detection)" }}
            {% endif %}
        enabled: true
alias: "Notification: Precipitation alert"

Tips

  • Get started using Static detection. Depending on your location, you may find that this either provides false-positives or false-negatives, as precipitation predicted towards the end of the hour either appears unexpectedly or dissapates before reaching you.
  • When you know precipitation is incoming, use Developer Tools → Actions → openweathermap.get_minute_forecast to see how the weather forms around your location. There is no shortcut here: every location on the planet is different.
4 Likes

Set it up, waiting for the next precipitation to come around - might take a while, though :frowning:

BTW:
In the script, I had to replace the notify.notify action with one for my mobile device, i.e. notify.mobile_app_phone, otherwise I didn’t get a notification anywhere.

Potentially stupid question as I only read over this once but would a local (on the property) weather station have any benefit for this?

From the perspective of the question “Is it raining here and now?”, a weather station would almost certainly be more accurate.

From the perspective of the question “When will it rain over the next hour?”, I guess that depends how big your property is! :grin:

:grinning:
Just wasn’t sure if it could be used to address:

To help adjust for these local effects, this Blueprint comes with different ‘detection’ modes.

Either way, thanks for this - will set it up and check it out

1 Like