From cecf7e633173d1b9b538ec60d5c08cb950ef1212 Mon Sep 17 00:00:00 2001 From: windyboy Date: Fri, 4 Sep 2026 21:44:43 +0800 Subject: [PATCH] =?UTF-8?q?docs(hass):=20CSG=20=E7=94=B5=E5=8A=9B=E7=9B=91?= =?UTF-8?q?=E6=8E=A7=E9=9D=A2=E6=9D=BF=E9=87=8D=E6=9E=84=20=E2=80=94=20avg?= =?UTF-8?q?=20price=20=E4=BC=A0=E6=84=9F=E5=99=A8=20+=20=E5=8E=BB=E9=87=8D?= =?UTF-8?q?/=E6=94=B9=E5=90=8D=20+=20=E5=AD=A3=E8=8A=82=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E6=8F=90=E9=86=92=20(VPS-90)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hosts/hass.windy.lan.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/hosts/hass.windy.lan.md b/hosts/hass.windy.lan.md index c24c174..0750865 100644 --- a/hosts/hass.windy.lan.md +++ b/hosts/hass.windy.lan.md @@ -279,6 +279,32 @@ updated 2026-08-29 (W1N-240 + W1N-242):** 「本月累计」gauge 对齐夏季 数据日)。备份 `csg_sensors.yaml.bak-20260829-w1n242`。验证:Core restart 后回归值不变(334.81 / -0.3 / 10.8 / 90.3 / 200.94 / 180.28)。 +**CSG 面板重构 2026-09-04(VPS-90,先核对计价后展示层改动):** 核对 +`power-monitor` 计价与 8 月账单一致(198.65 vs 账单 198.64,差 ≤0.01 元, +因模板用公众圆整价 0.589/0.639/0.889、账单用 6 位精确价),不改阶梯常量。 +改动:① `csg_sensors.yaml` Block B 新增 +`sensor.csg_this_month_avg_price`(本月阶梯电费÷本月用电,`元/kWh`, +availability 照 W1N-239 惯例;**csg_* 实体 14→15**);② 面板改名「环比上月」 +→「环比上月同期」;glance「本月/上月」grid 去重为单卡「上月」(本月用电/电费 +行归 💰核心数据卡);⚡阶梯电价卡加「本月实际均价」行(当前档位/当前电价/ +本月实际均价/档位剩余;面板唯一实体引用 20→21);③ `automations.yaml` 加 +2 条提醒:`automation.csg_mian_ban_qie_dong_ji_dang_ti_xing`(10-25 09:00) +与 `automation.csg_mian_ban_qie_xia_ji_dang_ti_xing`(4-25 09:00)经 +`matrix_e2ee.send_message` 提醒切 gauge。④ 金额单位混排(原生 CNY vs 模板 +元)**维持**:`config/entity_registry/update` 拒绝自定义文本单位 +(`extra keys not allowed … Got '元'`),用户确认接受。备份: +`.lovelace-backups/dashboard-unknown-power-monitor-20260904-204757-pre-refactor.json`、 +`.csg-backups/csg_sensors.yaml.bak-20260904-204757-pre-refactor`(及 +`-205301-pre-avgprice`)、`.automations-backups/automations.yaml.bak-*`。 +**WS 改法(2026.8,本机实测)**:core/主机 python 无 ws 库、core 容器内经 +supervisor 代理 WS 被拒(loop prevention),用 +`docker run --rm --network host -e SUPERVISOR_TOKEN`(supervisor 镜像 +`aarch64-hassio-supervisor:2026.08.0`)连 `ws://172.30.32.2/core/websocket`; +命令名 `lovelace/config`(读)+ `lovelace/config/save`(写), +`lovelace/config/get` 已不存在(unknown_command)。验证:新实体 +0.589 元/kWh、15 个 csg_* 数值齐全、回归值不变(14.09/198.65/331.22/ +304.99/181.89)、automations on、`ha core check` OK、日志无 template 错误。 + **CSG 长期归档(W1N-243, 2026-08-29):** scribe 库新增 `csg_history` 表(逐日 usage/cost/ladder/balance + 逐月累计;2026-07-01 起回填,永久), 由 TimescaleDB 每日任务 **1008** `csg_daily_snapshot()`(22:30 @@ -292,6 +318,11 @@ ladder/balance 为 22:30 快照值。详见 [hosts/pgdb.md](../hosts/pgdb.md)。 > `power-monitor` 视图「本月累计」gauge 切到冬季 `max:450` / > `0/200/400`,**5-01** 切回夏季 `max:650` / `0/260/600`(与模板 > `now().month` 季节逻辑对齐;模板常量在 Block B/D `variables`)。 +> **提醒 automation(2026-09-04 起,VPS-90):** +> `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_e2ee.send_message` 发操作步骤提醒;gauge 的 max/segments 无法 +> 模板化,仍需人工改卡配置。 Home PPPoE IPv4 to CSG is still blackholed (`curl -4` to `218.19.148.218:443` times out). `end0` IPv6 is enabled (`ipv6.method: auto`); from HA,