{ "annotations": { "list": [] }, "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, "id": null, "links": [], "liveNow": false, "panels": [ { "id": 1, "type": "stat", "title": "Active customers (push in last hour)", "datasource": { "type": "postgres", "uid": "timescaledb" }, "gridPos": { "x": 0, "y": 0, "w": 6, "h": 4 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "thresholds": { "mode": "absolute", "steps": [{ "color": "red", "value": null }, { "color": "green", "value": 1 }] } } }, "options": { "reduceOptions": { "calcs": ["lastNotNull"] }, "colorMode": "value", "textMode": "auto", "graphMode": "none" }, "targets": [ { "refId": "A", "datasource": { "type": "postgres", "uid": "timescaledb" }, "format": "table", "rawSql": "SELECT count(*) AS \"Active\" FROM fleet.\"Customers\" WHERE \"LastSeenAt\" > now() - INTERVAL '1 hour'" } ] }, { "id": 2, "type": "stat", "title": "Total customers", "datasource": { "type": "postgres", "uid": "timescaledb" }, "gridPos": { "x": 6, "y": 0, "w": 6, "h": 4 }, "options": { "reduceOptions": { "calcs": ["lastNotNull"] }, "colorMode": "none", "textMode": "auto", "graphMode": "none" }, "targets": [ { "refId": "A", "datasource": { "type": "postgres", "uid": "timescaledb" }, "format": "table", "rawSql": "SELECT count(*) AS \"Total\" FROM fleet.\"Customers\"" } ] }, { "id": 3, "type": "stat", "title": "Measurements last 24h", "datasource": { "type": "postgres", "uid": "timescaledb" }, "gridPos": { "x": 12, "y": 0, "w": 6, "h": 4 }, "options": { "reduceOptions": { "calcs": ["lastNotNull"] }, "colorMode": "none", "textMode": "auto", "graphMode": "none" }, "targets": [ { "refId": "A", "datasource": { "type": "postgres", "uid": "timescaledb" }, "format": "table", "rawSql": "SELECT SUM(samples)::bigint AS \"Samples\" FROM fleet.hourly_per_device WHERE bucket > now() - INTERVAL '24 hours'" } ] }, { "id": 4, "type": "stat", "title": "Total kWh imported today", "datasource": { "type": "postgres", "uid": "timescaledb" }, "gridPos": { "x": 18, "y": 0, "w": 6, "h": 4 }, "fieldConfig": { "defaults": { "unit": "kwatth" } }, "options": { "reduceOptions": { "calcs": ["lastNotNull"] }, "colorMode": "none", "textMode": "auto", "graphMode": "none" }, "targets": [ { "refId": "A", "datasource": { "type": "postgres", "uid": "timescaledb" }, "format": "table", "rawSql": "SELECT COALESCE(SUM(kwh_imported_delta), 0) AS \"kWh\" FROM fleet.hourly_per_device WHERE bucket >= date_trunc('day', now())" } ] }, { "id": 5, "type": "timeseries", "title": "Active power per customer (sum across devices)", "datasource": { "type": "postgres", "uid": "timescaledb" }, "gridPos": { "x": 0, "y": 4, "w": 24, "h": 9 }, "fieldConfig": { "defaults": { "unit": "kwatt", "color": { "mode": "palette-classic" }, "custom": { "drawStyle": "line", "lineWidth": 2, "fillOpacity": 10, "showPoints": "never", "spanNulls": false } } }, "options": { "tooltip": { "mode": "multi", "sort": "desc" }, "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true } }, "targets": [ { "refId": "A", "datasource": { "type": "postgres", "uid": "timescaledb" }, "format": "time_series", "rawSql": "SELECT time_bucket($__interval, h.bucket) AS time, c.\"Code\" AS metric, SUM(h.avg_kw) AS value FROM fleet.hourly_per_device h JOIN fleet.\"Customers\" c ON c.\"Id\" = h.\"CustomerId\" WHERE $__timeFilter(h.bucket) GROUP BY 1, 2 ORDER BY 1" } ] }, { "id": 6, "type": "timeseries", "title": "kWh imported per hour (per customer)", "datasource": { "type": "postgres", "uid": "timescaledb" }, "gridPos": { "x": 0, "y": 13, "w": 24, "h": 9 }, "fieldConfig": { "defaults": { "unit": "kwatth", "color": { "mode": "palette-classic" }, "custom": { "drawStyle": "bars", "lineWidth": 1, "fillOpacity": 80 } } }, "options": { "tooltip": { "mode": "multi", "sort": "desc" }, "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true } }, "targets": [ { "refId": "A", "datasource": { "type": "postgres", "uid": "timescaledb" }, "format": "time_series", "rawSql": "SELECT h.bucket AS time, c.\"Code\" AS metric, SUM(COALESCE(h.kwh_imported_delta, 0)) AS value FROM fleet.hourly_per_device h JOIN fleet.\"Customers\" c ON c.\"Id\" = h.\"CustomerId\" WHERE $__timeFilter(h.bucket) GROUP BY 1, 2 ORDER BY 1" } ] } ], "refresh": "30s", "schemaVersion": 38, "tags": ["fleet", "admin"], "templating": { "list": [] }, "time": { "from": "now-24h", "to": "now" }, "timepicker": {}, "timezone": "", "title": "Fleet Overview", "uid": "fleet-overview", "version": 1 }