English | 日本語
A Home Assistant custom integration that exposes weather warnings, advisories, and emergency warnings issued by the Japan Meteorological Agency (JMA / 気象庁) for any municipality in Japan.
It polls the official JMA disaster-prevention XML (R06 集約通報, VPWS50) and creates, per location, an aggregate sensor (number of active warnings) plus one binary_sensor per phenomenon (thunderstorm, heavy rain, flood, …).
Status: Phase 2b (warnings/advisories + disaster-prevention info). Weather forecast and precipitation nowcast are on the roadmap below.
- 🗾 Pick any municipality in Japan from a UI dropdown — no manual codes
- ⚡ One
binary_sensorper phenomenon (onwhile issued/continuing) — easy automations - 📊 Aggregate sensor with the full active-warning list in attributes
- 🚨 Emergency Warning (特別警報) detection
- 📍 Multiple locations (add the integration once per location)
- 🔁 Robust against JMA's "no warning" placeholder quirk; auto-recovers from fetch failures
- 🌐 Minimal dependencies — Home Assistant's built-in HTTP client +
defusedxml(safe XML parsing)
- HACS → Integrations → ⋮ (top-right) → Custom repositories
- Add
https://github.com/yhi264/ha-jma-weatherwith category Integration - Install JMA Weather, then restart Home Assistant
Once this repository is published to the HACS default store, the custom-repository step will no longer be necessary.
Copy custom_components/jma_weather/ into your Home Assistant config/custom_components/ directory and restart.
Settings → Devices & Services → Add Integration → JMA Weather. The setup wizard fetches area.json and walks you through:
- Forecast region (prefecture / 府県予報区) — dropdown
- Municipality (市町村) — dropdown
- Coordinates — defaults to your Home Assistant home location; editable (saved for the Phase 2d precipitation nowcast)
Options (changeable later): update interval in seconds (default 300 = 5 min, minimum 60). Note: the warning data source is a single nationwide document shared by one coordinator across all locations, so the warning poll interval is taken from the first-configured location; the per-location disaster-info poll honors each location's interval.
sensor.jma_weather_<class20>_warnings— number of active warnings/advisories (int)- Attributes:
summary(e.g.雷注意報・大雨警報/なし),warnings(list of{code, name, level, status}—levelis the warning's 警戒レベル or null),max_level(highest active 警戒レベル, or null if none),has_special_warning,report_datetime,area_name - Example:
sensor.jma_weather_4044700_warnings
- Attributes:
binary_sensor.jma_weather_<class20>_<group>—onwhile that phenomenon is issued (発表) or continuing (継続) (device_class: safety)- Attributes:
level(the warning's 警戒レベル, or null),status. A single phenomenon spans advisory→warning→emergency levels;levelreflects the highest active one. - Example:
binary_sensor.jma_weather_4044700_kaminari
- Attributes:
| group | Phenomenon | JMA codes |
|---|---|---|
kaminari |
Thunderstorm / 雷 | 14 |
ooame |
Heavy rain / 大雨 | 10 / 03 / 33 |
kozui |
Flood / 洪水 | 18 / 04 |
boufuu |
Gale / 暴風 | 05 / 35 |
boufuusetsu |
Snowstorm / 暴風雪 | 02 / 32 |
ooyuki |
Heavy snow / 大雪 | 12 / 06 / 36 |
nami |
High waves / 波浪 | 16 / 07 / 37 |
takashio |
Storm surge / 高潮 | 19 / 08 / 38 |
kyoufuu |
Strong wind / 強風 | 15 |
noumu |
Dense fog / 濃霧 | 20 |
tokubetsu |
Emergency Warning (any) / 特別警報 | 32 / 33 / 35 / 36 / 37 / 38 |
fuusetsu |
Snow & wind / 風雪 | 13 |
kansou |
Dry air / 乾燥 | 21 |
nadare |
Avalanche / なだれ | 22 |
teion |
Low temperature / 低温 | 23 |
shimo |
Frost / 霜 | 24 |
chakuhyou |
Icing / 着氷 | 25 |
chakusetsu |
Snow accretion / 着雪 | 26 |
yuusetsu |
Snowmelt / 融雪 | 17 |
Note: In the R06 format, flood (洪水) warnings are distributed via the 指定河川洪水予報 (VXKO) product, not this warning feed; the
kozuisensor currently has no data source and remains off (planned for a future release).
| entity_id suffix | Information |
|---|---|
doshakei |
Landslide warning (土砂災害警戒情報) — municipality-level |
tatsumaki |
Tornado advisory (竜巻注意情報) — prefecture-level, ~1h validity |
kirokuame |
Record short-time heavy rain (記録的短時間大雨情報) — prefecture-level |
Attributes: info_type, report_datetime, headline, plus valid_until (tornado) and target_areas (landslide).
Add the integration once per location (1 config entry = 1 location). Locations in the same prefecture register as independent entries; entities and devices never collide (keyed by municipality code).
automation:
- alias: Notify on thunderstorm advisory
trigger:
- platform: state
entity_id: binary_sensor.jma_weather_4044700_kaminari
to: "on"
action:
- service: notify.mobile_app
data:
message: "A thunderstorm advisory has been issued for your area."Data: Japan Meteorological Agency disaster-prevention information (https://www.jma.go.jp/bosai/). This project is not affiliated with or endorsed by the JMA.
- Phase 2c: Weather forecast, temperature, precipitation probability → Home Assistant
weatherentity - Phase 2d: Precipitation nowcast — "rain starts/stops in N minutes" (tile sampling)
python3 -m venv .venv
./.venv/bin/pip install -r requirements-test.txt
./.venv/bin/pytest tests/ -qMIT License © 2026 yhi264