Grafana vehicules : resume en tableau, couleurs fixes ; HANDOFF concierge vehicule non confirme

This commit is contained in:
Tallagrand Thierry
2026-10-03 23:57:18 +02:00
parent eabd55f0cb
commit 9b283292bc
3 changed files with 227 additions and 63 deletions

View File

@@ -60,9 +60,9 @@
},
"panels": [
{
"type": "stat",
"type": "table",
"title": "Sur la periode",
"description": "« Etiquette douteuse » compte les sessions ou le selecteur a change en cours de route, ou n'etait pas renseigne. C'est la mesure honnete de l'incertitude : elle ne peut pas etre levee autrement qu'en positionnant le selecteur au branchement.",
"description": "kWh charges par vehicule sur la plage choisie (compteur de la borne). « Invite » = tout vehicule hors foyer (Megane de service, amis). « A confirmer » compte les sessions dont l'etiquette vient du selecteur sans confirmation : la seule mesure honnete de l'incertitude.",
"datasource": {
"type": "grafana-postgresql-datasource",
"uid": "evcs-pg"
@@ -77,30 +77,24 @@
"format": "table",
"rawQuery": true,
"editorMode": "code",
"rawSql": "SELECT round(coalesce(sum(coalesce(energie_station_kwh, energie_kwh)) FILTER (WHERE vehicule = 'VW'), 0)::numeric, 1) AS \"VW\",\n round(coalesce(sum(coalesce(energie_station_kwh, energie_kwh)) FILTER (WHERE vehicule = 'JEEP'), 0)::numeric, 1) AS \"JEEP\",\n round(coalesce(sum(coalesce(energie_station_kwh, energie_kwh)) FILTER (WHERE vehicule = 'ZERO'), 0)::numeric, 1) AS \"ZERO\",\n round(coalesce(sum(coalesce(energie_station_kwh, energie_kwh)) FILTER (WHERE vehicule NOT IN ('VW', 'JEEP', 'ZERO')), 0)::numeric, 1) AS \"Invite\",\n count(*) AS \"Sessions\",\n count(*) FILTER (WHERE NOT vehicule_sur OR vehicule IS NULL) AS \"A confirmer\"\nFROM session_charge WHERE $__timeFilter(debut)"
"rawSql": "SELECT round(coalesce(sum(coalesce(energie_station_kwh, energie_kwh)) FILTER (WHERE vehicule = 'VW'), 0)::numeric, 1) AS \"VW\",\n round(coalesce(sum(coalesce(energie_station_kwh, energie_kwh)) FILTER (WHERE vehicule = 'JEEP'), 0)::numeric, 1) AS \"JEEP\",\n round(coalesce(sum(coalesce(energie_station_kwh, energie_kwh)) FILTER (WHERE vehicule = 'ZERO'), 0)::numeric, 1) AS \"ZERO\",\n round(coalesce(sum(coalesce(energie_station_kwh, energie_kwh)) FILTER (WHERE vehicule NOT IN ('VW', 'JEEP', 'ZERO')), 0)::numeric, 1) AS \"Invite\",\n round(coalesce(sum(coalesce(energie_station_kwh, energie_kwh)) FILTER (WHERE vehicule IS NULL), 0)::numeric, 1) AS \"Non etiquete\",\n count(*) AS \"Sessions\",\n count(*) FILTER (WHERE NOT vehicule_sur OR vehicule IS NULL) AS \"A confirmer\"\nFROM session_charge WHERE $__timeFilter(debut)"
}
],
"gridPos": {
"x": 0,
"y": 0,
"w": 24,
"h": 5
"h": 4
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "text",
"value": null
}
]
},
"mappings": []
"custom": {
"align": "left",
"cellOptions": {
"type": "auto"
},
"filterable": true
}
},
"overrides": [
{
@@ -113,6 +107,16 @@
"id": "unit",
"value": "kwatth"
},
{
"id": "decimals",
"value": 1
},
{
"id": "custom.cellOptions",
"value": {
"type": "color-text"
}
},
{
"id": "color",
"value": {
@@ -132,6 +136,16 @@
"id": "unit",
"value": "kwatth"
},
{
"id": "decimals",
"value": 1
},
{
"id": "custom.cellOptions",
"value": {
"type": "color-text"
}
},
{
"id": "color",
"value": {
@@ -151,6 +165,16 @@
"id": "unit",
"value": "kwatth"
},
{
"id": "decimals",
"value": 1
},
{
"id": "custom.cellOptions",
"value": {
"type": "color-text"
}
},
{
"id": "color",
"value": {
@@ -170,6 +194,16 @@
"id": "unit",
"value": "kwatth"
},
{
"id": "decimals",
"value": 1
},
{
"id": "custom.cellOptions",
"value": {
"type": "color-text"
}
},
{
"id": "color",
"value": {
@@ -182,9 +216,44 @@
{
"matcher": {
"id": "byName",
"options": "Etiquette douteuse"
"options": "Non etiquete"
},
"properties": [
{
"id": "unit",
"value": "kwatth"
},
{
"id": "decimals",
"value": 1
},
{
"id": "custom.cellOptions",
"value": {
"type": "color-text"
}
},
{
"id": "color",
"value": {
"mode": "fixed",
"fixedColor": "orange"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "A confirmer"
},
"properties": [
{
"id": "custom.cellOptions",
"value": {
"type": "color-text"
}
},
{
"id": "thresholds",
"value": {
@@ -200,31 +269,23 @@
}
]
}
},
{
"id": "color",
"value": {
"mode": "thresholds"
}
}
]
}
]
},
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"orientation": "horizontal",
"textMode": "auto",
"colorMode": "value",
"graphMode": "none",
"justifyMode": "center",
"percentChangeColorMode": "standard",
"noValue": "—",
"text": {
"valueSize": 34,
"titleSize": 12
},
"wideLayout": true
"showHeader": true,
"cellHeight": "sm",
"footer": {
"show": false
}
}
},
{
@@ -250,7 +311,7 @@
],
"gridPos": {
"x": 0,
"y": 5,
"y": 4,
"w": 24,
"h": 9
},
@@ -267,7 +328,83 @@
"axisBorderShow": false
}
},
"overrides": []
"overrides": [
{
"matcher": {
"id": "byName",
"options": "VW"
},
"properties": [
{
"id": "color",
"value": {
"mode": "fixed",
"fixedColor": "blue"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "JEEP"
},
"properties": [
{
"id": "color",
"value": {
"mode": "fixed",
"fixedColor": "green"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "ZERO"
},
"properties": [
{
"id": "color",
"value": {
"mode": "fixed",
"fixedColor": "purple"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "Invite"
},
"properties": [
{
"id": "color",
"value": {
"mode": "fixed",
"fixedColor": "yellow"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "Non etiquete"
},
"properties": [
{
"id": "color",
"value": {
"mode": "fixed",
"fixedColor": "orange"
}
}
]
}
]
},
"options": {
"orientation": "auto",
@@ -310,7 +447,7 @@
],
"gridPos": {
"x": 0,
"y": 14,
"y": 13,
"w": 24,
"h": 11
},