Skip to content

Releases: farmio/fronius-modbus

Release list

0.2.0

Choose a tag to compare

@farmio farmio released this 12 Aug 12:07
ba48b91

Storage limit switches are now declared fields, and the modbus-connection floor moves to 4.6.1.

Upgrade even if you don't write to storage

0.1.0 allowed modbus-connection>=4.1.0, and 4.4.0 through 4.5.1 read a repeating_group's instances in separate requests from the block holding their scale factors (#185). On Multiple MPPT (160) that tears each module's values away from the factors that scale them — and Fronius firmware bumps a shared factor as an acc32 counter approaches its ceiling rather than rolling over, so a bump landing mid-poll decodes later modules with a stale exponent.

This release requires 4.6.1 or newer, where the model is read in a single request again — one, where 4.3.0 needed two.

Packed bits for StorCtl_Mod

charge_limit_enabled and discharge_limit_enabled share one register. They were read by masking a bitfield16 by hand and written by replacing the whole register, which cleared any other bit the device keeps there. Both are ordinary fields now, and a write re-reads and merges:

charge_limit_enabled = bit(5, 0, writable=True)
discharge_limit_enabled = bit(5, 1, writable=True)

Same names, same types, same meaning for callers. Only bits 0 and 1 are defined in SunSpec model 124, so the clobbering was latent rather than something you would have seen on a device — but the write no longer depends on nothing else living in that register.

Breaking

  • Storage.control_mode is gone. It existed only to be masked by the two switch properties. Read charge_limit_enabled / discharge_limit_enabled instead.
  • modbus-connection>=4.6.1 is required, up from >=4.1.0.

Requirements

Python 3.12+ and modbus-connection>=4.6.1,<5.

0.1.0

Choose a tag to compare

@farmio farmio released this 08 Aug 06:46
897213f

First release of fronius-modbus, an async library for the Modbus TCP (SunSpec) interface of Fronius inverters, built on modbus-connection.

Warning

Alpha. The read paths are verified against a GEN24 and a SnapINverter, but the write operations change inverter behaviour and have only been exercised against a mock. Try them deliberately.

Supported devices

  • GEN24 / Tauro — the inverter serves Modbus TCP itself (unit ID 1)
  • SnapINverter behind a Datamanager 2.0 — one unit ID per inverter in the Solar Net ring (00 maps to 100)

The SunSpec register map is discovered at runtime, so the float vs int+SF setting is detected automatically and no register configuration is needed. Only Modbus itself has to be enabled on the inverter's web interface.

Reading

  • Common (1) — manufacturer, model, software version, serial number
  • Inverter (101-103 / 111-113), both encodings — AC power, frequency, lifetime energy, per-phase currents and voltages, apparent/reactive power, power factor, DC totals, operating and vendor state, event flags
  • Multiple MPPT (160) — per-tracker DC current, voltage, power and lifetime energy, with module roles classified (PV string / storage charge / storage discharge) and derived totals: PV-only energy and battery charge/discharge energy, which the HTTP Solar API does not expose
  • Basic Storage Control (124) — state of charge, battery status, charge/discharge limits and their enable flags, minimum reserve, grid charging

Every model is read in as few pooled block requests as possible, and values are read together with their scale factors so the two can never disagree.

Writing

Requires inverter control via Modbus to be enabled on the device.

  • set_power_limit() / clear_power_limit() — output power limiting (model 123)
  • set_limits() — battery charge/discharge rates, including forced charging
  • set_minimum_reserve(), set_grid_charging()
  • probe_write_access() — reports whether the device accepts writes at all

Limit setters take a revert_seconds auto-revert, so a controller that dies cannot leave the inverter constrained.

Also included

  • fronius_modbus.testing — build SunSpec register maps for modbus_connection.mock, used by this library's own tests and available to consumers
  • scripts/read_inverter.py — one-shot dump of everything, plus write commands
  • scripts/monitor.py — live terminal UI with a power graph and a write dialog

Requirements

Python 3.12+ and modbus-connection>=4.1.0,<5.