diff --git a/CHANGELOG.md b/CHANGELOG.md index 065e945..ab03ece 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## [Unreleased] +### pixii 2.1.10 + +Recognize battery calibration from Pixii's running-service register when +the SunSpec charge status is unsupported. Keep measurements live and +suspend FTW dispatch until calibration ends. + ### victron_mqtt 1.2.1 The manifest declares `R/+/keepalive` in `mqtt_read_request_topics`, so the diff --git a/SUPPORT_STATUS.md b/SUPPORT_STATUS.md index 1d9daab..e79b7e3 100644 --- a/SUPPORT_STATUS.md +++ b/SUPPORT_STATUS.md @@ -112,8 +112,8 @@ Catalog source is not proof that a target can install or run a driver. | p1_hdlc | 2.0.2 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | | p1_meter | 2.0.2 | ftw-core | not_assessed | — | not_recorded | not_assessed | | p1_meter | 2.0.2 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | -| pixii | 2.1.9 | ftw-core | not_assessed | — | not_recorded | not_assessed | -| pixii | 2.1.9 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | +| pixii | 2.1.10 | ftw-core | not_assessed | — | not_recorded | not_assessed | +| pixii | 2.1.10 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | | pixii_pv | 0.3.3 | ftw-core | not_assessed | — | not_recorded | not_assessed | | pixii_pv | 0.3.3 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | | remne_p1ib | 0.1.0 | ftw-core | not_assessed | — | not_recorded | not_assessed | diff --git a/devices.yaml b/devices.yaml index 94fc788..1d7bceb 100644 --- a/devices.yaml +++ b/devices.yaml @@ -1045,7 +1045,7 @@ manufacturers: protocols: - protocol: modbus driver: "pixii" - version: "2.1.9" + version: "2.1.10" ders: [battery, meter] control: true firmware_versions: "" diff --git a/drivers/lua/pixii.lua b/drivers/lua/pixii.lua index d2e8f8d..78e4199 100644 --- a/drivers/lua/pixii.lua +++ b/drivers/lua/pixii.lua @@ -29,7 +29,7 @@ DRIVER = { id = "pixii", name = "Pixii PowerShaper", manufacturer = "Pixii", - version = "2.1.9", + version = "2.1.10", protocols = { "modbus" }, capabilities = { "battery", "meter" }, description = "Pixii PowerShaper commercial battery storage via Modbus TCP.", @@ -61,6 +61,7 @@ local REG_SETPOINT_LO = 39906 -- int32 LSB -- SunSpec model 802 battery status points. Pixii's SoC is already read -- from this block at 40132, so these adjacent points are cheap diagnostics. local REG_BATTERY_SOC = 40132 +local REG_PIXII_RUNNING_SERVICE = 40108 -- StVnd: 116 is battery SoC calibration local REG_BATTERY_CHARGE_STATUS = 40137 -- ChaSt: OFF/EMPTY/DISCHARGING/... local REG_BATTERY_CONTROL_MODE = 40138 -- LocRemCtl: REMOTE/LOCAL local REG_BATTERY_STATE = 40143 -- State: CONNECTED/STANDBY/FAULT/... @@ -307,6 +308,12 @@ local last_charge_label = nil local function read_battery_status() local charge_status = read_status_u16(REG_BATTERY_CHARGE_STATUS) + local running_service = read_status_u16(REG_PIXII_RUNNING_SERVICE) + -- Pixii PowerShaper Modbus Mapping, Table 23 (StVnd service types). + -- https://www.pixii.com/wp-content/uploads/2026/06/U8022_06ENG_2v20_Configuration_Guide_Pixii_Powershaper_Modbus_Mapping.pdf#page=41 + local service_known = running_service ~= nil and running_service >= 101 and running_service <= 129 + local calibrating = charge_status == 7 or running_service == 116 + if running_service ~= nil then host.emit_metric("pixii_running_service_code", running_service) end local control_mode = read_status_u16(REG_BATTERY_CONTROL_MODE) local battery_state = read_status_u16(REG_BATTERY_STATE) local vendor_state = read_status_u16(REG_BATTERY_STATE_VENDOR) @@ -320,36 +327,35 @@ local function read_battery_status() local charge_label = label_for(charge_status_labels, charge_status) local charge_status_known = charge_status ~= nil and charge_status_labels[charge_status] ~= nil - if not charge_status_known and charge_label ~= last_charge_label then + if not charge_status_known and not service_known and charge_label ~= last_charge_label then host.log("warn", "Pixii: charge status " .. charge_label - .. "; calibration state is unknown; retaining any previous calibration fault") + .. "; calibration state is unknown; retaining any previous calibration state") end last_charge_label = charge_label local control_label = label_for(control_mode_labels, control_mode) local state_label = label_for(battery_state_labels, battery_state) - local key = charge_label .. "/" .. control_label .. "/" .. state_label .. "/" .. tostring(vendor_state) .. "/" .. tostring(event1) + local key = charge_label .. "/" .. control_label .. "/" .. state_label .. "/" .. tostring(vendor_state) .. "/" .. tostring(event1) .. "/" .. tostring(running_service) if key ~= last_status_key then host.log("info", "Pixii: status charge=" .. charge_label .. " control=" .. control_label .. " state=" .. state_label .. " vendor_state=" .. tostring(vendor_state) .. " event1=" .. tostring(event1)) - if charge_status == 7 then - host.log("warn", "Pixii: charge status is TESTING; excluding from dispatch until calibration finishes") + if calibrating then + host.log("info", "Pixii: battery calibration detected; excluding from dispatch until calibration finishes") end last_status_key = key end - -- SunSpec 802 ChaSt=testing (7): Pixii is calibrating and ignores - -- external setpoints. Flag a device fault so dispatch + MPC exclude it - -- while keeping telemetry and site-meter data live. Only a recognized - -- status can clear it: absent, unsupported or unknown values do not - -- prove calibration has finished. Unknown status at startup is not - -- evidence of calibration either, so it does not invent a fault. - if charge_status_known then - local calibrating = charge_status == 7 - host.set_device_fault(calibrating, - calibrating and "Pixii battery calibrating/testing (SunSpec ChaSt=testing)" or "") + -- StVnd can report calibration when the SunSpec charge status is + -- unsupported. Keep the last verdict if both reads are unknown. + if charge_status_known or service_known then + if host.set_calibrating then + host.set_calibrating(calibrating) + else + -- Older Core versions use the fault gate to suspend dispatch. + host.set_device_fault(calibrating, calibrating and "Pixii battery is calibrating" or "") + end end return { diff --git a/drivers/tests/test_pixii_status.py b/drivers/tests/test_pixii_status.py index eeb2a2b..c752b91 100644 --- a/drivers/tests/test_pixii_status.py +++ b/drivers/tests/test_pixii_status.py @@ -112,3 +112,37 @@ def test_pixii_control_readback_without_troubleshooting(): assert(battery.setpoint_w == nil, "failed read invented zero") assert(battery.control_power_w == nil and battery.control_power_available == false) ''') + + +@pytest.mark.parametrize(("charge_status", "service"), [(0xffff, 116), (7, 0xffff)]) +def test_pixii_reports_calibration_without_legacy_fault(charge_status: int, service: int) -> None: + run_lua(f''' +local calibrating +host.set_calibrating = function(active) calibrating = active end +host._modbus_registers.holding[40108] = {service} +poll({charge_status}) +assert(calibrating == true, "Pixii calibration did not block dispatch") +assert(not host._faulted, "calibration was also reported as a device fault") +host._modbus_registers.holding[40108] = 0xffff +poll(0xffff) +assert(calibrating == true, "inconclusive reads cleared calibration") +host._modbus_registers.holding[40108] = 119 +poll(0xffff) +assert(calibrating == false, "normal Pixii service did not clear calibration") +assert(#host._emitted.meter == 3, "calibration stopped meter telemetry") +''') + + +def test_pixii_service_calibration_uses_legacy_fault() -> None: + run_lua(''' +host.set_calibrating = nil +host._modbus_registers.holding[40108] = 116 +poll(0xffff) +assert(host._faulted, "Pixii service 116 did not set the legacy device fault") +host._modbus_registers.holding[40108] = 0xffff +poll(0xffff) +assert(host._faulted, "inconclusive reads cleared the legacy device fault") +host._modbus_registers.holding[40108] = 119 +poll(0xffff) +assert(not host._faulted, "normal Pixii service did not clear the legacy device fault") +''') diff --git a/index.yaml b/index.yaml index 4af9e0a..d38809c 100644 --- a/index.yaml +++ b/index.yaml @@ -508,14 +508,14 @@ drivers: size_bytes: 19344 sha256: "29f2bd2f73c0d39d809839ca60b40c3e4281f1dda267ba2b26e66bd9ab80c27b" - name: "pixii" - version: "2.1.9" + version: "2.1.10" tier: core protocol: modbus connectivity: local ders: [battery, meter] control: true - size_bytes: 32519 - sha256: "77e233e2d24e970ebff8eaacd67967f57b651677d25ce7b57a1f97c3eaeb71fe" + size_bytes: 33031 + sha256: "30cbb86aa19b8f9176e02cf5a751e11b73135ac78a7b7432b7bc587cc94f8e0d" - name: "pixii_pv" version: "0.3.3" tier: core diff --git a/manifests/pixii.yaml b/manifests/pixii.yaml index 083a6fc..8885dda 100644 --- a/manifests/pixii.yaml +++ b/manifests/pixii.yaml @@ -1,5 +1,5 @@ name: "pixii" -version: "2.1.9" +version: "2.1.10" tier: core author: "Sourceful Labs AB and community contributors" protocol: modbus @@ -16,6 +16,10 @@ tested_devices: min_driver_version: "1.1.0" min_host_version: "2.0.0" upstream_docs: + - url: "https://www.pixii.com/wp-content/uploads/2026/06/U8022_06ENG_2v20_Configuration_Guide_Pixii_Powershaper_Modbus_Mapping.pdf" + title: "Pixii PowerShaper Modbus Mapping, Table 23: StVnd service types" + kind: register_map + url_stability: stable - url: "https://sunspec.org/wp-content/uploads/2025/01/SunSpec-Device-Information-Model-Specificiation-V1-1-final-1.pdf" title: "SunSpec Device Information Model 1.1: unsupported enum16 and uint16 values" kind: manual @@ -24,9 +28,9 @@ upstream_docs: title: "SunSpec model 802: battery charge and control states" kind: register_map url_stability: stable -size_bytes: 32519 +size_bytes: 33031 dkb_id: "pixii" -sha256: "77e233e2d24e970ebff8eaacd67967f57b651677d25ce7b57a1f97c3eaeb71fe" +sha256: "30cbb86aa19b8f9176e02cf5a751e11b73135ac78a7b7432b7bc587cc94f8e0d" signature: "" bytecode_sha256: "" diff --git a/spec/host-api-profile.json b/spec/host-api-profile.json index 92d2e4a..45d06f9 100644 --- a/spec/host-api-profile.json +++ b/spec/host-api-profile.json @@ -27,6 +27,7 @@ "now_ms", "sleep", "set_device_fault", + "set_calibrating", "set_poll_interval", "millis", "set_watchdog_timeout_s", diff --git a/support-status.json b/support-status.json index d90e0b3..afa10d2 100644 --- a/support-status.json +++ b/support-status.json @@ -1136,7 +1136,7 @@ }, { "catalog_source": true, - "catalog_version": "2.1.9", + "catalog_version": "2.1.10", "driver_id": "pixii", "targets": { "blixt-l1": {