diff --git a/hosts/hass.windy.lan.md b/hosts/hass.windy.lan.md index 2528cbd..c24c174 100644 --- a/hosts/hass.windy.lan.md +++ b/hosts/hass.windy.lan.md @@ -506,6 +506,39 @@ manual copies): reader `remmob/timescale_database_reader` **v1.1.0** (main 修改前备份:`/homeassistant/.lovelace-backups/dashboard-quick-*.json` (W1N-230 修复: `20260829-190256`;round-2 改进: `20260829-194040`)。 +### 地图仪表盘:CARTO keyed tiles via `custom:map-card` (verified 2026-08-30, W1N-261) + +- **背景:** CARTO 自 2026-08-26 起对无 key 栅格瓦片打 "API KEY REQUIRED" + 水印,内置地图卡/zone 编辑器全部受影响。Core 2026.8.3 的 `MapCardConfig` + **没有任何瓦片配置项**(frontend 20260729.7 源码核对: + `setup-leaflet-map.ts` 硬编码 CARTO voyager URL)。上游修复是 2026.9.0b1 + 起改用 OSMF 矢量瓦片(frontend PR #53816),stable 预计 2026-09-02 前后。 +- **变更:** 「地图」仪表盘(url_path `map`,storage)唯一 map 卡替换为 + `custom:map-card`([nathan-gs/ha-map-card](https://github.com/nathan-gs/ha-map-card) + **v1.16.0**,手动安装非 HACS):`tile_layer_url` = + `https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}.png?key=` + (配 `tile_layer_options: {subdomains: abcd, maxZoom: 20}` + OSM/CARTO + attribution)。实体不变:2 person + 4 zone(zone 用 `display: icon` + + `circle: auto`,circle 读实体 `radius` 属性画半径圈)。 +- **CARTO key 是 secret**: 只存在于服务端 lovelace 存储(dashboard `map` + 的卡片配置)和用户本人处;勿写入本仓库或 Linear。 +- **文件/资源:** `/homeassistant/www/community/ha-map-card/map-card.js` + (root:root 644,678554 B,sha256 + `f30dfb606e858d2216d5198d8cf758ce956d127006ebd7d66d4329153a247ec2`); + Lovelace resource(storage)id `9d2b50b52c60420d89ebd041f722cf60` → + `/hacsfiles/ha-map-card/map-card.js`,type module(WS + `lovelace/resources/create`,2026.8 参数名 `res_type`)。升级 = 手动替换 + 该文件(不在 HACS 管理下,浏览器需强刷)。 +- **备份:** `/homeassistant/.lovelace-backups/dashboard-map-map-20260830-133714.json` + (还原 = 把备份里的 `views[0].cards[0]` 写回后再 WS `lovelace/config/save` + url_path `map`)。 +- **验证 8/30:** 同瓦片无 key=水印 / 带 key=干净(256×256 PNG 视觉对比); + resource HTTP 200 text/javascript;WS 读回卡片配置(type/entities/key/ + attribution/options)全部符合;HA 主机 `curl -4` 带 key 瓦片 200。 +- **Follow-up:** Core 升 2026.9.0 stable 后内置地图/zone 编辑器自动切 + OSMF 矢量瓦片;届时可保留 custom 卡(继续 keyed CARTO)或用备份还原 + 内置卡。zone 编辑器等其余内置地图的水印在 2026.9 前无解。 + ## Known issues **Bluetooth hci0 instability — RTL8821CS (verified 2026-08-13, W1N-74):**