From f61372166252dacb7b366fa9335015fadb3ed6a6 Mon Sep 17 00:00:00 2001 From: Moritz Graf Date: Tue, 7 Jul 2026 21:03:09 +0200 Subject: [PATCH] chore(monitoring): migrate heating gas dashboard to prometheus regex --- .../grafana-dashboard-heating-gas.yaml | 149 +++++++++++------- 1 file changed, 92 insertions(+), 57 deletions(-) diff --git a/k8s/monitoring/dashboards/grafana-dashboard-heating-gas.yaml b/k8s/monitoring/dashboards/grafana-dashboard-heating-gas.yaml index 4ce7a9f..d0556c0 100644 --- a/k8s/monitoring/dashboards/grafana-dashboard-heating-gas.yaml +++ b/k8s/monitoring/dashboards/grafana-dashboard-heating-gas.yaml @@ -1,62 +1,97 @@ apiVersion: v1 +data: + heating-gas.json: '{"uid": "heating-gas", "title": "\ud83d\udd25 Heating & Gas", + "tags": ["home", "heating", "gas", "auto-generated"], "timezone": "browser", "schemaVersion": + 39, "version": 1, "refresh": "5m", "editable": false, "graphTooltip": 1, "time": + {"from": "now-24h", "to": "now"}, "panels": [{"title": "\u26fd Gas Overview", + "type": "row", "gridPos": {"h": 1, "w": 24, "x": 0, "y": 0}, "collapsed": false}, + {"title": "Current Gas Flow", "type": "stat", "datasource": {"type": "prometheus", + "uid": "prometheus"}, "gridPos": {"h": 4, "w": 6, "x": 0, "y": 1}, "fieldConfig": + {"defaults": {"unit": "cms", "decimals": 0, "thresholds": {"mode": "absolute", + "steps": [{"color": "#73BF69", "value": null}, {"color": "#FFD700", "value": 0.5}, + {"color": "#FF7383", "value": 1.5}, {"color": "#C4162A", "value": 3}]}, "color": + {"mode": "thresholds"}}}, "options": {"graphMode": "area", "colorMode": "background", + "textMode": "auto", "reduceOptions": {"values": false, "calcs": ["lastNotNull"]}}, + "targets": [{"expr": "{__name__=~\"homeassistant_sensor_.*\", entity=\"sensor.home_gaszahler_currentgasflow\"}", + "format": "time_series", "refId": "A"}]}, {"title": "Total Gas Volume", "type": + "stat", "datasource": {"type": "prometheus", "uid": "prometheus"}, "gridPos": + {"h": 4, "w": 6, "x": 6, "y": 1}, "fieldConfig": {"defaults": {"unit": "cms", + "decimals": 0, "thresholds": {"mode": "absolute", "steps": [{"color": "#73BF69", + "value": null}, {"color": "#FFD700", "value": 500}, {"color": "#FF7383", "value": + 1000}, {"color": "#C4162A", "value": 2000}]}, "color": {"mode": "thresholds"}}}, + "options": {"graphMode": "area", "colorMode": "background", "textMode": "auto", + "reduceOptions": {"values": false, "calcs": ["lastNotNull"]}}, "targets": [{"expr": + "{__name__=~\"homeassistant_sensor_.*\", entity=\"sensor.home_gaszahler_gasvolume\"}", + "format": "time_series", "refId": "A"}]}, {"title": "Gas Cost (EUR)", "type": + "stat", "datasource": {"type": "prometheus", "uid": "prometheus"}, "gridPos": + {"h": 4, "w": 6, "x": 12, "y": 1}, "fieldConfig": {"defaults": {"unit": "currencyEUR", + "decimals": 0, "thresholds": {"mode": "absolute", "steps": [{"color": "#73BF69", + "value": null}, {"color": "#FFD700", "value": 200}, {"color": "#FF7383", "value": + 500}, {"color": "#C4162A", "value": 1000}]}, "color": {"mode": "thresholds"}}}, + "options": {"graphMode": "area", "colorMode": "background", "textMode": "auto", + "reduceOptions": {"values": false, "calcs": ["lastNotNull"]}}, "targets": [{"expr": + "{__name__=~\"homeassistant_sensor_.*\", entity=\"sensor.home_gaszahler_gasvolume_cost\"}", + "format": "time_series", "refId": "A"}]}, {"title": "Electricity Cost (EUR)", + "type": "stat", "datasource": {"type": "prometheus", "uid": "prometheus"}, "gridPos": + {"h": 4, "w": 6, "x": 18, "y": 1}, "fieldConfig": {"defaults": {"unit": "currencyEUR", + "decimals": 0, "thresholds": {"mode": "absolute", "steps": [{"color": "#73BF69", + "value": null}, {"color": "#FFD700", "value": 100}, {"color": "#FF7383", "value": + 300}, {"color": "#C4162A", "value": 500}]}, "color": {"mode": "thresholds"}}}, + "options": {"graphMode": "area", "colorMode": "background", "textMode": "auto", + "reduceOptions": {"values": false, "calcs": ["lastNotNull"]}}, "targets": [{"expr": + "{__name__=~\"homeassistant_sensor_.*\", entity=\"sensor.home_strommesserat_energy_counter_usage_high_tariff_cost\"}", + "format": "time_series", "refId": "A"}]}, {"title": "\ud83d\udcc8 Gas Consumption + Trend", "type": "row", "gridPos": {"h": 1, "w": 24, "x": 0, "y": 5}, "collapsed": + false}, {"title": "Gas Flow", "type": "timeseries", "datasource": {"type": "prometheus", + "uid": "prometheus"}, "gridPos": {"h": 8, "w": 16, "x": 0, "y": 6}, "fieldConfig": + {"defaults": {"unit": "cms", "custom": {"lineWidth": 2, "fillOpacity": 5, "spanNulls": + true, "showPoints": "never"}}, "overrides": [{"matcher": {"id": "byName", "options": + "Gas Flow"}, "properties": [{"id": "color", "value": {"fixedColor": "#FF7383", + "mode": "fixed"}}]}]}, "options": {"legend": {"displayMode": "table", "placement": + "bottom", "calcs": ["max", "mean"]}, "tooltip": {"mode": "multi", "sort": "desc"}}, + "targets": [{"refId": "FLOW", "expr": "{__name__=~\"homeassistant_sensor_.*\", + entity=\"sensor.home_gaszahler_currentgasflow\"}", "format": "time_series"}]}, + {"title": "Gas Volume", "type": "timeseries", "datasource": {"type": "prometheus", + "uid": "prometheus"}, "gridPos": {"h": 8, "w": 8, "x": 16, "y": 6}, "fieldConfig": + {"defaults": {"unit": "cms", "custom": {"lineWidth": 2, "fillOpacity": 5, "spanNulls": + true, "showPoints": "never"}}, "overrides": [{"matcher": {"id": "byName", "options": + "Gas Volume"}, "properties": [{"id": "color", "value": {"fixedColor": "#C4162A", + "mode": "fixed"}}]}]}, "options": {"legend": {"displayMode": "table", "placement": + "bottom", "calcs": ["mean", "lastNotNull"]}, "tooltip": {"mode": "multi", "sort": + "desc"}}, "targets": [{"refId": "VOL", "expr": "{__name__=~\"homeassistant_sensor_.*\", + entity=\"sensor.home_gaszahler_gasvolume\"}", "format": "time_series"}]}, {"title": + "\ud83c\udfe0 Heating Activity", "type": "row", "gridPos": {"h": 1, "w": 24, "x": + 0, "y": 14}, "collapsed": false}, {"title": "Heating Valve Position", "type": + "timeseries", "datasource": {"type": "prometheus", "uid": "prometheus"}, "gridPos": + {"h": 10, "w": 24, "x": 0, "y": 15}, "fieldConfig": {"defaults": {"unit": "percent", + "custom": {"lineWidth": 2, "fillOpacity": 5, "spanNulls": true, "showPoints": + "never"}}, "overrides": [{"matcher": {"id": "byName", "options": "Wohnzimmer"}, + "properties": [{"id": "color", "value": {"fixedColor": "#FF7383", "mode": "fixed"}}]}, + {"matcher": {"id": "byName", "options": "Wohnzimmer #2"}, "properties": [{"id": + "color", "value": {"fixedColor": "#FF9830", "mode": "fixed"}}]}, {"matcher": {"id": + "byName", "options": "Arbeitszimmer"}, "properties": [{"id": "color", "value": + {"fixedColor": "#5794F2", "mode": "fixed"}}]}, {"matcher": {"id": "byName", "options": + "Schlafzimmer"}, "properties": [{"id": "color", "value": {"fixedColor": "#8F3BB8", + "mode": "fixed"}}]}, {"matcher": {"id": "byName", "options": "K\u00fcche"}, "properties": + [{"id": "color", "value": {"fixedColor": "#73BF69", "mode": "fixed"}}]}, {"matcher": + {"id": "byName", "options": "Bad"}, "properties": [{"id": "color", "value": {"fixedColor": + "#1F60C4", "mode": "fixed"}}]}]}, "options": {"legend": {"displayMode": "table", + "placement": "bottom", "calcs": ["mean", "lastNotNull"]}, "tooltip": {"mode": + "multi", "sort": "desc"}}, "targets": [{"refId": "Wo", "expr": "{__name__=~\"homeassistant_sensor_.*\", + entity=\"sensor.home_wohnzimmer_heating\"}", "format": "time_series"}, {"refId": + "Wo", "expr": "{__name__=~\"homeassistant_sensor_.*\", entity=\"sensor.home_wohnzimmer_2_heating\"}", + "format": "time_series"}, {"refId": "Ar", "expr": "{__name__=~\"homeassistant_sensor_.*\", + entity=\"sensor.home_arbeitszimmer_heating\"}", "format": "time_series"}, {"refId": + "Sc", "expr": "{__name__=~\"homeassistant_sensor_.*\", entity=\"sensor.home_schlafzimmer_og_heating\"}", + "format": "time_series"}, {"refId": "K\u00fc", "expr": "{__name__=~\"homeassistant_sensor_.*\", + entity=\"sensor.home_kuche_vorne_heating\"}", "format": "time_series"}, {"refId": + "Ba", "expr": "{__name__=~\"homeassistant_sensor_.*\", entity=\"sensor.home_badezimmer_thermostat_heating\"}", + "format": "time_series"}]}]}' kind: ConfigMap metadata: - name: grafana-dashboard-heating-gas - namespace: monitoring + annotations: + grafana_dashboard_folder: "\U0001F3E0 Home" labels: grafana_dashboard: '1' - annotations: - grafana_dashboard_folder: 🏠 Home -data: - heating-gas.json: '{"uid": "heating-gas", "title": "🔥 Heating & Gas", "tags": ["home", "heating", "gas", "auto-generated"], "timezone": "browser", "schemaVersion": 39, "version": 1, "refresh": "5m", "editable": - false, "graphTooltip": 1, "time": {"from": "now-24h", "to": "now"}, "panels": [{"title": "⛽ Gas Overview", "type": "row", "gridPos": {"h": 1, "w": 24, "x": 0, "y": 0}, "collapsed": false}, {"title": - "Current Gas Flow", "type": "stat", "datasource": {"type": "influxdb", "uid": "P2AB959DC95E5519F"}, "gridPos": {"h": 4, "w": 6, "x": 0, "y": 1}, "fieldConfig": {"defaults": {"unit": "cms", "decimals": - 0, "thresholds": {"mode": "absolute", "steps": [{"color": "#73BF69", "value": null}, {"color": "#FFD700", "value": 0.5}, {"color": "#FF7383", "value": 1.5}, {"color": "#C4162A", "value": 3}]}, "color": - {"mode": "thresholds"}}}, "options": {"graphMode": "area", "colorMode": "background", "textMode": "auto", "reduceOptions": {"values": false, "calcs": ["lastNotNull"]}}, "targets": [{"query": "from(bucket: - \"default\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"m³/h\" and r[\"_field\"] == \"value\")\n |> filter(fn: (r) => r.entity_id == - \"home_gaszahler_currentgasflow\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")", "resultFormat": "time_series"}]}, {"title": "Total Gas Volume", - "type": "stat", "datasource": {"type": "influxdb", "uid": "P2AB959DC95E5519F"}, "gridPos": {"h": 4, "w": 6, "x": 6, "y": 1}, "fieldConfig": {"defaults": {"unit": "cms", "decimals": 0, "thresholds": - {"mode": "absolute", "steps": [{"color": "#73BF69", "value": null}, {"color": "#FFD700", "value": 500}, {"color": "#FF7383", "value": 1000}, {"color": "#C4162A", "value": 2000}]}, "color": {"mode": - "thresholds"}}}, "options": {"graphMode": "area", "colorMode": "background", "textMode": "auto", "reduceOptions": {"values": false, "calcs": ["lastNotNull"]}}, "targets": [{"query": "from(bucket: \"default\")\n |> - range(start: -15m)\n |> filter(fn: (r) => r[\"_measurement\"] == \"m³\" and r[\"_field\"] == \"value\")\n |> filter(fn: (r) => r.entity_id == \"home_gaszahler_gasvolume\")\n |> last()\n |> yield(name: - \"mean\")", "resultFormat": "time_series"}]}, {"title": "Gas Cost (EUR)", "type": "stat", "datasource": {"type": "influxdb", "uid": "P2AB959DC95E5519F"}, "gridPos": {"h": 4, "w": 6, "x": 12, "y": 1}, - "fieldConfig": {"defaults": {"unit": "currencyEUR", "decimals": 0, "thresholds": {"mode": "absolute", "steps": [{"color": "#73BF69", "value": null}, {"color": "#FFD700", "value": 200}, {"color": "#FF7383", - "value": 500}, {"color": "#C4162A", "value": 1000}]}, "color": {"mode": "thresholds"}}}, "options": {"graphMode": "area", "colorMode": "background", "textMode": "auto", "reduceOptions": {"values": false, - "calcs": ["lastNotNull"]}}, "targets": [{"query": "from(bucket: \"default\")\n |> range(start: -15m)\n |> filter(fn: (r) => r[\"_measurement\"] == \"EUR\" and r[\"_field\"] == \"value\")\n |> filter(fn: - (r) => r.entity_id == \"home_gaszahler_gasvolume_cost\")\n |> last()\n |> yield(name: \"mean\")", "resultFormat": "time_series"}]}, {"title": "Electricity Cost (EUR)", "type": "stat", "datasource": - {"type": "influxdb", "uid": "P2AB959DC95E5519F"}, "gridPos": {"h": 4, "w": 6, "x": 18, "y": 1}, "fieldConfig": {"defaults": {"unit": "currencyEUR", "decimals": 0, "thresholds": {"mode": "absolute", - "steps": [{"color": "#73BF69", "value": null}, {"color": "#FFD700", "value": 100}, {"color": "#FF7383", "value": 300}, {"color": "#C4162A", "value": 500}]}, "color": {"mode": "thresholds"}}}, "options": - {"graphMode": "area", "colorMode": "background", "textMode": "auto", "reduceOptions": {"values": false, "calcs": ["lastNotNull"]}}, "targets": [{"query": "from(bucket: \"default\")\n |> range(start: - -15m)\n |> filter(fn: (r) => r[\"_measurement\"] == \"EUR\" and r[\"_field\"] == \"value\")\n |> filter(fn: (r) => r.entity_id == \"home_strommesserat_energy_counter_usage_high_tariff_cost\")\n |> - last()\n |> yield(name: \"mean\")", "resultFormat": "time_series"}]}, {"title": "📈 Gas Consumption Trend", "type": "row", "gridPos": {"h": 1, "w": 24, "x": 0, "y": 5}, "collapsed": false}, {"title": - "Gas Flow", "type": "timeseries", "datasource": {"type": "influxdb", "uid": "P2AB959DC95E5519F"}, "gridPos": {"h": 8, "w": 16, "x": 0, "y": 6}, "fieldConfig": {"defaults": {"unit": "cms", "custom": - {"lineWidth": 2, "fillOpacity": 5, "spanNulls": true, "showPoints": "never"}}, "overrides": [{"matcher": {"id": "byName", "options": "Gas Flow"}, "properties": [{"id": "color", "value": {"fixedColor": - "#FF7383", "mode": "fixed"}}]}]}, "options": {"legend": {"displayMode": "table", "placement": "bottom", "calcs": ["max", "mean"]}, "tooltip": {"mode": "multi", "sort": "desc"}}, "targets": [{"refId": - "FLOW", "query": "from(bucket: \"default\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"m³/h\" and r[\"_field\"] == \"value\")\n |> - filter(fn: (r) => r.entity_id == \"home_gaszahler_currentgasflow\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\") |> set(key: \"metric\", value: - \"Gas Flow\")", "resultFormat": "time_series"}]}, {"title": "Gas Volume", "type": "timeseries", "datasource": {"type": "influxdb", "uid": "P2AB959DC95E5519F"}, "gridPos": {"h": 8, "w": 8, "x": 16, "y": - 6}, "fieldConfig": {"defaults": {"unit": "cms", "custom": {"lineWidth": 2, "fillOpacity": 5, "spanNulls": true, "showPoints": "never"}}, "overrides": [{"matcher": {"id": "byName", "options": "Gas Volume"}, - "properties": [{"id": "color", "value": {"fixedColor": "#C4162A", "mode": "fixed"}}]}]}, "options": {"legend": {"displayMode": "table", "placement": "bottom", "calcs": ["mean", "lastNotNull"]}, "tooltip": - {"mode": "multi", "sort": "desc"}}, "targets": [{"refId": "VOL", "query": "from(bucket: \"default\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] - == \"m³\" and r[\"_field\"] == \"value\")\n |> filter(fn: (r) => r.entity_id == \"home_gaszahler_gasvolume\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: - \"mean\") |> set(key: \"metric\", value: \"Gas Volume\")", "resultFormat": "time_series"}]}, {"title": "🏠 Heating Activity", "type": "row", "gridPos": {"h": 1, "w": 24, "x": 0, "y": 14}, "collapsed": - false}, {"title": "Heating Valve Position", "type": "timeseries", "datasource": {"type": "influxdb", "uid": "P2AB959DC95E5519F"}, "gridPos": {"h": 10, "w": 24, "x": 0, "y": 15}, "fieldConfig": {"defaults": - {"unit": "percent", "custom": {"lineWidth": 2, "fillOpacity": 5, "spanNulls": true, "showPoints": "never"}}, "overrides": [{"matcher": {"id": "byName", "options": "Wohnzimmer"}, "properties": [{"id": - "color", "value": {"fixedColor": "#FF7383", "mode": "fixed"}}]}, {"matcher": {"id": "byName", "options": "Wohnzimmer #2"}, "properties": [{"id": "color", "value": {"fixedColor": "#FF9830", "mode": "fixed"}}]}, - {"matcher": {"id": "byName", "options": "Arbeitszimmer"}, "properties": [{"id": "color", "value": {"fixedColor": "#5794F2", "mode": "fixed"}}]}, {"matcher": {"id": "byName", "options": "Schlafzimmer"}, - "properties": [{"id": "color", "value": {"fixedColor": "#8F3BB8", "mode": "fixed"}}]}, {"matcher": {"id": "byName", "options": "Küche"}, "properties": [{"id": "color", "value": {"fixedColor": "#73BF69", - "mode": "fixed"}}]}, {"matcher": {"id": "byName", "options": "Bad"}, "properties": [{"id": "color", "value": {"fixedColor": "#1F60C4", "mode": "fixed"}}]}]}, "options": {"legend": {"displayMode": "table", - "placement": "bottom", "calcs": ["mean", "lastNotNull"]}, "tooltip": {"mode": "multi", "sort": "desc"}}, "targets": [{"refId": "Wo", "query": "from(bucket: \"default\")\n |> range(start: v.timeRangeStart, - stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"%\" and r[\"_field\"] == \"value\")\n |> filter(fn: (r) => r.entity_id == \"home_wohnzimmer_heating\")\n |> aggregateWindow(every: - v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")\n |> set(key: \"room\", value: \"Wohnzimmer\")", "resultFormat": "time_series"}, {"refId": "Wo", "query": "from(bucket: \"default\")\n |> - range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"%\" and r[\"_field\"] == \"value\")\n |> filter(fn: (r) => r.entity_id == \"home_wohnzimmer_2_heating\")\n |> - aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")\n |> set(key: \"room\", value: \"Wohnzimmer #2\")", "resultFormat": "time_series"}, {"refId": "Ar", - "query": "from(bucket: \"default\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"%\" and r[\"_field\"] == \"value\")\n |> filter(fn: - (r) => r.entity_id == \"home_arbeitszimmer_heating\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")\n |> set(key: \"room\", value: \"Arbeitszimmer\")", - "resultFormat": "time_series"}, {"refId": "Sc", "query": "from(bucket: \"default\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"%\" and - r[\"_field\"] == \"value\")\n |> filter(fn: (r) => r.entity_id == \"home_schlafzimmer_og_heating\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")\n |> - set(key: \"room\", value: \"Schlafzimmer\")", "resultFormat": "time_series"}, {"refId": "Kü", "query": "from(bucket: \"default\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: - (r) => r[\"_measurement\"] == \"%\" and r[\"_field\"] == \"value\")\n |> filter(fn: (r) => r.entity_id == \"home_kuche_vorne_heating\")\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: - false)\n |> yield(name: \"mean\")\n |> set(key: \"room\", value: \"Küche\")", "resultFormat": "time_series"}, {"refId": "Ba", "query": "from(bucket: \"default\")\n |> range(start: v.timeRangeStart, - stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"%\" and r[\"_field\"] == \"value\")\n |> filter(fn: (r) => r.entity_id == \"home_badezimmer_thermostat_heating\")\n |> aggregateWindow(every: - v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")\n |> set(key: \"room\", value: \"Bad\")", "resultFormat": "time_series"}]}]}' + name: grafana-dashboard-heating-gas + namespace: monitoring