# Victron SDK for Python
> **__NOTE:__** This is not an offical Victron SDK.
### This Python Package enables you to develop applications with the Victron.
## Install:
```bash
pip install victron
```
## Example get a value:
```python
from victron import Victron
# Create a configration
config = {
"grid_limit": device.get(c.CFG_GRID_LIMIT),
"ess_feed_limit": device.get(c.CFG_ESS_FEED_LIMIT),
"ess_soc_limit": device.get(c.CFG_ESS_SOC_LIMIT),
}
# Initialize a new Victron connection
victron = victron(
host="my-Victron.local",
port=502,
unit_id=100,
config=config
)
# get the state of charge
soc = victron.getSoc()
# print
print(soc)
```
## Victron Class
```python
Victron(
host:str,
port:int=502,
unit_id:int=100,
config:dict={}
)
```
### Victron Config Options
> **__NOTE:__** The Configuration is to prevent the devices form overloading the grid or other components! Handle with care!
When values are not provided or None the are unused.
```python
{
"grid_limit": None, # The limit of the grid the deivce is connected to
"ess_feed_limit": None, # The limit of the feed from ESS to the grid
"ess_soc_limit": None, # The limit of the state of charge of the ESS
}
```
## Methods
### `getSoc(address:int=843)`
- Get the state of charge
### `readSingleHoldingRegisters(self, address:int, parse:bool=True):`
- Read a single holding register
- Parse = True handles signed values
# TODO: Add more methods
Raw data
{
"_id": null,
"home_page": "https://gitlab.com/jfk344/python-victron-sdk",
"name": "victron",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "@jfk344",
"author_email": "info@jfk-enterprise.com",
"download_url": "https://files.pythonhosted.org/packages/c8/65/988ca047915ba655cfaff81fbe4fdcc441be7f2b1856461acf4ab89ec9d4/victron-1.0.0.tar.gz",
"platform": null,
"description": "# Victron SDK for Python\n\n> **__NOTE:__** This is not an offical Victron SDK.\n\n\n### This Python Package enables you to develop applications with the Victron.\n\n## Install: \n\n```bash\npip install victron\n```\n\n## Example get a value:\n\n```python\nfrom victron import Victron\n\n# Create a configration\nconfig = {\n \"grid_limit\": device.get(c.CFG_GRID_LIMIT),\n \"ess_feed_limit\": device.get(c.CFG_ESS_FEED_LIMIT),\n \"ess_soc_limit\": device.get(c.CFG_ESS_SOC_LIMIT),\n}\n\n# Initialize a new Victron connection\nvictron = victron(\n host=\"my-Victron.local\",\n port=502,\n unit_id=100,\n config=config\n)\n\n# get the state of charge\nsoc = victron.getSoc()\n\n# print\nprint(soc)\n```\n\n## Victron Class\n```python\nVictron(\n host:str,\n port:int=502,\n unit_id:int=100,\n config:dict={}\n)\n```\n\n### Victron Config Options\n> **__NOTE:__** The Configuration is to prevent the devices form overloading the grid or other components! Handle with care!\n\nWhen values are not provided or None the are unused.\n```python\n{\n \"grid_limit\": None, # The limit of the grid the deivce is connected to\n \"ess_feed_limit\": None, # The limit of the feed from ESS to the grid\n \"ess_soc_limit\": None, # The limit of the state of charge of the ESS\n}\n```\n\n## Methods\n### `getSoc(address:int=843)`\n- Get the state of charge\n\n### `readSingleHoldingRegisters(self, address:int, parse:bool=True):`\n- Read a single holding register\n- Parse = True handles signed values\n\n\n\n# TODO: Add more methods\n",
"bugtrack_url": null,
"license": "mit",
"summary": "An SDK for Victron via Modbus TCP",
"version": "1.0.0",
"project_urls": {
"Homepage": "https://gitlab.com/jfk344/python-victron-sdk"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c865988ca047915ba655cfaff81fbe4fdcc441be7f2b1856461acf4ab89ec9d4",
"md5": "b250465d839d3c7a1b5ba1814ce734e2",
"sha256": "4ae829292ac9c0e1f768461b8db026aef3e32d4b4a5a5ecf81437a2fa300c3bf"
},
"downloads": -1,
"filename": "victron-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "b250465d839d3c7a1b5ba1814ce734e2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 24930,
"upload_time": "2024-11-20T09:30:36",
"upload_time_iso_8601": "2024-11-20T09:30:36.189238Z",
"url": "https://files.pythonhosted.org/packages/c8/65/988ca047915ba655cfaff81fbe4fdcc441be7f2b1856461acf4ab89ec9d4/victron-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-20 09:30:36",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "jfk344",
"gitlab_project": "python-victron-sdk",
"lcname": "victron"
}