From 17bb171578daa2382c51eadf33075e7d4c3f5d7e Mon Sep 17 00:00:00 2001 From: windyboy Date: Fri, 4 Sep 2026 21:55:40 +0800 Subject: [PATCH] =?UTF-8?q?docs(hass):=20CSG=20=E9=9D=A2=E6=9D=BF=E9=87=8D?= =?UTF-8?q?=E6=9E=84=E5=85=A5=E7=BB=B4=E6=8A=A4=20runbook=20=E2=80=94=20av?= =?UTF-8?q?g=20price=20=E4=BC=A0=E6=84=9F=E5=99=A8=20+=20=E5=AD=A3?= =?UTF-8?q?=E8=8A=82=E6=8F=90=E9=86=92=20automation=20+=20WS=20=E6=94=B9?= =?UTF-8?q?=E6=B3=95=20(VPS-90)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- runbooks/home-assistant-maintenance.md | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/runbooks/home-assistant-maintenance.md b/runbooks/home-assistant-maintenance.md index a887909..58fd995 100644 --- a/runbooks/home-assistant-maintenance.md +++ b/runbooks/home-assistant-maintenance.md @@ -307,6 +307,40 @@ There is no long-lived `HA_TOKEN` in the agent environment. Read entity states via Supervisor (`SUPERVISOR_TOKEN` after `sudo -n -i`) at `http://supervisor/core/api/states/`. +#### CSG display refactor 2026-09-04 (VPS-90) + +Template/dashboard changes made **after** pricing cross-check (8月账单 +198.64 元 vs 模板 198.65 元,≤0.01 元;阶梯常量 0.589/0.639/0.889、 +260/600 夏档未动): + +- `templates/csg_sensors.yaml` Block B 新增 + `sensor.csg_this_month_avg_price`(本月阶梯电费÷本月用电,`元/kWh`); + **csg_* template sensors = 15**。 +- Panel `power-monitor`(`lovelace.dashboard_unknown`):环比行改名 + 「环比上月同期」;glance「本月/上月」去重为单卡「上月」(本月行归 + 💰核心数据卡);⚡阶梯电价卡加「本月实际均价」行。实体引用 20→21。 +- `automations.yaml` +2 提醒:`automation.csg_mian_ban_qie_dong_ji_dang_ti_xing` + (10-25)/ `automation.csg_mian_ban_qie_xia_ji_dang_ti_xing`(4-25) + 09:00 Matrix 提醒人工切「本月累计」gauge 季节档(max/segments 不可模板化)。 +- 金额单位混排(原生 CNY vs 模板 元)**保留**:`config/entity_registry/update` + 拒绝自定义文本单位(`extra keys not allowed … Got '元'`),已定案接受。 + +**WS 改面板(2026.8,本机实测,后续沿用)**: core/主机 python 无 ws 库、 +core 容器内经 supervisor 代理 WS 被拒(loop prevention)。用 + +```bash +ssh -o BatchMode=yes hassio@hass.windy.lan \ + 'sudo -n -i sh -c "docker run --rm -i --network host -e SUPERVISOR_TOKEN \ + --entrypoint python3 r.hassbus.com/home-assistant/aarch64-hassio-supervisor:2026.08.0 \ + - < /tmp/x.py"' +``` + +连 `ws://172.30.32.2/core/websocket`(aiohttp,header `Authorization: Bearer +$SUPERVISOR_TOKEN`,随后 auth 帧同 token)。命令名 **`lovelace/config`**(读) ++ **`lovelace/config/save`**(写,url_path + 全量 config);`lovelace/config/get` +已不存在(unknown_command)。备份与细节见 +[hosts/hass.windy.lan.md](../hosts/hass.windy.lan.md) § CSG 面板重构 2026-09-04。 + ## Command families intentionally NOT scripted These exist in `ha` but are either rare, dangerous, or better done in the web