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.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Michael Hope 23c0a49a26 vedirect: use the systemd watchdog 1 year ago
vedirect vedirect: use the systemd watchdog 1 year ago
.drone.yml vedirect: add flake8 2 years ago
.gitignore vedirect: ran YAPF and tidied up power.py 2 years ago
CONTRIBUTING.md vedirect: added the Apache license and CONTRIBUTING 2 years ago
LICENSE vedirect: added the Apache license and CONTRIBUTING 2 years ago
README.md vedirect: be clear about this being for Victron devices 2 years ago
requirements.txt vedirect: use the systemd watchdog 1 year ago
setup.py vedirect: move to requirements.txt to pick up janet 2 years ago

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