{"id":31799802,"url":"https://github.com/pierregode/mmm-vma","last_synced_at":"2025-11-01T12:02:41.211Z","repository":{"id":316127057,"uuid":"1062081736","full_name":"PierreGode/MMM-VMA","owner":"PierreGode","description":"Viktigt Meddelande till Allmänheten for Swede","archived":false,"fork":false,"pushed_at":"2025-09-22T19:46:10.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-22T21:25:33.147Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PierreGode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-22T19:29:38.000Z","updated_at":"2025-09-22T19:46:14.000Z","dependencies_parsed_at":"2025-09-22T21:25:39.310Z","dependency_job_id":null,"html_url":"https://github.com/PierreGode/MMM-VMA","commit_stats":null,"previous_names":["pierregode/mmm-vma"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/PierreGode/MMM-VMA","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PierreGode%2FMMM-VMA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PierreGode%2FMMM-VMA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PierreGode%2FMMM-VMA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PierreGode%2FMMM-VMA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PierreGode","download_url":"https://codeload.github.com/PierreGode/MMM-VMA/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PierreGode%2FMMM-VMA/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005458,"owners_count":26083902,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-10T22:50:01.069Z","updated_at":"2025-10-10T22:50:04.816Z","avatar_url":"https://github.com/PierreGode.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MMM-VMA\n\nMMM-VMA [MagicMirror²](https://magicmirror.builders/) module that shows the latest\n**Viktigt Meddelande till Allmänheten (VMA)** alerts published by\n[Krisinformation.se](https://www.krisinformation.se/). The module consumes the official V3 API and can\noptionally surface test alerts so that you are prepared for Sweden's recurring public warning tests.\n\n\n## Requirements\n\n- MagicMirror² `v2.22.0` or later.\n- Node.js 16+ (MagicMirror² currently ships with Node.js 18 LTS).\n- Internet access to reach `https://api.krisinformation.se/`.\n\n## Installation\n\n1. Change into your MagicMirror `modules` directory:\n\n   ```bash\n   cd ~/MagicMirror/modules\n   ```\n\n2. Clone this repository:\n\n   ```bash\n   git clone https://github.com/PierreGode/MMM-VMA.git\n   ```\n\n3. Install the Node.js dependencies inside the module folder:\n\n   ```bash\n   cd MMM-VMA\n   npm install\n   ```\n\n4. Add the module to the `modules` section of your `config/config.js` file:\n\n   ```js\n   {\n     module: \"MMM-VMA\",\n     position: \"top_left\",\n     config: {\n       language: \"sv\",\n       counties: [\"Stockholms län\"],\n       includeTestVma: false,\n       timeFormat: \"relative\"\n     }\n   }\n   ```\n\n5. Restart MagicMirror².\n\n## Configuration\n\n| Option              | Type      | Default                | Description |\n|---------------------|-----------|------------------------|-------------|\n| `language`          | `string`  | `\"sv\"`                 | Language hint passed to the API and used for formatting timestamps. Accepts IETF language tags such as `\"sv\"` or `\"en\"`. |\n| `counties`          | `string[]`| `[]`                    | Optional list of county names to filter alerts. When empty, all alerts are returned. Example: `[\"Stockholms län\", \"Uppsala län\"]`. |\n| `allCounties`       | `boolean` | `true`                  | Mirrors the API parameter. When `true` an empty `counties` array means “all counties”, otherwise “no counties”. |\n| `includeTestVma`    | `boolean` | `false`                 | Include messages from the `/v3/testvmas` endpoint (useful ahead of the quarterly tests). |\n| `updateInterval`    | `number`  | `15 * 60 * 1000`        | Polling frequency in milliseconds. Minimum practical value is 60 000 ms (1 minute). |\n| `retryDelay`        | `number`  | `5 * 60 * 1000`         | Delay before retrying after a failed request, in milliseconds. |\n| `maxAlerts`         | `number`  | `5`                     | Maximum number of alerts rendered at once. |\n| `fadeSpeed`         | `number`  | `1000`                  | Animation speed (ms) for DOM updates. |\n| `timeFormat`        | `string`  | `\"relative\"`           | Set to `\"absolute\"` for e.g. `03 Feb 13:37`. |\n| `absoluteTimeOptions` | `object` | `{ hour: \"2-digit\", minute: \"2-digit\", day: \"2-digit\", month: \"short\" }` | Overrides passed to `Intl.DateTimeFormat` when `timeFormat` is `\"absolute\"`. |\n| `showUpdatedTime`   | `boolean` | `true`                  | Displays the updated timestamp when different from published. |\n| `showAreas`         | `boolean` | `true`                  | Toggles the chip style list of affected areas (counties, municipalities, etc.). |\n| `showEmptyMessage`  | `boolean` | `true`                  | Hide or show the “no active VMA” placeholder. |\n| `emptyMessage`      | `object`  | `{ sv: \"Inga aktiva VMA\", en: \"No active public warnings\" }` | Customise the placeholder text. Keys can be full (`sv-SE`) or short (`sv`) language codes. |\n| `loadingMessage`    | `object`  | `{ sv: \"Hämtar meddelanden…\", en: \"Loading alerts…\" }` | Customise the loading indicator. |\n| `errorMessage`      | `object`  | `{ sv: \"Kunde inte hämta VMA\", en: \"Failed to load VMA alerts\" }` | Customise the error headline. |\n\n\n## Features\n\n- ✅ Polls the official Krisinformation V3 endpoints for active and test VMA alerts.\n- ✅ County aware filtering so you only see messages that matter to your location.\n- ✅ Localised timestamps with optional relative mode (`just now`, `3 hours ago`, …).\n- ✅ Graceful error handling with automatic retries and helpful UI states.\n- ✅ Lightweight styling that matches the MagicMirror aesthetic\n\n\n\n## Troubleshooting\n\n- **No alerts are shown** – Active VMAs are rare. Enable `includeTestVma: true` in your config to visualise\n  the layout using historical test messages.\n- **County filtering returns nothing** – Make sure the county names match Krisinformation's spelling\n  (for example `\"Värmlands län\"`). Leave `counties` empty to show all alerts.\n- **Firewall or proxy issues** – Ensure outbound HTTPS traffic to `api.krisinformation.se` is allowed. You can\n  manually run `npm test` to confirm connectivity. The module and endpoint probe honour the standard\n  `HTTPS_PROXY` / `HTTP_PROXY` environment variables used by MagicMirror².\n\n## License\n\n[MIT](LICENSE)\n\nKrisinformation's content is licensed under their respective terms. Respect the upstream API usage guidelines.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpierregode%2Fmmm-vma","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpierregode%2Fmmm-vma","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpierregode%2Fmmm-vma/lists"}