2020-11-01 15:53:33 +01:00
|
|
|
# vedirect - export Victron metrics
|
|
|
|
|
2020-11-21 16:32:04 +01:00
|
|
|
This tool parses the Victron [VE.Direct][ved] TEXT protocol and
|
|
|
|
exports the metrics over [Prometheus][prom] and [MQTT][mqtt]. This can
|
|
|
|
be used to monitor your solar installation and view statistics in
|
|
|
|
tools like [Grafana](https://grafana.com/) or [Home Assistant][hass].
|
2020-11-01 15:53:33 +01:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2020-11-17 21:06:20 +01:00
|
|
|
```
|
|
|
|
python3 setup.py install
|
2020-11-01 15:53:33 +01:00
|
|
|
|
2020-11-17 21:06:20 +01:00
|
|
|
vedirect --port=/dev/ttyAMA4 \
|
|
|
|
--prometheus_port=7099 \
|
|
|
|
--mqtt_host=localhost
|
|
|
|
```
|
2020-11-01 15:53:33 +01:00
|
|
|
|
|
|
|
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`.
|
|
|
|
|
2020-11-17 21:06:20 +01:00
|
|
|
## Compatibility
|
2020-11-01 15:53:33 +01:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
2020-11-17 21:06:20 +01:00
|
|
|
## Prometheus
|
2020-11-01 15:53:33 +01:00
|
|
|
|
2020-11-17 21:06:20 +01:00
|
|
|
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
|
2020-11-01 15:53:33 +01:00
|
|
|
detected by Home Assistant.
|
|
|
|
|
|
|
|
## Note
|
2020-11-01 16:18:00 +01:00
|
|
|
|
2020-11-01 15:53:33 +01:00
|
|
|
This is not an official Google product.
|
|
|
|
|
2020-11-17 21:06:20 +01:00
|
|
|
\-- Michael Hope <michaelh@juju.nz> <mlhx@google.com>
|
2020-11-01 15:53:33 +01:00
|
|
|
|
|
|
|
[hass]: https://www.home-assistant.io/
|
2020-11-17 21:06:20 +01:00
|
|
|
[mqtt]: https://mqtt.org/
|
|
|
|
[prom]: https://prometheus.io/
|
|
|
|
[ved]: https://www.victronenergy.com/live/vedirect_protocol:faq
|