diff --git a/README.md b/README.md index f06cbe6f4aaafbdfbea2f1ad38c8b0d6f4e32fea..34c5e972ad8b4ea203fa6e43221ca1e704b554d2 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,9 @@ There are other Hue exporter projects. They didn't quite do what I wanted and to * [huepro](https://github.com/stevenbower/huepro) * [hue_exporter](https://github.com/nilsding/hue_exporter) +Here's a screenshot of an [example Grafana dashboard](docs/grafana.json): + + ## Light metrics Each light metric is labelled with the friendly name, the model, the type, the product name, the manufacturer name, and the unique ID. diff --git a/docs/grafana.json b/docs/grafana.json new file mode 100644 index 0000000000000000000000000000000000000000..98b56ceb9397040d8708b9fabaf4b58ad8d9c4fd --- /dev/null +++ b/docs/grafana.json @@ -0,0 +1,443 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 12, + "links": [], + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": null, + "fill": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 2, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "$$hashKey": "object:5905", + "expr": "hue_sensor_value{type=\"ZLLTemperature\"} / 100", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{ name }}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Temperature", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:5973", + "format": "celsius", + "label": null, + "logBase": 1, + "max": "30", + "min": "0", + "show": true + }, + { + "$$hashKey": "object:5974", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "columns": [], + "datasource": null, + "fontSize": "100%", + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 4, + "links": [], + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 2, + "desc": true + }, + "styles": [ + { + "$$hashKey": "object:6715", + "alias": "Time", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Time", + "type": "hidden" + }, + { + "$$hashKey": "object:6828", + "alias": "Room", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "Metric", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "$$hashKey": "object:6886", + "alias": "Lights on", + "colorMode": "cell", + "colors": [ + "rgba(50, 172, 45, 0)", + "#967302", + "#f2c96d" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value", + "thresholds": [ + "1", + "2" + ], + "type": "string", + "unit": "short", + "valueMaps": [ + { + "$$hashKey": "object:6965", + "text": "None", + "value": "0" + }, + { + "$$hashKey": "object:6988", + "text": "Some", + "value": "1" + }, + { + "$$hashKey": "object:7011", + "text": "All", + "value": "2" + } + ] + }, + { + "$$hashKey": "object:6716", + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "number", + "unit": "short" + } + ], + "targets": [ + { + "$$hashKey": "object:6273", + "expr": "hue_group_on{type=\"Room\"}", + "format": "time_series", + "instant": true, + "intervalFactor": 1, + "legendFormat": "{{ name }}", + "refId": "A" + } + ], + "title": "Rooms", + "transform": "timeseries_to_rows", + "type": "table" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": null, + "fill": 0, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 9 + }, + "id": 5, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "$$hashKey": "object:5905", + "expr": "hue_sensor_value{type=\"ZLLLightLevel\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{ name }}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Light level", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:5973", + "format": "short", + "label": "Lux", + "logBase": 1, + "max": null, + "min": "0", + "show": true + }, + { + "$$hashKey": "object:5974", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "columns": [], + "datasource": null, + "fontSize": "100%", + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 9 + }, + "id": 7, + "links": [], + "pageSize": 100, + "scroll": true, + "showHeader": true, + "sort": { + "col": 1, + "desc": true + }, + "styles": [ + { + "$$hashKey": "object:7908", + "alias": "Time", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "link": false, + "pattern": "Time", + "type": "hidden" + }, + { + "$$hashKey": "object:7944", + "alias": "Device", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "name", + "thresholds": [], + "type": "string", + "unit": "percent" + }, + { + "$$hashKey": "object:8008", + "alias": "Battery level", + "colorMode": "value", + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "Value", + "thresholds": [ + "5", + "10" + ], + "type": "number", + "unit": "percent" + }, + { + "$$hashKey": "object:7909", + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "number", + "unit": "short" + } + ], + "targets": [ + { + "$$hashKey": "object:7746", + "expr": "min(hue_sensor_battery{type=~\"(ZLLPresence|ZLLSwitch)\"}) by (name)", + "format": "table", + "instant": true, + "intervalFactor": 1, + "legendFormat": "{{name}}", + "refId": "A" + } + ], + "title": "Battery levels", + "transform": "table", + "type": "table" + } + ], + "schemaVersion": 16, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-15m", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "Hue exporter", + "uid": "CB4gXSgRz", + "version": 2 +} diff --git a/docs/grafana.png b/docs/grafana.png new file mode 100644 index 0000000000000000000000000000000000000000..6c7a1210c0fe137e10d73f2b76882b45075471f5 Binary files /dev/null and b/docs/grafana.png differ