Get minute forecast
Use this action to get a short-term precipitation forecast, also called a nowcast, for one of your Google Weather entities. It covers up to the next 6 hours in short segments, so you can tell whether rain is about to start, how heavy it is likely to get, and when it is expected to stop.
This is more detailed than the hourly forecast that the entityAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more] itself provides. Use it when the timing matters, for example to send yourself a heads-up a few minutes before rain reaches your house, or to hold off the sprinklers when a shower is on the way.
Unlike the weather.get_forecasts action, every call to this action sends a new request to Google and counts toward your API quota.
The Google Weather integration already uses about 4,464 requests per month for each location you have configured, out of the 10,000 requests per month that are free. That leaves roughly 5,500 calls per month for one location, which is about one call every 8 minutes. With two locations configured, there is far less room.
Call this action on a schedule you choose, such as a time pattern, or only when something else makes the forecast worth checking. Do not call it from a template that re-renders on its own, and check the billing section in the Google developer documentation before going beyond the free usage cap.
This action returns data that you can use in later steps of the same automation or script.
Using this action from the user interface
If you prefer building automations and scripts visually, Home Assistant walks you through this action step by step. You pick what to target, tweak a few options, and save. No YAML knowledge required.
To get a minute forecast from an automation or a script:
- Go to Settings > Automations & scenes.
- Open an existing automation or script, or select Create automation > Create new automation.
- If you’re setting up a new automation, add a trigger in the When section. Scripts don’t need a trigger. They run when something else calls them.
- In the Then do section, select Add action.
- Select what you want to control. Under By target (see Targets), pick the Google Weather weather entity you want the forecast for. You can also select an area, a device, or a label.
- From the actions shown for that target, select Google Weather: Get minute forecast.
- In the Response variable field, enter a name to store the data in, such as
nowcast. - Select Save.
Options in the UI
This action has no options beyond the target.
Using this action in YAML
If you work directly in YAML, or you want to know exactly what Home Assistant does under the hood, this section has the technical reference. It lists the field names you use in YAML, their types, and which ones are required. For how an automation or a script is built in YAML, refer to Automations in YAML and Scripts.
In YAML, refer to this action as google_weather.get_minute_forecast. Because it returns data, store the result in a response variable so you can use it in later steps:
action: google_weather.get_minute_forecast
target:
entity_id: weather.home
response_variable: nowcast
This stores the nowcast for weather.home in nowcast.
Options in YAML
This action has no options beyond the target.
Targets of the action
This action requires a target. The target is the object of the action. You can point the action at a single entityAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more], a device, an area, a floor, or a label, and Home Assistant will run the action on every matching weather entity behind that target.
-
Entity: one specific weather entity, such as
weather.living_room. - Device: every weather entity that belongs to a device.
- Area: every weather entity in a room or area.
- Floor: every weather entity on a floor.
- Label: every weather entity that shares a label.
You can also select different target types in one action. For example, you can add a specific entity and an area as targets in the same action to run the action on both of them at once.
To learn which entities Home Assistant includes for a device, area, floor, or label, and how it handles several entities, refer to Automation targets.
To leave out some of these entities, refer to Excluding targets. For example, you can leave out one weather entity in an area.
Response data
This action always returns data, so the response variable is required. If you leave it out, the action fails when it runs. Use the response variable to store the data for later steps of the same automation or script. For details, refer to Action response data.
The response is keyed by the entity ID of each targeted weather entity. For every entity, the response contains:
-
start_time: when the whole forecast starts. -
end_time: when the whole forecast ends. -
segments: the list of forecast segments, in chronological order.
Each segment has these fields:
-
start_time: when the segment starts. -
end_time: when the segment ends. -
precipitation_type: the kind of precipitation expected. One ofnone,rain,snow, orhail. It is empty if Google doesn’t specify a type. -
precipitation_probability: how likely the precipitation is, from 0 to 100. -
precipitation: the expected amount of liquid precipitation. -
snowfall_amount: the expected amount of snow, as its liquid-water equivalent, not the snow depth. -
intensity: how heavy the precipitation is expected to be. One ofnone,light,mid_light,moderate,mid_moderate,heavy, ormid_heavy. It is empty if Google doesn’t specify an intensity.
The precipitation and snowfall_amount values use the precipitation unit of the weather entity, the same as weather.get_forecasts. They are not rounded, because the amounts in short segments can be very small. Both are empty when Google doesn’t provide an amount, which is common for dry segments, so guard for this in templates.
A shortened example response looks like this:
weather.home:
start_time: "2025-06-01T00:00:00Z"
end_time: "2025-06-01T06:00:00Z"
segments:
- start_time: "2025-06-01T00:00:00Z"
end_time: "2025-06-01T00:02:00Z"
precipitation_type: rain
precipitation_probability: 62
precipitation: 0.5
snowfall_amount: 0.0
intensity: moderate
- start_time: "2025-06-01T00:02:00Z"
end_time: "2025-06-01T00:04:00Z"
precipitation_type: none
precipitation_probability: 0
precipitation:
snowfall_amount:
intensity: none
To keep the answer around as a entityAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more], store it in a trigger-based template sensor. This one counts down the minutes until precipitation is expected to start, and is unknown when nothing is expected in the next 6 hours:
template:
- triggers:
- trigger: time_pattern
minutes: /15
actions:
- action: google_weather.get_minute_forecast
target:
entity_id: weather.home
response_variable: nowcast
sensor:
- name: "Precipitation starts in"
unique_id: google_weather_precipitation_starts_in
unit_of_measurement: min
state: >
{% set ns = namespace(starts_in=none) %}
{% for segment in nowcast['weather.home']['segments']
if ns.starts_in is none %}
{% if segment['precipitation_type'] not in ['none', none]
and as_timestamp(segment['end_time'])
> now().timestamp() %}
{% set minutes = (as_timestamp(segment['start_time'])
- now().timestamp()) / 60 %}
{% set ns.starts_in = [minutes, 0] | max %}
{% endif %}
{% endfor %}
{% if ns.starts_in is not none %}
{{ ns.starts_in | round | int }}
{% endif %}
The loop skips segments that have already ended, so the sensor never reports a negative countdown. A state of 0 means precipitation is falling now, and unknown means none is expected in the next 6 hours.
This example refreshes every 15 minutes, which adds about 2,900 calls per month. That fits alongside one configured location, but not two. Check the arithmetic above against your own setup before copying the cadence.
Good to know
- The forecast covers up to the next 6 hours. Segments are 2 or 15 minutes long depending on the location, so do not assume a fixed segment length or a fixed number of segments.
- Google offers this forecast as an experimental, pre-general-availability feature. The data it returns, and its availability in your area, can change.
- A segment with a
precipitation_typeofnonemeans no precipitation is expected during that segment. - The Google Maps Platform terms require that these forecast values are not kept for longer than one hour, so do not archive them in long-term statistics.
- The forecast is only as accurate as the data Google provides for your location.
Try it yourself
Ready to test this? Open Settings > Tools > Actions, search for this action, fill in the fields, and select Perform action. You see what happens on your actual entitiesAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more] without writing a line of YAML.
More examples
Real scenarios where this action shows up in automations and scripts. Copy any example and adapt it to your setup. In the visual editor, select the UI options listed in the example or paste the YAML code.
You don’t need to edit YAML to use these examples. Copy a YAML snippet from this page, open the visual automation editor in Home Assistant, and press Ctrl+V (or Cmd+V on Mac). Home Assistant automatically converts the pasted YAML into the visual editor format, whether it’s a full automation, a single trigger, a condition, or an action.
Automation: get a heads-up before rain starts
Check the nowcast every 15 minutes, and send a notification when precipitation is expected to begin within the next half hour. It stays quiet while precipitation is already falling, so you only hear about it before it starts. Because it checks every 15 minutes and looks 30 minutes ahead, it usually notifies you twice about the same rain: a first heads-up, then a second one closer to the start.
At this cadence the automation adds about 2,900 calls per month, which fits alongside one configured location but not two.
- Trigger: Time pattern, every 15 minutes
-
Action: Google Weather: Get minute forecast
-
Target: Home (
weather.home) -
Response variable:
nowcast
-
Target: Home (
- Condition: Template, no precipitation is falling now and the next precipitation starts within 30 minutes
-
Action: Send a notification message
-
Target: My Device (
notify.my_device)
-
Target: My Device (
YAML example for a heads-up before rain starts
alias: "Warn me before rain starts"
triggers:
- trigger: time_pattern
minutes: /15
actions:
- action: google_weather.get_minute_forecast
target:
entity_id: weather.home
response_variable: nowcast
- variables:
next_segment: >
{% set ns = namespace(segment=none) %}
{% for segment in nowcast['weather.home']['segments']
if ns.segment is none %}
{% if segment['precipitation_type'] not in ['none', none]
and as_timestamp(segment['end_time'])
> now().timestamp() %}
{% set ns.segment = segment %}
{% endif %}
{% endfor %}
{{ ns.segment }}
- condition: template
value_template: >
{{ next_segment is not none
and 0 < as_timestamp(next_segment['start_time'])
- now().timestamp() < 1800 }}
- action: notify.send_message
target:
entity_id: notify.my_device
data:
message: >
{{ next_segment['precipitation_type'] }} expected in about
{{ ((as_timestamp(next_segment['start_time'])
- now().timestamp()) / 60) | round | int }} minutes.
Automation: skip the sprinklers when rain is on the way
Before the evening watering run, check the nowcast and only turn the sprinklers on when no meaningful rain is expected in the next 6 hours. The example adds up the forecast amounts, skipping the segments that have no amount. The threshold of 1 is in the precipitation unit of your weather entity, so this example assumes millimeters. If your entity uses inches, use a value such as 0.04 instead.
- Trigger: Time, 19:00:00
-
Action: Google Weather: Get minute forecast
-
Target: Home (
weather.home) -
Response variable:
nowcast
-
Target: Home (
- Condition: Template, less than 1 mm of rain expected in total
-
Action: Turn on switch
- Target: Sprinklers
YAML example for skipping the sprinklers when rain is coming
alias: "Water the garden unless rain is coming"
triggers:
- trigger: time
at: "19:00:00"
actions:
- action: google_weather.get_minute_forecast
target:
entity_id: weather.home
response_variable: nowcast
- condition: template
value_template: >
{{ nowcast['weather.home']['segments']
| map(attribute='precipitation')
| select
| sum < 1 }}
- action: switch.turn_on
target:
entity_id: switch.sprinklers
Still stuck?
To test the action on its own, run it in the automation editor with Run action, and check the message that it shows. To see what the action did when the automation ran, open the trace of that run. For details, refer to Testing automations. For common problems and their solutions, refer to Troubleshooting automations.
If that doesn’t help, the Home Assistant community is quick to help: join Discord for real-time chat, post on the community forum with the action you’re calling and what you expected to happen, or share on our subreddit /r/homeassistant.
AI assistants like ChatGPT or Claude can also explain actions or suggest the right one when you describe what you want in plain language.
Related actions
Explore related actions:
- Get weather forecasts: Retrieves the forecasts from one or more weather entities.