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.2.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: python-pylontech-0.0.2.tar.gz
  • Upload date:
  • Size: 3.8 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.2.tar.gz
Algorithm Hash digest
SHA256 0c89950bbbf8a4fdec0853d280a3fffa841270f97251fdf2a1e5c768f8c10ca8
MD5 36361e7bbe0a7ae43e5c63c4ba2be2d9
BLAKE2b-256 0cae7d27e1c4b899776dd4467c978f95dbc9f76742570456a712636fb4bd5c68

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_pylontech-0.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4790e5c1023f2f2c6a3c94757aa0a0e25af9244784f6fa747aa8a3a842e19b42
MD5 ff91f1fd646524cb97c4e10a33d2cbee
BLAKE2b-256 be3d4b6bbe1e5661dadea31a3498cb9172724c315100bae2d8aeb4d9e7ef79a9

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