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.
marcel 6bfce5a652 100% cpu usage fixed. 2 years ago
conf Eerste versie 2 years ago
exampleconf Eerste versie 2 years ago
tests Eerste versie 2 years ago
utils Eerste versie 2 years ago 100% cpu usage fixed. 2 years ago
LICENSE Initial commit 2 years ago Typo 2 years ago
requirements-dev.txt Eerste versie 2 years ago
requirements-frozen.txt Eerste versie 2 years ago
requirements.txt Eerste versie 2 years ago Eerste versie 2 years ago 100% cpu usage fixed. 2 years ago

Prometheus exporter for Victron MQTT devices

A purposely build Prometheus exporter for Victron Energy Cerbo GX MQTT devices.

(C) 2022 M. Konstapel

Based on the General purpose Prometheus exporter for MQTT from Frederic Hemberger. (

Subscribes to one or more MQTT topics, and lets you configure prometheus metrics based on pattern matching.


  • Converts JSON string from Victron MQTT device topics to value readable by Prometheus.
  • Sends keepalive signal to Victron Energy Cerbo GX MQTT device (every 30 seconds).
  • Supported Metrics:
    • standard metrics
      • Gauge, Counter, Histogram, Summary
    • additional
      • Counter (Absolute):
        • Same as Counter, but working with absolute numbers received from MQTT. Which is far more common, than sending the diff in each publish.
        • e.g. a network counter or a rain sensor
      • Enum:
        • is a metric type not so common, details can be found in the OpenMetrics docs and Python client code.
        • Allows to track as state by a know set of strings describing the state, e.g. on/off or high/medium/low
        • Common sources would be a light switch oder a door lock.
  • Comprehensive rewriting for topic, value/payload and labels
    • similar to prometheus label rewrites
    • regex allows almost every conversion
    • e.g. to
      • remove units or other strings from payload
      • convert topic hierarchy into labels
      • normalize labels
    • check example configs ./exampleconf and the configs in ./test/test_data/


  • Create a folder to hold the config (default: conf/)
  • Add metric config(s) in YAML format to the folder. Files are combined and read as a single config. (See exampleconf/metric_example.yaml for details)
  • Install dependencies with pip3 install -r requirements-frozen.txt
  • Run ./

Python dependencies

  • paho-mqtt
  • prometheus-client
  • PyYAML
  • yamlreader


  • Add persistence of metrics on restart
  • forget/age out metrics receiving no updates anymore