Skip to content

Commit

Permalink
Merge branch 'release/2.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
jheredianet committed Jan 13, 2023
2 parents ca13c22 + 6692a1d commit 3e574fb
Show file tree
Hide file tree
Showing 6 changed files with 563 additions and 457 deletions.
154 changes: 79 additions & 75 deletions dashboards/BatteryHealth.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,43 @@
{
"__elements": [],
"__requires": [
{
"type": "panel",
"id": "bargauge",
"name": "Bar gauge",
"version": ""
},
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "8.5.6"
},
{
"type": "datasource",
"id": "postgres",
"name": "PostgreSQL",
"version": "1.0.0"
},
{
"type": "panel",
"id": "stat",
"name": "Stat",
"version": ""
},
{
"type": "panel",
"id": "text",
"name": "Text",
"version": ""
},
{
"type": "panel",
"id": "timeseries",
"name": "Time series",
"version": ""
}
],
"annotations": {
"list": [
{
Expand All @@ -24,7 +63,8 @@
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 1,
"iteration": 1673555504638,
"id": null,
"iteration": 1673602455096,
"links": [
{
"icon": "dashboard",
Expand All @@ -49,7 +89,7 @@
{
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "TeslaMate"
},
"description": "",
"fieldConfig": {
Expand Down Expand Up @@ -108,7 +148,7 @@
{
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "TeslaMate"
},
"format": "table",
"group": [],
Expand Down Expand Up @@ -144,7 +184,7 @@
{
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "TeslaMate"
},
"description": "",
"fieldConfig": {
Expand Down Expand Up @@ -205,7 +245,7 @@
{
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "TeslaMate"
},
"format": "table",
"group": [],
Expand Down Expand Up @@ -241,7 +281,7 @@
{
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "TeslaMate"
},
"description": "",
"fieldConfig": {
Expand Down Expand Up @@ -290,7 +330,7 @@
{
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "TeslaMate"
},
"format": "table",
"group": [],
Expand Down Expand Up @@ -326,7 +366,7 @@
{
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "TeslaMate"
},
"description": "",
"fieldConfig": {
Expand Down Expand Up @@ -375,7 +415,7 @@
{
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "TeslaMate"
},
"format": "table",
"group": [],
Expand Down Expand Up @@ -411,7 +451,7 @@
{
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "TeslaMate"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -493,7 +533,7 @@
"alias": "",
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "TeslaMate"
},
"format": "time_series",
"group": [],
Expand Down Expand Up @@ -528,7 +568,7 @@
{
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "TeslaMate"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -620,7 +660,7 @@
"alias": "",
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "TeslaMate"
},
"format": "time_series",
"group": [],
Expand Down Expand Up @@ -651,7 +691,7 @@
{
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "TeslaMate"
},
"format": "time_series",
"group": [],
Expand Down Expand Up @@ -688,7 +728,7 @@
{
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "TeslaMate"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -751,7 +791,7 @@
{
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "TeslaMate"
},
"format": "table",
"group": [],
Expand Down Expand Up @@ -813,7 +853,7 @@
{
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "TeslaMate"
},
"description": "",
"fieldConfig": {
Expand Down Expand Up @@ -877,7 +917,7 @@
{
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "TeslaMate"
},
"format": "table",
"group": [],
Expand Down Expand Up @@ -949,7 +989,7 @@
{
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "TeslaMate"
},
"gridPos": {
"h": 5,
Expand All @@ -967,7 +1007,7 @@
{
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "TeslaMate"
},
"format": "time_series",
"group": [],
Expand Down Expand Up @@ -1013,14 +1053,10 @@
"templating": {
"list": [
{
"current": {
"selected": true,
"text": "Ambrosio",
"value": "3"
},
"current": {},
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "TeslaMate"
},
"definition": "SELECT name AS __text, id AS __value FROM cars ORDER BY display_priority ASC, name ASC;",
"hide": 0,
Expand All @@ -1040,14 +1076,10 @@
"useTags": false
},
{
"current": {
"selected": false,
"text": "km",
"value": "km"
},
"current": {},
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "TeslaMate"
},
"definition": "select unit_of_length from settings limit 1;",
"hide": 2,
Expand All @@ -1067,14 +1099,10 @@
"useTags": false
},
{
"current": {
"selected": false,
"text": "rated",
"value": "rated"
},
"current": {},
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "TeslaMate"
},
"definition": "select preferred_range from settings limit 1;",
"hide": 2,
Expand All @@ -1093,14 +1121,10 @@
"useTags": false
},
{
"current": {
"selected": false,
"text": "http://192.168.193.93:4000",
"value": "http://192.168.193.93:4000"
},
"current": {},
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "TeslaMate"
},
"definition": "select base_url from settings limit 1;",
"hide": 2,
Expand All @@ -1120,14 +1144,10 @@
"useTags": false
},
{
"current": {
"selected": false,
"text": "80.66666666666667",
"value": "80.66666666666667"
},
"current": {},
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "TeslaMate"
},
"definition": "WITH lastTopCharges AS (\n SELECT (100.0 * charge_energy_added) / (end_battery_level - start_battery_level) as Battery_Capacity\n FROM charging_processes\n WHERE charge_energy_added > 5 AND car_id = $car_id\n ORDER BY end_date DESC\n LIMIT 5\n)\nSELECT Battery_Capacity FROM lastTopCharges ORDER BY 1 DESC LIMIT 1",
"hide": 2,
Expand All @@ -1143,14 +1163,10 @@
"type": "query"
},
{
"current": {
"selected": false,
"text": "534.6190476190476",
"value": "534.6190476190476"
},
"current": {},
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "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 @@ -1166,14 +1182,10 @@
"type": "query"
},
{
"current": {
"selected": false,
"text": "3.1179299902021875",
"value": "3.1179299902021875"
},
"current": {},
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "TeslaMate"
},
"definition": "WITH lastTopCharges AS (\n SELECT 100-((end_rated_range_km * 100.0)/(end_battery_level * $MaxRange / 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 @@ -1189,14 +1201,10 @@
"type": "query"
},
{
"current": {
"selected": false,
"text": "513.375",
"value": "513.375"
},
"current": {},
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "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 $__timeFilter(date) 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 $__timeFilter(date) and 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 \"Projected [[preferred_range]] range [$length_unit]\" FROM ProjectedRange ORDER BY time DESC LIMIT 1",
"hide": 2,
Expand All @@ -1212,14 +1220,10 @@
"type": "query"
},
{
"current": {
"selected": false,
"text": "84",
"value": "84"
},
"current": {},
"datasource": {
"type": "postgres",
"uid": "PC98BA2F4D77E1A42"
"uid": "TeslaMate"
},
"definition": "SELECT MAX((100.0 * charge_energy_added) / (end_battery_level - start_battery_level)) as Battery_Capacity\n FROM charging_processes\n WHERE charge_energy_added > 5 AND car_id = $car_id",
"description": "Brand new Capacity",
Expand Down Expand Up @@ -1269,6 +1273,6 @@
"timezone": "browser",
"title": "Battery Health",
"uid": "jchmRiqUfXgRx",
"version": 1,
"version": 2,
"weekStart": ""
}
Loading

0 comments on commit 3e574fb

Please sign in to comment.