Skip to content

Home Assistant custom component for Sveriges Radio's API for Important Public Announcements (VMA)

License

Notifications You must be signed in to change notification settings

Nicxe/krisinformation

Repository files navigation

Krisinformation

hacs_badge Maintenance GitHub last commit

GitHub Repo stars GitHub Downloads (all assets, latest release)

Overview

Krisinformation is a custom Home Assistant integration that fetches VMA alerts from Sveriges Radio.

This repository now contains both:

  • the Home Assistant integration (krisinformation)
  • the Lovelace alert card (krisinformation-alert-card.js)

Buy Me A Coffee

Installation

Integration with HACS (recommended)

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

You can also add https://github.com/Nicxe/krisinformation manually in HACS as type Integration.

Integration without HACS

  1. Download krisinformation.zip from the latest release.
  2. Extract the archive and place the krisinformation folder in config/custom_components/.
  3. Restart Home Assistant.

Alert card installation

The alert card is bundled with this integration.

When the integration starts, it automatically:

  • syncs the bundled card to config/www/krisinformation-alert-card.js
  • creates or updates a Lovelace module resource at /local/krisinformation-alert-card.js?v=... for cache-busting

If you have just installed or updated, reload the browser once to ensure the latest card resource is loaded.

Card usage

  1. Open your dashboard.
  2. Select Edit dashboard.
  3. Add a new card.
  4. Choose Custom: Krisinformation Alert Card.

Manual card type:

  • custom:krisinformation-alert-card

Manual fallback (if needed)

Normally no manual Lovelace resource setup is required.

If your dashboard does not load the card automatically, add this resource manually:

  • URL: /local/krisinformation-alert-card.js
  • Type: JavaScript Module

Configuration

To add the integration, use this button:

Add Krisinformation to Home Assistant

If needed, add it manually via Settings > Devices & Services > Add Integration.

Example: Notification from first alert

{% set alert = state_attr('sensor.krisinformation_hela_sverige', 'alerts')[0] %}
{{ alert['event'] }}: {{ alert['description'] }}
automation:
  - alias: "Krisinformation Alert Notification"
    trigger:
      - platform: state
        entity_id: sensor.krisinformation_hela_sverige
    action:
      - service: notify.mobile_app_your_phone
        data:
          title: "{{ state_attr('sensor.krisinformation_hela_sverige', 'alerts')[0]['event'] }}"
          message: "{{ state_attr('sensor.krisinformation_hela_sverige', 'alerts')[0]['description'] }}"

Release assets and versioning

Each GitHub release in this repository publishes:

  • krisinformation.zip for integration installation

The bundled alert card is included inside krisinformation.zip.

Migration from the old card repository

If you previously used Nicxe/krisinformation-alert-card, see MIGRATION.md.

Usage screenshots

krisinfo_card_screenshoot

Contributing

Contributions, bug reports, and feedback are welcome. Please open issues or pull requests on GitHub.

About

Home Assistant custom component for Sveriges Radio's API for Important Public Announcements (VMA)

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors