{"id":31730296,"url":"https://github.com/vemonitor/vedirect_m8","last_synced_at":"2025-10-09T07:26:42.272Z","repository":{"id":38341443,"uuid":"496731324","full_name":"vemonitor/vedirect_m8","owner":"vemonitor","description":"Victron Serial VeDirect Reader and simulator. Fork from karioja/vedirect","archived":false,"fork":false,"pushed_at":"2024-08-30T04:08:46.000Z","size":1327,"stargazers_count":9,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-25T15:24:23.142Z","etag":null,"topics":["python3","reader","serial-communication","simulator","vedirect","victronenergy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vemonitor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"eliserra","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2022-05-26T18:30:58.000Z","updated_at":"2025-07-27T04:48:27.000Z","dependencies_parsed_at":"2023-02-12T19:15:32.309Z","dependency_job_id":"64d4afe6-1f63-4721-ac7b-37173f3d46ef","html_url":"https://github.com/vemonitor/vedirect_m8","commit_stats":{"total_commits":276,"total_committers":2,"mean_commits":138.0,"dds":"0.21014492753623193","last_synced_commit":"9071e76345d7222cfd2e9758c375e9d51d3ff6eb"},"previous_names":["vemonitor/vedirect_m8","mano8/vedirect_m8"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/vemonitor/vedirect_m8","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vemonitor%2Fvedirect_m8","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vemonitor%2Fvedirect_m8/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vemonitor%2Fvedirect_m8/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vemonitor%2Fvedirect_m8/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vemonitor","download_url":"https://codeload.github.com/vemonitor/vedirect_m8/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vemonitor%2Fvedirect_m8/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278518899,"owners_count":26000177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python3","reader","serial-communication","simulator","vedirect","victronenergy"],"created_at":"2025-10-09T07:26:40.061Z","updated_at":"2025-10-09T07:26:42.265Z","avatar_url":"https://github.com/vemonitor.png","language":"Python","funding_links":["https://ko-fi.com/eliserra"],"categories":[],"sub_categories":[],"readme":"# VeDirect M8\n\n![CI/CD](https://github.com/vemonitor/vedirect_m8/actions/workflows/python-package.yml/badge.svg?branch=main)\n[![PyPI package](https://img.shields.io/pypi/v/vedirect_m8.svg)](https://pypi.org/project/vedirect_m8/)\n[![Known Vulnerabilities](https://snyk.io/test/github/mano8/vedirect_m8/badge.svg)](https://snyk.io/test/github/mano8/vedirect_m8)\n[![codecov](https://codecov.io/gh/vemonitor/vedirect_m8/graph/badge.svg?token=KkAwHvkse6)](https://codecov.io/gh/vemonitor/vedirect_m8)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/c401bed6812d4f9bb77bfaee16cf0abe)](https://www.codacy.com/gh/mano8/vedirect_m8/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=mano8/vedirect_m8\u0026amp;utm_campaign=Badge_Grade)\n[![Downloads](https://static.pepy.tech/badge/vedirect_m8)](https://pepy.tech/project/vedirect_m8)\n\n## Description\n\nThis is a Python library for decoding the Victron Energy VE.Direct text protocol\nused in their range of MPPT solar charge controllers and battery monitors.\n\nThis is a forked version of a package originally created by Janne Kario\n[VeDirect](https://github.com/karioja/vedirect).\n\nThis version was originally developed for the [vemonitor_m8](https://github.com/vemonitor/vemonitor_m8) package.\n\n## Installation\n\nTo install directly from GitHub:\n\n``python3 -m pip install \"git+https://github.com/mano8/vedirect_m8\"``\n\nTo install from PypI :\n\n``python3 -m pip install vedirect_m8``\n\n## Test on virtual serial port\n\nThe sim_data directory contains a set of live recordings of the serial port data\nsent by the 3 devices that I own.\n\n* SmartSolar MPPT 100/20 running firmware version 1.39\n* BlueSolar MPPT 75/15 running firmware version 1.23\n* BVM 702 battery monitor running firmware version 3.08\n\nOn unix systems, these recordings can be fed to the Vedirect decoder\nusing a pair of virtual serial ports.\n\nFirst you need install socat on your machine.\nOn debian systems type on your terminal :\n\n```bash\n sudo apt-get install socat\n```\n\nNext install the vedirect_m8 package ``see above``.\n\nNow, to create a pair of virtual serial ports issue the following command:\n\n```bash\n socat -d -d PTY,raw,echo=0,link=/${HOME}/vmodem0 PTY,raw,echo=0,link=/${HOME}/vmodem1\n```\n\nThis will create 2 virtual serials ports connected to each other.\n\nAnything sent to ```/${HOME}/vmodem0``` will be echoed to ```/${HOME}/vmodem1``` and vice versa.\n\nIn other terminal, run the vedirectsim script with your desired device:\n\n```bash\n python examples/vedirectsim.py --port /${HOME}/vmodem0 --device bmv702\n```\n\nOr if you need to see the inputs sent on serial port :\n\n```bash\n python examples/vedirectsim.py --port /${HOME}/vmodem0 --device bmv702 --debug\n```\n\nDevice option must be ``bmv702, bluesolar_1.23, or smartsolar_1.39``.\n\nThen, in other terminal, attach the decoder to /${HOME}/vmodem1:\n\n```bash\n python examples/vedirect_print.py --port /${HOME}/vmodem1\n```\n\nAll the inputs from the selected device file, are encoded to the vmodem0 serial port,\nthen echoed to the vmodem1 by socat, and finally decoded by the vedirect module.\n\n## The Vedirect Controller\n\nThis script extends from Vedirect,\nand add ability to automate connection to serial port.\n\nUseful if you don't know the serial port,\nor if you disconnect VeDirect USB cables and don't reconnect on sames USB ports.\n\nTo do so, we need a serialTest extra configuration settings.\n\nWarning, all the test must successful for validate the serial port.\n\n### Available serialTest\n\nTwo test types, can be used to validate a serial port.\n\n#### 1. Value Tests\n\nThis type of test evaluates whether the key value from the decoded data\nis equal to the provided value.\n\nThe configuration must contain the following parameters :\n\n* typeTest: must be equal to ```value``` here.\n* key: the key of the value to tested from decoded data\n* value: the value to test must be equal of the value of the key from decoded data\n\nMust be used only on static keys values egg ```PID```, ```SER#``` or , ```FW```.\n\nExample for the bmv702 device from sim_data directory:\n\n```python\n'serialTest':{\n    'PID_test': { \n        \"typeTest\": \"value\",\n        \"key\": \"PID\",\n        \"value\": \"0x203\" # the value to test\n    },\n    'FW_test': { \n        \"typeTest\": \"value\",\n        \"key\": \"FW\",\n        \"value\": \"308\" # the value to test\n    }\n}\n```\n\nIn this example, we search a serial port, sending vedirect encoded data\ncontaining at least, \u003c/br\u003e\nthe keys ```PID``` and ```FW```, whose values are respectively\n```0x203``` and ```308```.\n\n#### 2. Column keys Tests\n\nThis type of test evaluates whether the all the keys provided exists\nin the decoded data.\n\nThe configuration must contain the following parameters :\n\n* typeTest: must be equal to ```value``` here.\n* keys: the keys that must be present in the decoded data\n\nExample for the bmv702 device from sim_data directory:\n\n```json\n\"serialTest\": {\n    \"KeysTest\": {\n        \"typeTest\": \"value\",\n        \"keys\": [\"V\", \"I\", \"P\", \"CE\", \"SOC\", \"H18\"]\n    }\n}\n```\n\nIn this example, we search a serial port, sending vedirect encoded data\ncontaining at least, \u003c/br\u003e\nthe keys ```[ \"V\", \"I\", \"P\", \"CE\", \"SOC\", \"H18\" ]```\n\n### Complete configuration example\n\nExample with Complete configuration :\n\n```python\nfrom vedirect_m8.ve_controller import VedirectController\n\ndef print_data_callback(packet):\n    print(packet)\n\nif __name__ == '__main__':\n    conf = {\n        'serialPort': \"/${HOME}/vmodem1\",\n        'timeout': 0,\n        \n        'serialTest':{ \n            'PID_test': { \n                \"typeTest\": \"value\",\n                \"key\": \"PID\",\n                \"value\": \"0x203\"\n            },\n            'FW_test': { \n                \"typeTest\": \"value\",\n                \"key\": \"FW\",\n                \"value\": \"308\"\n            },\n            \"KeysTest\": {\n                \"typeTest\": \"columns\",\n                \"keys\": [ \"V\", \"I\", \"P\", \"CE\", \"SOC\", \"H18\" ]\n            }\n        }\n    }\n    ve = VedirectController(**conf)\n    ve.read_data_callback(print_data_callback)\n```\n\nIn this example, we search a serial port,\nsending vedirect encoded data containing at least:\n\n* the keys ```[ \"V\", \"I\", \"P\", \"CE\", \"SOC\", \"H18\" ]```\n* and the keys ```PID``` and ```FW```,\n  whose values are respectively ```0x203``` and ```308```.\n\nWhen the script is initialized, it first tries to connect to the\n```/${HOME}/vmodem1``` serial port.\n\nIf the connection fails, it waits for an available serial port\nthat matches all the tests above.\n\nThen, when a valid serial port is found, it will start\nto decode VeDirect data from that serial port normally.\n\nLater, if you disconnect the serial USB cable\nand reconnect it to another USB port, the serial port\nwill change and the connection will fail.\n\nThis will restart the same process, it is waiting for an available serial port\nthat matches all the tests above. Then, when a valid serial port is found,\nit resumes decoding VeDirect data from that serial port normally.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvemonitor%2Fvedirect_m8","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvemonitor%2Fvedirect_m8","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvemonitor%2Fvedirect_m8/lists"}