Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Releases: dewet22/givenergy-modbus

v0.10.1

03 Mar 21:53
Compare
Choose a tag to compare

Fixed

  • 🛠 Make Plant serializable.

v0.10.0

02 Mar 20:51
Compare
Choose a tag to compare

Added

  • 💪 Reintroduced the battery energy totals on the Battery model. On some firmware versions that is populated instead
    of the values from the inverter. (#7, via @britkat1980)

Changed

  • ⚠️ Breaking change: rejigged the Plant model to abstract away RegisterCaches and remove some of the toil around
    managing state. README.md updated with example implementation.

v0.9.4

20 Feb 15:28
Compare
Choose a tag to compare

Added

  • 🛠 Enable CodeQL GitHub workflow for automated code quality scans

Fixed

  • 🐛 Allow multiple serial number prefixes to map to the same inverter model name (#6, by @zaheerm)

v0.9.3

02 Feb 08:50
Compare
Choose a tag to compare

Fixed

  • 🧽 Update total energy registers (by @britkat1980)
  • 🛠 Re-enable builds back to python v3.7 to support e.g. Raspberry Pi current version
  • 🧹 Update python and pre-commit deps, including security fix for loguru

v0.9.2

24 Jan 15:15
Compare
Choose a tag to compare

Fixed

  • 🐛 Scaled registers to use division instead of multiplication – prevents rounding errors.
  • 📖 Update README.md to match reality better
  • 🧽 Update deps
  • 🛠 Try to re-enable GH pages

v0.9.1

13 Jan 20:29
Compare
Choose a tag to compare

Fixed

  • 🐛 The _time fault registers don't denote a BCD-encoded timestamp, but seems to be a counter of #cycles the fault
    lasted.
  • Sometimes a time slot timestamp is returned as 60 minutes. Guard by taking the modulo-60 instead.

v0.9.0

13 Jan 15:50
Compare
Choose a tag to compare

Added

  • 💪 Create RegisterCache and RegisterGetter to contain the custom register data structures in one place. Also
    started a Plant model to be a container for all devices in a given system.
  • 🛠 Add JSON processing for the RegisterCache – mostly to help with testing but also expecting debugging other plants
    to benefit from it.
  • 👷 Add some more test cases with actual register data.
  • 🚨 Added some recovery logic to the framer – try to scan ahead for other messages instead of truncating the entire
    buffer when there's unexpected data incoming. Hopefully this helps when the communication stream seems to get out of
    sync a bit.
  • 🙅 Add an ErrorResponse PDU so we can try and cope better when the inverter throws error responses.
  • 🧽 Added absolufy-imports and autoflake to pre-commit checks.

Changed

  • ⚠️ Ensure we check charge and discharge limits: current hardware cannot support >50% (i.e. >2.6kW) rates.
  • ✅ Make sure we query the 180+ block of input registers too, since it contains (amongst others) battery energy
    counters.
  • 🤔 Split out querying the battery/BMS registers since this will vary depending on how many batteries the user has. The
    slave address of the request determines which battery unit is targeted.
    • Also start modeling the Battery as separate from the Inverter.
  • 🔎 Collapse the register cache to a single dict since we can use the HoldingRegister/InputRegister identity to
    discern between the types. It makes the data structures a lot simpler.
  • 🛠 Improve the CLI – it is already a useful tool to dump registers for debugging right now.
  • 😳 Changed to target slave id 0x11 by default instead of 0x32. 0x32 shadows 0x11 but seems to be the first battery,
    with subsequent batteries living at the following slave addresses.
    • ☝️ reverted that change because it seems to affect the cloud metrics quite badly when you query frequently.
  • 🤫 Squelch flake8 warnings about missing constructor and magic method docstrings.
  • 🩹 Update README to show usage properly.
  • 🧹 Update python deps.

v0.8.0

09 Jan 17:55
Compare
Choose a tag to compare

Added

  • A large number of convenience methods in the client to alter the state of the inverter:
    • enable_charge_target(target_soc: int) & disable_charge_target()
    • enable_charge() & disable_charge()
    • enable_discharge() and enable_discharge()
    • set_battery_discharge_mode_max_power() and set_battery_discharge_mode_demand()
    • set_charge_slot_n((start_time: datetime.time, end_time: datetime.time)) and reset_charge_slot_n()
      for slots 1 & 2. Also matching set_discharge_slot_n((start_time, end_time)) and reset_discharge_slot_n().
    • set_mode_dynamic() to maximise storage of generation and discharge during demand. This mirrors "mode 1"
      operation in the portal.
    • set_mode_storage(slot_1, [slot_2], [export]) which keeps the battery charge topped-up and discharges
      during specified periods. This mirrors modes 2-4 in the portal.
    • set_datetime(datetime) to set the inverter date & time.
  • Ensure we always close the socket after every network socket. Sometimes the inverter turns orange/grey
    in the portal after executing queries via this library, and this seems to mitigate against it.

Changed

  • Potentially breaking: Wholesale renaming of registers to more official designations, and standardising
    naming somewhat. Part of the motivation for adding more convenience functions is so clients never have to deal
    with register names directly, so this should hopefully make future renaming easier.

v0.7.0

05 Jan 01:09
Compare
Choose a tag to compare

Added

  • Another register whitelist and check in the WriteHoldingRegisterRequest PDU as another layer of checks
    to not inadvertently write to unsafe registers. Add a test to ensure the allow list stays in sync with
    the register definitions from model.register_banks.HoldingRegister.
  • A bunch of convenience methods to write data to the inverter without needing any knowledge of registers.
    See client.GivEnergyClient which has a number of set_* methods.

Changed

  • Split out the end-user client functionality from the Modbus client - they were getting too entangled
    unnecessarily. Updated example code in README for reference.
  • Renamed target_soc to battery_target_soc instead.

v0.6.2

05 Jan 01:09
Compare
Choose a tag to compare

Fixed

  • Will this fix mindsers/changelog-reader-action@v2?