Skip to main content

Interfaces with Pylontech Batteries using RS485 protocol

Project description

python-pylontech

Python lib to talk to pylontech lithium batteries (US2000, US3000, ...) using RS485

What is this lib ?

This lib is meant to talk to Pylontech batteries using RS485. Sadly the protocol over RS485 is not some fancy thing like MODBUS but their own crappy protocol.

How to use this lib ?

First of all, you need a USB to RS485 converter. They are many available online for some bucks.

Then, you simply need to import the lib and start asking values:

>>> import pylontech
>>> p = pylontech.Pylontech()
>>> print(p.get_values())
Container: 
    CommandValue = 1
    NumberOfCells = 15
    CellVoltages = ListContainer: 
        3.325
        3.326
        3.325
        3.325
        3.325
        3.325
        3.325
        3.324
        3.324
        3.324
        3.326
        3.326
        3.326
        3.326
        3.326
    NumberOfTemperatures = 5
    AverageBMSTemperature = 30.01
    GroupedCellsTemperatures = ListContainer: 
        29.61
        29.61
        29.61
        29.61
    Current = 0
    Voltage = 49.878
    RemainingCapacity = 49.0
    TotalCapacity = 50.0
    CycleNumber = 0
>>> print(p.get_system_parameters())
Container: 
    CellHighVoltageLimit = 3.7
    CellLowVoltageLimit = 3.05
    CellUnderVoltageLimit = 2.9
    ChargeHighTemperatureLimit = 33.41
    ChargeLowTemperatureLimit = 26.21
    ChargeCurrentLimit = 10.2
    ModuleHighVoltageLimit = 54.0
    ModuleLowVoltageLimit = 46.0
    ModuleUnderVoltageLimit = 44.5
    DischargeHighTemperatureLimit = 33.41
    DischargeLowTemperatureLimit = 26.21
    DischargeCurrentLimit = -10.0

Dependencies

This lib depends on pyserial and the awesome construct lib.

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

python-pylontech-0.0.3.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

python_pylontech-0.0.3-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file python-pylontech-0.0.3.tar.gz.

File metadata

  • Download URL: python-pylontech-0.0.3.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.10

File hashes

Hashes for python-pylontech-0.0.3.tar.gz
Algorithm Hash digest
SHA256 de187158c0ddeafbec623d74a951713e1dea2a10c3366eb967d99b5655ba5de2
MD5 2e0fb7e3f43b9483cf1da3005049dc38
BLAKE2b-256 8aa80aca619b2eb5022567e0465725fd78f7996845f1f6eea9945ac27809583a

See more details on using hashes here.

File details

Details for the file python_pylontech-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: python_pylontech-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.10

File hashes

Hashes for python_pylontech-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0a56f75c1e85daf6641e26d190ddf49a49b20f2708359c250b2ff3ff3e84282b
MD5 491984b78bd7cc773b46f616970ccdff
BLAKE2b-256 678c992ffc0176e5ec11cddc9eda72add065971fbc07481249ab9e230856ddd4

See more details on using hashes here.

Supported by

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