diff --git a/README.md b/README.md index ca1c566..2146544 100644 --- a/README.md +++ b/README.md @@ -122,15 +122,22 @@ ___ ## Screenshots +### [Amortization Tracker](./dashboards/AmortizationTracker.json) + +This dashboard aims to show the depreciation value of the car over time and its journey. +Depreciating a car by its mileage can be done using various methods. A common approach is to use a depreciation rate per mile or to create a depreciation curve based on data. On the other hand, the depreciation of a car due to age can vary depending on several factors such as the make, model, overall condition of the vehicle, and demand in the market. Here you can put your costs, rates and other variable values to have and idea of the depreciated car value and fuel savings. + +![Amortization Tracker](./screenshots/AmortizationTracker.png) + ### [Battery Health](./dashboards/BatteryHealth.json) -This dashboard is already integrated on the core dashboards of Teslamate and will continue developing directly there with the collaboration of all the enthusiasts in the community. +This dashboard has been already migrated (given) to the core dashboards of Teslamate and will continue developing directly there with the collaboration of all the enthusiasts in the community. You will find it there with the same name **Battery Health**. ![Battery Health](./screenshots/BatteryHealth.png) ### [Browse Charges](./dashboards/BrowseCharges.json) -This dasboard is used to browse your charges by Geofence, Location, Type, Cost and Duration in order to have an accurate Total of kWh added and their respective costs. +This dashboard has been already migrated (given) to the core dashboards of Teslamate and will continue developing directly there with the collaboration of all the enthusiasts in the community. You will find it there with the name **Charges**. ![Browse Charges](./screenshots/BrowseCharges.png) @@ -209,8 +216,6 @@ With this dashboard you may find your incomplete drives or charges that have bee ![Incomplete Data](./screenshots/IncompleteData.png) - - ### [Range Degradation](./dashboards/RangeDegradation.json) In this dashboard you may analize your mileage and the range degradation by a selected period. diff --git a/dashboards/AmortizationTracker.json b/dashboards/AmortizationTracker.json new file mode 100644 index 0000000..9613459 --- /dev/null +++ b/dashboards/AmortizationTracker.json @@ -0,0 +1,919 @@ +{ + "__elements": {}, + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "11.1.0" + }, + { + "type": "datasource", + "id": "grafana-postgresql-datasource", + "name": "PostgreSQL", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + }, + { + "type": "panel", + "id": "trend", + "name": "Trend", + "version": "" + }, + { + "type": "panel", + "id": "xychart", + "name": "XY Chart", + "version": "" + } + ], + "annotations": { + "list": [ + { + "$$hashKey": "object:75", + "builtIn": 1, + "datasource": "-- Grafana --", + "definition": "TeslaMate|U2FsdGVkX1/cEWK+8cz7pjEKXtzJnDN7b21ZDXt1MGneFGPWTLqOPtxKmu02mJPLzi/f29I+NBHd3vi0FB8R4Xn0+GtobWDgk6VAVSBTdSNniOKO8i2WPlhRaOsl2+hG7gnZ7wrf1Th2nxR7f1uYCrbwOek0IzkfLzrkjh7gkr6inT6bbDuJqrmogZajLxmAMrQ6V+/vHxBRGiwjJhgiEeq3hM1q2h04JKkNiZ8RHbsF5Cd/xd8Q9u0JVrZzIrtnhM/SFlaApU7RtRMu8CSj1llTX7WEOj6VDZAMSf+XUAanWdk725kEPN9MNu89o2zEq5P3E3cju8IbbBdPzXLV3oVuzD6/tMnxFToIIV1E/BrpF7s2RtNa8+KJJ1PF8xgs6m+/KTD2hy+WsP0636AgObRAmYg7+qotGrgNvpNPdE0EgrB7WHYlV7R/1q66bcq6tCe51X1Un70k+zo+K6AK0o4B1H6IyMlEVuRH/Fz8QVl9aYu2ztd08RbuKJlYVKpkH+pxVETAO9MclYQ90tzE6TfwDZrQZzsAlMenr4s1ZB1OlFXjLjVjnddnUilzO76cqv4yI2THQEuyQ47nuVQ4gUbx02K59vMQhns3C01JOAYokOaSXe66Y7QYdMlk09Lf|aes-256-cbc", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 1, + "id": null, + "links": [ + { + "icon": "dashboard", + "tags": [], + "title": "TeslaMate", + "tooltip": "", + "type": "link", + "url": "[[base_url:raw]]" + }, + { + "asDropdown": true, + "icon": "external link", + "tags": [ + "tesla" + ], + "title": "Dashboards", + "type": "dashboards" + }, + { + "asDropdown": true, + "icon": "external link", + "includeVars": false, + "keepTime": false, + "tags": [ + "TeslamateCustomDashboards" + ], + "targetBlank": false, + "title": "Custom Dashboards", + "tooltip": "", + "type": "dashboards", + "url": "" + } + ], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "datasource", + "uid": "-- Dashboard --" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-RdYlGr" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 13, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "dash": [ + 10, + 10 + ], + "fill": "dash" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "line" + } + }, + "fieldMinMax": false, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 367000 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "car_value_pls_el_savings" + }, + "properties": [ + { + "id": "custom.gradientMode", + "value": "scheme" + }, + { + "id": "displayName", + "value": "Depreciated Car Value + Cumulative Savings" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 16, + "x": 0, + "y": 0 + }, + "id": 76, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "single", + "sort": "none" + }, + "xField": "period_number" + }, + "pluginVersion": "10.4.0", + "targets": [ + { + "datasource": { + "type": "datasource", + "uid": "-- Dashboard --" + }, + "panelId": 77, + "refId": "A" + } + ], + "title": "Break-Even Chart", + "transformations": [ + { + "id": "filterFieldsByName", + "options": { + "include": { + "names": [ + "car_value_pls_el_savings", + "period_number" + ] + } + } + } + ], + "type": "trend" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "TeslaMate" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-YlRd" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "pointSize": { + "fixed": 9 + }, + "scaleDistribution": { + "type": "linear" + }, + "show": "points+lines" + }, + "fieldMinMax": false, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "period_number" + }, + "properties": [ + { + "id": "displayName", + "value": "Period [$period]" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "percent_depreciated" + }, + "properties": [ + { + "id": "displayName", + "value": "Depreciated [%]" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 8, + "x": 16, + "y": 0 + }, + "id": 75, + "options": { + "dims": { + "exclude": [ + "months", + "depreciation_time", + "depreciation_mileage" + ] + }, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "series": [], + "seriesMapping": "auto", + "tooltip": { + "maxHeight": 600, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "10.4.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "TeslaMate" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "WITH periodic_mileage AS (\r\n SELECT\r\n DATE_TRUNC('$period', start_date) AS period_start,\r\n convert_km(SUM(end_km - start_km)::numeric, '$length_unit') AS total_mileage\r\n FROM\r\n drives\r\n WHERE\r\n car_id = $car_id \r\n GROUP BY\r\n period_start\r\n),\r\ncum_mileage AS (\r\n SELECT\r\n ROW_NUMBER() OVER () AS period_number,\r\n period_start,\r\n total_mileage,\r\n SUM(total_mileage) OVER (ORDER BY period_start) AS cum_mileage\r\n FROM\r\n periodic_mileage\r\n),\r\nBreakEven AS (\r\nSELECT\r\n cm.period_number,\r\n cm.cum_mileage * (0.20 / CASE WHEN '$length_unit' = 'mi' THEN 1 ELSE 1.60934 END) AS depreciation_mileage,\r\n ($depreciated_value - (cm.period_number - 1) * 5.0 / 12) AS depreciation_time\r\nFROM\r\n cum_mileage cm\r\nLEFT JOIN\r\n periodic_mileage mm ON cm.period_start = mm.period_start\r\nORDER BY\r\n cm.period_number\r\n)\r\nSELECT \r\n period_number,\r\n ($car_cost - depreciation_mileage - (($car_cost - depreciation_mileage) * depreciation_time / 100)) * 100 / $car_cost AS percent_depreciated\r\nFROM BreakEven", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Depreciation over time", + "type": "xychart" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "TeslaMate" + }, + "fieldConfig": { + "defaults": { + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false, + "minWidth": 100 + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "period_number" + }, + "properties": [ + { + "id": "displayName", + "value": "Period [$period]" + }, + { + "id": "custom.width", + "value": 120 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "periodic_mileage" + }, + "properties": [ + { + "id": "displayName", + "value": "Mileage [$length_unit]" + }, + { + "id": "custom.width", + "value": 110 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "period_el_cost" + }, + "properties": [ + { + "id": "displayName", + "value": "Energy Cost" + }, + { + "id": "custom.width", + "value": 100 + }, + { + "id": "decimals", + "value": 2 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "period_cost_per_mileage" + }, + "properties": [ + { + "id": "displayName", + "value": "Cost per $length_unit" + }, + { + "id": "custom.width", + "value": 105 + }, + { + "id": "decimals", + "value": 2 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "cum_mileage" + }, + "properties": [ + { + "id": "displayName", + "value": "Cumulative Mileage" + }, + { + "id": "custom.width", + "value": 150 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "cum_el_cost" + }, + "properties": [ + { + "id": "displayName", + "value": "Cumulative Energy Cost" + }, + { + "id": "custom.width", + "value": 180 + }, + { + "id": "decimals", + "value": 2 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "cum_el_savings" + }, + "properties": [ + { + "id": "displayName", + "value": "Cumulative Savings" + }, + { + "id": "custom.width", + "value": 150 + }, + { + "id": "decimals", + "value": 2 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "depreciated_car_value" + }, + "properties": [ + { + "id": "displayName", + "value": "Depreciated Car Value" + }, + { + "id": "custom.width", + "value": 180 + }, + { + "id": "decimals", + "value": 2 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "car_value_pls_el_savings" + }, + "properties": [ + { + "id": "displayName", + "value": "Depreciated Car Value + Savings" + }, + { + "id": "decimals", + "value": 2 + }, + { + "id": "custom.align", + "value": "center" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "depreciation_mileage" + }, + "properties": [ + { + "id": "displayName", + "value": "Depreciation per $length_unit" + }, + { + "id": "decimals", + "value": 2 + }, + { + "id": "custom.width", + "value": 160 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "depreciation_time" + }, + "properties": [ + { + "id": "displayName", + "value": "Depreciation per age" + }, + { + "id": "decimals", + "value": 1 + }, + { + "id": "custom.width", + "value": 160 + }, + { + "id": "unit", + "value": "percent" + } + ] + } + ] + }, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 10 + }, + "id": 77, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true + }, + "pluginVersion": "11.1.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "TeslaMate" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "WITH periodic_mileage AS (\r\n SELECT\r\n DATE_TRUNC('$period', start_date) AS period_start,\r\n convert_km(SUM(end_km - start_km)::numeric, '$length_unit') AS total_mileage\r\n FROM\r\n drives\r\n WHERE\r\n car_id = $car_id \r\n GROUP BY\r\n period_start\r\n),\r\nperiod_cost AS (\r\n SELECT\r\n DATE_TRUNC('$period', start_date) AS period_start,\r\n SUM(cost) AS total_cost\r\n FROM\r\n charging_processes \r\n WHERE\r\n car_id = $car_id \r\n GROUP BY\r\n DATE_TRUNC('$period', start_date)\r\n),\r\ncum_mileage AS (\r\n SELECT\r\n ROW_NUMBER() OVER () AS period_number,\r\n period_start,\r\n total_mileage,\r\n SUM(total_mileage) OVER (ORDER BY period_start) AS cum_mileage\r\n FROM\r\n periodic_mileage\r\n),\r\ncum_cost AS (\r\n SELECT\r\n ROW_NUMBER() OVER () AS period_number,\r\n period_start,\r\n total_cost,\r\n SUM(total_cost) OVER (ORDER BY period_start) AS cum_el_cost\r\n FROM\r\n period_cost\r\n),\r\ncar_current_value AS (\r\n SELECT\r\n $car_cost AS car_current_value\r\n),\r\nBreakEven AS (\r\nSELECT\r\n cm.period_number,\r\n mm.total_mileage AS periodic_mileage,\r\n mc.total_cost AS period_el_cost,\r\n mc.total_cost/mm.total_mileage AS period_cost_per_mileage,\r\n cm.cum_mileage,\r\n cc.cum_el_cost,\r\n cm.cum_mileage * ($loss_rate / CASE WHEN '$length_unit' = 'mi' THEN 1 ELSE 1.60934 END) AS depreciation_mileage,\r\n ($depreciated_value - (cm.period_number - 1) * 5.0 / CASE WHEN '$period' = 'year' THEN 1 ELSE 12 END) AS depreciation_time,\r\n cm.cum_mileage * $fuel_price - cc.cum_el_cost AS cum_el_savings, car_current_value\r\nFROM\r\n cum_mileage cm\r\nLEFT JOIN\r\n cum_cost cc ON cm.period_number = cc.period_number\r\nLEFT JOIN\r\n periodic_mileage mm ON cm.period_start = mm.period_start\r\nLEFT JOIN\r\n period_cost mc ON cm.period_start = mc.period_start\r\nCROSS JOIN\r\n car_current_value\r\nORDER BY\r\n cm.period_number\r\n)\r\nSELECT \r\n period_number, periodic_mileage, period_el_cost, period_cost_per_mileage, cum_mileage, cum_el_cost, depreciation_mileage, depreciation_time, cum_el_savings,\r\n car_current_value - depreciation_mileage - ((car_current_value - depreciation_mileage) * depreciation_time / 100) AS depreciated_car_value,\r\n (car_current_value - depreciation_mileage - ((car_current_value - depreciation_mileage) * depreciation_time / 100)) + (cum_mileage * $fuel_price - cum_el_cost) AS car_value_pls_el_savings\r\nFROM BreakEven", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Break-Even Table", + "type": "table" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 16 + }, + "id": 79, + "panels": [], + "title": "Help", + "type": "row" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "TeslaMate" + }, + "gridPos": { + "h": 29, + "w": 24, + "x": 0, + "y": 17 + }, + "id": 78, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "# Return of investment\n\nThis dashboard aims to show the depreciation value of the car over time and its journey.\n\nDepreciating a car by its mileage can be done using various methods. A common approach is to use a depreciation rate per mile or to create a depreciation curve based on data. On the other hand, the depreciation of a car due to age can vary depending on several factors such as the make, model, overall condition of the vehicle, and demand in the market.\n\nGenerally, it is estimated that a new car loses approximately 15% to 20% of its value in the first year. From there, the rate of depreciation tends to gradually decrease. Below is a rough estimate of the annual depreciation in the first few years:\n\n- First year: Around 15% to 20%.\n- Second year: Around 10% to 15%.\n- Third year and beyond: Around 5% to 10% annually.\n\nIt is important to remember that these values ​​are approximate and may vary depending on individual circumstances. Also, some car models may hold their value better than others.\n\nAditionally, some studies and experts suggest that a car loses a certain amount of value per mile driven. For instance, here we are using a standard rate 0.20 (use your currency) per mile or kilometer (depending on your prefered length unit)\n\n## Considerations for values ​​in text boxes\n\nIn this panel we have both estimations: **Drepreciation per Mileage** and **Depreciation per Age**\n\nSo fist of all you have to select:\n\n- Period to estimate (yearly or monthly)\n- Cost of your car\n- Depreciation percent % (of the first year). 20% by default as explained before\n- Loss rate per mile of kilometer. 0.2 (your currency) by default as explained before\n- Fuel price per mile of kilometer of your previous car (or a generic on equivalent to your actual Tesla)\n \n To calculate the cost per miles/kilometer of your car, you first need to determine how much it consumes in liters per 100 miles/kilometers. Then you can divide Consumption by mileage.\n\n For example: let's say a car consumes 6 liters per 100km and the fuel costs 1.8€ per liter, we can calculate the actual consumption: 6/100 = 0.06 L/km\n \n Now, to determine the cost per kilometer, we multiply the actual consumption by the price of a liter of fuel (use your currency). For example 0.06L/km × 1.8€/L =0.108€/km (use miles or kms).\n \n Therefore, the cost per kilometer for your car would be approximately 0.108€. That's the value expected on the Fuel price textbox.\n\n## Data shown in the table\n\n- **Period**: Could be 'month' or 'year' dependig what you've selected in the drop down list. So if selected as 'month', its going to be the data accumulated from 1st month at which TeslaMate started logging data, So 1,2,3 will be the month numbers. If \"period\" is selcted as 'year', then its the year numbers.\n- **Mileage**: is the number of kms/miles (depending on your prefered length unit) the car has driven in that period.\n- **Energy Cost**: is the cost spent for electricity in that particular period.\n- **Cost per km or mi** is *energy cost* / *Mileage*\n- **Cumulative Mileage** is the cumulative mileage for that particular period.\n- **Cumulative Cost** is the cumulative cost for electricity for that particular period.\n- **Depreciation per km or mi** is the depreciation by mileage explained at the begining.\n- **Depreciation per age** is the depreciation by time explained at the begining.\n- **Cumulative Savings** is running cost savings for driving an electric car when compared to a fossil fuel car, based on the value enter in the *Fuel price* textbox.\n- **Depreciated Car Value** is the estimated actual price based on the depreciation per age and mileage. \n- **Depreciated Car Value + Savings** is simply adding *Depreciated Car Value* + *Cumulative Savings*. So the expectation is like when one can get the Break-Even for the money we put into buying the car by driving at a cheaper electricity cost when compared to driving a fossil fuel car.\n", + "mode": "markdown" + }, + "pluginVersion": "11.1.0", + "type": "text" + } + ], + "refresh": "", + "schemaVersion": 39, + "tags": [ + "TeslamateCustomDashboards" + ], + "templating": { + "list": [ + { + "current": {}, + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "TeslaMate" + }, + "definition": "SELECT name 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;", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "current": {}, + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "TeslaMate" + }, + "definition": "select base_url from settings limit 1;", + "hide": 2, + "includeAll": false, + "label": "", + "multi": false, + "name": "base_url", + "options": [], + "query": "select base_url from settings limit 1;", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "current": {}, + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "TeslaMate" + }, + "definition": "select unit_of_length from settings limit 1;", + "hide": 2, + "includeAll": false, + "multi": false, + "name": "length_unit", + "options": [], + "query": "select unit_of_length from settings limit 1;", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "auto": false, + "auto_count": 30, + "auto_min": "10s", + "current": { + "selected": true, + "text": "year", + "value": "year" + }, + "hide": 0, + "name": "period", + "options": [ + { + "selected": true, + "text": "month", + "value": "month" + }, + { + "selected": false, + "text": "year", + "value": "year" + } + ], + "query": "month, year", + "queryValue": "", + "refresh": 2, + "skipUrlSync": false, + "type": "interval" + }, + { + "current": { + "selected": false, + "text": "40000", + "value": "40000" + }, + "description": "Cost of the car to be recovered over time", + "hide": 0, + "label": "Cost of the car", + "name": "car_cost", + "options": [ + { + "selected": true, + "text": "40000", + "value": "40000" + } + ], + "query": "40000", + "skipUrlSync": false, + "type": "textbox" + }, + { + "current": { + "selected": false, + "text": "20", + "value": "20" + }, + "description": "Depreciation percentage for age (first year %)", + "hide": 0, + "label": "Depreciation percentage", + "name": "depreciated_value", + "options": [ + { + "selected": true, + "text": "20", + "value": "20" + } + ], + "query": "20", + "skipUrlSync": false, + "type": "textbox" + }, + { + "current": { + "selected": false, + "text": "0.20", + "value": "0.20" + }, + "description": "Loss per mile or km driven", + "hide": 0, + "label": "Loss rate per mileage", + "name": "loss_rate", + "options": [ + { + "selected": true, + "text": "0.20", + "value": "0.20" + } + ], + "query": "0.20", + "skipUrlSync": false, + "type": "textbox" + }, + { + "current": { + "selected": false, + "text": "0.108", + "value": "0.108" + }, + "description": "Fuel price per mile or km driven on a combustion car", + "hide": 0, + "label": "Fuel price", + "name": "fuel_price", + "options": [ + { + "selected": true, + "text": "0.108", + "value": "0.108" + } + ], + "query": "0.108", + "skipUrlSync": false, + "type": "textbox" + } + ] + }, + "time": { + "from": "now-5y", + "to": "now" + }, + "timepicker": { + "hidden": true, + "refresh_intervals": [], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "browser", + "title": "Return on Investment", + "uid": "jchmAdd4SiQgWa", + "version": 1, + "weekStart": "" +} \ No newline at end of file diff --git a/dashboards/BrowseCharges.json b/dashboards/BrowseCharges.json deleted file mode 100644 index 40571e6..0000000 --- a/dashboards/BrowseCharges.json +++ /dev/null @@ -1,1561 +0,0 @@ -{ - "__elements": {}, - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "10.4.0" - }, - { - "type": "datasource", - "id": "grafana-postgresql-datasource", - "name": "PostgreSQL", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "stat", - "name": "Stat", - "version": "" - }, - { - "type": "panel", - "id": "table", - "name": "Table", - "version": "" - } - ], - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "definition": "TeslaMate|U2FsdGVkX1/cEWK+8cz7pjEKXtzJnDN7b21ZDXt1MGneFGPWTLqOPtxKmu02mJPLzi/f29I+NBHd3vi0FB8R4Xn0+GtobWDgk6VAVSBTdSNniOKO8i2WPlhRaOsl2+hG7gnZ7wrf1Th2nxR7f1uYCrbwOek0IzkfLzrkjh7gkr6inT6bbDuJqrmogZajLxmAMrQ6V+/vHxBRGiwjJhgiEeq3hM1q2h04JKkNiZ8RHbsF5Cd/xd8Q9u0JVrZzIrtnhM/SFlaApU7RtRMu8CSj1llTX7WEOj6VDZAMSf+XUAanWdk725kEPN9MNu89o2zEq5P3E3cju8IbbBdPzXLV3oVuzD6/tMnxFToIIV1E/BrpF7s2RtNa8+KJJ1PF8xgs6m+/KTD2hy+WsP0636AgObRAmYg7+qotGrgNvpNPdE0EgrB7WHYlV7R/1q66bcq6tCe51X1Un70k+zo+K6AK0o4B1H6IyMlEVuRH/Fz8QVl9aYu2ztd08RbuKJlYVKpkH+pxVETAO9MclYQ90tzE6TfwDZrQZzsAlMenr4s1ZB1OlFXjLjVjnddnUilzO76cqv4yI2THQEuyQ47nuVQ4gUbx02K59vMQhns3C01JOAYokOaSXe66Y7QYdMlk09Lf|aes-256-cbc", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "target": { - "limit": 100, - "matchAny": false, - "tags": [], - "type": "dashboard" - }, - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": null, - "links": [ - { - "icon": "dashboard", - "tags": [], - "title": "TeslaMate", - "tooltip": "", - "type": "link", - "url": "[[base_url:raw]]" - }, - { - "asDropdown": true, - "icon": "external link", - "tags": [ - "tesla" - ], - "title": "Dashboards", - "type": "dashboards" - }, - { - "asDropdown": true, - "icon": "external link", - "includeVars": false, - "keepTime": false, - "tags": [ - "TeslamateCustomDashboards" - ], - "targetBlank": false, - "title": "Custom Dashboards", - "tooltip": "", - "type": "dashboards", - "url": "" - } - ], - "liveNow": false, - "panels": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "TeslaMate" - }, - "description": "Browse your charges by Geofence, Location, Type, Cost and Duration in order to have an accurate Total of kWh added and their respective costs", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "center", - "cellOptions": { - "type": "auto" - }, - "filterable": false, - "inspect": false, - "minWidth": 150 - }, - "decimals": 2, - "displayName": "", - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "short" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "start_date" - }, - "properties": [ - { - "id": "displayName", - "value": "Date" - }, - { - "id": "unit", - "value": "dateTimeAsLocal" - }, - { - "id": "links", - "value": [ - { - "targetBlank": false, - "title": "View charge details", - "url": "d/BHhxFeZRz?from=${__data.fields.start_date_ts.numeric}&to=${__data.fields.end_date_ts.numeric}&var-car_id=${__data.fields.car_id.numeric}&var-charging_process_id=${__data.fields.id.numeric}" - } - ] - }, - { - "id": "custom.align" - }, - { - "id": "custom.minWidth", - "value": 160 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "charge_energy_added" - }, - "properties": [ - { - "id": "displayName", - "value": "Added" - }, - { - "id": "unit", - "value": "kwatth" - }, - { - "id": "decimals", - "value": 2 - }, - { - "id": "custom.minWidth", - "value": 80 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "start_battery_level" - }, - "properties": [ - { - "id": "displayName", - "value": "% Start" - }, - { - "id": "unit", - "value": "percent" - }, - { - "id": "custom.align" - }, - { - "id": "decimals", - "value": 0 - }, - { - "id": "custom.minWidth", - "value": 62 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "end_battery_level" - }, - "properties": [ - { - "id": "displayName", - "value": "% End" - }, - { - "id": "unit", - "value": "percent" - }, - { - "id": "custom.align" - }, - { - "id": "decimals", - "value": 0 - }, - { - "id": "custom.minWidth", - "value": 62 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "duration_min" - }, - "properties": [ - { - "id": "displayName", - "value": "Duration" - }, - { - "id": "unit", - "value": "m" - }, - { - "id": "decimals", - "value": 1 - }, - { - "id": "custom.align" - }, - { - "id": "custom.minWidth", - "value": 75 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "outside_temp_avg_c" - }, - "properties": [ - { - "id": "displayName", - "value": "Temp" - }, - { - "id": "unit", - "value": "celsius" - }, - { - "id": "decimals", - "value": 1 - }, - { - "id": "custom.cellOptions", - "value": { - "type": "color-text" - } - }, - { - "id": "custom.align" - }, - { - "id": "thresholds", - "value": { - "mode": "absolute", - "steps": [ - { - "color": "#C0D8FF", - "value": null - }, - { - "color": "#C8F2C2", - "value": 10 - }, - { - "color": "#FFA6B0", - "value": 20 - } - ] - } - }, - { - "id": "custom.minWidth", - "value": 70 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "cost" - }, - "properties": [ - { - "id": "displayName", - "value": "Cost" - }, - { - "id": "unit", - "value": "none" - }, - { - "id": "decimals", - "value": 2 - }, - { - "id": "links", - "value": [ - { - "targetBlank": false, - "title": "Set Cost", - "url": "[[base_url:raw]]/charge-cost/${__data.fields.id.numeric}" - } - ] - }, - { - "id": "custom.align" - }, - { - "id": "noValue", - "value": "-" - }, - { - "id": "custom.minWidth", - "value": 65 - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/.*_ts/" - }, - "properties": [ - { - "id": "unit", - "value": "short" - }, - { - "id": "decimals", - "value": 2 - }, - { - "id": "custom.align" - }, - { - "id": "custom.hidden", - "value": true - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "id" - }, - "properties": [ - { - "id": "unit", - "value": "short" - }, - { - "id": "decimals", - "value": 2 - }, - { - "id": "custom.align" - }, - { - "id": "custom.hidden", - "value": true - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "address" - }, - "properties": [ - { - "id": "displayName", - "value": "Location" - }, - { - "id": "unit", - "value": "short" - }, - { - "id": "decimals", - "value": 2 - }, - { - "id": "links", - "value": [ - { - "targetBlank": true, - "title": "Create or edit geo-fence", - "url": "[[base_url:raw]]/geo-fences/${__data.fields.path}" - } - ] - }, - { - "id": "custom.align" - }, - { - "id": "custom.minWidth", - "value": 300 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "distance_km" - }, - "properties": [ - { - "id": "displayName", - "value": "Driven" - }, - { - "id": "unit", - "value": "lengthkm" - }, - { - "id": "custom.align" - }, - { - "id": "decimals", - "value": 0 - }, - { - "id": "custom.minWidth", - "value": 90 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "charge_energy_added_per_hour" - }, - "properties": [ - { - "id": "displayName", - "value": "kW" - }, - { - "id": "unit", - "value": "kwatt" - }, - { - "id": "decimals", - "value": 1 - }, - { - "id": "custom.cellOptions", - "value": { - "type": "color-text" - } - }, - { - "id": "custom.align" - }, - { - "id": "thresholds", - "value": { - "mode": "absolute", - "steps": [ - { - "color": "#96D98D", - "value": null - }, - { - "color": "#56A64B", - "value": 20 - }, - { - "color": "#37872D", - "value": 55 - } - ] - } - }, - { - "id": "custom.minWidth", - "value": 70 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "range_added_per_hour_km" - }, - "properties": [ - { - "id": "displayName", - "value": "Range added" - }, - { - "id": "unit", - "value": "velocitykmh" - }, - { - "id": "custom.align" - }, - { - "id": "decimals", - "value": 0 - }, - { - "id": "custom.minWidth", - "value": 120 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "outside_temp_avg_f" - }, - "properties": [ - { - "id": "displayName", - "value": "Temp" - }, - { - "id": "unit", - "value": "fahrenheit" - }, - { - "id": "decimals", - "value": 1 - }, - { - "id": "custom.align" - }, - { - "id": "custom.minWidth", - "value": 70 - }, - { - "id": "custom.cellOptions", - "value": { - "type": "color-text" - } - }, - { - "id": "thresholds", - "value": { - "mode": "absolute", - "steps": [ - { - "color": "super-light-blue", - "value": null - }, - { - "color": "super-light-green", - "value": 50 - }, - { - "color": "super-light-red", - "value": 68 - } - ] - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "distance_mi" - }, - "properties": [ - { - "id": "displayName", - "value": "Driven" - }, - { - "id": "unit", - "value": "lengthmi" - }, - { - "id": "custom.align" - }, - { - "id": "decimals", - "value": 0 - }, - { - "id": "custom.minWidth", - "value": 90 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "range_added_per_hour_mi" - }, - "properties": [ - { - "id": "displayName", - "value": "Range added" - }, - { - "id": "unit", - "value": "velocitymph" - }, - { - "id": "custom.align" - }, - { - "id": "decimals", - "value": 0 - }, - { - "id": "custom.minWidth", - "value": 120 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "path" - }, - "properties": [ - { - "id": "unit", - "value": "short" - }, - { - "id": "decimals", - "value": 2 - }, - { - "id": "custom.align" - }, - { - "id": "custom.hidden", - "value": true - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "charge_energy_used" - }, - "properties": [ - { - "id": "displayName", - "value": "Used" - }, - { - "id": "unit", - "value": "kwatth" - }, - { - "id": "decimals", - "value": 2 - }, - { - "id": "custom.align" - }, - { - "id": "custom.minWidth", - "value": 85 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "charging_efficiency" - }, - "properties": [ - { - "id": "displayName", - "value": "Efficiency" - }, - { - "id": "unit", - "value": "percentunit" - }, - { - "id": "custom.align", - "value": "auto" - }, - { - "id": "decimals", - "value": 0 - }, - { - "id": "custom.cellOptions", - "value": { - "mode": "basic", - "type": "gauge" - } - }, - { - "id": "color", - "value": { - "mode": "continuous-RdYlGr" - } - }, - { - "id": "max", - "value": 1 - }, - { - "id": "custom.minWidth", - "value": 100 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "car_id" - }, - "properties": [ - { - "id": "unit", - "value": "short" - }, - { - "id": "decimals", - "value": 2 - }, - { - "id": "custom.align" - }, - { - "id": "custom.hidden", - "value": true - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "end_date" - }, - "properties": [ - { - "id": "unit", - "value": "short" - }, - { - "id": "decimals", - "value": 2 - }, - { - "id": "custom.align" - }, - { - "id": "custom.hidden", - "value": true - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "cost_per_kwh" - }, - "properties": [ - { - "id": "unit", - "value": "none" - }, - { - "id": "displayName", - "value": "Cost/kWh" - }, - { - "id": "decimals", - "value": 2 - }, - { - "id": "noValue", - "value": "-" - }, - { - "id": "custom.minWidth", - "value": 80 - }, - { - "id": "custom.align", - "value": "right" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "charge_type" - }, - "properties": [ - { - "id": "displayName", - "value": "Type" - }, - { - "id": "custom.cellOptions", - "value": { - "type": "color-text" - } - }, - { - "id": "custom.cellOptions", - "value": { - "type": "color-text" - } - }, - { - "id": "color", - "value": { - "fixedColor": "super-light-blue", - "mode": "fixed" - } - }, - { - "id": "custom.minWidth", - "value": 40 - } - ] - } - ] - }, - "gridPos": { - "h": 21, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 6, - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true, - "sortBy": [] - }, - "pluginVersion": "10.4.0", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "TeslaMate" - }, - "format": "table", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "WITH data AS (\n SELECT\n (round(extract(epoch FROM start_date) - 10) * 1000) AS start_date_ts,\n (round(extract(epoch FROM end_date) + 10) * 1000) AS end_date_ts,\n start_date,\n end_date,\n CONCAT_WS(', ', COALESCE(addresses.name, nullif(CONCAT_WS(' ', addresses.road, addresses.house_number), '')), addresses.city) AS address,\n g.name as geofence_name,\n g.id as geofence_id,\n p.latitude,\n p.longitude,\n cp.charge_energy_added,\n cp.charge_energy_used,\n duration_min,\n start_battery_level,\n end_battery_level,\n start_[[preferred_range]]_range_km,\n end_[[preferred_range]]_range_km,\n outside_temp_avg,\n cp.id,\n lag(end_[[preferred_range]]_range_km) OVER (ORDER BY start_date) - start_[[preferred_range]]_range_km AS range_loss,\n p.odometer - lag(p.odometer) OVER (ORDER BY start_date) AS distance,\n cars.efficiency,\n cp.car_id,\n cost,\n max(c.charger_voltage) as max_charger_voltage,\n CASE WHEN NULLIF(mode() within group (order by charger_phases),0) is null THEN 'DC' ELSE 'AC' END AS charge_type\n FROM\n charging_processes cp\n\t LEFT JOIN charges c ON cp.id = c.charging_process_id\n LEFT JOIN positions p ON p.id = cp.position_id\n LEFT JOIN cars ON cars.id = cp.car_id\n LEFT JOIN addresses ON addresses.id = cp.address_id\n LEFT JOIN geofences g ON g.id = geofence_id\nWHERE \n cp.car_id = $car_id AND\n $__timeFilter(start_date) AND\n (cp.charge_energy_added IS NULL OR cp.charge_energy_added > 0) AND\n ('${geofence:pipe}' = '-1' OR geofence_id in ($geofence))\nGROUP BY 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11,12,13,14,15,16,17,18,21,p.odometer\nORDER BY\n start_date\n)\nSELECT\n start_date_ts,\n end_date_ts,\n CASE WHEN geofence_id IS NULL THEN CONCAT('new?lat=', latitude, '&lng=', longitude)\n WHEN geofence_id IS NOT NULL THEN CONCAT(geofence_id, '/edit')\n END as path,\n car_id,\n id,\n -- Columns\n start_date,\n end_date,\n COALESCE(geofence_name, address) as address, \n charge_type,\n duration_min,\n cost,\n cost / NULLIF(greatest(charge_energy_added, charge_energy_used), 0) as cost_per_kwh,\n charge_energy_added,\n charge_energy_used,\n CASE WHEN charge_energy_used IS NULL THEN NULL ELSE LEAST(charge_energy_added / NULLIF(charge_energy_used, 0), 1.0) END as charging_efficiency,\n convert_celsius(outside_temp_avg, '$temp_unit') AS outside_temp_avg_$temp_unit,\n charge_energy_added * 60 / NULLIF (duration_min, 0) AS charge_energy_added_per_hour,\n convert_km((end_[[preferred_range]]_range_km - start_[[preferred_range]]_range_km) * 60 / NULLIF (duration_min, 0), '$length_unit') AS range_added_per_hour_$length_unit,\n start_battery_level,\n end_battery_level,\n convert_km(distance::numeric, '$length_unit') AS distance_$length_unit\n FROM\n data\nWHERE\n (distance >= 0 OR distance IS NULL)\n AND duration_min >= '$min_duration_min'\n AND CASE WHEN $cost = 0 THEN (cost IS NULL OR cost >= 0) ELSE cost >= $cost END\n AND charge_type = ANY(CASE WHEN array_to_string(ARRAY[$charge_type], ',') = 'DC' THEN ARRAY['DC'] WHEN array_to_string(ARRAY[$charge_type], ',') = 'AC' THEN ARRAY['AC'] ELSE ARRAY['DC', 'AC'] END)\n AND address ILIKE '%$location%'\nORDER BY\n start_date DESC;", - "refId": "A", - "select": [ - [ - { - "params": [ - "value" - ], - "type": "column" - } - ] - ], - "timeColumn": "time", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "title": "Charges: $charge_type", - "type": "table" - }, - { - "datasource": { - "type": "datasource", - "uid": "-- Dashboard --" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" - } - }, - "type": "special" - } - ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "kwatth" - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 7, - "x": 0, - "y": 21 - }, - "id": 10, - "maxDataPoints": 100, - "options": { - "colorMode": "none", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "sum" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "10.4.0", - "targets": [ - { - "datasource": { - "type": "datasource", - "uid": "-- Dashboard --" - }, - "panelId": 6, - "refId": "A" - } - ], - "title": "Energy added", - "transformations": [ - { - "id": "filterFieldsByName", - "options": { - "include": { - "names": [ - "charge_energy_added" - ] - } - } - } - ], - "transparent": true, - "type": "stat" - }, - { - "datasource": { - "type": "datasource", - "uid": "-- Dashboard --" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" - } - }, - "type": "special" - } - ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "kwatth" - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 7, - "x": 7, - "y": 21 - }, - "id": 12, - "maxDataPoints": 100, - "options": { - "colorMode": "none", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "sum" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "10.4.0", - "targets": [ - { - "datasource": { - "type": "datasource", - "uid": "-- Dashboard --" - }, - "panelId": 6, - "refId": "A" - } - ], - "title": "Energy used", - "transformations": [ - { - "id": "filterFieldsByName", - "options": { - "include": { - "names": [ - "charge_energy_used" - ] - } - } - } - ], - "transparent": true, - "type": "stat" - }, - { - "datasource": { - "type": "datasource", - "uid": "-- Dashboard --" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "decimals": 2, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" - } - }, - "type": "special" - } - ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "none" - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 5, - "x": 14, - "y": 21 - }, - "id": 14, - "maxDataPoints": 100, - "options": { - "colorMode": "none", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "sum" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "10.4.0", - "targets": [ - { - "datasource": { - "type": "datasource", - "uid": "-- Dashboard --" - }, - "panelId": 6, - "refId": "A" - } - ], - "title": "Cost", - "transformations": [ - { - "id": "filterFieldsByName", - "options": { - "include": { - "names": [ - "cost" - ] - } - } - } - ], - "transparent": true, - "type": "stat" - }, - { - "datasource": { - "type": "datasource", - "uid": "-- Dashboard --" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "decimals": 0, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" - } - }, - "type": "special" - } - ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "m" - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 5, - "x": 19, - "y": 21 - }, - "id": 15, - "maxDataPoints": 100, - "options": { - "colorMode": "none", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "mean" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "10.4.0", - "targets": [ - { - "datasource": { - "type": "datasource", - "uid": "-- Dashboard --" - }, - "panelId": 6, - "refId": "A" - } - ], - "title": "Average Duration", - "transformations": [ - { - "id": "filterFieldsByName", - "options": { - "include": { - "names": [ - "duration_min" - ] - } - } - } - ], - "transparent": true, - "type": "stat" - } - ], - "refresh": "", - "schemaVersion": 39, - "tags": [ - "TeslamateCustomDashboards" - ], - "templating": { - "list": [ - { - "current": {}, - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "TeslaMate" - }, - "definition": "SELECT name 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;", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "current": {}, - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "TeslaMate" - }, - "definition": "select unit_of_length from settings limit 1;", - "hide": 2, - "includeAll": false, - "label": "", - "multi": false, - "name": "length_unit", - "options": [], - "query": "select unit_of_length from settings limit 1;", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "current": {}, - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "TeslaMate" - }, - "definition": "select unit_of_temperature from settings limit 1;", - "hide": 2, - "includeAll": false, - "label": "", - "multi": false, - "name": "temp_unit", - "options": [], - "query": "select unit_of_temperature from settings limit 1;", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "current": {}, - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "TeslaMate" - }, - "definition": "select preferred_range from settings limit 1;", - "hide": 2, - "includeAll": false, - "multi": false, - "name": "preferred_range", - "options": [], - "query": "select preferred_range from settings limit 1;", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "current": {}, - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "TeslaMate" - }, - "definition": "select base_url from settings limit 1;", - "hide": 2, - "includeAll": false, - "multi": false, - "name": "base_url", - "options": [], - "query": "select base_url from settings limit 1;", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": "-1", - "current": {}, - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "TeslaMate" - }, - "definition": "SELECT name AS __text, id AS __value FROM geofences ORDER BY name COLLATE \"C\" ASC;", - "hide": 0, - "includeAll": true, - "label": "Geofence", - "multi": true, - "name": "geofence", - "options": [], - "query": "SELECT name AS __text, id AS __value FROM geofences ORDER BY name COLLATE \"C\" ASC;", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "current": { - "selected": false, - "text": "", - "value": "" - }, - "description": "Type a text contained in Location", - "hide": 0, - "label": "Location", - "name": "location", - "options": [ - { - "selected": true, - "text": "", - "value": "" - } - ], - "query": "", - "skipUrlSync": false, - "type": "textbox" - }, - { - "allValue": "", - "current": { - "selected": false, - "text": [ - "All" - ], - "value": [ - "$__all" - ] - }, - "hide": 0, - "includeAll": true, - "label": "Type", - "multi": true, - "name": "charge_type", - "options": [ - { - "selected": true, - "text": "All", - "value": "$__all" - }, - { - "selected": false, - "text": "AC", - "value": "AC" - }, - { - "selected": false, - "text": "DC", - "value": "DC" - } - ], - "query": "AC, DC", - "queryValue": "", - "skipUrlSync": false, - "type": "custom" - }, - { - "current": { - "selected": false, - "text": "0", - "value": "0" - }, - "hide": 0, - "label": "Cost >=", - "name": "cost", - "options": [ - { - "selected": true, - "text": "0", - "value": "0" - } - ], - "query": "0", - "skipUrlSync": false, - "type": "textbox" - }, - { - "current": { - "selected": true, - "text": "0", - "value": "0" - }, - "hide": 0, - "label": "Duration (minutes) >=", - "name": "min_duration_min", - "options": [ - { - "selected": true, - "text": "0", - "value": "0" - } - ], - "query": "0", - "skipUrlSync": false, - "type": "textbox" - } - ] - }, - "time": { - "from": "now-1M", - "to": "now" - }, - "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] - }, - "timezone": "", - "title": "Browse Charges", - "uid": "jchmTSmNYvRRk", - "version": 5, - "weekStart": "" -} \ No newline at end of file diff --git a/dashboards/DatabaseDashboadInfo.json b/dashboards/DatabaseDashboadInfo.json index 0ac630f..78b9b31 100644 --- a/dashboards/DatabaseDashboadInfo.json +++ b/dashboards/DatabaseDashboadInfo.json @@ -1180,7 +1180,7 @@ "format": "table", "hide": false, "rawQuery": true, - "rawSql": "SELECT '2024.6.27' AS \"Current Version\"", + "rawSql": "SELECT '2024.7.11' AS \"Current Version\"", "refId": "DashboardVersion", "sql": { "columns": [ diff --git a/screenshots/AmortizationTracker.png b/screenshots/AmortizationTracker.png new file mode 100644 index 0000000..084f516 Binary files /dev/null and b/screenshots/AmortizationTracker.png differ