Skip to main content

A python library to access GivEnergy inverters via Modbus TCP, with no dependency on the GivEnergy Cloud.

Project description

GivEnergy Modbus

pypi python Build Status codecov Code style: black

A python library to access GivEnergy inverters via Modbus TCP on a local network, with no dependency on the GivEnergy Cloud.

⚠️ This project makes no representations as to its completeness or correctness. You use it at your own risk — if your inverter mysteriously explodes because you accidentally set the BOOMTIME register or you consume a MWh of electricity doing SOC calibration: you really are on your own. We make every effort to prevent you from shooting yourself in the foot, so as long as you use the client and its exposed methods, you should be perfectly safe.

Features

  • Reading all registers and decoding them into their representative datatypes
  • Writing data to holding registers that are deemed to be safe to set configuration on the inverter

How to use

Use the provided client to interact with the device over the network, and register caches to build combined state of a device:

import datetime
import givenergy_modbus.commands as commands
from givenergy_modbus.client import Client
from givenergy_modbus.model.plant import Plant, Inverter

client = Client(host="192.168.99.99")
await client.connect()

await client.exec(commands.enable_charge_target(80))
# set a charging slot from 00:30 to 04:30
await client.exec(commands.set_charge_slot_1((datetime.time(hour=0, minute=30), datetime.time(hour=4, minute=30)))
# set the inverter to charge when there's excess, and discharge otherwise. it will also respect charging slots.
await client.exec(commands.set_mode_dynamic())

client.refresh_plant(full_refresh=True)
p = client.plant
inverter = p.inverter
assert inverter.serial_number == 'SA1234G567'
assert inverter.model == Model.Hybrid
assert inverter.v_pv1 == 1.4  # V
assert inverter.e_battery_discharge_day == 8.1  # kWh
assert inverter.enable_charge_target

b0 = p.batteries[0]
assert b0.serial_number == 'BG1234G567'
assert b0.v_battery_cell_01 == 3.117

Credits

This package was created with Cookiecutter and the waynerv/cookiecutter-pypackage project template.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

givenergy_modbus_async-2.0.2.tar.gz (75.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

givenergy_modbus_async-2.0.2-py3-none-any.whl (63.4 kB view details)

Uploaded Python 3

File details

Details for the file givenergy_modbus_async-2.0.2.tar.gz.

File metadata

  • Download URL: givenergy_modbus_async-2.0.2.tar.gz
  • Upload date:
  • Size: 75.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for givenergy_modbus_async-2.0.2.tar.gz
Algorithm Hash digest
SHA256 5a0e212248f5cca30d4dd1c426fe2a0fc7d41d1237e7bc6c363f76b9c3b408df
MD5 516cd2fb79e1064e00e8348fe706bf91
BLAKE2b-256 016a5f22a1a3852619955efe04a23efec6492e841a84e7aa97fa5f641950518b

See more details on using hashes here.

File details

Details for the file givenergy_modbus_async-2.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for givenergy_modbus_async-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8f2415003ba7a17cb099dcbe741b67f41b51a35d74a17d853274dbc4b7c04798
MD5 60714fd0157ba93914100f2c29a4089e
BLAKE2b-256 7086eb48312b9e4b800c225236f74d3c2b632cd436be1faeeb591ae1bb5b56e4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page