From 4276548f2842be341000319cc271f65482eeedd5 Mon Sep 17 00:00:00 2001 From: Carlos Cuezva Ticio Date: Mon, 16 Jan 2023 06:49:10 +0100 Subject: [PATCH] Added dropdown menu to access all custom dashboards --- dashboards/battery-health.json | 60 ++++++++++++++++++----- dashboards/charging-costs-stats.json | 73 +++++++++++++++++++++++----- dashboards/charging-curves.json | 42 +++++++++++++--- dashboards/charging-tops.json | 48 ++++++++++++++---- dashboards/current-charge-view.json | 61 ++++++++++++++++++----- 5 files changed, 231 insertions(+), 53 deletions(-) diff --git a/dashboards/battery-health.json b/dashboards/battery-health.json index 438deef..32d4eab 100644 --- a/dashboards/battery-health.json +++ b/dashboards/battery-health.json @@ -21,8 +21,7 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": null, - "iteration": 1673743579151, + "iteration": 1673847679249, "links": [ { "asDropdown": false, @@ -36,6 +35,20 @@ "type": "link", "url": "[[base_url:raw]]" }, + { + "asDropdown": true, + "icon": "external link", + "includeVars": false, + "keepTime": false, + "tags": [ + "customTeslamate" + ], + "targetBlank": false, + "title": "Custom Dashboards", + "tooltip": "", + "type": "dashboards", + "url": "" + }, { "asDropdown": true, "icon": "external link", @@ -982,12 +995,17 @@ "schemaVersion": 36, "style": "dark", "tags": [ - "tesla" + "tesla", + "customTeslamate" ], "templating": { "list": [ { - "current": {}, + "current": { + "selected": false, + "text": "Jo-El", + "value": "1" + }, "datasource": "TeslaMate", "definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;", "hide": 2, @@ -1004,7 +1022,11 @@ "type": "query" }, { - "current": {}, + "current": { + "selected": false, + "text": "km", + "value": "km" + }, "datasource": "TeslaMate", "definition": "select unit_of_length from settings limit 1;", "hide": 2, @@ -1020,7 +1042,11 @@ "type": "query" }, { - "current": {}, + "current": { + "selected": false, + "text": "rated", + "value": "rated" + }, "datasource": "TeslaMate", "definition": "select preferred_range from settings;", "hide": 2, @@ -1036,7 +1062,11 @@ "type": "query" }, { - "current": {}, + "current": { + "selected": false, + "text": "75.78787878787878", + "value": "75.78787878787878" + }, "datasource": "TeslaMate", "definition": "SELECT (100.0 * charge_energy_added) / (end_battery_level - start_battery_level) as battery_capacity\nFROM charging_processes\nWHERE charge_energy_added >= 10 AND car_id = $car_id\nORDER BY end_date DESC\nLIMIT 1;", "hide": 2, @@ -1052,7 +1082,11 @@ "type": "query" }, { - "current": {}, + "current": { + "selected": false, + "text": "4.219903815466555", + "value": "4.219903815466555" + }, "datasource": "TeslaMate", "definition": "WITH lastTopCharges AS (\n SELECT 100-((convert_km(end_rated_range_km, '$length_unit') * 100.0)/(end_battery_level * $max_range / 100.0)) as Battery_Degradation\n FROM charging_processes \n WHERE car_id = $car_id AND end_date IS NOT NULL and charge_energy_added > 5.0 \n ORDER BY end_date DESC \n LIMIT 10\n)\nSELECT battery_degradation FROM lastTopCharges ORDER BY 1 DESC LIMIT 1", "hide": 2, @@ -1068,7 +1102,11 @@ "type": "query" }, { - "current": {}, + "current": { + "selected": false, + "text": "576.9333333333333", + "value": "576.9333333333333" + }, "datasource": "TeslaMate", "definition": "WITH ProjectedRange AS (\nSELECT\n\t$__timeGroup(date, 12h) AS time,\n\tconvert_km((sum([[preferred_range]]_battery_range_km) / nullif(sum(coalesce(usable_battery_level,battery_level)),0) * 100)::numeric, '$length_unit') AS \"Projected [[preferred_range]] range [$length_unit]\"\nFROM\n\t(\n select battery_level, usable_battery_level, date,\n rated_battery_range_km, ideal_battery_range_km, outside_temp\n from positions\n where\n car_id = $car_id and ideal_battery_range_km is not null\n union all\n select battery_level, coalesce(usable_battery_level,battery_level) as usable_battery_level, date,\n rated_battery_range_km, ideal_battery_range_km, outside_temp\n from charges c\n join\n charging_processes p ON p.id = c.charging_process_id \n where\n p.car_id = $car_id\n ) as data\n\nGROUP BY\n\t1\nhaving convert_km((sum([[preferred_range]]_battery_range_km) / nullif(sum(coalesce(usable_battery_level,battery_level)),0) * 100)::numeric, '$length_unit') is not null\nORDER BY\n\t1,2 DESC )\nSELECT max(\"Projected [[preferred_range]] range [$length_unit]\") FROM ProjectedRange \n", "hide": 2, @@ -1091,8 +1129,8 @@ }, "timepicker": {}, "timezone": "browser", - "title": "Custom - Battery Health", + "title": "Battery Health", "uid": "eYPXK_24k", - "version": 4, + "version": 6, "weekStart": "" } \ No newline at end of file diff --git a/dashboards/charging-costs-stats.json b/dashboards/charging-costs-stats.json index 363cc1f..16b7a62 100644 --- a/dashboards/charging-costs-stats.json +++ b/dashboards/charging-costs-stats.json @@ -22,8 +22,7 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 1, - "id": null, - "iteration": 1673802782897, + "iteration": 1673847676917, "links": [ { "icon": "dashboard", @@ -33,6 +32,20 @@ "type": "link", "url": "[[base_url:raw]]" }, + { + "asDropdown": true, + "icon": "external link", + "includeVars": false, + "keepTime": false, + "tags": [ + "customTeslamate" + ], + "targetBlank": false, + "title": "Custom Dashboards", + "tooltip": "", + "type": "dashboards", + "url": "" + }, { "asDropdown": true, "icon": "external link", @@ -3006,12 +3019,17 @@ "schemaVersion": 36, "style": "dark", "tags": [ - "tesla" + "tesla", + "customTeslamate" ], "templating": { "list": [ { - "current": {}, + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, "datasource": "TeslaMate", "definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;", "hide": 2, @@ -3031,7 +3049,11 @@ "useTags": false }, { - "current": {}, + "current": { + "selected": false, + "text": "http://192.168.2.249:4000", + "value": "http://192.168.2.249:4000" + }, "datasource": "TeslaMate", "definition": "select base_url from settings limit 1;", "hide": 2, @@ -3051,7 +3073,11 @@ "useTags": false }, { - "current": {}, + "current": { + "selected": false, + "text": "km", + "value": "km" + }, "datasource": "TeslaMate", "definition": "select unit_of_length from settings limit 1;", "hide": 2, @@ -3070,7 +3096,11 @@ "useTags": false }, { - "current": {}, + "current": { + "selected": false, + "text": "Etc/UTC", + "value": "Etc/UTC" + }, "datasource": "TeslaMate", "definition": "select current_setting('TIMEZONE'), name from pg_timezone_names where abbrev ~ '^[a-zA-Z]{3,4}$' and name not like 'posix%' order by 2;", "hide": 2, @@ -3087,7 +3117,11 @@ "type": "query" }, { - "current": {}, + "current": { + "selected": false, + "text": "C", + "value": "C" + }, "datasource": "TeslaMate", "definition": "select unit_of_temperature from settings limit 1;", "hide": 2, @@ -3103,7 +3137,11 @@ "type": "query" }, { - "current": {}, + "current": { + "selected": false, + "text": "rated", + "value": "rated" + }, "datasource": "TeslaMate", "definition": "select preferred_range from settings limit 1;", "hide": 2, @@ -3119,7 +3157,11 @@ "type": "query" }, { - "current": {}, + "current": { + "selected": false, + "text": "253.1", + "value": "253.1" + }, "datasource": "TeslaMate", "definition": "SELECT\n\tsum(cost)\nFROM\n\tcharging_processes\nWHERE\n\tcar_id = $car_id;", "hide": 2, @@ -3135,7 +3177,12 @@ "type": "query" }, { - "current": {}, + "current": { + "selected": false, + "text": "3964.04", + "value": "3964.04" + }, + "datasource": "TeslaMate", "definition": "SELECT\n\tsum(greatest(charge_energy_added,charge_energy_used))\nFROM\n\tcharging_processes\nWHERE\n\tcar_id = $car_id AND charge_energy_added > 0.01;", "hide": 2, "includeAll": false, @@ -3182,8 +3229,8 @@ ] }, "timezone": "browser", - "title": "Custom - Charging Costs Stats", + "title": "Charging Costs Stats", "uid": "LdwdLXt4z", - "version": 4, + "version": 5, "weekStart": "" } \ No newline at end of file diff --git a/dashboards/charging-curves.json b/dashboards/charging-curves.json index 77a4844..fa8303f 100644 --- a/dashboards/charging-curves.json +++ b/dashboards/charging-curves.json @@ -22,8 +22,7 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 1, - "id": null, - "iteration": 1673621413861, + "iteration": 1673847675441, "links": [ { "icon": "dashboard", @@ -33,6 +32,20 @@ "type": "link", "url": "[[base_url:raw]]" }, + { + "asDropdown": true, + "icon": "external link", + "includeVars": false, + "keepTime": false, + "tags": [ + "customTeslamate" + ], + "targetBlank": false, + "title": "Custom Dashboards", + "tooltip": "", + "type": "dashboards", + "url": "" + }, { "asDropdown": true, "icon": "external link", @@ -447,12 +460,17 @@ "schemaVersion": 36, "style": "dark", "tags": [ - "tesla" + "tesla", + "customTeslamate" ], "templating": { "list": [ { - "current": {}, + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, "datasource": "TeslaMate", "definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;", "hide": 2, @@ -472,7 +490,11 @@ "useTags": false }, { - "current": {}, + "current": { + "selected": false, + "text": "http://192.168.2.249:4000", + "value": "http://192.168.2.249:4000" + }, "datasource": "TeslaMate", "definition": "select base_url from settings limit 1;", "hide": 2, @@ -492,7 +514,11 @@ "useTags": false }, { - "current": {}, + "current": { + "selected": false, + "text": "km", + "value": "km" + }, "datasource": "TeslaMate", "definition": "select unit_of_length from settings limit 1;", "hide": 2, @@ -543,8 +569,8 @@ ] }, "timezone": "", - "title": "Custom - Charging Curves", + "title": "Charging Curves", "uid": "bdPvluK4z", - "version": 6, + "version": 5, "weekStart": "" } \ No newline at end of file diff --git a/dashboards/charging-tops.json b/dashboards/charging-tops.json index 480a2ea..8d4154a 100644 --- a/dashboards/charging-tops.json +++ b/dashboards/charging-tops.json @@ -22,8 +22,7 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 1, - "id": null, - "iteration": 1673743976508, + "iteration": 1673847673250, "links": [ { "icon": "dashboard", @@ -33,6 +32,20 @@ "type": "link", "url": "[[base_url:raw]]" }, + { + "asDropdown": true, + "icon": "external link", + "includeVars": false, + "keepTime": false, + "tags": [ + "customTeslamate" + ], + "targetBlank": false, + "title": "Custom Dashboards", + "tooltip": "", + "type": "dashboards", + "url": "" + }, { "asDropdown": true, "icon": "external link", @@ -1241,12 +1254,17 @@ "schemaVersion": 36, "style": "dark", "tags": [ - "tesla" + "tesla", + "customTeslamate" ], "templating": { "list": [ { - "current": {}, + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, "datasource": "TeslaMate", "definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;", "hide": 2, @@ -1266,7 +1284,11 @@ "useTags": false }, { - "current": {}, + "current": { + "selected": false, + "text": "http://192.168.2.249:4000", + "value": "http://192.168.2.249:4000" + }, "datasource": "TeslaMate", "definition": "select base_url from settings limit 1;", "hide": 2, @@ -1286,7 +1308,11 @@ "useTags": false }, { - "current": {}, + "current": { + "selected": false, + "text": "km", + "value": "km" + }, "datasource": "TeslaMate", "definition": "select unit_of_length from settings limit 1;", "hide": 2, @@ -1305,7 +1331,11 @@ "useTags": false }, { - "current": {}, + "current": { + "selected": false, + "text": "rated", + "value": "rated" + }, "datasource": "TeslaMate", "definition": "select preferred_range from settings limit 1;", "hide": 2, @@ -1353,8 +1383,8 @@ ] }, "timezone": "", - "title": "Custom - Charging Tops", + "title": "Charging Tops", "uid": "DdLe5uFVk", - "version": 7, + "version": 4, "weekStart": "" } \ No newline at end of file diff --git a/dashboards/current-charge-view.json b/dashboards/current-charge-view.json index 221d506..dfa3e97 100644 --- a/dashboards/current-charge-view.json +++ b/dashboards/current-charge-view.json @@ -19,12 +19,10 @@ } ] }, - "description": "", "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 1, - "id": null, - "iteration": 1673743581038, + "iteration": 1673846903359, "links": [ { "icon": "dashboard", @@ -34,6 +32,20 @@ "type": "link", "url": "[[base_url:raw]]" }, + { + "asDropdown": true, + "icon": "external link", + "includeVars": false, + "keepTime": false, + "tags": [ + "customTeslamate" + ], + "targetBlank": false, + "title": "Custom Dashboards", + "tooltip": "", + "type": "dashboards", + "url": "" + }, { "asDropdown": true, "icon": "external link", @@ -1379,12 +1391,17 @@ "schemaVersion": 36, "style": "dark", "tags": [ - "tesla" + "tesla", + "customTeslamate" ], "templating": { "list": [ { - "current": {}, + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, "datasource": "TeslaMate", "definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;", "hide": 2, @@ -1404,7 +1421,11 @@ "useTags": false }, { - "current": {}, + "current": { + "selected": false, + "text": "km", + "value": "km" + }, "datasource": "TeslaMate", "definition": "select unit_of_length from settings limit 1;", "hide": 2, @@ -1423,7 +1444,11 @@ "useTags": false }, { - "current": {}, + "current": { + "selected": false, + "text": "C", + "value": "C" + }, "datasource": "TeslaMate", "definition": "select unit_of_temperature from settings limit 1;", "hide": 2, @@ -1442,7 +1467,11 @@ "useTags": false }, { - "current": {}, + "current": { + "selected": false, + "text": "http://192.168.2.249:4000", + "value": "http://192.168.2.249:4000" + }, "datasource": "TeslaMate", "definition": "select base_url from settings limit 1;", "hide": 2, @@ -1462,7 +1491,11 @@ "useTags": false }, { - "current": {}, + "current": { + "selected": false, + "text": "rated", + "value": "rated" + }, "datasource": "TeslaMate", "definition": "select preferred_range from settings;", "hide": 2, @@ -1478,7 +1511,11 @@ "type": "query" }, { - "current": {}, + "current": { + "selected": false, + "text": "342", + "value": "342" + }, "datasource": "TeslaMate", "definition": "SELECT id\n FROM charging_processes\n WHERE car_id = $car_id\n ORDER BY start_date DESC LIMIT 1", "hide": 2, @@ -1521,8 +1558,8 @@ ] }, "timezone": "", - "title": "Custom - Current Charge View", + "title": "Current Charge View", "uid": "K9VmZD54k", - "version": 5, + "version": 2, "weekStart": "" } \ No newline at end of file