This tool parses the Victron VE.Direct TEXT protocol and exports the metrics over Prometheus and MQTT. This can be used to monitor your solar installation and view statistics in tools like Grafana or Home Assistant.
Go to file
Michael Hope 23c0a49a26
continuous-integration/drone/push Build is failing Details
vedirect: use the systemd watchdog
2021-05-09 14:20:10 +02:00
vedirect vedirect: use the systemd watchdog 2021-05-09 14:20:10 +02:00
.drone.yml vedirect: add flake8 2021-03-10 21:28:14 +01:00
.gitignore vedirect: ran YAPF and tidied up power.py 2021-01-02 17:37:49 +01:00
CONTRIBUTING.md vedirect: added the Apache license and CONTRIBUTING 2020-11-17 20:54:29 +01:00
LICENSE vedirect: added the Apache license and CONTRIBUTING 2020-11-17 20:54:29 +01:00
README.md vedirect: be clear about this being for Victron devices 2020-11-21 16:32:04 +01:00
requirements.txt vedirect: use the systemd watchdog 2021-05-09 14:20:10 +02:00
setup.py vedirect: move to requirements.txt to pick up janet 2021-02-26 17:46:01 +01:00

README.md

vedirect - export Victron metrics

This tool parses the Victron VE.Direct TEXT protocol and exports the metrics over Prometheus and MQTT. This can be used to monitor your solar installation and view statistics in tools like Grafana or Home Assistant.

Usage

python3 setup.py install

vedirect --port=/dev/ttyAMA4 \
	--prometheus_port=7099 \
	--mqtt_host=localhost

This will connect to the Victron module on ttyAMA4, export the metrics at http://localhost:7099/metrics, and push the metrics to the MQTT server at localhost:1889.

Compatibility

This tool has been tested with a Victron BlueSolar 75/15 running firmware 1.56 with protocol v3.29. See vedirect/defs.py to enable new types.

Prometheus

Each field appears as a separate Prometheus metric. For example:

wget -nv -O - http://localhost:7099/metrics

gives

victron_fw_info{fw="1.53",product_id="0xA042",serial_number="HQ1123I8XGA"} 1.0
victron_v_volt{product_id="0xA042",serial_number="HQ1123I8XGA"} 12.235
victron_i_ampere{product_id="0xA042",serial_number="HQ1123I8XGA"} -0.401
victron_cs{product_id="0xA042",serial_number="HQ1123I8XGA",victron_cs="off"} 1.0
victron_cs{product_id="0xA042",serial_number="HQ1123I8XGA",victron_cs="low_power"} 0.0

Gauges are put through a first order filter before exporting. This increases the apparent resolution of low resolution signals like the load current.

MQTT

Each field appears as a separate, single valued MQTT topic. For example:

tele/victron_HQ1123I8XGA/pid 0xA042
tele/victron_HQ1123I8XGA/fw 1.53
tele/victron_HQ1123I8XGA/v 12.24
tele/victron_HQ1123I8XGA/i -0.4

This tool exports MQTT discovery records and should be automatically detected by Home Assistant.

Note

This is not an official Google product.

-- Michael Hope michaelh@juju.nz mlhx@google.com