This is a Prometheus exporter for the Philips Hue system. It's written in Go.
It exposes metrics about lights, groups and sensors. I hope you like it.
There are other Hue exporter projects. They didn't quite do what I wanted and to make them do what I wanted would have meant some pretty major changes. They might work for you though:
Here's a screenshot of an example Grafana dashboard:
Each light metric is labelled with the friendly name, the model, the type, the product name, the manufacturer name, and the unique ID.
hue_light_brightness
hue_light_hue
hue_light_saturation
hue_light_on
:0
means off,1
means onhue_light_reachable
:0
or1
representing false or true
Each group metric is labelled with the name, and the type.
hue_group_brightness
hue_group_hue
hue_group_saturation
hue_group_on
:0
means off,1
means some lights within the group are on,2
means all lights within the group are on
Each sensor metric is labelled with the friendly name, the model, the type, the product name, the manufacturer name, the unique ID and the device ID (for motion sensor components). The device ID is a truncated version of the unique ID, that may be used to group the individual sensors that make up a single physical device.
hue_sensor_value
: value varies depending on thetype
of the sensor. For switches, it's the value of the last button pressed; for daylight and presence sensors it's a0
or1
representing false or true values; for the temperature sensor it's hundredths of a degree celsius; for the light level sensor it's Lux.hue_sensor_battery
: battery level percentage (0 for sensors that have no battery)hue_sensor_last_updated
: last updated timestamp (Unix epoch)hue_sensor_on
:0
or1
representing false or truehue_sensor_reachable
:0
or1
representing false or true
Some sensor type values you might find useful:
Daylight
: the Hue Hub's built-in "daylight" sensor, based on sunset / sunrise in your configured locationZGPSwitch
: the Hue tap switchZLLSwitch
: the Hue dimmer switchClipGenericStatus
: a generic sensor, usually a pseudo-sensor created through the API for automation purposesZLLTemperature
: the temperature sensor in the Hue motion sensorZLLPresence
: the presence sensor in the Hue motion sensorZLLLightLevel
: the light level sensor in the Hue motion sensor
hue_group_scrapes_failed
,hue_light_scrapes_failed
,hue_sensor_scrapes_failed
: count of failures when trying to scrape from the Hue API.hue_bridge_restarts
: count of times the bridge has restarted (estimated based on sensor data).
Hey, why didn't you combine the metrics for brightness and hue and saturation and on and reachable?
I tried that, but because of the different label combinations, it didn't really work and you ended up with a load of empty labels.
There's an example configuration file hue_exporter.example.yml
in this repository, but you can also generate one! Run hue_exporter generate
to have the app discover to your Hue bridge and create an API user for itself, then write the necessary configuration.
hue_exporter --config.file hue_exporter.yml --listen.address :9366
Those flag values are the defaults, so you could just run hue_exporter
on its own if you're happy with those.
There are a few docker images built, including ones for ARM7 (Raspberry Pi). You can find these on Docker Hub. They expose /etc/hue_exporter
as a volume for you to generate or pass in your own configuration.
docker run -p 9366:9366 -v my_config.yml:/etc/hue_exporter/config.yml mitchellrj/hue_exporter:latest
MIT / X11 Consortium license. I'd prefer to use Apache 2.0, but the excellent Hue library that this app uses is GPL 2.0 and that isn't compatible with Apache.