Files
archived-hipudding-teslamate/grafana/dashboards/charges.json
2025-02-22 09:13:42 +01:00

1551 lines
40 KiB
JSON

{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"links": [
{
"icon": "dashboard",
"tags": [],
"title": "TeslaMate",
"tooltip": "",
"type": "link",
"url": "${base_url:raw}"
},
{
"asDropdown": true,
"icon": "external link",
"tags": [
"tesla"
],
"title": "Dashboards",
"type": "dashboards"
}
],
"panels": [
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 0
},
"id": 16,
"panels": [],
"title": "Summary of this period",
"type": "row"
},
{
"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": "text",
"value": null
}
]
},
"unit": "kwatth"
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "charge_energy_added"
},
"properties": [
{
"id": "displayName",
"value": "Total Energy added:"
}
]
}
]
},
"gridPos": {
"h": 2,
"w": 6,
"x": 0,
"y": 1
},
"id": 10,
"maxDataPoints": 100,
"options": {
"colorMode": "background",
"graphMode": "none",
"justifyMode": "center",
"orientation": "auto",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"sum"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "11.5.2",
"targets": [
{
"datasource": {
"type": "datasource",
"uid": "-- Dashboard --"
},
"panelId": 6,
"refId": "A"
}
],
"title": "",
"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": "text",
"value": null
}
]
},
"unit": "kwatth"
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "charge_energy_used"
},
"properties": [
{
"id": "displayName",
"value": "Total Energy used:"
}
]
}
]
},
"gridPos": {
"h": 2,
"w": 6,
"x": 6,
"y": 1
},
"id": 20,
"maxDataPoints": 100,
"options": {
"colorMode": "background",
"graphMode": "none",
"justifyMode": "center",
"orientation": "auto",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"sum"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "11.5.2",
"targets": [
{
"datasource": {
"type": "datasource",
"uid": "-- Dashboard --"
},
"panelId": 6,
"refId": "A"
}
],
"title": "",
"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": "text",
"value": null
}
]
},
"unit": "none"
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "cost"
},
"properties": [
{
"id": "displayName",
"value": "Total Charging Cost:"
}
]
}
]
},
"gridPos": {
"h": 2,
"w": 6,
"x": 12,
"y": 1
},
"id": 14,
"maxDataPoints": 100,
"options": {
"colorMode": "background",
"graphMode": "none",
"justifyMode": "center",
"orientation": "horizontal",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"sum"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "11.5.2",
"targets": [
{
"datasource": {
"type": "datasource",
"uid": "-- Dashboard --"
},
"panelId": 6,
"refId": "A"
}
],
"title": "",
"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": "text",
"value": null
}
]
},
"unit": "m"
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "duration_min"
},
"properties": [
{
"id": "displayName",
"value": "Ø Duration:"
}
]
}
]
},
"gridPos": {
"h": 2,
"w": 6,
"x": 18,
"y": 1
},
"id": 15,
"maxDataPoints": 100,
"options": {
"colorMode": "background",
"graphMode": "none",
"justifyMode": "center",
"orientation": "horizontal",
"percentChangeColorMode": "standard",
"reduceOptions": {
"calcs": [
"mean"
],
"fields": "",
"values": false
},
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "11.5.2",
"targets": [
{
"datasource": {
"type": "datasource",
"uid": "-- Dashboard --"
},
"panelId": 6,
"refId": "A"
}
],
"title": "",
"transformations": [
{
"id": "filterFieldsByName",
"options": {
"include": {
"names": [
"duration_min"
]
}
}
}
],
"transparent": true,
"type": "stat"
},
{
"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": "auto",
"cellOptions": {
"type": "auto"
},
"filterable": false,
"inspect": false,
"minWidth": 150
},
"displayName": "",
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "start_date"
},
"properties": [
{
"id": "displayName",
"value": "Date"
},
{
"id": "links",
"value": [
{
"targetBlank": false,
"title": "View charge details",
"url": "/d/BHhxFeZRz/charge-details?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.minWidth",
"value": 180
},
{
"id": "unit",
"value": "dateTimeAsLocal"
}
]
},
{
"matcher": {
"id": "byName",
"options": "charge_energy_added"
},
"properties": [
{
"id": "displayName",
"value": "Energy added"
},
{
"id": "decimals",
"value": 2
},
{
"id": "custom.minWidth",
"value": 115
}
]
},
{
"matcher": {
"id": "byName",
"options": "start_battery_level"
},
"properties": [
{
"id": "displayName",
"value": "% Start"
},
{
"id": "unit",
"value": "percent"
},
{
"id": "decimals",
"value": 0
},
{
"id": "custom.minWidth",
"value": 70
}
]
},
{
"matcher": {
"id": "byName",
"options": "end_battery_level"
},
"properties": [
{
"id": "displayName",
"value": "% End"
},
{
"id": "unit",
"value": "percent"
},
{
"id": "decimals",
"value": 0
},
{
"id": "custom.minWidth",
"value": 65
}
]
},
{
"matcher": {
"id": "byName",
"options": "duration_min"
},
"properties": [
{
"id": "displayName",
"value": "Duration"
},
{
"id": "unit",
"value": "m"
},
{
"id": "decimals",
"value": 1
},
{
"id": "custom.minWidth",
"value": 80
}
]
},
{
"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": "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": "decimals",
"value": 2
},
{
"id": "links",
"value": [
{
"targetBlank": false,
"title": "Set Cost",
"url": "${base_url:raw}/charge-cost/${__data.fields.id.numeric}"
}
]
},
{
"id": "noValue",
"value": "-"
},
{
"id": "custom.minWidth",
"value": 70
}
]
},
{
"matcher": {
"id": "byRegexp",
"options": "/.*_ts/"
},
"properties": [
{
"id": "custom.hidden",
"value": true
}
]
},
{
"matcher": {
"id": "byName",
"options": "id"
},
"properties": [
{
"id": "custom.hidden",
"value": true
}
]
},
{
"matcher": {
"id": "byName",
"options": "address"
},
"properties": [
{
"id": "displayName",
"value": "Location"
},
{
"id": "links",
"value": [
{
"targetBlank": true,
"title": "Create or edit geo-fence",
"url": "${base_url:raw}/geo-fences/${__data.fields.path}"
}
]
},
{
"id": "custom.minWidth",
"value": 180
}
]
},
{
"matcher": {
"id": "byName",
"options": "range_added_km"
},
"properties": [
{
"id": "displayName",
"value": "Range gained"
},
{
"id": "decimals",
"value": 0
},
{
"id": "custom.minWidth",
"value": 120
},
{
"id": "unit",
"value": "lengthkm"
}
]
},
{
"matcher": {
"id": "byName",
"options": "range_added_mi"
},
"properties": [
{
"id": "displayName",
"value": "Range gained"
},
{
"id": "decimals",
"value": 0
},
{
"id": "custom.minWidth",
"value": 120
},
{
"id": "unit",
"value": "lengthmi"
}
]
},
{
"matcher": {
"id": "byName",
"options": "charge_energy_added_per_hour"
},
"properties": [
{
"id": "displayName",
"value": "Ø Power"
},
{
"id": "unit",
"value": "kwatt"
},
{
"id": "decimals",
"value": 1
},
{
"id": "custom.cellOptions",
"value": {
"type": "color-text"
}
},
{
"id": "thresholds",
"value": {
"mode": "absolute",
"steps": [
{
"color": "#96D98D",
"value": null
},
{
"color": "#56A64B",
"value": 20
},
{
"color": "#37872D",
"value": 55
}
]
}
},
{
"id": "custom.minWidth",
"value": 90
}
]
},
{
"matcher": {
"id": "byName",
"options": "range_added_per_hour_km"
},
"properties": [
{
"id": "displayName",
"value": "Ø Charge rate"
},
{
"id": "unit",
"value": "velocitykmh"
},
{
"id": "custom.minWidth",
"value": 120
},
{
"id": "decimals",
"value": 0
}
]
},
{
"matcher": {
"id": "byName",
"options": "outside_temp_avg_f"
},
"properties": [
{
"id": "displayName",
"value": "Temp"
},
{
"id": "unit",
"value": "fahrenheit"
},
{
"id": "decimals",
"value": 1
},
{
"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": "range_added_per_hour_mi"
},
"properties": [
{
"id": "displayName",
"value": "Ø Charge rate"
},
{
"id": "unit",
"value": "velocitymph"
},
{
"id": "custom.minWidth",
"value": 120
},
{
"id": "decimals",
"value": 0
}
]
},
{
"matcher": {
"id": "byName",
"options": "path"
},
"properties": [
{
"id": "custom.hidden",
"value": true
}
]
},
{
"matcher": {
"id": "byName",
"options": "charge_energy_used"
},
"properties": [
{
"id": "displayName",
"value": "Energy used"
},
{
"id": "decimals",
"value": 2
},
{
"id": "custom.minWidth",
"value": 105
}
]
},
{
"matcher": {
"id": "byName",
"options": "charging_efficiency"
},
"properties": [
{
"id": "displayName",
"value": "Efficiency"
},
{
"id": "unit",
"value": "percentunit"
},
{
"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": 120
}
]
},
{
"matcher": {
"id": "byName",
"options": "car_id"
},
"properties": [
{
"id": "custom.hidden",
"value": true
}
]
},
{
"matcher": {
"id": "byName",
"options": "end_date"
},
"properties": [
{
"id": "custom.hidden",
"value": true
}
]
},
{
"matcher": {
"id": "byName",
"options": "cost_per_kwh"
},
"properties": [
{
"id": "displayName",
"value": "Cost / kWh"
},
{
"id": "decimals",
"value": 2
},
{
"id": "noValue",
"value": "-"
},
{
"id": "custom.minWidth",
"value": 100
}
]
},
{
"matcher": {
"id": "byName",
"options": "charge_type"
},
"properties": [
{
"id": "displayName",
"value": "Type"
},
{
"id": "custom.cellOptions",
"value": {
"type": "color-text"
}
},
{
"id": "custom.minWidth",
"value": 40
},
{
"id": "mappings",
"value": [
{
"options": {
"AC": {
"color": "green",
"index": 0
},
"DC": {
"color": "light-orange",
"index": 1
}
},
"type": "value"
}
]
},
{
"id": "custom.align",
"value": "center"
}
]
},
{
"matcher": {
"id": "byName",
"options": "odometer_km"
},
"properties": [
{
"id": "unit",
"value": "km"
},
{
"id": "displayName",
"value": "Odometer"
},
{
"id": "custom.minWidth",
"value": 95
},
{
"id": "decimals",
"value": 0
}
]
},
{
"matcher": {
"id": "byName",
"options": "odometer_mi"
},
"properties": [
{
"id": "unit",
"value": "mi"
},
{
"id": "displayName",
"value": "Odometer"
},
{
"id": "custom.minWidth",
"value": 95
},
{
"id": "decimals",
"value": 0
}
]
}
]
},
"gridPos": {
"h": 19,
"w": 24,
"x": 0,
"y": 3
},
"id": 6,
"options": {
"cellHeight": "sm",
"footer": {
"countRows": false,
"fields": "",
"reducer": [
"sum"
],
"show": false
},
"showHeader": true,
"sortBy": []
},
"pluginVersion": "11.5.2",
"targets": [
{
"datasource": {
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"editorMode": "code",
"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 end_${preferred_range}_range_km - start_${preferred_range}_range_km as range_added,\n outside_temp_avg,\n cp.id,\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 p.odometer as odometer\n FROM\n charging_processes cp\n\tLEFT 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\n WHERE \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))\n GROUP BY 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, p.odometer\n ORDER 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 greatest(charge_energy_used, charge_energy_added) as charge_energy_used,\n charge_energy_added / greatest(charge_energy_used, charge_energy_added) 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(range_added * 60 / NULLIF (duration_min, 0), '$length_unit') AS range_added_per_hour_$length_unit,\n convert_km(range_added, '$length_unit') AS range_added_$length_unit,\n start_battery_level,\n end_battery_level,\n convert_km(odometer::numeric, '$length_unit') AS odometer_$length_unit\n FROM\n data\nWHERE\n (distance >= 0 OR distance IS NULL)\n AND duration_min >= '$min_duration_min'\n AND \n CASE\n WHEN '$cost' !~ '^[0-9]+$' THEN TRUE \n ELSE cost >= COALESCE(NULLIF('$cost', '')::NUMERIC, 0) \n 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"
}
]
],
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
},
"timeColumn": "time",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"title": "Charger type: $charge_type",
"type": "table"
},
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 22
},
"id": 18,
"panels": [],
"title": "General information (All charges)",
"type": "row"
},
{
"fieldConfig": {
"defaults": {},
"overrides": []
},
"gridPos": {
"h": 2,
"w": 24,
"x": 0,
"y": 23
},
"id": 19,
"options": {
"code": {
"language": "plaintext",
"showLineNumbers": false,
"showMiniMap": false
},
"content": "From here you can check if you have \nincomplete data of **Charges** (charges without ending date)\nIf so, you may follow the official \nguide by <a href='https://docs.teslamate.org/docs/maintenance/manually_fixing_data' target='_blank'>Manually fixing data</a>",
"mode": "markdown"
},
"pluginVersion": "11.5.2",
"title": "",
"type": "text"
},
{
"datasource": {
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "fixed"
},
"custom": {
"align": "center",
"cellOptions": {
"type": "auto"
},
"inspect": false
},
"links": [],
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 24,
"x": 0,
"y": 25
},
"id": 17,
"options": {
"cellHeight": "sm",
"footer": {
"countRows": false,
"enablePagination": true,
"fields": "",
"reducer": [
"sum"
],
"show": false
},
"showHeader": true
},
"pluginVersion": "11.5.2",
"targets": [
{
"alias": "",
"datasource": {
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"format": "table",
"group": [],
"hide": false,
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT id as \"Charging Process ID\", start_date, end_date, charge_energy_added, charge_energy_used, start_battery_level, end_battery_level, duration_min\nFROM charging_processes \nWHERE car_id = $car_id AND end_date is null\nORDER BY start_date DESC\n",
"refId": "A",
"select": [
[
{
"params": [
"value"
],
"type": "column"
}
]
],
"timeColumn": "time",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"title": "Incomplete Charges 🪫",
"type": "table"
}
],
"preload": false,
"refresh": "",
"schemaVersion": 40,
"tags": [
"tesla"
],
"templating": {
"list": [
{
"current": {},
"datasource": {
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"definition": "SELECT\n id as __value,\n CASE WHEN COUNT(id) OVER (PARTITION BY name) > 1 AND name IS NOT NULL THEN CONCAT(name, ' - ', RIGHT(vin, 6)) ELSE COALESCE(name, CONCAT('VIN ', vin)) end as __text \nFROM cars\nORDER BY display_priority ASC, name ASC, vin ASC;",
"includeAll": false,
"label": "Car",
"name": "car_id",
"options": [],
"query": "SELECT\n id as __value,\n CASE WHEN COUNT(id) OVER (PARTITION BY name) > 1 AND name IS NOT NULL THEN CONCAT(name, ' - ', RIGHT(vin, 6)) ELSE COALESCE(name, CONCAT('VIN ', vin)) end as __text \nFROM cars\nORDER BY display_priority ASC, name ASC, vin ASC;",
"refresh": 1,
"regex": "",
"type": "query"
},
{
"current": {},
"datasource": {
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"definition": "select unit_of_length from settings limit 1;",
"hide": 2,
"includeAll": false,
"name": "length_unit",
"options": [],
"query": "select unit_of_length from settings limit 1;",
"refresh": 1,
"regex": "",
"type": "query"
},
{
"current": {},
"datasource": {
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"definition": "select unit_of_temperature from settings limit 1;",
"hide": 2,
"includeAll": false,
"name": "temp_unit",
"options": [],
"query": "select unit_of_temperature from settings limit 1;",
"refresh": 1,
"regex": "",
"type": "query"
},
{
"current": {},
"datasource": {
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"definition": "select preferred_range from settings limit 1;",
"hide": 2,
"includeAll": false,
"name": "preferred_range",
"options": [],
"query": "select preferred_range from settings limit 1;",
"refresh": 1,
"regex": "",
"type": "query"
},
{
"current": {},
"datasource": {
"type": "grafana-postgresql-datasource",
"uid": "TeslaMate"
},
"definition": "select base_url from settings limit 1;",
"hide": 2,
"includeAll": false,
"name": "base_url",
"options": [],
"query": "select base_url from settings limit 1;",
"refresh": 1,
"regex": "",
"type": "query"
},
{
"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;",
"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": "",
"type": "query"
},
{
"current": {
"text": "",
"value": ""
},
"description": "Type a text contained in Location",
"label": "Location",
"name": "location",
"options": [
{
"selected": true,
"text": "",
"value": ""
}
],
"query": "",
"type": "textbox"
},
{
"current": {},
"includeAll": true,
"label": "Type",
"multi": true,
"name": "charge_type",
"options": [
{
"selected": false,
"text": "AC",
"value": "AC"
},
{
"selected": false,
"text": "DC",
"value": "DC"
}
],
"query": "AC, DC",
"type": "custom"
},
{
"current": {
"text": "",
"value": ""
},
"label": "Cost >=",
"name": "cost",
"options": [
{
"selected": true,
"text": "",
"value": ""
}
],
"query": "",
"type": "textbox"
},
{
"current": {
"text": "0",
"value": "0"
},
"label": "Duration (minutes) >=",
"name": "min_duration_min",
"options": [
{
"selected": true,
"text": "0",
"value": "0"
}
],
"query": "0",
"type": "textbox"
}
]
},
"time": {
"from": "now-3M",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Charges",
"uid": "TSmNYvRRk",
"version": 1,
"weekStart": ""
}