Files
EVCS/deploy/historisation/grafana/dashboards/solaire.json
2026-09-25 16:28:35 +02:00

676 lines
23 KiB
JSON

{
"templating": {
"list": []
},
"uid": "evcs-solaire",
"title": "Le solaire",
"description": "La production mesuree n'est jamais la production disponible : sans injection, le MPPT ne produit que ce que le systeme peut absorber. Ces panneaux montrent l'ecart entre les deux.",
"tags": [
"evcs"
],
"timezone": "Europe/Paris",
"editable": true,
"schemaVersion": 39,
"version": 1,
"refresh": "1m",
"time": {
"from": "now-24h",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"30s",
"1m",
"5m",
"15m",
"1h"
]
},
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"name": "Annotations & Alerts",
"iconColor": "rgba(0, 211, 255, 1)",
"type": "dashboard"
},
{
"name": "Evenements",
"datasource": {
"type": "grafana-postgresql-datasource",
"uid": "evcs-pg"
},
"enable": false,
"iconColor": "semi-dark-orange",
"hide": false,
"target": {
"format": "table",
"rawQuery": true,
"editorMode": "code",
"rawSql": "SELECT ts AS time, resume AS text, genre || ',' || coalesce(source,'?') AS tags FROM evenement WHERE $__timeFilter(ts) AND genre <> 'bilan' ORDER BY 1"
}
}
]
},
"panels": [
{
"type": "timeseries",
"title": "Production, maison, et ce qui reste",
"description": "L'excedent (production moins maison hors voiture) est la grandeur qui decide d'un demarrage depuis le 03/09. Le 03/09 a 19:44, la production valait 758 W — au-dessus du seuil — pour un excedent de MOINS 444 W : la voiture a vide la batterie.",
"datasource": {
"type": "grafana-postgresql-datasource",
"uid": "evcs-pg"
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "grafana-postgresql-datasource",
"uid": "evcs-pg"
},
"format": "time_series",
"rawQuery": true,
"editorMode": "code",
"rawSql": "WITH par_minute AS (\n SELECT date_trunc('minute', ts) AS t,\n avg(valeur) FILTER (WHERE cle = 'sensor.victron_pv_power_system') AS Production,\n (array_agg(valeur ORDER BY ts DESC) FILTER (WHERE cle = 'sensor.victron_pv_power_system'))[1] AS d_Production,\n avg(valeur) FILTER (WHERE cle = 'sensor.victron_consumption_power_l1') AS Maison,\n (array_agg(valeur ORDER BY ts DESC) FILTER (WHERE cle = 'sensor.victron_consumption_power_l1'))[1] AS d_Maison,\n avg(valeur) FILTER (WHERE cle = 'sensor.victron_evcs_ac_power') AS Voiture,\n (array_agg(valeur ORDER BY ts DESC) FILTER (WHERE cle = 'sensor.victron_evcs_ac_power'))[1] AS d_Voiture\n FROM mesure WHERE $__timeFilter(ts) GROUP BY 1\n),\npaliers AS (\n SELECT t,\n Production, count(d_Production) OVER (ORDER BY t) AS g_Production,\n Maison, count(d_Maison) OVER (ORDER BY t) AS g_Maison,\n Voiture, count(d_Voiture) OVER (ORDER BY t) AS g_Voiture,\n d_Production,\n d_Maison,\n d_Voiture\n FROM par_minute\n),\nreport AS (\n SELECT t,\n coalesce(Production, first_value(d_Production) OVER (PARTITION BY g_Production ORDER BY t)) AS Production,\n coalesce(Maison, first_value(d_Maison) OVER (PARTITION BY g_Maison ORDER BY t)) AS Maison,\n coalesce(Voiture, first_value(d_Voiture) OVER (PARTITION BY g_Voiture ORDER BY t)) AS Voiture\n FROM paliers\n)\nSELECT t AS time,\n Production AS \"Production\",\n Maison AS \"Maison\",\n Voiture AS \"Voiture\",\n Production - Maison AS \"Excedent\"\nFROM report ORDER BY t"
}
],
"gridPos": {
"x": 0,
"y": 0,
"w": 24,
"h": 9
},
"fieldConfig": {
"defaults": {
"unit": "watt",
"color": {
"mode": "palette-classic"
},
"custom": {
"lineWidth": 2,
"fillOpacity": 8,
"showPoints": "never",
"spanNulls": true,
"axisBorderShow": false,
"gradientMode": "opacity"
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Production"
},
"properties": [
{
"id": "color",
"value": {
"mode": "fixed",
"fixedColor": "yellow"
}
},
{
"id": "custom.fillOpacity",
"value": 22
}
]
},
{
"matcher": {
"id": "byName",
"options": "Maison"
},
"properties": [
{
"id": "color",
"value": {
"mode": "fixed",
"fixedColor": "text"
}
},
{
"id": "custom.fillOpacity",
"value": 0
}
]
},
{
"matcher": {
"id": "byName",
"options": "Voiture"
},
"properties": [
{
"id": "color",
"value": {
"mode": "fixed",
"fixedColor": "blue"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "Excedent"
},
"properties": [
{
"id": "color",
"value": {
"mode": "fixed",
"fixedColor": "green"
}
},
{
"id": "custom.lineWidth",
"value": 3
},
{
"id": "custom.fillOpacity",
"value": 0
}
]
}
]
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": true,
"calcs": []
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "state-timeline",
"title": "Production bridee ?",
"description": "Bridee = de la ressource solaire est REFUSEE faute de preneur. Charger la voiture pendant ces heures-la ne coute rien.",
"datasource": {
"type": "grafana-postgresql-datasource",
"uid": "evcs-pg"
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "grafana-postgresql-datasource",
"uid": "evcs-pg"
},
"format": "table",
"rawQuery": true,
"editorMode": "code",
"rawSql": "SELECT ts AS time,\n CASE WHEN pv_censure THEN coalesce(motif_censure, 'bridee')\n ELSE 'libre' END AS \"Production\"\nFROM bilan\nWHERE $__timeFilter(ts)\nORDER BY 1"
}
],
"gridPos": {
"x": 0,
"y": 9,
"w": 12,
"h": 6
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "continuous-GrYlRd"
},
"custom": {
"lineWidth": 0,
"fillOpacity": 80,
"insertNulls": false,
"spanNulls": true
},
"mappings": [
{
"type": "value",
"options": {
"libre": {
"color": "green",
"index": 0
}
}
},
{
"type": "regex",
"options": {
"pattern": ".*",
"result": {
"color": "orange",
"index": 1
}
}
}
]
},
"overrides": []
},
"options": {
"showValue": "auto",
"mergeValues": true,
"alignValue": "left",
"rowHeight": 0.85,
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": false
},
"tooltip": {
"mode": "single"
}
}
},
{
"type": "state-timeline",
"title": "Ce que les chargeurs declarent eux-memes",
"description": "mppt_active = ce chargeur donne tout ce qu'il peut. voltage_current_limited ou off = il se retient, faute de preneur. Le 03/09 ces capteurs ont bascule 24 minutes avant le drapeau du bilan — c'est le signal le plus direct dont on dispose.",
"datasource": {
"type": "influxdb",
"uid": "evcs-influx"
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "influxdb",
"uid": "evcs-influx"
},
"query": "from(bucket: \"evcs\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r._field == \"state\")\n |> filter(fn: (r) => r._measurement =~ /operation_mode$/)\n |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)\n |> map(fn: (r) => ({ r with tracker:\n if r._measurement =~ /^v1_/ then \"Suiveur\"\n else if r._measurement =~ /solar_1/ then \"Sud 1\"\n else if r._measurement =~ /solar_2/ then \"Sud 2\"\n else if r._measurement =~ /solar_3/ then \"Sud 3\"\n else if r._measurement =~ /solar_4/ then \"Ouest\"\n else if r._measurement =~ /mppt1/ then \"Sud-est\"\n else \"Ensemble\" }))\n |> keep(columns: [\"_time\", \"_value\", \"tracker\"])\n |> pivot(rowKey: [\"_time\"], columnKey: [\"tracker\"], valueColumn: \"_value\")"
}
],
"gridPos": {
"x": 12,
"y": 9,
"w": 12,
"h": 6
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "continuous-GrYlRd"
},
"custom": {
"lineWidth": 0,
"fillOpacity": 80,
"insertNulls": false,
"spanNulls": true
},
"mappings": [
{
"type": "value",
"options": {
"mppt_active": {
"color": "green",
"index": 0
},
"voltage_current_limited": {
"color": "orange",
"index": 1
},
"off": {
"color": "dark-blue",
"index": 2
}
}
}
]
},
"overrides": []
},
"options": {
"showValue": "auto",
"mergeValues": true,
"alignValue": "left",
"rowHeight": 0.85,
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": false
},
"tooltip": {
"mode": "single"
}
}
},
{
"type": "timeseries",
"title": "Production du jour par chargeur",
"description": "Le rendement du jour que chaque chargeur declare lui-meme (yield_today), remis a zero chaque nuit. C'est la production REELLE (MANUEL §0), la meme que sensor.evcs_production_jour_kwh et que l'agent vocal. Le Total n'apparait que si les trois chargeurs publient : un chargeur muet donne un total partiel, qu'on ne trace pas. Les trois ne se remettent pas a zero a la meme minute (vers 00:40). Le suiveur n'est exporte que depuis le 25/09.",
"datasource": {
"type": "influxdb",
"uid": "evcs-influx"
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "influxdb",
"uid": "evcs-influx"
},
"query": "from(bucket: \"evcs\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r._measurement == \"kWh\" and r._field == \"value\")\n |> filter(fn: (r) => r.entity_id == \"airtria_mppt1_yield_today\"\n or r.entity_id == \"mppt_450_200_hq2449yr9pt_yield_today\"\n or r.entity_id == \"v1_yield_today\")\n |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)\n |> map(fn: (r) => ({ r with chargeur:\n if r.entity_id =~ /^airtria/ then \"MPPT 250/70 sud-est\"\n else if r.entity_id =~ /^mppt_450/ then \"RS 450/200 sud + ouest\"\n else \"150/35 suiveur\" }))\n |> group()\n |> keep(columns: [\"_time\", \"_value\", \"chargeur\"])\n |> pivot(rowKey: [\"_time\"], columnKey: [\"chargeur\"], valueColumn: \"_value\")\n |> sort(columns: [\"_time\"])"
},
{
"refId": "B",
"datasource": {
"type": "influxdb",
"uid": "evcs-influx"
},
"query": "from(bucket: \"evcs\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r._measurement == \"kWh\" and r._field == \"value\")\n |> filter(fn: (r) => r.entity_id == \"airtria_mppt1_yield_today\"\n or r.entity_id == \"mppt_450_200_hq2449yr9pt_yield_today\"\n or r.entity_id == \"v1_yield_today\")\n |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)\n |> map(fn: (r) => ({ r with chargeur:\n if r.entity_id =~ /^airtria/ then \"MPPT 250/70 sud-est\"\n else if r.entity_id =~ /^mppt_450/ then \"RS 450/200 sud + ouest\"\n else \"150/35 suiveur\" }))\n |> group()\n |> keep(columns: [\"_time\", \"_value\", \"chargeur\"])\n |> pivot(rowKey: [\"_time\"], columnKey: [\"chargeur\"], valueColumn: \"_value\")\n |> sort(columns: [\"_time\"])\n |> fill(usePrevious: true, column: \"MPPT 250/70 sud-est\")\n |> fill(usePrevious: true, column: \"RS 450/200 sud + ouest\")\n |> fill(usePrevious: true, column: \"150/35 suiveur\")\n |> filter(fn: (r) => exists r[\"MPPT 250/70 sud-est\"] and exists r[\"RS 450/200 sud + ouest\"]\n and exists r[\"150/35 suiveur\"])\n |> map(fn: (r) => ({ _time: r._time, Total: r[\"MPPT 250/70 sud-est\"]\n + r[\"RS 450/200 sud + ouest\"] + r[\"150/35 suiveur\"] }))"
}
],
"gridPos": {
"x": 0,
"y": 23,
"w": 24,
"h": 8
},
"fieldConfig": {
"defaults": {
"unit": "kwatth",
"color": {
"mode": "palette-classic"
},
"custom": {
"lineWidth": 2,
"fillOpacity": 8,
"showPoints": "never",
"spanNulls": true,
"axisBorderShow": false,
"gradientMode": "opacity"
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Total"
},
"properties": [
{
"id": "color",
"value": {
"mode": "fixed",
"fixedColor": "yellow"
}
},
{
"id": "custom.lineWidth",
"value": 3
},
{
"id": "custom.fillOpacity",
"value": 0
}
]
}
]
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": true,
"calcs": []
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"title": "RS 450/200 — les quatre entrees",
"description": "Rendement du jour de chaque entree du RS 450/200 : trois strings sud de 10 panneaux a 35 degres, et l'ouest (9 panneaux, 45 degres). Les trois sud doivent rester SUPERPOSEES : une courbe qui decroche signale un defaut de string (ombre, connecteur, panneau). Ces quatre valeurs detaillent le total du RS, elles ne s'y ajoutent pas. Resolution 0,1 kWh.",
"datasource": {
"type": "influxdb",
"uid": "evcs-influx"
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "influxdb",
"uid": "evcs-influx"
},
"query": "from(bucket: \"evcs\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r._measurement == \"kWh\" and r._field == \"value\")\n |> filter(fn: (r) => r.entity_id =~ /^mppt_450_200_hq2449yr9pt_tracker_solar_[1-4]_yield_today$/)\n |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)\n |> map(fn: (r) => ({ r with entree:\n if r.entity_id =~ /solar_1/ then \"Sud string 1\"\n else if r.entity_id =~ /solar_2/ then \"Sud string 2\"\n else if r.entity_id =~ /solar_3/ then \"Sud string 3\"\n else \"Ouest\" }))\n |> group()\n |> keep(columns: [\"_time\", \"_value\", \"entree\"])\n |> pivot(rowKey: [\"_time\"], columnKey: [\"entree\"], valueColumn: \"_value\")\n |> sort(columns: [\"_time\"])"
}
],
"gridPos": {
"x": 0,
"y": 31,
"w": 24,
"h": 8
},
"fieldConfig": {
"defaults": {
"unit": "kwatth",
"color": {
"mode": "palette-classic"
},
"custom": {
"lineWidth": 2,
"fillOpacity": 8,
"showPoints": "never",
"spanNulls": true,
"axisBorderShow": false,
"gradientMode": "opacity"
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Ouest"
},
"properties": [
{
"id": "color",
"value": {
"mode": "fixed",
"fixedColor": "orange"
}
}
]
}
]
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": true,
"calcs": []
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"title": "Batterie",
"description": "Le SOC n'est pas lineaire : 0,169 kWh par point au-dessus de 33 %, 0,097 en dessous (576 paliers mesures). Un point en bas d'echelle vaut la moitie d'un point en haut.",
"datasource": {
"type": "grafana-postgresql-datasource",
"uid": "evcs-pg"
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "grafana-postgresql-datasource",
"uid": "evcs-pg"
},
"format": "time_series",
"rawQuery": true,
"editorMode": "code",
"rawSql": "SELECT date_trunc('minute', ts) AS time, avg(valeur) AS \"SOC\"\nFROM mesure WHERE cle = 'sensor.victron_battery_soc'\n AND $__timeFilter(ts) GROUP BY 1 ORDER BY 1"
},
{
"refId": "B",
"datasource": {
"type": "grafana-postgresql-datasource",
"uid": "evcs-pg"
},
"format": "time_series",
"rawQuery": true,
"editorMode": "code",
"rawSql": "SELECT date_trunc('minute', ts) AS time, avg(valeur) AS \"Courant\"\nFROM mesure WHERE cle = 'sensor.victron_battery_current'\n AND $__timeFilter(ts) GROUP BY 1 ORDER BY 1"
}
],
"gridPos": {
"x": 0,
"y": 15,
"w": 12,
"h": 8
},
"fieldConfig": {
"defaults": {
"unit": "percent",
"color": {
"mode": "palette-classic"
},
"custom": {
"lineWidth": 2,
"fillOpacity": 8,
"showPoints": "never",
"spanNulls": true,
"axisBorderShow": false,
"gradientMode": "opacity"
},
"min": 0,
"max": 100
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Courant"
},
"properties": [
{
"id": "unit",
"value": "amp"
},
{
"id": "custom.axisPlacement",
"value": "right"
},
{
"id": "max",
"value": null
},
{
"id": "min",
"value": null
},
{
"id": "color",
"value": {
"mode": "fixed",
"fixedColor": "purple"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "SOC"
},
"properties": [
{
"id": "color",
"value": {
"mode": "fixed",
"fixedColor": "green"
}
},
{
"id": "custom.lineWidth",
"value": 3
}
]
}
]
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": true,
"calcs": []
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"title": "Le detail que PostgreSQL ne voit pas (~1 point/s)",
"description": "InfluxDB enregistre chaque changement d'etat, pas un echantillon par minute. C'est la resolution qu'il faut pour voir un transitoire de reprise du reseau (~150 s) ou une pointe de cuisson.",
"datasource": {
"type": "influxdb",
"uid": "evcs-influx"
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "influxdb",
"uid": "evcs-influx"
},
"query": "from(bucket: \"evcs\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r._measurement == \"W\" and r._field == \"value\")\n |> filter(fn: (r) => r.entity_id == \"victron_pv_power_system\"\n or r.entity_id == \"victron_consumption_power_l1\"\n or r.entity_id == \"victron_evcs_ac_power\"\n or r.entity_id == \"victron_grid_power_l1\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> keep(columns: [\"_time\", \"_value\", \"entity_id\"])\n |> pivot(rowKey: [\"_time\"], columnKey: [\"entity_id\"], valueColumn: \"_value\")"
}
],
"gridPos": {
"x": 12,
"y": 15,
"w": 12,
"h": 8
},
"fieldConfig": {
"defaults": {
"unit": "watt",
"color": {
"mode": "palette-classic"
},
"custom": {
"lineWidth": 1,
"fillOpacity": 5,
"showPoints": "never",
"spanNulls": true
}
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": true,
"calcs": []
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
}
]
}