Skip to content

Commit

Permalink
Added dropdown menu to access all custom dashboards
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosCuezva committed Jan 16, 2023
1 parent 71721db commit 4276548
Show file tree
Hide file tree
Showing 5 changed files with 231 additions and 53 deletions.
60 changes: 49 additions & 11 deletions dashboards/battery-health.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": null,
"iteration": 1673743579151,
"iteration": 1673847679249,
"links": [
{
"asDropdown": false,
Expand All @@ -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",
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -1020,7 +1042,11 @@
"type": "query"
},
{
"current": {},
"current": {
"selected": false,
"text": "rated",
"value": "rated"
},
"datasource": "TeslaMate",
"definition": "select preferred_range from settings;",
"hide": 2,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -1091,8 +1129,8 @@
},
"timepicker": {},
"timezone": "browser",
"title": "Custom - Battery Health",
"title": "Battery Health",
"uid": "eYPXK_24k",
"version": 4,
"version": 6,
"weekStart": ""
}
73 changes: 60 additions & 13 deletions dashboards/charging-costs-stats.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 1,
"id": null,
"iteration": 1673802782897,
"iteration": 1673847676917,
"links": [
{
"icon": "dashboard",
Expand All @@ -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",
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -3182,8 +3229,8 @@
]
},
"timezone": "browser",
"title": "Custom - Charging Costs Stats",
"title": "Charging Costs Stats",
"uid": "LdwdLXt4z",
"version": 4,
"version": 5,
"weekStart": ""
}
42 changes: 34 additions & 8 deletions dashboards/charging-curves.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 1,
"id": null,
"iteration": 1673621413861,
"iteration": 1673847675441,
"links": [
{
"icon": "dashboard",
Expand All @@ -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",
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -543,8 +569,8 @@
]
},
"timezone": "",
"title": "Custom - Charging Curves",
"title": "Charging Curves",
"uid": "bdPvluK4z",
"version": 6,
"version": 5,
"weekStart": ""
}
Loading

0 comments on commit 4276548

Please sign in to comment.