Cleaned up inverter mqtt
This commit is contained in:
@@ -129,6 +129,8 @@ What each patch fixes:
|
||||
|
||||
**f.** `ports/__init__.py` `from_config()`: change `port_config['serial_number'] = serial_number` to be a fallback (`if port_config.get('serial_number') is None:`). The device-level `serial_number` is the logical HA identifier (`lvx6048_1`), the port-level one is the hardware PI18 serial (22-digit) — different fields, different purposes; they must not be conflated.
|
||||
|
||||
**g.** `outputformats/hass.py`: rewrite the discovery payload assembly to (1) drop the bogus `last_reset` field that upstream emits unconditionally (HA spec only allows it on `state_class: total` cumulative counters; on `measurement` sensors HA warns and ignores), (2) drop `force_update: "true"` default which makes HA store every state publish even on unchanged values (bloats the recorder DB for slowly-changing fields), (3) emit `suggested_display_precision` based on a per-unit map (so HA's voltage/current device classes don't truncate `52.5 V` to `52 V` in the frontend), (4) default `state_class: measurement` for numeric sensors lacking an explicit class (required for HA long-term statistics + Energy dashboard wiring). Also tweaks patch (a) further: `"DC-AC power direction"` → `"DC AC power direction"` so the HA entity_id becomes `dc_ac_power_direction` (underscore) rather than the non-conforming `dc-ac_power_direction`.
|
||||
|
||||
Patches (e) and (f) enable powermon's native wildcard-path + serial-matching flow, which we *don't* currently use — two services probing independently at startup race each other over the same hidraw. Our current setup uses the external `lvx-resolve-links` resolver (§2b) instead, so (e) and (f) are dormant but kept applied in case we ever want to use powermon's native resolver for a single-service deployment.
|
||||
|
||||
## 6. systemd services
|
||||
|
||||
Reference in New Issue
Block a user