Skip to content

Commit

Permalink
fix: display vehicle vin as a fallback for vehicle name on grafana da…
Browse files Browse the repository at this point in the history
…shboards.
  • Loading branch information
Alan Castro committed Sep 14, 2024
1 parent 363e5a6 commit 4903ca1
Show file tree
Hide file tree
Showing 21 changed files with 42 additions and 42 deletions.
4 changes: 2 additions & 2 deletions grafana/dashboards/battery-health.json
Original file line number Diff line number Diff line change
Expand Up @@ -1844,14 +1844,14 @@
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC",
"definition": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC",
"hide": 0,
"includeAll": false,
"label": "Car",
"multi": false,
"name": "car_id",
"options": [],
"query": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC",
"query": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand Down
4 changes: 2 additions & 2 deletions grafana/dashboards/charge-level.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,14 @@
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"definition": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"hide": 2,
"includeAll": true,
"label": "Car",
"multi": false,
"name": "car_id",
"options": [],
"query": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"query": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand Down
4 changes: 2 additions & 2 deletions grafana/dashboards/charges.json
Original file line number Diff line number Diff line change
Expand Up @@ -1579,14 +1579,14 @@
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"definition": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"hide": 0,
"includeAll": false,
"label": "Car",
"multi": false,
"name": "car_id",
"options": [],
"query": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"query": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand Down
4 changes: 2 additions & 2 deletions grafana/dashboards/charging-stats.json
Original file line number Diff line number Diff line change
Expand Up @@ -2447,14 +2447,14 @@
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"definition": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"hide": 2,
"includeAll": true,
"label": "Car",
"multi": false,
"name": "car_id",
"options": [],
"query": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"query": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand Down
4 changes: 2 additions & 2 deletions grafana/dashboards/drive-stats.json
Original file line number Diff line number Diff line change
Expand Up @@ -1057,14 +1057,14 @@
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"definition": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"hide": 0,
"includeAll": false,
"label": "Car",
"multi": false,
"name": "car_id",
"options": [],
"query": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"query": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand Down
4 changes: 2 additions & 2 deletions grafana/dashboards/drives.json
Original file line number Diff line number Diff line change
Expand Up @@ -1543,14 +1543,14 @@
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"definition": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"hide": 0,
"includeAll": false,
"label": "Car",
"multi": false,
"name": "car_id",
"options": [],
"query": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"query": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand Down
4 changes: 2 additions & 2 deletions grafana/dashboards/efficiency.json
Original file line number Diff line number Diff line change
Expand Up @@ -1100,14 +1100,14 @@
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"definition": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"hide": 2,
"includeAll": true,
"label": "Car",
"multi": false,
"name": "car_id",
"options": [],
"query": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"query": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand Down
4 changes: 2 additions & 2 deletions grafana/dashboards/internal/charge-details.json
Original file line number Diff line number Diff line change
Expand Up @@ -1955,14 +1955,14 @@
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"definition": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"hide": 0,
"includeAll": false,
"label": "Car",
"multi": false,
"name": "car_id",
"options": [],
"query": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"query": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand Down
4 changes: 2 additions & 2 deletions grafana/dashboards/internal/drive-details.json
Original file line number Diff line number Diff line change
Expand Up @@ -2639,14 +2639,14 @@
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"definition": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"hide": 0,
"includeAll": false,
"label": "Car",
"multi": false,
"name": "car_id",
"options": [],
"query": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"query": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand Down
4 changes: 2 additions & 2 deletions grafana/dashboards/locations.json
Original file line number Diff line number Diff line change
Expand Up @@ -1194,14 +1194,14 @@
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"definition": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"hide": 1,
"includeAll": true,
"label": "Car",
"multi": true,
"name": "car_id",
"options": [],
"query": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"query": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand Down
4 changes: 2 additions & 2 deletions grafana/dashboards/mileage.json
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,14 @@
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"definition": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"hide": 2,
"includeAll": true,
"label": "Car",
"multi": false,
"name": "car_id",
"options": [],
"query": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"query": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand Down
4 changes: 2 additions & 2 deletions grafana/dashboards/overview.json
Original file line number Diff line number Diff line change
Expand Up @@ -2025,14 +2025,14 @@
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"definition": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"hide": 2,
"includeAll": true,
"label": "Car",
"multi": false,
"name": "car_id",
"options": [],
"query": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"query": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand Down
4 changes: 2 additions & 2 deletions grafana/dashboards/projected-range.json
Original file line number Diff line number Diff line change
Expand Up @@ -704,14 +704,14 @@
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"definition": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"hide": 2,
"includeAll": true,
"label": "Car",
"multi": false,
"name": "car_id",
"options": [],
"query": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"query": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand Down
4 changes: 2 additions & 2 deletions grafana/dashboards/reports/dutch-tax.json
Original file line number Diff line number Diff line change
Expand Up @@ -360,14 +360,14 @@
"value": "$__all"
},
"datasource": "TeslaMate",
"definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"definition": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"hide": 2,
"includeAll": true,
"label": "Car",
"multi": false,
"name": "car_id",
"options": [],
"query": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"query": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand Down
4 changes: 2 additions & 2 deletions grafana/dashboards/states.json
Original file line number Diff line number Diff line change
Expand Up @@ -518,14 +518,14 @@
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"definition": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"hide": 2,
"includeAll": true,
"label": "Car",
"multi": false,
"name": "car_id",
"options": [],
"query": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"query": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand Down
4 changes: 2 additions & 2 deletions grafana/dashboards/statistics.json
Original file line number Diff line number Diff line change
Expand Up @@ -842,14 +842,14 @@
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"definition": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"hide": 2,
"includeAll": true,
"label": "Car",
"multi": false,
"name": "car_id",
"options": [],
"query": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"query": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand Down
4 changes: 2 additions & 2 deletions grafana/dashboards/timeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -688,14 +688,14 @@
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"definition": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"hide": 2,
"includeAll": true,
"label": "Car",
"multi": false,
"name": "car_id",
"options": [],
"query": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"query": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand Down
4 changes: 2 additions & 2 deletions grafana/dashboards/trip.json
Original file line number Diff line number Diff line change
Expand Up @@ -2687,14 +2687,14 @@
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"definition": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"hide": 2,
"includeAll": true,
"label": "Car",
"multi": false,
"name": "car_id",
"options": [],
"query": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"query": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand Down
4 changes: 2 additions & 2 deletions grafana/dashboards/updates.json
Original file line number Diff line number Diff line change
Expand Up @@ -683,14 +683,14 @@
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"definition": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"hide": 2,
"includeAll": true,
"label": "Car",
"multi": false,
"name": "car_id",
"options": [],
"query": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"query": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand Down
4 changes: 2 additions & 2 deletions grafana/dashboards/vampire-drain.json
Original file line number Diff line number Diff line change
Expand Up @@ -606,14 +606,14 @@
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"definition": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"hide": 2,
"includeAll": true,
"label": "Car",
"multi": false,
"name": "car_id",
"options": [],
"query": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"query": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand Down
4 changes: 2 additions & 2 deletions grafana/dashboards/visited.json
Original file line number Diff line number Diff line change
Expand Up @@ -673,14 +673,14 @@
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"definition": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"hide": 2,
"includeAll": true,
"label": "Car",
"multi": false,
"name": "car_id",
"options": [],
"query": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"query": "SELECT COALESCE(name, CONCAT('VIN ', vin)) AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand Down

0 comments on commit 4903ca1

Please sign in to comment.