Domoticz exporter for Prometheus.io, written in Node.js.
This exporter provides metrics for the devices defined in Domoticz, rather than for Domoticz itself.
--port 9486 Exporter listens on this port (default = 9486)
--interval 15 Polling interval in seconds (default = 15, minimum 2)
--hostip 127.0.0.1 Domoticz IP (default = 127.0.0.1)
--hostport 8080 Domoticz port (default = 8080, or 443 if using SSL)
--hostssl Use SSL to connect to Domoticz
--collectdefault Collect default Prometheus metrics as well (default = false)
The arguments can also be set as env variables instead. Useful if you're using it in a Docker container.
- DOMOTICZ_PORT
- DOMOTICZ_INTERVAL
- DOMOTICZ_HOSTIP
- DOMOTICZ_HOSTPORT
- DOMOTICZ_HOSTSSL
- DOMOTICZ_DEFAULTMETRICS
Node 16+ is required to run it.
git clone git@github.com:wywywywy/domoticz_exporter.git
cd domoticz_exporter
npm install
npm start
Recommend npm version >= 6.
docker run -d --restart=always -p 9486:9486 wywywywy/domoticz_exporter:latest
Add this to prometheus.yml and change the IP/port if needed.
- job_name: 'domoticz_exporter'
metrics_path: /
static_configs:
- targets:
- '127.0.0.1:9486'
There are 4 types of devices in Domoticz, and they are presented as separate metric groups.
- light = Get all lights/switches
- weather = Get all weather devices
- temp = Get all temperature devices
- utility = Get all utility devices
Unfortunately there is no standard in Domoticz how "levels" are presented. So for example on some devices battery level 100 means full, and others it will be 255.
The same goes for units - on some it may be Celsius others Fahrenheit, some it may be kWh others Ah, etc. It all depends on the device itself.
- Support for more edge-case devices
- Metrics of Domoticz itself maybe?
Yes, contributions are always welcome.
Fork it, clone it, submit a pull request, etc.
This is licensed under the Apache License 2.0.