This repository has been archived by the owner on Jun 20, 2024. It is now read-only.
Releases: dewet22/givenergy-modbus
Releases · dewet22/givenergy-modbus
v0.10.1
v0.10.0
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 thePlant
model to abstract awayRegisterCache
s and remove some of the toil around
managing state.README.md
updated with example implementation.
v0.9.4
v0.9.3
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
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
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
Added
- 💪 Create
RegisterCache
andRegisterGetter
to contain the custom register data structures in one place. Also
started aPlant
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
andautoflake
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
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()
andenable_discharge()
set_battery_discharge_mode_max_power()
andset_battery_discharge_mode_demand()
set_charge_slot_n((start_time: datetime.time, end_time: datetime.time))
andreset_charge_slot_n()
for slots 1 & 2. Also matchingset_discharge_slot_n((start_time, end_time))
andreset_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
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 frommodel.register_banks.HoldingRegister
. - A bunch of convenience methods to write data to the inverter without needing any knowledge of registers.
Seeclient.GivEnergyClient
which has a number ofset_*
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
tobattery_target_soc
instead.
v0.6.2
Fixed
- Will this fix
mindsers/changelog-reader-action@v2
?