Get warnings

Use this action to retrieve the full details of all weather warnings for one of your GeoSphere Austria Warnings locations. It returns both the warnings that are currently active and the advance warnings that start later.

The warning sensors show the warning level and a few details of one selected warning. This action gives you every warning, including the warning text, the expected impacts, and the recommendations from GeoSphere Austria. For example, you can use the result to send a notification that explains what to expect and what to do.

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 warnings from an automation or a script:

  1. Go to Settings > Automations & scenes.
  2. Open an existing automation or script, or select Create automation > Create new automation.
  3. 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.
  4. In the Then do section, select Add action.
  5. From the search box, search for and select GeoSphere Austria Warnings: Get warnings.
  6. Under Location, select the location to get the warnings for.
  7. In the Response variable field, enter a name to store the data in, such as warnings.
  8. Select Save.

This action does not support targets. In the UI, you are not prompted to choose an area, device, entity, or label.

Options in the UI

Location (Required)

The GeoSphere Austria Warnings location to get the warnings for.

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 geosphere_austria_warnings.get_warnings. Store the result in a response variable so you can use it in later steps:

ActionAn action makes Home Assistant do something, for example, turn on a light, send a notification, or activate a scene. Automations and scripts run a list of actions. [Learn more]
action: geosphere_austria_warnings.get_warnings
data:
  config_entry_id: YOUR_CONFIG_ENTRY_ID
response_variable: warnings

This stores the warnings for the selected location in warnings.

Options in YAML

config_entry_id string Required

The ID of the GeoSphere Austria Warnings location to get the warnings for.

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 contains two lists:

  • active_warnings: Warnings that have already started.
  • advance_warnings: Warnings that GeoSphere Austria has issued, but that start later.

A list with no warnings is empty. Each item covers one time period of a warning. GeoSphere Austria can split a warning into several periods, for example when it lasts several days or its level changes over time. Such a warning appears once for each period, with the same warning_id and a different course_id.

Both lists use the same order as the warning sensors: warnings you can act on right now come first. Heat and cold warnings rank one severity tier below storm, rain, snow, black ice, and thunderstorm warnings. Among equally ranked warnings, the one that ends first comes first. So the first item of each list is the same warning that the matching sensor describes in its attributes.

Each item has the following fields:

  • warning_id: The identifier GeoSphere Austria assigns to the warning.
  • change_id: The change identifier GeoSphere Austria assigns to the warning.
  • course_id: The identifier of this time period of the warning.
  • type: The kind of weather event. One of storm, rain, snow, black_ice, thunderstorm, heat, or cold.
  • level: The severity of the warning in this time period. One of yellow, orange, or red.
  • start: When this time period starts, in ISO 8601 format.
  • end: When this time period ends, in ISO 8601 format.
  • text: A short summary of the warning.
  • impacts: The expected impacts of the weather event.
  • recommendations: What GeoSphere Austria recommends you do.
  • meteo_text: A description of the weather situation.
  • update_reason: The reason GeoSphere Austria gives for an update of the warning, if any.

Text fields that GeoSphere Austria did not provide are empty.

active_warnings:
  - warning_id: 4149
    change_id: 6
    course_id: 12
    type: storm
    level: orange
    start: "2023-03-27T06:00:00+00:00"
    end: "2023-03-27T16:00:00+00:00"
    text: >
      Orange storm warning from Mon, 27.03.2023 08:00
      until Mon, 27.03.2023 18:00
    impacts: "* Branches may fall and objects may be thrown around."
    recommendations: "* Be careful in forests, parks and avenues!"
    meteo_text: "Strong northwest winds with gusts between 60 and 80 km/h."
    update_reason: ""
advance_warnings: []

Good to know

  • The action returns the warnings from the most recent update. It does not request new data from GeoSphere Austria. The integration updates the warnings every 5 minutes.
  • If the most recent update failed, the action fails with the message Weather warnings are unavailable because the last update failed. At the same time, the warning sensors are unavailable. The action works again after the next successful update.
  • The location must be loaded. If you disabled the location, or it failed to set up, the action fails.

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.

Tip

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: Explain what to do when a severe warning starts

The active warning level sensor tells you that a severe warning is active. Send a notification with what GeoSphere Austria expects and recommends.

The first item in the list is not always the most severe warning, because heat and cold warnings rank lower. So this example picks the first orange or red warning.

  • Trigger: State changed
    • Entity: Innsbruck active warning level (sensor.innsbruck_active_warning_level)
    • To: Orange, Red
  • Action: GeoSphere Austria Warnings: Get warnings
    • Location: Innsbruck
    • Response variable: warnings
  • Action: Define variables
    • warning: the first active warning with the level orange or red
  • Action: Send a notification message
    • Target: My Device (notify.my_device)
    • Title: {{ warning.text }}
    • Message: {{ warning.impacts }} {{ warning.recommendations }}
YAML example for explaining a severe warning
AutomationAutomations in Home Assistant allow you to automatically respond to things that happen in and around your home. [Learn more]
alias: "Explain severe weather warning"
triggers:
  - trigger: state
    entity_id: sensor.innsbruck_active_warning_level
    to:
      - orange
      - red
actions:
  - action: geosphere_austria_warnings.get_warnings
    data:
      config_entry_id: YOUR_CONFIG_ENTRY_ID
    response_variable: warnings
  - variables:
      warning: >
        {{ warnings.active_warnings
           | selectattr('level', 'in', ['orange', 'red'])
           | first }}
  - action: notify.send_message
    target:
      entity_id: notify.my_device
    data:
      title: "{{ warning.text }}"
      message: >
        {{ warning.impacts }}
        {{ warning.recommendations }}

Automation: Morning summary of upcoming warnings

Every morning, get a list of all warnings that start later, so you can plan your day.

  • Trigger: Time
    • At: 07:00
  • Action: GeoSphere Austria Warnings: Get warnings
    • Location: Innsbruck
    • Response variable: warnings
  • Condition: Template
    • Value template: {{ warnings.advance_warnings | count > 0 }}
  • Action: Send a notification message
    • Target: My Device (notify.my_device)
    • Title: Upcoming weather warnings
    • Message: The level, type, and start time of each warning, as shown in the YAML example.
YAML example for a morning summary of upcoming warnings
AutomationAutomations in Home Assistant allow you to automatically respond to things that happen in and around your home. [Learn more]
alias: "Morning summary of upcoming weather warnings"
triggers:
  - trigger: time
    at: "07:00:00"
actions:
  - action: geosphere_austria_warnings.get_warnings
    data:
      config_entry_id: YOUR_CONFIG_ENTRY_ID
    response_variable: warnings
  - condition: template
    value_template: "{{ warnings.advance_warnings | count > 0 }}"
  - action: notify.send_message
    target:
      entity_id: notify.my_device
    data:
      title: "Upcoming weather warnings"
      message: |
        {% for warning in warnings.advance_warnings -%}
        - {{ warning.level }} {{ warning.type }} warning, starts
          {{ warning.start | as_datetime | as_local }}
        {% endfor %}

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.

Tip

AI assistants like ChatGPT or Claude can also explain actions or suggest the right one when you describe what you want in plain language.