docs(hass,pgdb): scribe 4.4.0 升级核对 + stats_io_interval 300 + sensor_minute 体积诊断
- hass: Scribe 3.8.0 → 4.4.0(HACS jonathan-gtd/scribe,2026-09-13 随 Core 2026.9.1 / HAOS 18.2 升级)。记录 4.0 两个 breaking change 在本机均无需动作 (3.x 结构 DB + PK 在、TimescaleDB 2.29.2 已装)、配置优先级 YAML > options > entry data > 默认值、以及「YAML 改动必须重启 Core」。 - hass: 新增 stats_io_interval: 300(备份 scribe.yaml.bak-20260913-191558)。 变更前 24h scribe 自写 11 019/87 461 行(12.6%);实测发布间隔 300s。 retention_states/retention_events 可用但刻意不设;flush_interval 仍被 entry data 钉在 5s(采用新默认 30s 需显式写 YAML)。 - pgdb: sensor_minute 2.26 GB 是压缩窗口内的正常暂存(compress_after 按 chunk 结束时间判断,09-17 才合格),稳态 4–5 GB 平台期,暂不处理;复查点 09-17 之后。顺带修正 hass/scribe 库体积事实。 校验:scripts/validate-repo.sh PASS (0 warnings)。
This commit is contained in:
+30
-8
@@ -415,9 +415,11 @@ deployed 2026-08-18 from `216cc99` (backup
|
||||
reworked in v0.3.1/v0.3.2 to wait for a peer-initiated inbound SAS from
|
||||
Element with emoji comparison), see
|
||||
[docs/home-assistant-matrix.md § Device verification](../docs/home-assistant-matrix.md).
|
||||
### Scribe long-term history (verified 2026-08-29)
|
||||
### Scribe long-term history (3.8.0 setup 2026-08-29; 4.4.0 verified 2026-09-13)
|
||||
|
||||
- **Scribe 3.8.0** (`/homeassistant/custom_components/scribe/`), configured from
|
||||
- **Scribe 4.4.0** (`/homeassistant/custom_components/scribe/`, HACS repo
|
||||
`jonathan-gtd/scribe`, = latest stable 2026-09-12; upgraded 2026-09-13 together
|
||||
with Core 2026.9.1 / HAOS 18.2), configured from
|
||||
`/homeassistant/scribe.yaml` — W1N-238 moved the block out of
|
||||
`configuration.yaml` on 2026-08-29 (main config now carries
|
||||
`scribe: !include scribe.yaml`; content moved verbatim; backup
|
||||
@@ -441,12 +443,32 @@ deployed 2026-08-18 from `216cc99` (backup
|
||||
entities (`scribe_states_written`, `scribe_events_written`, rates, sizes).
|
||||
- Verified post-restart 14:23 CST: writer started, `scribe_events_written=1`
|
||||
(homeassistant_start), states ~110/min, buffer 3, no scribe log errors.
|
||||
- **Scribe 3.8.0 has no retention option.** Retention ships only in the v4.x line,
|
||||
which as of 2026-08-29 has no stable release (v4.0.0rc1/v4.1.0rc1 are
|
||||
prereleases; user declined RCs — data keeps growing until an upgrade). v4.x is
|
||||
a major rewrite (writer.py largely rewritten, migration.py removed, TimescaleDB
|
||||
extension required): re-read release notes before upgrading. Do not expect
|
||||
retention YAML keys to validate on 3.8.0.
|
||||
- **4.x upgrade核对 2026-09-13(只读 + 一处配置变更)**:live `manifest.json` =
|
||||
4.4.0。两个 4.0 breaking change 在本机都不需要动作——数据库是 3.x 结构
|
||||
(`states_raw` PK `(metadata_id, time)` 在,4.2.0 的启动态去重因此可用),
|
||||
TimescaleDB 2.29.2 已装。4.1.0 修了 `db_url` 优先级,YAML 里的
|
||||
`!secret scribe_url` 现在是权威。`scribe.yaml` 现有键在 4.4.0 全部仍然合法
|
||||
(未知键被忽略,`extra=vol.ALLOW_EXTRA`)。**配置优先级 YAML > entry
|
||||
`options` > entry `data` > 默认值**,而 `_resolve_settings` 读的是
|
||||
`hass.data[DOMAIN]["yaml_config"]`(只有 `async_setup` 会写),所以
|
||||
**YAML 改动必须重启 Core,reload config entry 不重读 YAML。**
|
||||
- **`stats_io_interval: 300`(2026-09-13 添加**,备份
|
||||
`/homeassistant/scribe.yaml.bak-20260913-191558`)。4.4.0 不再让 HA 每 30s
|
||||
轮询 I/O 统计传感器,改由集成自己每 60s 发布,间隔成为配置项。scribe 自己的
|
||||
传感器此前是本机自写历史的主要来源(变更前 24h:11 019 / 87 461 行状态 =
|
||||
12.6%),60s → 300s 把这部分降约 5 倍(每个 I/O 传感器约 1440 → 288 行/天)。
|
||||
验证:`ha core check` OK;重启 88s;`ScribeWriter started successfully`;
|
||||
无 scribe error/warning;scribe Repairs 问题 0 条;传感器发布间隔实测正好
|
||||
300s(11:19:26 → 11:24:26 UTC)。
|
||||
- **Retention 现在可用但刻意不设**:`retention_states` / `retention_events`
|
||||
(4.0.0)按间隔丢 chunk,留空 = 永久保留,符合本机定位(Scribe 是永久归档,
|
||||
recorder 保留 365 天)。注意 retention 是**绕过** entry `data` 副本读取的
|
||||
(`from_entry_data=False`),所以删掉 YAML 行即撤销策略。`db_schema`、
|
||||
`enable_rollups`、`scribe.purge` 同样未用:图表走 `sensor_minute` +
|
||||
`timescale_database_reader`(见 [hosts/pgdb.md](pgdb.md)),不吃 scribe 自己的
|
||||
视图,配置里也没有任何 `scribe.query` 调用。`flush_interval` 仍是 entry
|
||||
`data` 钉住的 5s——上游下一个版本把默认改成 30s,但 entry 值优先,要采用只能
|
||||
在 YAML 显式写 `flush_interval: 30`。
|
||||
- Recorder stays external-Postgres with `purge_keep_days: 365` (W1N-243,
|
||||
2026-08-29, raised from 30 — ~300 MB/yr, 1% of the 30G pgdb disk) for
|
||||
native UI per-change history; Scribe is the permanent archive. Long-term
|
||||
|
||||
Reference in New Issue
Block a user