A Home Assistant Blueprint that monitors minute-by-minute weather forecasts and updates helper entities with rain predictions.
📚 Quick Start Guide | Get set up in 5 minutes!
- 🌧️ Rain Detection: Identifies if rain is expected within the next hour
- ⏱️ Time to Rain: Calculates minutes until rain starts
- 📊 Precipitation Rate: Tracks maximum mm/hr expected
- 🌡️ Intensity Classification: Categorizes rain as None, Light, Moderate, Heavy, or Violent
You need a weather integration that supports minute-level forecasts, such as:
- OpenWeatherMap (with OneCall API)
- Other providers with
weather_provider.get_minute_forecastmay work, but not tested
Before using this blueprint, create the following helper entities in Home Assistant.
Quick Setup: See example_helpers.yaml for ready-to-use configurations.
-
Input Boolean: Rain within hour indicator
- Go to Settings → Devices & Services → Helpers
- Add Helper → Toggle
- Name:
Rain Within Hour(or similar) - Entity ID example:
input_boolean.rain_within_hour
-
Input Number: Minutes until rain
- Add Helper → Number
- Name:
Minutes Until Rain - Minimum: 0
- Maximum: 60
- Step: 1
- Unit: minutes
- Entity ID example:
input_number.minutes_until_rain
-
Input Number: Maximum mm per hour
- Add Helper → Number
- Name:
Max mm Within Hour - Minimum: 0
- Maximum: 200
- Step: 0.1
- Unit: mm
- Entity ID example:
input_number.max_mm_within_hour
-
Input Select: Rain intensity
- Add Helper → Dropdown
- Name:
Rain Intensity - Options (must include exactly these values):
NoneLightModerateHeavyViolent
- Entity ID example:
input_select.rain_intensity
- Copy the contents of
openweathermap_rain_in_next_hour.yaml - In Home Assistant, go to:
- Settings → Automations & Scenes → Blueprints
- Click "Import Blueprint"
- Paste the URL:
https://github.com/Bibbleq/HA-OpenWeatherMap_UpcomingRain-Blueprint/blob/main/openweathermap_rain_in_next_hour.yaml
- Download
openweathermap_rain_in_next_hour.yaml - Place it in your Home Assistant
config/blueprints/automation/directory - Create subdirectory if needed:
config/blueprints/automation/rain_forecast/ - Restart Home Assistant or reload automations
After importing the blueprint, create a new automation:
-
Go to Settings → Automations & Scenes
-
Click "Create Automation"
-
Select "Rain Within Hour (Weather Forecast → Helpers)"
-
Configure the following inputs:
- Weather Provider Entity: Select your weather entity (e.g.,
weather.home) - Poll Interval Pattern: Time pattern for polling (default: "/10" for every 10 minutes)
- Use "/5" for every 5 minutes, "/15" for every 15 minutes, etc.
- Use "0,30" for twice per hour (at :00 and :30)
- Rain Threshold: Minimum mm/h to consider as rain (default: 0.1 mm/h)
- Input Boolean - Rain Within Hour: Select your toggle helper
- Input Number - Minutes Until Rain: Select your minutes helper
- Input Number - Max mm/hr Within Hour: Select your max precipitation helper
- Input Select - Rain Intensity: Select your intensity dropdown helper
- Weather Provider Entity: Select your weather entity (e.g.,
-
Save the automation
alias: Notify when rain is coming
trigger:
- platform: state
entity_id: input_boolean.rain_within_hour
to: "on"
action:
- service: notify.mobile_app
data:
title: "Rain Alert"
message: >
Rain expected in {{ states('input_number.minutes_until_rain') }} minutes.
Intensity: {{ states('input_select.rain_intensity') }}
Max rate: {{ states('input_number.max_mm_within_hour') }} mm/hralias: Close windows when rain is coming
trigger:
- platform: state
entity_id: input_boolean.rain_within_hour
to: "on"
condition:
- condition: numeric_state
entity_id: input_number.minutes_until_rain
below: 5
action:
- service: cover.close_cover
target:
entity_id: cover.bedroom_windowtype: entities
title: Rain Forecast
entities:
- entity: input_boolean.rain_within_hour
name: Rain Expected
- entity: input_number.minutes_until_rain
name: Minutes Until Rain
- entity: input_number.max_mm_within_hour
name: Max Precipitation
- entity: input_select.rain_intensity
name: IntensityThe blueprint categorizes rain intensity based on precipitation rate:
| Intensity | mm/hr Range | Description |
|---|---|---|
| None | < 0.1 | No rain |
| Light | 0.1 - 2.5 | Light drizzle |
| Moderate | 2.5 - 10 | Steady rain |
| Heavy | 10 - 50 | Heavy rain |
| Violent | > 50 | Extreme rainfall |
- Verify your weather entity supports
weather_provider.get_minute_forecast - Check the automation trace in Home Assistant for errors
- Ensure helper entities exist and are not disabled
- The weather provider may not be returning forecast data
- Check if your weather integration is properly configured
- Verify API key and location settings
- The blueprint expects the response structure from
get_minute_forecast - Check Developer Tools → Templates to test:
{{ Minute_Weather }}
- CRITICAL FIX: Changed rain threshold from mm/min to mm/h for proper light rain detection
- Default threshold now 0.1 mm/h (was 0.05 mm/min = 3.0 mm/h)
- Rain detection now uses raw precipitation values (mm/h) directly
- Much more user-friendly threshold configuration
- FIXED: Duration calculation now only counts actual rain minutes, not tolerated dry gaps
- ENHANCED: Improved raw data compression with smart digit dropping to fit in 255 chars
- Added "gap_duration" blueprint input (Dry gap tolerance) and improved expected rain duration calculation to merge short dry gaps (debounce/jitter tolerant).
- Expected rain duration now uses configurable small-gap tolerance to produce more realistic shower durations.
- Added Version: 1.5 tag to blueprint header.
- Optional raw minute-by-minute storage retained; recommended to exclude raw input_text from recorder to avoid DB bloat.
- Documentation: guidance added for required helpers and recommended defaults.
Feel free to open issues or submit pull requests to improve this blueprint.
MIT License - Feel free to use and modify as needed.
Created for the Home Assistant community to make rain forecasting more accessible and actionable.