Welcome to the MET Alerts integration for Home Assistant! This custom component provides real-time weather alerts from MET Norway directly into your Home Assistant setup.
- 🎨 UI Configuration - Easy setup through Home Assistant UI (no YAML required!)
- 🔄 Real-time Updates - Fetches alerts every 30 minutes
- 🌍 Multiple Languages - Support for Norwegian and English
- 📍 Location-based - Configure alerts for any coordinates
- 🚨 Sensor Modes - Choose between legacy (4 sensors) or new array mode (1 sensor with all alerts as attribute)
- 🖼️ Automatic Alert Icons - Sensors display the correct warning icon for each alert (offline, embedded)
- 🗺️ Map URLs - Direct links to alert maps
- Open HACS in Home Assistant
- Click the three dots in the top right corner
- Select "Custom repositories"
- Add this repository URL:
https://github.com/kurtern84/met_alerts - Select category: Integration
- Click "Add"
- Find "Met Alerts" in HACS and click "Download"
- Restart Home Assistant
- Download the latest release
- Copy the
met_alertsdirectory to yourcustom_componentsdirectory:/config/custom_components/met_alerts/ - Restart Home Assistant
- Go to Settings → Devices & Services
- Click the + Add Integration button in the bottom right
- Search for "Met Alerts"
- Click on the Met Alerts integration when it appears
Screenshot: Adding Met Alerts through the integrations page
Enter your configuration details:
- Name: A friendly name for this alert monitor (e.g., "Home Alerts" or "Cottage Alerts")
- Latitude: The latitude for your location (defaults to your Home Assistant location)
- Longitude: The longitude for your location (defaults to your Home Assistant location)
- Language: Choose between:
no- Norwegian (default)en- English
Screenshot: Configuration form for Met Alerts
💡 Tip: You can set up multiple instances for different locations (e.g., one for home, one for your cottage).
Click Submit to complete the setup. The integration will:
- Validate your coordinates with the MET Norway API
- Create 4 sensors for tracking up to 4 simultaneous alerts
- Start monitoring for weather alerts every 30 minutes
Screenshot: Successfully added Met Alerts integration
To update your configuration later:
- Go to Settings → Devices & Services
- Find the Met Alerts integration
- Click the ⚙️ Configure button
- Update your settings and click Submit
Screenshot: Accessing configuration options
The integration will automatically reload with your new settings.
⚠️ Note: YAML configuration is deprecated as of v3.0. Please migrate to UI configuration. Existing YAML configurations will continue to work but you'll see a deprecation warning in your logs.
Click to see legacy YAML configuration
sensor:
- platform: met_alerts
name: MET Alerts
latitude: YOUR_LATITUDE
longitude: YOUR_LONGITUDE
lang: no # or "en" for EnglishAfter adding this, restart Home Assistant.
Depending on your configuration, the integration creates either:
-
Legacy Mode (default):
- 4 sensor entities for each configured location:
Entity ID Description Priority sensor.met_alertsHighest priority alert 1st (Most severe) sensor.met_alerts_2Second highest priority 2nd sensor.met_alerts_3Third highest priority 3rd sensor.met_alerts_4Fourth highest priority 4th (Least severe) - Each sensor shows the event type and attributes for a single alert (sorted by severity).
- 4 sensor entities for each configured location:
-
Array Mode:
- 1 sensor entity per location:
Entity ID Description sensor.met_alertsNumber of active alerts (state), all alerts as attribute array - The
alertsattribute contains a list of all active alerts, each with full details.
- 1 sensor entity per location:
Note: Alerts are always sorted by awareness level (severity), with the most severe first.
- Legacy mode: The sensor state shows the event type, or "No Alert" if no alerts are active. Common event types:
stormSurge,wind,snow,ice,forestFire,avalanches,rain,flooding,polarLow,rain-flood, etc.
- Array mode: The sensor state is the number of active alerts (or "No Alert" if none).
- Legacy mode: Each sensor provides detailed information through attributes:
entity_picture: The correct warning icon for the alert (SVG, offline, with attribution)attribution: License and credit for the icon set
In array mode, the single sensor has an alerts attribute, which is a list of all active alerts. Each alert in the array contains the same fields as above (title, starttime, endtime, etc.).
Alert icons are from the NRK/yr.no warning icon set, licensed under CC BY 4.0:
"Warning icons by NRK/yr.no, CC BY 4.0, https://github.com/nrkno/yr-warning-icons"
The icons are embedded as base64-encoded SVGs for offline use. See LICENSE_yr_icons.txt for full license text and attribution.
| Attribute | Description | Example |
|---|---|---|
title |
Alert title (timestamps removed) | "Høy vannstand, gult nivå, Kyst- og fjordstrøk av Rogaland" |
starttime |
When the alert becomes active | "2025-11-28T13:00:00+00:00" |
endtime |
When the alert expires | "2025-11-28T17:00:00+00:00" |
description |
Detailed description of the alert | Full text description in selected language |
awareness_level |
Full awareness level string | "2; yellow; Moderate" |
awareness_level_numeric |
Severity level (1-4) | "2" |
awareness_level_color |
Visual severity indicator | "yellow" |
certainty |
How certain the forecast is | "likely", "possible", "observed" |
severity |
Impact severity | "minor", "moderate", "severe", "extreme" |
instruction |
Safety instructions | What actions to take |
area |
Geographic area affected | Region or municipality names |
event_awareness_name |
Human-readable event name | "Moderate storm surge" |
consequences |
Potential impacts | Expected damage or disruption |
map_url |
URL to visual alert map (PNG) | Direct link to MET Norway map image |
The awareness_level_numeric indicates severity:
| Level | Color | Meaning | Description |
|---|---|---|---|
| 1 | 🟢 Green | Minor | Be aware. Keep yourself updated. |
| 2 | 🟡 Yellow | Moderate | Be prepared. Weather may be dangerous. |
| 3 | 🟠 Orange | Severe | Be ready to act. Dangerous weather expected. |
| 4 | 🔴 Red | Extreme | Take action immediately. Very dangerous conditions. |
You can add the integration multiple times for different locations:
- Home location - Monitor alerts for your primary residence
- Cottage/Cabin - Track weather at your vacation property
- Work location - Stay informed about conditions affecting your commute
- Elderly relatives - Monitor weather at their location for safety checks
Each instance creates its own set of 4 sensors with unique names.
Example 1: Send notification for severe weather
automation:
- alias: "Severe Weather Alert"
trigger:
- platform: state
entity_id: sensor.met_alerts
condition:
- condition: template
value_template: "{{ state_attr('sensor.met_alerts', 'awareness_level_numeric') | int >= 3 }}"
action:
- service: notify.mobile_app
data:
title: "⚠️ Severe Weather Alert"
message: >
{{ states('sensor.met_alerts') }}:
{{ state_attr('sensor.met_alerts', 'title') }}
{{ state_attr('sensor.met_alerts', 'instruction') }}Example 2: Flash lights when extreme weather is detected
automation:
- alias: "Extreme Weather Light Warning"
trigger:
- platform: state
entity_id: sensor.met_alerts
condition:
- condition: template
value_template: "{{ state_attr('sensor.met_alerts', 'awareness_level_color') == 'red' }}"
action:
- service: light.turn_on
target:
entity_id: light.living_room
data:
flash: long
rgb_color: [255, 0, 0]Example 3: Announce alert on smart speaker
automation:
- alias: "Announce Weather Alert"
trigger:
- platform: state
entity_id: sensor.met_alerts
to:
from: "No Alert"
action:
- service: tts.google_translate_say
target:
entity_id: media_player.kitchen_speaker
data:
message: >
Nytt værvarsle: {{ state_attr('sensor.met_alerts', 'title') }}To display the MET Alerts data in your Lovelace dashboard, you can use the following configuration:
- Add an entities card to your Lovelace dashboard:
type: entities
title: MET Alerts
show_header_toggle: false
entities:
- entity: sensor.met_alerts
name: Event
- type: attribute
entity: sensor.met_alerts
attribute: title
name: Title
- type: attribute
entity: sensor.met_alerts
attribute: starttime
name: Start time
- type: attribute
entity: sensor.met_alerts
attribute: endtime
name: End time
- type: attribute
entity: sensor.met_alerts
attribute: description
name: Description
- type: attribute
entity: sensor.met_alerts
attribute: awareness_level
name: Awareness Level
- type: attribute
entity: sensor.met_alerts
attribute: awareness_level_numeric
name: Awareness Level Numeric
- type: attribute
entity: sensor.met_alerts
attribute: awareness_level_color
name: Awareness Level Color
- type: attribute
entity: sensor.met_alerts
attribute: certainty
name: Certainty
- type: attribute
entity: sensor.met_alerts
attribute: severity
name: Severity
- type: attribute
entity: sensor.met_alerts
attribute: instruction
name: Instruction
- type: attribute
entity: sensor.met_alerts
attribute: contact
name: Contact
- type: attribute
entity: sensor.met_alerts
attribute: area
name: Area
- type: attribute
entity: sensor.met_alerts
attribute: event_awareness_name
name: Event Awareness Name
- type: attribute
entity: sensor.met_alerts
attribute: consequences
name: Consequences
- type: attribute
entity: sensor.met_alerts
attribute: map_url
name: Map URL2. Example of displaying a the extensive/large card and the map for it, but only if there is an alert
(this card was added by @svenove)
- Note that the color of the first line will be yellow/orange/red based on the severity of the alert.
- To customize:
- Set the weekday names in the
set weekdays-line. Note that the first day is Sunday! - Change
if time_diff < 24and set how many hours before the alert start time you want the card to be displayed/visible. Default is 24 hours.
- Set the weekday names in the
type: markdown
show_empty: false
content: >
{% set weekdays = ['Søndag', 'Mandag', 'Tirsdag', 'Onsdag', 'Torsdag',
'Fredag', 'Lørdag'] %} {% set start_time = state_attr('sensor.met_alerts_2',
'starttime') %} {% set end_time = state_attr('sensor.met_alerts_2',
'endtime')%} {% if start_time and end_time %}
{% set start_timestamp = as_timestamp(strptime(start_time, "%Y-%m-%dT%H:%M:%S%z")) %}
{% set end_timestamp = as_timestamp(strptime(end_time, "%Y-%m-%dT%H:%M:%S%z")) %}
{% set start_day_index = start_timestamp | timestamp_custom("%w") | int %}
{% set end_day_index = end_timestamp | timestamp_custom("%w") | int %}
{% set start_day = weekdays[start_day_index] %}
{% set end_day = weekdays[end_day_index] | lower %}
{% if start_day_index == end_day_index %}
{% set met_alerts_time = start_day + ' kl ' + (start_timestamp | timestamp_custom("%H:%M")) + ' til ' + (end_timestamp | timestamp_custom("%H:%M")) %}
{% else %}
{% set met_alerts_time = start_day + ' kl ' + (start_timestamp | timestamp_custom("%H:%M")) + ' til ' + end_day + ' kl ' + (end_timestamp | timestamp_custom("%H:%M")) %}
{% endif %}
{% set time_diff = (as_timestamp(start_time) - as_timestamp(now())) / 3600 %}
{% set time_diff_end = (as_timestamp(end_time) - as_timestamp(now())) / 3600 %}
{% if time_diff < 24 and time_diff_end > 0 %}## <center><font color="{{ state_attr('sensor.met_alerts_2', 'awareness_level_color') }}"><ha-icon icon="mdi:alert"></ha-icon> Farevarsel - {{ state_attr('sensor.met_alerts_2', 'event_awareness_name') }} <ha-icon icon="mdi:alert"></ha-icon></font></center>
### <center>{{ met_alerts_time }}
{{ state_attr('sensor.met_alerts_2', 'description') }}</center>
<i>{{ state_attr('sensor.met_alerts_2', 'instruction') }}</i>
 }})
{% endif %}
{% endif %}- Add a markdown card to display resources:
type: markdown
title: Resources
content: >
{% if state_attr('sensor.met_alerts', 'resources') %}
{% for resource in state_attr('sensor.met_alerts', 'resources') %}
- [{{ resource.description }}]({{ resource.uri }})
{% endfor %}
{% else %}
No resources available.
{% endif %}
When there are no active weather warnings in Norway (or for testing dashboard configurations), you can enable Test Mode to inject fake weather alerts into your Met Alerts integration.
Test Mode injects 2 fake weather alerts for a fictional location called "Testville":
-
Orange Wind Warning
- Awareness Level: Orange (Moderate)
- Event: Strong gale/storm
- Valid: December 16-17, 2025
- Description: Wind gusts up to 35 m/s in coastal areas
-
Red Rain Warning
- Awareness Level: Red (Severe)
- Event: Extreme rainfall
- Valid: December 17-18, 2025
- Description: 150-200mm rainfall in 24 hours, flooding expected
- Go to Settings → Devices & Services
- Click Add Integration
- Search for and select Met Alerts
- Fill in your coordinates (lat/lon) and preferences
- Check the "Test Mode" checkbox at the bottom of the form
- Click Submit
- Go to Settings → Devices & Services
- Find your Met Alerts integration
- Click the three-dot menu (⋮) and select Configure
- Check the "Test Mode" checkbox at the bottom of the form
- Click Submit
- The integration will reload with the test alerts
After enabling test mode, verify the alerts are working:
- Go to Developer Tools → States
- Find your sensor (e.g.,
sensor.met_alerts) - For Array Mode: You should see
state: 2and analertsattribute with 2 items - For Legacy Mode: You should see alerts in the first two sensors
- Go to Settings → System → Logs
- Look for messages like:
Test mode: Injected 2 fake alerts for Testville (Orange Wind + Red Rain) Found 2 alert(s) in response
Once test mode is enabled, you can test all the dashboard card configurations from CARD_EXAMPLES.md:
- The fake alerts will appear in your cards
- You can iterate through both warnings
- Icons will show (orange triangle for wind, red triangle for rain)
- All alert attributes are populated (title, description, instructions, consequences, etc.)
To disable test mode and return to real weather data:
- Go to Settings → Devices & Services
- Find your Met Alerts integration
- Click the three-dot menu (⋮) and select Configure
- Uncheck the "Test Mode" checkbox
- Click Submit
- Test mode does not require specific coordinates
- Works with any lat/lon configuration
- Test alerts are injected after the real API call
- If there are real alerts, test alerts are added to them (not replaced)
- Test alerts use proper GeoJSON structure matching Met.no API format
- All standard alert attributes are included (awareness_level, severity, certainty, etc.)
Test mode is perfect for:
- ✅ Testing dashboard card configurations
- ✅ Development and debugging
- ✅ Taking screenshots for documentation
- ✅ Training users on what alerts look like
- ✅ Testing automations and notifications
- ✅ When Norway has no active weather warnings (rare but it happens!)
If you have an active weather alert but it's not showing in Home Assistant:
-
Verify your location is in the alert area
- Alerts are geographically specific
- Coastal alerts (like storm surge) only apply to coastal areas
- Check the
areaattribute to see which regions are affected
-
Check the logs
- Go to Settings → System → Logs
- Search for "met_alerts"
- Look for entries showing number of alerts fetched
Example log output:
Successfully fetched Met alerts data Found 1 alert(s) in response Alert 1: event='stormSurge', awareness_level='2; yellow; Moderate' -
Verify coordinates
- Ensure your latitude/longitude are correct for your intended location
- You can verify coordinates at Google Maps (right-click → What's here?)
-
Check language setting
- Make sure the language matches your preference
- Some alerts may only be available in Norwegian
-
API connectivity
- Ensure your Home Assistant instance can reach
api.met.no - Check firewall and network settings
- Ensure your Home Assistant instance can reach
Issue: "Failed to connect to MET Norway API"
- Solution: Check your internet connection and verify the coordinates are valid (lat: -90 to 90, lon: -180 to 180)
Issue: Sensors show "Unknown" or "Unavailable"
- Solution: Wait for the next update cycle (30 minutes) or restart Home Assistant to force an update
Issue: Duplicate integrations after migration from YAML
- Solution: Remove the old YAML configuration from
configuration.yaml, restart, then delete the duplicate integration from the UI
To change your configuration:
- Go to Settings → Devices & Services
- Find the "Met Alerts" integration
- Click the ⚙️ Configure button
- Update your settings:
- Change the name
- Adjust coordinates
- Switch language
- Click Submit
The integration will automatically reload with the new configuration - no restart required!
To completely remove Met Alerts:
- Go to Settings → Devices & Services
- Find the "Met Alerts" integration
- Click Delete
- Confirm the deletion
All sensors and configuration will be removed.
We welcome contributions! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request at https://github.com/kurtern84/met_alerts
Q: How often does the integration check for new alerts?
A: Every 30 minutes. This balances timely updates with respectful API usage.
Q: Can I monitor multiple locations?
A: Yes! Simply add the integration multiple times through the UI, each with different coordinates and names.
Q: Why do I see 4 sensors?
A: MET Norway can issue multiple simultaneous alerts for a location. The integration creates 4 sensors sorted by severity, so you can track all active alerts.
Q: What's the difference between Norwegian and English?
A: The language setting determines which language the alert text appears in (title, description, instructions). Both pull from the same alert data.
Q: Do alerts work for locations outside Norway?
A: This integration uses MET Norway's API, which primarily covers Norway and surrounding areas. Alerts may not be available for locations far from Norway.
Q: How do I know if my location has any alerts right now?
A: Check the MET Norway website at https://www.met.no/vaer-og-klima/ekstremvaervarsler-og-andre-faremeldinger to see current active alerts.
Q: Can I adjust the update interval?
A: Not currently through the UI. The 30-minute interval is set to balance timeliness with API load.
Q: What happens when an alert expires?
A: The sensor will automatically return to "No Alert" state at the next update after the alert's end time.
- ✨ New: UI-based configuration through Home Assistant
- ✨ New: Options flow for reconfiguring existing instances
- ✨ New: Enhanced logging for troubleshooting
- ✨ New: Unique IDs for proper entity registry support
- ✨ New: Support for multiple integration instances
- 📝 Deprecated YAML configuration (still supported with warning)
- 🐛 Various bug fixes and improvements
- Initial YAML-based configuration
- Basic alert fetching and display
- Support for Norwegian and English languages
Originally forked from @kurtern84's version. Modernized with UI configuration support.
This project is licensed under the MIT License. See the LICENSE file for details.





