Hi everyone!
I’m a chronic migraine sufferer, and over the years I’ve noticed a clear pattern: my migraines follow the weather. A barometric pressure drop before a storm front, a sudden temperature swing, a high-pollution day. These invisible triggers stack up and hit me hours later.
I realised that if I could see the warning signs before symptoms start, I could take my preventive medication early and actually get ahead of an attack. So I built a sensor system in Home Assistant that watches the weather for me and scores the environmental risk in real time.
I shared some screenshots of my dashboard with friends, they shared them with others, and before long people were asking how to set it up themselves. So I’ve packaged the whole thing up for anyone to use!
What it does
The card tracks 9 environmental factors known to trigger migraines:
- Barometric pressure drops (6h and 24h rolling windows) the biggest trigger for most sufferers
- Humidity extremes
- Temperature extremes and rapid temperature changes
- Wind speed
- UV index
- Thunderstorm proximity (from warnings and forecast text)
- Air quality (AQI, PM2.5, PM10, ozone)
Each factor is scored and combined into a composite risk score out of 22, with four risk levels: Low, Moderate, High, and Very High. There’s also a tomorrow’s forecast that predicts next-day risk.
What it looks like
The card has a dark-themed design with an SVG gauge, a 3x3 colour-coded factor grid, and a forecast bar. All factors are optional, the card only shows what you configure.
How it works
It comes in two parts:
- A custom Lovelace card (
migraine-risk-card.js) the visual frontend - A sensor package (
migraine_sensors.yaml) template sensors that create the derived values (pressure drops, temperature deltas, etc.) that most weather integrations don’t provide
The sensor package uses input_text helpers to map to your existing weather entities, so it works with any weather integration such as BOM, OpenWeatherMap, Met.no, whatever you have. You can configure everything through the HA UI (Settings → Helpers) without touching YAML.
Installation
Available via HACS as a custom repository:
- HACS → three-dot menu → Custom repositories
- Paste:
https://github.com/GreenNovaEmma/migraine-risk-card - Category: Plugin
- Install the card, then copy the sensor package to your
/config/packages/directory
Full instructions, scoring breakdown, and scientific references are in the README.
The science
The scoring thresholds are based on published research linking barometric pressure changes (Kimoto et al., 2011; Okuma et al., 2015), humidity and temperature extremes (Hoffmann et al., 2015), and air quality (Szyszkowicz et al., 2009) to migraine onset.
If you find it useful, I’d love to hear how it works for you — and if you’d like to support the project, there’s a Buy Me a Coffee link in the repo.
Hope it helps someone else get ahead of their migraines like it’s helped me!
