Crates.io | deconz-exporter |
lib.rs | deconz-exporter |
version | 0.1.0 |
source | src |
created_at | 2022-03-07 15:05:23.297676 |
updated_at | 2022-03-07 15:05:23.297676 |
description | A very simple (and naive) Prometheus exporter for deCONZ Phoscon zigbee gateway |
homepage | |
repository | https://github.com/jaseemabid/deconz-exporter |
max_upload_size | |
id | 545073 |
size | 1,007,289 |
A very simple (and naive) Prometheus exporter for deCONZ Phoscon zigbee gateway. Exports prometheus metrics for sensors connected to Conbee II USB gateway.
# HELP deconz_battery Battery level of sensors
# TYPE deconz_battery gauge
deconz_battery{manufacturername, modelid, name, swversion}
# HELP deconz_humidity Humidity level
# TYPE deconz_humidity gauge
deconz_humidity{manufacturername, modelid, name, swversion, type}
# HELP deconz_pressure Pressure level
# TYPE deconz_pressure gauge
deconz_pressure{manufacturername,modelid, name, swversion, type}
# HELP deconz_temperature Temperature level
# TYPE deconz_temperature gauge
deconz_temperature{manufacturername, modelid, name, swversion, type}
Enable discovery in gateway settings
Generate a new username for the exporter
$ curl -X POST -s http://<rest api endpoint>/api -d '{"devicetype": "deconz-exporter"}' | jq
[{"success":{"username":"0E87CDA111"}}]
Start the exporter.
$ cargo run -- --url http://<gateway rest API>:4501 --username 0E87CDA111 --port 9199
Profit! 🥇
websocat is a handy tool to see the raw websocket events emitted. Use it to debug issues, capture some sample events etc.
$ websocat ws://nyx.jabid.in:4502
{"attr":{"id":"1","lastannounced":null,"lastseen":"2022-03-04T22:42Z","manufacturername":"dresden elektronik","modelid":...
Run $ cargo test
just to be sure.
This exporter is only tested with a few devices I own. There is no guarantee that it would work with anything else.
Feel free to send me PRs for other devices supported by Conbee II
The auth flow is cumbersome and manual, would be great to automate this.
Process metrics are missing, should bring them back.
Auto discovery of gateways might be nice.