From ea1f140c7cd0c938b46c4d794c9230cee1c50898 Mon Sep 17 00:00:00 2001 From: Eric FELIXINE Date: Mon, 4 May 2026 23:47:00 -0400 Subject: [PATCH] Grafana: Add source variable to Smart City dashboard - Add 'source' variable for broker filtering - Save original and modified dashboard JSON - Prepare for mqttTopic integration --- .../grafana-dashboard-sc-dt-modified.json | 162 ++++++++++++++++++ references/grafana-dashboard-sc-dt.json | 135 +++++++++++++++ 2 files changed, 297 insertions(+) create mode 100644 references/grafana-dashboard-sc-dt-modified.json create mode 100644 references/grafana-dashboard-sc-dt.json diff --git a/references/grafana-dashboard-sc-dt-modified.json b/references/grafana-dashboard-sc-dt-modified.json new file mode 100644 index 00000000..7b132e90 --- /dev/null +++ b/references/grafana-dashboard-sc-dt-modified.json @@ -0,0 +1,162 @@ +{ + "meta": { + "type": "db", + "canSave": true, + "canEdit": true, + "canAdmin": true, + "canStar": true, + "canDelete": true, + "slug": "smart-city-digital-twin-martinique", + "url": "/d/smartcity-martinique-2026/smart-city-digital-twin-martinique", + "expires": "0001-01-01T00:00:00Z", + "created": "2026-05-04T21:28:58Z", + "updated": "2026-05-05T02:14:44Z", + "updatedBy": "admin", + "createdBy": "admin", + "version": 3, + "hasAcl": false, + "isFolder": false, + "folderId": 0, + "folderUid": "", + "folderTitle": "General", + "folderUrl": "", + "provisioned": false, + "provisionedExternalId": "", + "annotationsPermissions": { + "dashboard": { + "canAdd": true, + "canEdit": true, + "canDelete": true + }, + "organization": { + "canAdd": true, + "canEdit": true, + "canDelete": true + } + } + }, + "dashboard": { + "annotations": { + "list": [] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 9, + "links": [], + "panels": [ + { + "datasource": "FIWARE Orion", + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "targets": [ + { + "query": "/ngsi-ld/v1/entities?type=TrafficFlowObserved&limit=1000", + "refId": "A" + } + ], + "title": "Traffic Flow (Orion-LD)", + "type": "timeseries" + }, + { + "datasource": "FROST-Server SensorThings", + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 0 + }, + "targets": [ + { + "query": "/Datastreams?$expand=Observations", + "refId": "B" + } + ], + "title": "Air Quality (FROST-Server)", + "type": "timeseries" + }, + { + "datasource": "InfluxDB-Local", + "gridPos": { + "h": 8, + "w": 8, + "x": 0, + "y": 8 + }, + "targets": [ + { + "query": "SHOW TAG VALUES FROM \"sensor_data\" WITH KEY = \"type\"", + "refId": "C" + } + ], + "title": "Capteurs par Type (InfluxDB)", + "type": "stat" + }, + { + "datasource": "FROST-Server SensorThings", + "gridPos": { + "h": 8, + "w": 16, + "x": 8, + "y": 8 + }, + "targets": [ + { + "query": "/Observations?$orderby=phenomenonTime desc&$top=10", + "refId": "D" + } + ], + "title": "Derni\u00e8res Observations (FROST)", + "type": "table" + } + ], + "schemaVersion": 36, + "style": "dark", + "tags": [ + "smartcity", + "martinique", + "simulator" + ], + "templating": { + "list": [ + { + "name": "source", + "type": "custom", + "label": "Source (Broker)", + "options": [ + { + "text": "simulator", + "value": "simulator", + "selected": true + }, + { + "text": "emqx", + "value": "emqx" + }, + { + "text": "mosquitto", + "value": "mosquitto" + }, + { + "text": "bunkerm", + "value": "bunkerm" + } + ], + "query": "simulator,emqx,mosquitto,bunkerm", + "allFormat": "regex" + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "title": "Smart City Digital Twin - Martinique", + "uid": "smartcity-martinique-2026", + "version": 3 + } +} \ No newline at end of file diff --git a/references/grafana-dashboard-sc-dt.json b/references/grafana-dashboard-sc-dt.json new file mode 100644 index 00000000..6045ae65 --- /dev/null +++ b/references/grafana-dashboard-sc-dt.json @@ -0,0 +1,135 @@ +{ + "meta": { + "type": "db", + "canSave": true, + "canEdit": true, + "canAdmin": true, + "canStar": true, + "canDelete": true, + "slug": "smart-city-digital-twin-martinique", + "url": "/d/smartcity-martinique-2026/smart-city-digital-twin-martinique", + "expires": "0001-01-01T00:00:00Z", + "created": "2026-05-04T21:28:58Z", + "updated": "2026-05-05T02:14:44Z", + "updatedBy": "admin", + "createdBy": "admin", + "version": 3, + "hasAcl": false, + "isFolder": false, + "folderId": 0, + "folderUid": "", + "folderTitle": "General", + "folderUrl": "", + "provisioned": false, + "provisionedExternalId": "", + "annotationsPermissions": { + "dashboard": { + "canAdd": true, + "canEdit": true, + "canDelete": true + }, + "organization": { + "canAdd": true, + "canEdit": true, + "canDelete": true + } + } + }, + "dashboard": { + "annotations": { + "list": [] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 9, + "links": [], + "panels": [ + { + "datasource": "FIWARE Orion", + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "targets": [ + { + "query": "/ngsi-ld/v1/entities?type=TrafficFlowObserved&limit=1000", + "refId": "A" + } + ], + "title": "Traffic Flow (Orion-LD)", + "type": "timeseries" + }, + { + "datasource": "FROST-Server SensorThings", + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 0 + }, + "targets": [ + { + "query": "/Datastreams?$expand=Observations", + "refId": "B" + } + ], + "title": "Air Quality (FROST-Server)", + "type": "timeseries" + }, + { + "datasource": "InfluxDB-Local", + "gridPos": { + "h": 8, + "w": 8, + "x": 0, + "y": 8 + }, + "targets": [ + { + "query": "SHOW TAG VALUES FROM \"sensor_data\" WITH KEY = \"type\"", + "refId": "C" + } + ], + "title": "Capteurs par Type (InfluxDB)", + "type": "stat" + }, + { + "datasource": "FROST-Server SensorThings", + "gridPos": { + "h": 8, + "w": 16, + "x": 8, + "y": 8 + }, + "targets": [ + { + "query": "/Observations?$orderby=phenomenonTime desc&$top=10", + "refId": "D" + } + ], + "title": "Derni\u00e8res Observations (FROST)", + "type": "table" + } + ], + "schemaVersion": 36, + "style": "dark", + "tags": [ + "smartcity", + "martinique", + "simulator" + ], + "templating": { + "list": [] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "title": "Smart City Digital Twin - Martinique", + "uid": "smartcity-martinique-2026", + "version": 3 + } +} \ No newline at end of file