902 lines
No EOL
30 KiB
JSON
902 lines
No EOL
30 KiB
JSON
{
|
|
"__inputs": [
|
|
{
|
|
"name": "DS_P1",
|
|
"label": "p1",
|
|
"description": "",
|
|
"type": "datasource",
|
|
"pluginId": "grafana-postgresql-datasource",
|
|
"pluginName": "PostgreSQL"
|
|
}
|
|
],
|
|
"__elements": {},
|
|
"__requires": [
|
|
{
|
|
"type": "grafana",
|
|
"id": "grafana",
|
|
"name": "Grafana",
|
|
"version": "11.1.1"
|
|
},
|
|
{
|
|
"type": "datasource",
|
|
"id": "grafana-postgresql-datasource",
|
|
"name": "PostgreSQL",
|
|
"version": "1.0.0"
|
|
},
|
|
{
|
|
"type": "panel",
|
|
"id": "timeseries",
|
|
"name": "Time series",
|
|
"version": ""
|
|
}
|
|
],
|
|
"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,
|
|
"id": null,
|
|
"links": [],
|
|
"liveNow": false,
|
|
"panels": [
|
|
{
|
|
"datasource": {
|
|
"type": "grafana-postgresql-datasource",
|
|
"uid": "${DS_P1}"
|
|
},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
},
|
|
"custom": {
|
|
"axisBorderShow": false,
|
|
"axisCenteredZero": false,
|
|
"axisColorMode": "text",
|
|
"axisLabel": "",
|
|
"axisPlacement": "auto",
|
|
"barAlignment": 0,
|
|
"drawStyle": "line",
|
|
"fillOpacity": 0,
|
|
"gradientMode": "none",
|
|
"hideFrom": {
|
|
"legend": false,
|
|
"tooltip": false,
|
|
"viz": false
|
|
},
|
|
"insertNulls": false,
|
|
"lineInterpolation": "linear",
|
|
"lineWidth": 1,
|
|
"pointSize": 5,
|
|
"scaleDistribution": {
|
|
"type": "linear"
|
|
},
|
|
"showPoints": "auto",
|
|
"spanNulls": false,
|
|
"stacking": {
|
|
"group": "A",
|
|
"mode": "none"
|
|
},
|
|
"thresholdsStyle": {
|
|
"mode": "off"
|
|
}
|
|
},
|
|
"mappings": [],
|
|
"thresholds": {
|
|
"mode": "absolute",
|
|
"steps": [
|
|
{
|
|
"color": "green",
|
|
"value": null
|
|
},
|
|
{
|
|
"color": "red",
|
|
"value": 80
|
|
}
|
|
]
|
|
},
|
|
"unit": "watt"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"gridPos": {
|
|
"h": 10,
|
|
"w": 12,
|
|
"x": 0,
|
|
"y": 0
|
|
},
|
|
"id": 8,
|
|
"options": {
|
|
"legend": {
|
|
"calcs": [
|
|
"min",
|
|
"max",
|
|
"mean",
|
|
"stdDev",
|
|
"last"
|
|
],
|
|
"displayMode": "table",
|
|
"placement": "bottom",
|
|
"showLegend": true
|
|
},
|
|
"tooltip": {
|
|
"mode": "multi",
|
|
"sort": "none"
|
|
}
|
|
},
|
|
"targets": [
|
|
{
|
|
"datasource": {
|
|
"type": "grafana-postgresql-datasource",
|
|
"uid": "${DS_P1}"
|
|
},
|
|
"editorMode": "code",
|
|
"format": "table",
|
|
"rawQuery": true,
|
|
"rawSql": "-- SELECT time_bucket('$__interval', timestamp) AS time, \n-- delivery_l1 - returning_l1 AS \"Power L1\", \n-- delivery_l2 - returning_l2 AS \"Power L2\", \n-- delivery_l3 - returning_l3 AS \"Power L3\",\n-- delivery_all - returning_all AS \"Power total\"\n-- FROM p1\n-- WHERE timestamp >= $__timeFrom()::timestamptz AND timestamp < $__timeTo()::timestamptz\n\nWITH RECURSIVE DateRange AS (\n SELECT generate_series($__timeFrom()::timestamp, $__timeTo()::timestamp, '$__interval') AS timestamp\n),\nLastValues AS (\n SELECT\n dr.timestamp,\n (SELECT delivery_l1 FROM p1 WHERE timestamp <= dr.timestamp AND delivery_l1 IS NOT NULL ORDER BY timestamp DESC LIMIT 1) AS delivery_l1,\n (SELECT delivery_l2 FROM p1 WHERE timestamp <= dr.timestamp AND delivery_l2 IS NOT NULL ORDER BY timestamp DESC LIMIT 1) AS delivery_l2,\n (SELECT delivery_l3 FROM p1 WHERE timestamp <= dr.timestamp AND delivery_l3 IS NOT NULL ORDER BY timestamp DESC LIMIT 1) AS delivery_l3,\n (SELECT delivery_all FROM p1 WHERE timestamp <= dr.timestamp AND delivery_all IS NOT NULL ORDER BY timestamp DESC LIMIT 1) AS delivery_all,\n (SELECT returning_l1 FROM p1 WHERE timestamp <= dr.timestamp AND returning_l1 IS NOT NULL ORDER BY timestamp DESC LIMIT 1) AS returning_l1,\n (SELECT returning_l2 FROM p1 WHERE timestamp <= dr.timestamp AND returning_l2 IS NOT NULL ORDER BY timestamp DESC LIMIT 1) AS returning_l2,\n (SELECT returning_l3 FROM p1 WHERE timestamp <= dr.timestamp AND returning_l3 IS NOT NULL ORDER BY timestamp DESC LIMIT 1) AS returning_l3,\n (SELECT returning_all FROM p1 WHERE timestamp <= dr.timestamp AND returning_all IS NOT NULL ORDER BY timestamp DESC LIMIT 1) AS returning_all\n FROM DateRange dr\n)\nSELECT\n timestamp,\n COALESCE(delivery_l1, 0) - COALESCE(returning_l1, 0) AS \"Power L1\",\n COALESCE(delivery_l2, 0) - COALESCE(returning_l2, 0) AS \"Power L2\",\n COALESCE(delivery_l3, 0) - COALESCE(returning_l3, 0) AS \"Power L3\",\n COALESCE(delivery_all, 0) - COALESCE(returning_all, 0) AS \"Power total\"\nFROM LastValues\nORDER BY timestamp;\n",
|
|
"refId": "A",
|
|
"sql": {
|
|
"columns": [
|
|
{
|
|
"parameters": [],
|
|
"type": "function"
|
|
}
|
|
],
|
|
"groupBy": [
|
|
{
|
|
"property": {
|
|
"type": "string"
|
|
},
|
|
"type": "groupBy"
|
|
}
|
|
],
|
|
"limit": 50
|
|
},
|
|
"table": "p1"
|
|
}
|
|
],
|
|
"title": "Current import or export",
|
|
"type": "timeseries"
|
|
},
|
|
{
|
|
"datasource": {
|
|
"type": "grafana-postgresql-datasource",
|
|
"uid": "${DS_P1}"
|
|
},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
},
|
|
"custom": {
|
|
"axisBorderShow": false,
|
|
"axisCenteredZero": false,
|
|
"axisColorMode": "text",
|
|
"axisLabel": "",
|
|
"axisPlacement": "auto",
|
|
"barAlignment": 0,
|
|
"drawStyle": "line",
|
|
"fillOpacity": 0,
|
|
"gradientMode": "none",
|
|
"hideFrom": {
|
|
"legend": false,
|
|
"tooltip": false,
|
|
"viz": false
|
|
},
|
|
"insertNulls": false,
|
|
"lineInterpolation": "linear",
|
|
"lineWidth": 1,
|
|
"pointSize": 5,
|
|
"scaleDistribution": {
|
|
"type": "linear"
|
|
},
|
|
"showPoints": "auto",
|
|
"spanNulls": false,
|
|
"stacking": {
|
|
"group": "A",
|
|
"mode": "none"
|
|
},
|
|
"thresholdsStyle": {
|
|
"mode": "off"
|
|
}
|
|
},
|
|
"mappings": [],
|
|
"thresholds": {
|
|
"mode": "absolute",
|
|
"steps": [
|
|
{
|
|
"color": "green",
|
|
"value": null
|
|
},
|
|
{
|
|
"color": "red",
|
|
"value": 80
|
|
}
|
|
]
|
|
},
|
|
"unit": "watth"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"gridPos": {
|
|
"h": 10,
|
|
"w": 6,
|
|
"x": 12,
|
|
"y": 0
|
|
},
|
|
"id": 4,
|
|
"options": {
|
|
"legend": {
|
|
"calcs": [
|
|
"firstNotNull",
|
|
"lastNotNull",
|
|
"range"
|
|
],
|
|
"displayMode": "table",
|
|
"placement": "bottom",
|
|
"showLegend": true
|
|
},
|
|
"tooltip": {
|
|
"mode": "multi",
|
|
"sort": "none"
|
|
}
|
|
},
|
|
"targets": [
|
|
{
|
|
"datasource": {
|
|
"type": "grafana-postgresql-datasource",
|
|
"uid": "${DS_P1}"
|
|
},
|
|
"editorMode": "code",
|
|
"format": "table",
|
|
"rawQuery": true,
|
|
"rawSql": "-- SELECT time_bucket('$__interval', timestamp) AS time, \n-- delivered_tariff1+delivered_tariff2 AS \"Import total\", \n-- returned_tariff1+returned_tariff2 AS \"Export total\", \n-- delivered_tariff1 AS \"Import register 1\", \n-- delivered_tariff2 AS \"Import register 2\", \n-- returned_tariff1 AS \"Export register 1\", \n-- returned_tariff2 AS \"Export register 2\"\n-- FROM p1\n-- WHERE timestamp >= $__timeFrom()::timestamptz AND timestamp < $__timeTo()::timestamptz\n\nWITH LastKnownValues AS (\n SELECT\n (SELECT delivered_tariff1 FROM p1 WHERE delivered_tariff1 IS NOT NULL AND timestamp < $__timeFrom()::timestamptz ORDER BY timestamp DESC LIMIT 1) AS last_delivered_tariff1,\n (SELECT delivered_tariff2 FROM p1 WHERE delivered_tariff2 IS NOT NULL AND timestamp < $__timeFrom()::timestamptz ORDER BY timestamp DESC LIMIT 1) AS last_delivered_tariff2,\n (SELECT returned_tariff1 FROM p1 WHERE returned_tariff1 IS NOT NULL AND timestamp < $__timeFrom()::timestamptz ORDER BY timestamp DESC LIMIT 1) AS last_returned_tariff1,\n (SELECT returned_tariff2 FROM p1 WHERE returned_tariff2 IS NOT NULL AND timestamp < $__timeFrom()::timestamptz ORDER BY timestamp DESC LIMIT 1) AS last_returned_tariff2\n),\nMainQuery AS (\n SELECT\n time_bucket('$__interval', timestamp) AS time,\n delivered_tariff1,\n delivered_tariff2,\n returned_tariff1,\n returned_tariff2\n FROM\n p1\n WHERE\n timestamp >= $__timeFrom()::timestamptz AND timestamp < $__timeTo()::timestamptz\n)\nSELECT\n mq.time,\n (COALESCE(mq.delivered_tariff1, lv.last_delivered_tariff1) + COALESCE(mq.delivered_tariff2, lv.last_delivered_tariff2)) AS \"Import total\",\n (COALESCE(mq.returned_tariff1, lv.last_returned_tariff1) + COALESCE(mq.returned_tariff2, lv.last_returned_tariff2)) AS \"Export total\",\n COALESCE(mq.delivered_tariff1, lv.last_delivered_tariff1) AS \"Import register 1\",\n COALESCE(mq.delivered_tariff2, lv.last_delivered_tariff2) AS \"Import register 2\",\n COALESCE(mq.returned_tariff1, lv.last_returned_tariff1) AS \"Export register 1\",\n COALESCE(mq.returned_tariff2, lv.last_returned_tariff2) AS \"Export register 2\"\nFROM\n MainQuery mq,\n LastKnownValues lv\n",
|
|
"refId": "A",
|
|
"sql": {
|
|
"columns": [
|
|
{
|
|
"parameters": [],
|
|
"type": "function"
|
|
}
|
|
],
|
|
"groupBy": [
|
|
{
|
|
"property": {
|
|
"type": "string"
|
|
},
|
|
"type": "groupBy"
|
|
}
|
|
],
|
|
"limit": 50
|
|
},
|
|
"table": "p1"
|
|
}
|
|
],
|
|
"title": "Meter readings electricity",
|
|
"type": "timeseries"
|
|
},
|
|
{
|
|
"datasource": {
|
|
"type": "grafana-postgresql-datasource",
|
|
"uid": "${DS_P1}"
|
|
},
|
|
"description": "First + Last = since 0, Range = current time window.",
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
},
|
|
"custom": {
|
|
"axisBorderShow": false,
|
|
"axisCenteredZero": false,
|
|
"axisColorMode": "text",
|
|
"axisLabel": "",
|
|
"axisPlacement": "auto",
|
|
"barAlignment": 0,
|
|
"drawStyle": "line",
|
|
"fillOpacity": 0,
|
|
"gradientMode": "none",
|
|
"hideFrom": {
|
|
"legend": false,
|
|
"tooltip": false,
|
|
"viz": false
|
|
},
|
|
"insertNulls": false,
|
|
"lineInterpolation": "linear",
|
|
"lineWidth": 1,
|
|
"pointSize": 5,
|
|
"scaleDistribution": {
|
|
"type": "linear"
|
|
},
|
|
"showPoints": "auto",
|
|
"spanNulls": false,
|
|
"stacking": {
|
|
"group": "A",
|
|
"mode": "none"
|
|
},
|
|
"thresholdsStyle": {
|
|
"mode": "off"
|
|
}
|
|
},
|
|
"mappings": [],
|
|
"thresholds": {
|
|
"mode": "absolute",
|
|
"steps": [
|
|
{
|
|
"color": "green",
|
|
"value": null
|
|
},
|
|
{
|
|
"color": "red",
|
|
"value": 80
|
|
}
|
|
]
|
|
},
|
|
"unit": "watth"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"gridPos": {
|
|
"h": 10,
|
|
"w": 6,
|
|
"x": 18,
|
|
"y": 0
|
|
},
|
|
"id": 10,
|
|
"options": {
|
|
"legend": {
|
|
"calcs": [
|
|
"firstNotNull",
|
|
"lastNotNull",
|
|
"range"
|
|
],
|
|
"displayMode": "table",
|
|
"placement": "bottom",
|
|
"showLegend": true
|
|
},
|
|
"tooltip": {
|
|
"mode": "multi",
|
|
"sort": "none"
|
|
}
|
|
},
|
|
"targets": [
|
|
{
|
|
"datasource": {
|
|
"type": "grafana-postgresql-datasource",
|
|
"uid": "${DS_P1}"
|
|
},
|
|
"editorMode": "code",
|
|
"format": "table",
|
|
"rawQuery": true,
|
|
"rawSql": "-- SELECT time_bucket('$__interval', timestamp) AS time, \n-- delivered_tariff1-returned_tariff1 AS \"Register 1\", \n-- delivered_tariff2-returned_tariff2 AS \"Register 2\", \n-- delivered_tariff1+delivered_tariff2-returned_tariff1-returned_tariff2 AS \"Total\"\n-- FROM p1\n-- WHERE timestamp >= $__timeFrom()::timestamptz AND timestamp < $__timeTo()::timestamptz\n\nWITH LastKnownValues AS (\n SELECT\n (SELECT delivered_tariff1 FROM p1 WHERE delivered_tariff1 IS NOT NULL AND timestamp < $__timeFrom()::timestamptz ORDER BY timestamp DESC LIMIT 1) AS last_delivered_tariff1,\n (SELECT delivered_tariff2 FROM p1 WHERE delivered_tariff2 IS NOT NULL AND timestamp < $__timeFrom()::timestamptz ORDER BY timestamp DESC LIMIT 1) AS last_delivered_tariff2,\n (SELECT returned_tariff1 FROM p1 WHERE returned_tariff1 IS NOT NULL AND timestamp < $__timeFrom()::timestamptz ORDER BY timestamp DESC LIMIT 1) AS last_returned_tariff1,\n (SELECT returned_tariff2 FROM p1 WHERE returned_tariff2 IS NOT NULL AND timestamp < $__timeFrom()::timestamptz ORDER BY timestamp DESC LIMIT 1) AS last_returned_tariff2\n),\nMainQuery AS (\n SELECT\n time_bucket('$__interval', timestamp) AS time,\n COALESCE(delivered_tariff1, (SELECT last_delivered_tariff1 FROM LastKnownValues)) AS delivered_tariff1,\n COALESCE(delivered_tariff2, (SELECT last_delivered_tariff2 FROM LastKnownValues)) AS delivered_tariff2,\n COALESCE(returned_tariff1, (SELECT last_returned_tariff1 FROM LastKnownValues)) AS returned_tariff1,\n COALESCE(returned_tariff2, (SELECT last_returned_tariff2 FROM LastKnownValues)) AS returned_tariff2\n FROM\n p1\n WHERE\n timestamp >= $__timeFrom()::timestamptz AND timestamp < $__timeTo()::timestamptz\n)\nSELECT\n time,\n (delivered_tariff1 - returned_tariff1) AS \"Register 1\",\n (delivered_tariff2 - returned_tariff2) AS \"Register 2\",\n (delivered_tariff1 + delivered_tariff2 - returned_tariff1 - returned_tariff2) AS \"Total\"\nFROM\n MainQuery\n",
|
|
"refId": "A",
|
|
"sql": {
|
|
"columns": [
|
|
{
|
|
"parameters": [],
|
|
"type": "function"
|
|
}
|
|
],
|
|
"groupBy": [
|
|
{
|
|
"property": {
|
|
"type": "string"
|
|
},
|
|
"type": "groupBy"
|
|
}
|
|
],
|
|
"limit": 50
|
|
},
|
|
"table": "p1"
|
|
}
|
|
],
|
|
"title": "Meter readings (net metered)",
|
|
"type": "timeseries"
|
|
},
|
|
{
|
|
"datasource": {
|
|
"type": "grafana-postgresql-datasource",
|
|
"uid": "${DS_P1}"
|
|
},
|
|
"description": "Min: 216,2V. Max: 253V. (-6% to +10%)",
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
},
|
|
"custom": {
|
|
"axisBorderShow": false,
|
|
"axisCenteredZero": false,
|
|
"axisColorMode": "text",
|
|
"axisLabel": "",
|
|
"axisPlacement": "auto",
|
|
"barAlignment": 0,
|
|
"drawStyle": "line",
|
|
"fillOpacity": 0,
|
|
"gradientMode": "none",
|
|
"hideFrom": {
|
|
"legend": false,
|
|
"tooltip": false,
|
|
"viz": false
|
|
},
|
|
"insertNulls": false,
|
|
"lineInterpolation": "linear",
|
|
"lineWidth": 1,
|
|
"pointSize": 5,
|
|
"scaleDistribution": {
|
|
"type": "linear"
|
|
},
|
|
"showPoints": "auto",
|
|
"spanNulls": false,
|
|
"stacking": {
|
|
"group": "A",
|
|
"mode": "none"
|
|
},
|
|
"thresholdsStyle": {
|
|
"mode": "off"
|
|
}
|
|
},
|
|
"mappings": [],
|
|
"thresholds": {
|
|
"mode": "absolute",
|
|
"steps": [
|
|
{
|
|
"color": "green",
|
|
"value": null
|
|
},
|
|
{
|
|
"color": "red",
|
|
"value": 80
|
|
}
|
|
]
|
|
},
|
|
"unit": "volt"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"gridPos": {
|
|
"h": 9,
|
|
"w": 12,
|
|
"x": 0,
|
|
"y": 10
|
|
},
|
|
"id": 3,
|
|
"options": {
|
|
"legend": {
|
|
"calcs": [
|
|
"logmin",
|
|
"max",
|
|
"mean",
|
|
"lastNotNull"
|
|
],
|
|
"displayMode": "table",
|
|
"placement": "bottom",
|
|
"showLegend": true
|
|
},
|
|
"tooltip": {
|
|
"mode": "multi",
|
|
"sort": "none"
|
|
}
|
|
},
|
|
"targets": [
|
|
{
|
|
"datasource": {
|
|
"type": "grafana-postgresql-datasource",
|
|
"uid": "${DS_P1}"
|
|
},
|
|
"editorMode": "code",
|
|
"format": "table",
|
|
"rawQuery": true,
|
|
"rawSql": "SELECT time_bucket('$__interval', timestamp) AS time, \nvoltage_l1 AS \"Voltage L1\", \nvoltage_l2 AS \"Voltage L2\", \nvoltage_l3 AS \"Voltage L3\"\nFROM p1\nWHERE timestamp >= $__timeFrom()::timestamptz AND timestamp < $__timeTo()::timestamptz",
|
|
"refId": "A",
|
|
"sql": {
|
|
"columns": [
|
|
{
|
|
"parameters": [],
|
|
"type": "function"
|
|
}
|
|
],
|
|
"groupBy": [
|
|
{
|
|
"property": {
|
|
"type": "string"
|
|
},
|
|
"type": "groupBy"
|
|
}
|
|
],
|
|
"limit": 50
|
|
},
|
|
"table": "p1"
|
|
}
|
|
],
|
|
"title": "Voltage",
|
|
"type": "timeseries"
|
|
},
|
|
{
|
|
"datasource": {
|
|
"type": "grafana-postgresql-datasource",
|
|
"uid": "${DS_P1}"
|
|
},
|
|
"description": "",
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
},
|
|
"custom": {
|
|
"axisBorderShow": false,
|
|
"axisCenteredZero": false,
|
|
"axisColorMode": "text",
|
|
"axisLabel": "",
|
|
"axisPlacement": "auto",
|
|
"barAlignment": 0,
|
|
"drawStyle": "line",
|
|
"fillOpacity": 0,
|
|
"gradientMode": "none",
|
|
"hideFrom": {
|
|
"legend": false,
|
|
"tooltip": false,
|
|
"viz": false
|
|
},
|
|
"insertNulls": false,
|
|
"lineInterpolation": "linear",
|
|
"lineWidth": 1,
|
|
"pointSize": 5,
|
|
"scaleDistribution": {
|
|
"type": "linear"
|
|
},
|
|
"showPoints": "auto",
|
|
"spanNulls": false,
|
|
"stacking": {
|
|
"group": "A",
|
|
"mode": "none"
|
|
},
|
|
"thresholdsStyle": {
|
|
"mode": "off"
|
|
}
|
|
},
|
|
"mappings": [],
|
|
"thresholds": {
|
|
"mode": "absolute",
|
|
"steps": [
|
|
{
|
|
"color": "green",
|
|
"value": null
|
|
},
|
|
{
|
|
"color": "red",
|
|
"value": 80
|
|
}
|
|
]
|
|
},
|
|
"unit": "amp"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"gridPos": {
|
|
"h": 9,
|
|
"w": 12,
|
|
"x": 12,
|
|
"y": 10
|
|
},
|
|
"id": 6,
|
|
"options": {
|
|
"legend": {
|
|
"calcs": [
|
|
"min",
|
|
"max",
|
|
"mean",
|
|
"lastNotNull"
|
|
],
|
|
"displayMode": "table",
|
|
"placement": "bottom",
|
|
"showLegend": true
|
|
},
|
|
"tooltip": {
|
|
"mode": "multi",
|
|
"sort": "none"
|
|
}
|
|
},
|
|
"targets": [
|
|
{
|
|
"datasource": {
|
|
"type": "grafana-postgresql-datasource",
|
|
"uid": "${DS_P1}"
|
|
},
|
|
"editorMode": "code",
|
|
"format": "table",
|
|
"rawQuery": true,
|
|
"rawSql": "SELECT time_bucket('$__interval', timestamp) AS time, \ncurrent_l1 AS \"Current L1\", \ncurrent_l2 AS \"Current L2\", \ncurrent_l3 AS \"Current L3\"\nFROM p1\nWHERE timestamp >= $__timeFrom()::timestamptz AND timestamp < $__timeTo()::timestamptz",
|
|
"refId": "A",
|
|
"sql": {
|
|
"columns": [
|
|
{
|
|
"parameters": [],
|
|
"type": "function"
|
|
}
|
|
],
|
|
"groupBy": [
|
|
{
|
|
"property": {
|
|
"type": "string"
|
|
},
|
|
"type": "groupBy"
|
|
}
|
|
],
|
|
"limit": 50
|
|
},
|
|
"table": "p1"
|
|
}
|
|
],
|
|
"title": "Current",
|
|
"type": "timeseries"
|
|
},
|
|
{
|
|
"datasource": {
|
|
"type": "grafana-postgresql-datasource",
|
|
"uid": "${DS_P1}"
|
|
},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
},
|
|
"custom": {
|
|
"axisBorderShow": false,
|
|
"axisCenteredZero": false,
|
|
"axisColorMode": "text",
|
|
"axisLabel": "",
|
|
"axisPlacement": "auto",
|
|
"barAlignment": 0,
|
|
"drawStyle": "line",
|
|
"fillOpacity": 0,
|
|
"gradientMode": "none",
|
|
"hideFrom": {
|
|
"legend": false,
|
|
"tooltip": false,
|
|
"viz": false
|
|
},
|
|
"insertNulls": false,
|
|
"lineInterpolation": "linear",
|
|
"lineWidth": 1,
|
|
"pointSize": 5,
|
|
"scaleDistribution": {
|
|
"type": "linear"
|
|
},
|
|
"showPoints": "auto",
|
|
"spanNulls": false,
|
|
"stacking": {
|
|
"group": "A",
|
|
"mode": "none"
|
|
},
|
|
"thresholdsStyle": {
|
|
"mode": "off"
|
|
}
|
|
},
|
|
"mappings": [],
|
|
"thresholds": {
|
|
"mode": "absolute",
|
|
"steps": [
|
|
{
|
|
"color": "green",
|
|
"value": null
|
|
},
|
|
{
|
|
"color": "red",
|
|
"value": 80
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"overrides": []
|
|
},
|
|
"gridPos": {
|
|
"h": 8,
|
|
"w": 12,
|
|
"x": 0,
|
|
"y": 19
|
|
},
|
|
"id": 7,
|
|
"options": {
|
|
"legend": {
|
|
"calcs": [
|
|
"firstNotNull",
|
|
"lastNotNull",
|
|
"range"
|
|
],
|
|
"displayMode": "table",
|
|
"placement": "bottom",
|
|
"showLegend": true
|
|
},
|
|
"tooltip": {
|
|
"mode": "multi",
|
|
"sort": "none"
|
|
}
|
|
},
|
|
"targets": [
|
|
{
|
|
"datasource": {
|
|
"type": "grafana-postgresql-datasource",
|
|
"uid": "${DS_P1}"
|
|
},
|
|
"editorMode": "code",
|
|
"format": "table",
|
|
"rawQuery": true,
|
|
"rawSql": "SELECT time_bucket('$__interval', timestamp) AS time, \nfailures AS \"Power outages\", \nlong_failures AS \"Long power outages\" \nFROM p1\nWHERE timestamp >= $__timeFrom()::timestamptz AND timestamp < $__timeTo()::timestamptz",
|
|
"refId": "A",
|
|
"sql": {
|
|
"columns": [
|
|
{
|
|
"parameters": [],
|
|
"type": "function"
|
|
}
|
|
],
|
|
"groupBy": [
|
|
{
|
|
"property": {
|
|
"type": "string"
|
|
},
|
|
"type": "groupBy"
|
|
}
|
|
],
|
|
"limit": 50
|
|
}
|
|
}
|
|
],
|
|
"title": "Power outages",
|
|
"type": "timeseries"
|
|
},
|
|
{
|
|
"datasource": {
|
|
"type": "grafana-postgresql-datasource",
|
|
"uid": "${DS_P1}"
|
|
},
|
|
"description": "1L = 1 dm^3, so 1kL = 1m^3. \nRange = consumption in selected time window.",
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"color": {
|
|
"fixedColor": "yellow",
|
|
"mode": "fixed"
|
|
},
|
|
"custom": {
|
|
"axisBorderShow": false,
|
|
"axisCenteredZero": false,
|
|
"axisColorMode": "text",
|
|
"axisLabel": "",
|
|
"axisPlacement": "auto",
|
|
"barAlignment": 0,
|
|
"drawStyle": "line",
|
|
"fillOpacity": 50,
|
|
"gradientMode": "opacity",
|
|
"hideFrom": {
|
|
"legend": false,
|
|
"tooltip": false,
|
|
"viz": false
|
|
},
|
|
"insertNulls": false,
|
|
"lineInterpolation": "stepAfter",
|
|
"lineStyle": {
|
|
"fill": "solid"
|
|
},
|
|
"lineWidth": 1,
|
|
"pointSize": 5,
|
|
"scaleDistribution": {
|
|
"type": "linear"
|
|
},
|
|
"showPoints": "auto",
|
|
"spanNulls": false,
|
|
"stacking": {
|
|
"group": "A",
|
|
"mode": "none"
|
|
},
|
|
"thresholdsStyle": {
|
|
"mode": "off"
|
|
}
|
|
},
|
|
"fieldMinMax": false,
|
|
"mappings": [],
|
|
"thresholds": {
|
|
"mode": "absolute",
|
|
"steps": [
|
|
{
|
|
"color": "green",
|
|
"value": null
|
|
},
|
|
{
|
|
"color": "red",
|
|
"value": 80
|
|
}
|
|
]
|
|
},
|
|
"unit": "litre"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"gridPos": {
|
|
"h": 8,
|
|
"w": 12,
|
|
"x": 12,
|
|
"y": 19
|
|
},
|
|
"id": 5,
|
|
"options": {
|
|
"legend": {
|
|
"calcs": [
|
|
"firstNotNull",
|
|
"lastNotNull",
|
|
"range"
|
|
],
|
|
"displayMode": "table",
|
|
"placement": "bottom",
|
|
"showLegend": true
|
|
},
|
|
"tooltip": {
|
|
"mode": "multi",
|
|
"sort": "none"
|
|
}
|
|
},
|
|
"targets": [
|
|
{
|
|
"datasource": {
|
|
"type": "grafana-postgresql-datasource",
|
|
"uid": "${DS_P1}"
|
|
},
|
|
"editorMode": "code",
|
|
"format": "table",
|
|
"rawQuery": true,
|
|
"rawSql": "SELECT time_bucket('$__interval', timestamp) AS time, \ngas AS \"Gas consumption\"\nFROM p1\nWHERE timestamp >= $__timeFrom()::timestamptz AND timestamp < $__timeTo()::timestamptz AND gas IS NOT NULL",
|
|
"refId": "A",
|
|
"sql": {
|
|
"columns": [
|
|
{
|
|
"parameters": [],
|
|
"type": "function"
|
|
}
|
|
],
|
|
"groupBy": [
|
|
{
|
|
"property": {
|
|
"type": "string"
|
|
},
|
|
"type": "groupBy"
|
|
}
|
|
],
|
|
"limit": 50
|
|
}
|
|
}
|
|
],
|
|
"title": "Gas consumption",
|
|
"type": "timeseries"
|
|
}
|
|
],
|
|
"refresh": "5s",
|
|
"schemaVersion": 39,
|
|
"tags": [],
|
|
"templating": {
|
|
"list": []
|
|
},
|
|
"time": {
|
|
"from": "now/d",
|
|
"to": "now"
|
|
},
|
|
"timepicker": {},
|
|
"timezone": "",
|
|
"title": "P1 meter readings",
|
|
"uid": "cf296851-06f4-4479-9d5e-2bf85b56f69c",
|
|
"version": 2,
|
|
"weekStart": ""
|
|
} |