Home Assistant dashboard card that draws THL's weekly disease numbers on a map of Finland.
Hey dude! Help me out for a couple of 🍻 or a ☕!
A custom card that shows one disease's weekly numbers, or the flu-like illness visits in primary care, on an interactive map of the wellbeing services counties. Each county is coloured by how it compares with the whole country, and clicking one shows its figures and a trend of its past weeks under the map.
The numbers come from the thl integration, which is required.
- Add this repository to HACS custom repositories with type Dashboard
- Search for THL card in HACS and download it
- Refresh your browser
- Take
dist/thl-card.jsfrom the source code of the latest release and copy it to theconfig/wwwfolder of your Home Assistant installation - In Home Assistant settings, open dashboards, click the three dots at the top right and open resources
- Add a new resource with the path
/local/thl-card.jsand type JavaScript - Refresh your browser
The card has a visual editor: add it from the card picker and choose the disease. The options can also be written by hand.
| Name | Type | Requirement | Description | Default |
|---|---|---|---|---|
type |
string | Required | custom:thl-card |
|
entity |
string | Required | The whole country's sensor of a disease, or of the flu-like illness visits | |
color_by |
string | Optional | level compares each county with the whole country, change with its own week before |
level |
default_area |
string | Optional | The area_id of a county chosen whenever the card loads, such as etela-karjalan_hyvinvointialue |
the whole country |
show_trend |
boolean | Optional | A line of the chosen area's past six months with its figures | true |
map_width |
number | Optional | A fixed width for the map, in pixels | follows the card |
type: custom:thl-card
entity: sensor.thl_influenssaA card a whole section wide, which is where it starts, puts the figures beside the map, over the sea west of it, so the card isn't taller than it needs to be. A narrower card keeps them under the map. The trend is always under the map. The map grows with the card up to a point, and the shapes and the numbers written on them scale together. The card is not made narrower than half a section.
Set map_width to fix the map at one size whatever the card does.
By default a county is coloured by its level compared with the whole country: its incidence per 100 000 people for a disease, or its share of flu-like illness visits. The level is what makes counties comparable, since a large county has more cases simply because more people live there.
| Colour | What it means |
|---|---|
| Blue | No cases at all |
| Green | Less than half the whole country's level |
| Light green | Less than 0.8 times the whole country's level |
| Yellow | About the same as the whole country |
| Orange | More than 1.25 times the whole country's level |
| Red | More than twice the whole country's level |
With color_by: change a county is coloured by how its cases changed from the week before instead:
| Colour | What it means |
|---|---|
| Blue | No cases at all, this week or the week before |
| Green | Cases fell by more than 40 % |
| Light green | Cases fell by more than 10 % |
| Yellow | Little change either way, or no week to compare with |
| Orange | Cases rose by more than 10 % |
| Red | Cases rose by more than 40 % |
A county the sensor carries no numbers for is left the colour of the text.
Under the map are the whole country's figures: last week's cases and incidence, the week before, and the change. For the flu-like illness visits they are the share of visits, how many there were, and the share the week before. Clicking a county shows its own figures instead; clicking it again goes back to the whole country.
The trend covers the past six months, drawn from the statistics the integration keeps for each area's sensor: the incidence when colouring by level, the cases when colouring by change. Pointing at it shows the week and its figure.
Requires Node 22.13 or newer.
npm install
npm run check
npm run check typechecks, lints, checks formatting, runs the tests and builds dist/thl-card.js, which is the file
HACS installs and is committed to the repository.
| Path | What it contains |
|---|---|
src/thl-card.ts |
The card itself |
src/areas.ts |
Reading the sensor's areas, and the colour of each county |
src/map/counties.ts |
The map, generated from the original inline SVG — not edited by hand |
src/logos.ts |
The THL and disease drawings |
src/localize/ |
The card's texts |
tests/ |
Tests, run with vitest |

