{ "annotations": { "list": [ { "builtIn": 1, "datasource": { "type": "grafana", "uid": "-- Grafana --" }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "type": "dashboard" } ] }, "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, "id": null, "links": [], "liveNow": false, "panels": [ { "id": 1, "type": "timeseries", "title": "Active power (kW)", "datasource": { "type": "postgres", "uid": "timescaledb" }, "gridPos": { "x": 0, "y": 0, "w": 24, "h": 9 }, "fieldConfig": { "defaults": { "unit": "kwatt", "color": { "mode": "palette-classic" }, "custom": { "drawStyle": "line", "lineWidth": 2, "fillOpacity": 10, "showPoints": "never", "spanNulls": false } }, "overrides": [] }, "options": { "tooltip": { "mode": "multi", "sort": "none" }, "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true } }, "targets": [ { "refId": "A", "datasource": { "type": "postgres", "uid": "timescaledb" }, "format": "time_series", "rawSql": "SELECT time_bucket($__interval, \"Time\") AS time, avg(\"ActivePowerKw\") AS \"kW\" FROM monitoring.\"PowerMeasurements\" WHERE \"DeviceId\" = '${device}' AND $__timeFilter(\"Time\") GROUP BY 1 ORDER BY 1" } ] }, { "id": 2, "type": "timeseries", "title": "Cumulative energy imported (kWh)", "datasource": { "type": "postgres", "uid": "timescaledb" }, "gridPos": { "x": 0, "y": 9, "w": 12, "h": 9 }, "fieldConfig": { "defaults": { "unit": "kwatth", "color": { "mode": "palette-classic" }, "custom": { "drawStyle": "line", "lineWidth": 2, "fillOpacity": 5, "showPoints": "never" } }, "overrides": [] }, "options": { "tooltip": { "mode": "single", "sort": "none" }, "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true } }, "targets": [ { "refId": "A", "datasource": { "type": "postgres", "uid": "timescaledb" }, "format": "time_series", "rawSql": "SELECT \"Time\" AS time, \"EnergyImportedKwh\" AS \"kWh imported\" FROM monitoring.\"PowerMeasurements\" WHERE \"DeviceId\" = '${device}' AND $__timeFilter(\"Time\") AND \"EnergyImportedKwh\" IS NOT NULL ORDER BY \"Time\"" } ] }, { "id": 3, "type": "stat", "title": "Latest active power", "datasource": { "type": "postgres", "uid": "timescaledb" }, "gridPos": { "x": 12, "y": 9, "w": 12, "h": 9 }, "fieldConfig": { "defaults": { "unit": "kwatt", "color": { "mode": "thresholds" }, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "orange", "value": 50 }, { "color": "red", "value": 100 } ] } }, "overrides": [] }, "options": { "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "auto", "colorMode": "value", "graphMode": "area", "justifyMode": "auto" }, "targets": [ { "refId": "A", "datasource": { "type": "postgres", "uid": "timescaledb" }, "format": "time_series", "rawSql": "SELECT \"Time\" AS time, \"ActivePowerKw\" AS \"kW\" FROM monitoring.\"PowerMeasurements\" WHERE \"DeviceId\" = '${device}' ORDER BY \"Time\" DESC LIMIT 1" } ] } ], "refresh": "30s", "schemaVersion": 38, "tags": ["power"], "templating": { "list": [ { "name": "device", "label": "Device", "type": "query", "datasource": { "type": "postgres", "uid": "timescaledb" }, "query": "SELECT \"Name\" AS __text, \"Id\"::text AS __value FROM monitoring.\"Devices\" WHERE \"IsActive\" = true ORDER BY \"Name\"", "refresh": 1, "multi": false, "includeAll": false, "current": {} } ] }, "time": { "from": "now-24h", "to": "now" }, "timepicker": {}, "timezone": "", "title": "Power Overview", "uid": "power-overview", "version": 1, "weekStart": "" }