Grafana Le solaire : les quatre entrees du RS 450/200

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011uJ47NxgfpGnuuMr3f2n7Z
This commit is contained in:
Tallagrand Thierry
2026-09-25 16:28:35 +02:00
parent 8c24f4ed86
commit e4c6af555e
2 changed files with 96 additions and 0 deletions

View File

@@ -428,6 +428,76 @@
} }
} }
}, },
{
"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", "type": "timeseries",
"title": "Batterie", "title": "Batterie",

View File

@@ -457,6 +457,32 @@ solaire = dashboard("evcs-solaire", "Le solaire", (
{"id": "custom.lineWidth", "value": 3}, {"id": "custom.lineWidth", "value": 3},
{"id": "custom.fillOpacity", "value": 0}]}]}), {"id": "custom.fillOpacity", "value": 0}]}]}),
ts("RS 450/200 — les quatre entrees", [
flux("A",
'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"])')],
IN, 0, 31, 24, 8, "kwatth",
"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.",
extra={"overrides": [
{"matcher": {"id": "byName", "options": "Ouest"},
"properties": [{"id": "color", "value": {"mode": "fixed", "fixedColor": "orange"}}]}]}),
ts("Batterie", [ ts("Batterie", [
sql("A", "SELECT date_trunc('minute', ts) AS time, avg(valeur) AS \"SOC\"\n" sql("A", "SELECT date_trunc('minute', ts) AS time, avg(valeur) AS \"SOC\"\n"
"FROM mesure WHERE cle = 'sensor.victron_battery_soc'\n" "FROM mesure WHERE cle = 'sensor.victron_battery_soc'\n"