Mercurial > ~darius > hgwebdir.cgi > pw2log
comparison Grafana-dashboard.json @ 5:c02b765b4eb3 default tip
Add grafana dashboard configuration.
author | Daniel O'Connor <darius@dons.net.au> |
---|---|
date | Fri, 21 Jul 2023 19:57:53 +0930 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
4:8990981c60a0 | 5:c02b765b4eb3 |
---|---|
1 { | |
2 "annotations": { | |
3 "list": [ | |
4 { | |
5 "$$hashKey": "object:7", | |
6 "builtIn": 1, | |
7 "datasource": { | |
8 "type": "datasource", | |
9 "uid": "grafana" | |
10 }, | |
11 "enable": true, | |
12 "hide": true, | |
13 "iconColor": "rgba(0, 211, 255, 1)", | |
14 "name": "Annotations & Alerts", | |
15 "target": { | |
16 "limit": 100, | |
17 "matchAny": false, | |
18 "tags": [], | |
19 "type": "dashboard" | |
20 }, | |
21 "type": "dashboard" | |
22 } | |
23 ] | |
24 }, | |
25 "editable": true, | |
26 "fiscalYearStartMonth": 0, | |
27 "graphTooltip": 2, | |
28 "id": 4, | |
29 "links": [], | |
30 "liveNow": false, | |
31 "panels": [ | |
32 { | |
33 "aliasColors": { | |
34 "Battery": "red", | |
35 "Grid": "blue", | |
36 "Solar": "green", | |
37 "battery_power": "red", | |
38 "grid_power": "blue", | |
39 "solar_power": "green" | |
40 }, | |
41 "bars": false, | |
42 "dashLength": 10, | |
43 "dashes": false, | |
44 "datasource": { | |
45 "type": "postgres", | |
46 "uid": "000000004" | |
47 }, | |
48 "fieldConfig": { | |
49 "defaults": { | |
50 "links": [] | |
51 }, | |
52 "overrides": [] | |
53 }, | |
54 "fill": 0, | |
55 "fillGradient": 0, | |
56 "gridPos": { | |
57 "h": 11, | |
58 "w": 24, | |
59 "x": 0, | |
60 "y": 0 | |
61 }, | |
62 "hiddenSeries": false, | |
63 "id": 2, | |
64 "legend": { | |
65 "avg": false, | |
66 "current": false, | |
67 "max": false, | |
68 "min": false, | |
69 "show": true, | |
70 "total": false, | |
71 "values": false | |
72 }, | |
73 "lines": true, | |
74 "linewidth": 1, | |
75 "nullPointMode": "null", | |
76 "options": { | |
77 "alertThreshold": true | |
78 }, | |
79 "percentage": false, | |
80 "pluginVersion": "8.5.4", | |
81 "pointradius": 2, | |
82 "points": false, | |
83 "renderer": "flot", | |
84 "seriesOverrides": [ | |
85 { | |
86 "alias": "battery_charge", | |
87 "yaxis": 2 | |
88 }, | |
89 { | |
90 "alias": "Charge", | |
91 "yaxis": 2 | |
92 } | |
93 ], | |
94 "spaceLength": 10, | |
95 "stack": false, | |
96 "steppedLine": false, | |
97 "targets": [ | |
98 { | |
99 "format": "time_series", | |
100 "group": [], | |
101 "metricColumn": "none", | |
102 "rawQuery": true, | |
103 "rawSql": "SELECT\n $__time(date),\n grid_power AS \"Grid\",\n load_power AS \"Load\",\n battery_power AS \"Battery\",\n battery_charge AS \"Charge\",\n solar_power AS \"Solar\"\nFROM\n pw2\nWHERE\n $__timeFilter(date)\n", | |
104 "refId": "A", | |
105 "select": [ | |
106 [ | |
107 { | |
108 "params": [ | |
109 "value" | |
110 ], | |
111 "type": "column" | |
112 } | |
113 ] | |
114 ], | |
115 "timeColumn": "time", | |
116 "where": [ | |
117 { | |
118 "name": "$__timeFilter", | |
119 "params": [], | |
120 "type": "macro" | |
121 } | |
122 ] | |
123 } | |
124 ], | |
125 "thresholds": [], | |
126 "timeRegions": [ | |
127 { | |
128 "$$hashKey": "object:42", | |
129 "colorMode": "yellow", | |
130 "fill": true, | |
131 "fillColor": "rgba(234, 112, 112, 0.12)", | |
132 "from": "15:30", | |
133 "line": false, | |
134 "lineColor": "rgba(237, 46, 24, 0.60)", | |
135 "op": "time", | |
136 "to": "20:30" | |
137 }, | |
138 { | |
139 "$$hashKey": "object:70", | |
140 "colorMode": "green", | |
141 "fill": true, | |
142 "fillColor": "rgba(234, 112, 112, 0.12)", | |
143 "from": "00:30", | |
144 "line": false, | |
145 "lineColor": "rgba(237, 46, 24, 0.60)", | |
146 "op": "time", | |
147 "to": "05:30" | |
148 } | |
149 ], | |
150 "title": "Charge / Power", | |
151 "tooltip": { | |
152 "shared": true, | |
153 "sort": 0, | |
154 "value_type": "individual" | |
155 }, | |
156 "type": "graph", | |
157 "xaxis": { | |
158 "mode": "time", | |
159 "show": true, | |
160 "values": [] | |
161 }, | |
162 "yaxes": [ | |
163 { | |
164 "$$hashKey": "object:202", | |
165 "format": "watt", | |
166 "logBase": 1, | |
167 "max": "6000", | |
168 "min": "-6000", | |
169 "show": true | |
170 }, | |
171 { | |
172 "$$hashKey": "object:203", | |
173 "format": "percent", | |
174 "logBase": 1, | |
175 "max": "100", | |
176 "min": "0", | |
177 "show": true | |
178 } | |
179 ], | |
180 "yaxis": { | |
181 "align": false | |
182 } | |
183 }, | |
184 { | |
185 "aliasColors": {}, | |
186 "bars": false, | |
187 "dashLength": 10, | |
188 "dashes": false, | |
189 "datasource": { | |
190 "type": "postgres", | |
191 "uid": "000000004" | |
192 }, | |
193 "fieldConfig": { | |
194 "defaults": { | |
195 "links": [] | |
196 }, | |
197 "overrides": [] | |
198 }, | |
199 "fill": 1, | |
200 "fillGradient": 0, | |
201 "gridPos": { | |
202 "h": 9, | |
203 "w": 24, | |
204 "x": 0, | |
205 "y": 11 | |
206 }, | |
207 "hiddenSeries": false, | |
208 "id": 6, | |
209 "legend": { | |
210 "alignAsTable": false, | |
211 "avg": false, | |
212 "current": true, | |
213 "max": false, | |
214 "min": false, | |
215 "rightSide": false, | |
216 "show": true, | |
217 "total": false, | |
218 "values": true | |
219 }, | |
220 "lines": true, | |
221 "linewidth": 1, | |
222 "nullPointMode": "null", | |
223 "options": { | |
224 "alertThreshold": true | |
225 }, | |
226 "percentage": false, | |
227 "pluginVersion": "8.5.4", | |
228 "pointradius": 2, | |
229 "points": false, | |
230 "renderer": "flot", | |
231 "seriesOverrides": [], | |
232 "spaceLength": 10, | |
233 "stack": false, | |
234 "steppedLine": false, | |
235 "targets": [ | |
236 { | |
237 "format": "time_series", | |
238 "group": [], | |
239 "metricColumn": "none", | |
240 "rawQuery": true, | |
241 "rawSql": "WITH foo AS (\n SELECT \n date,\n solar_power * EXTRACT(seconds FROM date - lag(date) OVER (ORDER BY date ASC)) / 3600 AS solar_wh,\n load_power * EXTRACT(seconds FROM date - lag(date) OVER (ORDER BY date ASC)) / 3600 AS load_wh,\n CASE WHEN grid_power > 0 THEN grid_power * EXTRACT(seconds FROM date - lag(date) OVER (ORDER BY date ASC)) / 3600 END AS grid_import_wh,\n CASE WHEN grid_power < 0 THEN -grid_power * EXTRACT(seconds FROM date - lag(date) OVER (ORDER BY date ASC)) / 3600 END AS grid_export_wh,\n CASE WHEN battery_power > 0 THEN battery_power * EXTRACT(seconds FROM date - lag(date) OVER (ORDER BY date ASC)) / 3600 END AS battery_discharge_wh,\n CASE WHEN battery_power < 0 THEN -battery_power * EXTRACT(seconds FROM date - lag(date) OVER (ORDER BY date ASC)) / 3600 END AS battery_charge_wh\n FROM pw2\n WHERE $__timeFilter(date)\n ORDER BY date ASC\n)\nSELECT\n date AS time,\n SUM(solar_wh) OVER (ORDER BY date ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS \"Solar Generation\",\n SUM(load_wh) OVER (ORDER BY date ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS \"Consumption\",\n SUM(grid_import_wh) OVER (ORDER BY date ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS \"Grid Import\",\n SUM(grid_export_wh) OVER (ORDER BY date ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS \"Grid Export\",\n SUM(battery_discharge_wh) OVER (ORDER BY date ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS \"Battery Discharge\",\n SUM(battery_charge_wh) OVER (ORDER BY date ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS \"Battery Charge\"\nFROM foo;", | |
242 "refId": "A", | |
243 "select": [ | |
244 [ | |
245 { | |
246 "params": [ | |
247 "value" | |
248 ], | |
249 "type": "column" | |
250 } | |
251 ] | |
252 ], | |
253 "timeColumn": "time", | |
254 "where": [ | |
255 { | |
256 "name": "$__timeFilter", | |
257 "params": [], | |
258 "type": "macro" | |
259 } | |
260 ] | |
261 } | |
262 ], | |
263 "thresholds": [], | |
264 "timeRegions": [], | |
265 "title": "Cumulative Energy", | |
266 "tooltip": { | |
267 "shared": true, | |
268 "sort": 0, | |
269 "value_type": "individual" | |
270 }, | |
271 "type": "graph", | |
272 "xaxis": { | |
273 "mode": "time", | |
274 "show": true, | |
275 "values": [] | |
276 }, | |
277 "yaxes": [ | |
278 { | |
279 "format": "watth", | |
280 "logBase": 1, | |
281 "show": true | |
282 }, | |
283 { | |
284 "format": "short", | |
285 "logBase": 1, | |
286 "show": true | |
287 } | |
288 ], | |
289 "yaxis": { | |
290 "align": false | |
291 } | |
292 }, | |
293 { | |
294 "aliasColors": {}, | |
295 "bars": false, | |
296 "dashLength": 10, | |
297 "dashes": false, | |
298 "datasource": { | |
299 "type": "postgres", | |
300 "uid": "000000004" | |
301 }, | |
302 "fieldConfig": { | |
303 "defaults": { | |
304 "links": [] | |
305 }, | |
306 "overrides": [] | |
307 }, | |
308 "fill": 1, | |
309 "fillGradient": 0, | |
310 "gridPos": { | |
311 "h": 9, | |
312 "w": 24, | |
313 "x": 0, | |
314 "y": 20 | |
315 }, | |
316 "hiddenSeries": false, | |
317 "id": 7, | |
318 "legend": { | |
319 "alignAsTable": false, | |
320 "avg": false, | |
321 "current": true, | |
322 "max": false, | |
323 "min": false, | |
324 "rightSide": false, | |
325 "show": true, | |
326 "total": false, | |
327 "values": true | |
328 }, | |
329 "lines": true, | |
330 "linewidth": 1, | |
331 "nullPointMode": "null", | |
332 "options": { | |
333 "alertThreshold": true | |
334 }, | |
335 "percentage": false, | |
336 "pluginVersion": "8.5.4", | |
337 "pointradius": 2, | |
338 "points": false, | |
339 "renderer": "flot", | |
340 "seriesOverrides": [], | |
341 "spaceLength": 10, | |
342 "stack": false, | |
343 "steppedLine": false, | |
344 "targets": [ | |
345 { | |
346 "datasource": { | |
347 "type": "postgres", | |
348 "uid": "000000004" | |
349 }, | |
350 "format": "time_series", | |
351 "group": [], | |
352 "metricColumn": "none", | |
353 "rawQuery": true, | |
354 "rawSql": "WITH bar AS (\n WITH foo AS (\n SELECT\n date as time,\n EXTRACT('hour' FROM DATE_TRUNC('hour', date)) AS hour,\n CASE WHEN EXTRACT('hour' FROM DATE_TRUNC('hour', date)) BETWEEN 1 AND 6 THEN 36.63\n WHEN EXTRACT('hour' FROM DATE_TRUNC('hour', date)) BETWEEN 10 AND 15 THEN 31.548\n ELSE 48.312\n END AS rate,\n 14 AS tarrif,\n CASE WHEN grid_power > 0 THEN grid_power * EXTRACT(seconds FROM date - lag(date) OVER (ORDER BY date ASC)) / 3600 ELSE 0 END AS grid_import_wh,\n CASE WHEN grid_power < 0 THEN -grid_power * EXTRACT(seconds FROM date - lag(date) OVER (ORDER BY date ASC)) / 3600 ELSE 0 END AS grid_export_wh\n FROM pw2\n WHERE $__timeFilter(date)\n ORDER BY date ASC\n )\n SELECT\n time,\n rate,\n grid_import_wh / 1000 * rate / 100 AS grid_import_dollars,\n grid_export_wh / 1000 * tarrif / 100 AS grid_export_dollars\n FROM foo\n )\nSELECT\n time,\n SUM(grid_import_dollars) OVER (ORDER BY time ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS \"Import\",\n SUM(grid_export_dollars) OVER (ORDER BY time ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS \"Export\",\n SUM(grid_import_dollars) OVER (ORDER BY time ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) -\n SUM(grid_export_dollars) OVER (ORDER BY time ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS \"Net\"\n FROM bar;", | |
355 "refId": "A", | |
356 "select": [ | |
357 [ | |
358 { | |
359 "params": [ | |
360 "value" | |
361 ], | |
362 "type": "column" | |
363 } | |
364 ] | |
365 ], | |
366 "timeColumn": "time", | |
367 "where": [ | |
368 { | |
369 "name": "$__timeFilter", | |
370 "params": [], | |
371 "type": "macro" | |
372 } | |
373 ] | |
374 } | |
375 ], | |
376 "thresholds": [], | |
377 "timeRegions": [], | |
378 "title": "Cost (excl. supply charge)", | |
379 "tooltip": { | |
380 "shared": true, | |
381 "sort": 0, | |
382 "value_type": "individual" | |
383 }, | |
384 "type": "graph", | |
385 "xaxis": { | |
386 "mode": "time", | |
387 "show": true, | |
388 "values": [] | |
389 }, | |
390 "yaxes": [ | |
391 { | |
392 "$$hashKey": "object:61", | |
393 "format": "currencyUSD", | |
394 "logBase": 1, | |
395 "show": true | |
396 }, | |
397 { | |
398 "$$hashKey": "object:62", | |
399 "format": "currencyUSD", | |
400 "logBase": 1, | |
401 "show": true | |
402 } | |
403 ], | |
404 "yaxis": { | |
405 "align": false | |
406 } | |
407 }, | |
408 { | |
409 "aliasColors": {}, | |
410 "bars": false, | |
411 "dashLength": 10, | |
412 "dashes": false, | |
413 "datasource": { | |
414 "type": "postgres", | |
415 "uid": "000000004" | |
416 }, | |
417 "fieldConfig": { | |
418 "defaults": { | |
419 "links": [] | |
420 }, | |
421 "overrides": [] | |
422 }, | |
423 "fill": 0, | |
424 "fillGradient": 0, | |
425 "gridPos": { | |
426 "h": 8, | |
427 "w": 24, | |
428 "x": 0, | |
429 "y": 29 | |
430 }, | |
431 "hiddenSeries": false, | |
432 "id": 4, | |
433 "legend": { | |
434 "avg": false, | |
435 "current": false, | |
436 "max": false, | |
437 "min": false, | |
438 "show": true, | |
439 "total": false, | |
440 "values": false | |
441 }, | |
442 "lines": true, | |
443 "linewidth": 2, | |
444 "nullPointMode": "null", | |
445 "options": { | |
446 "alertThreshold": true | |
447 }, | |
448 "percentage": false, | |
449 "pluginVersion": "8.5.4", | |
450 "pointradius": 2, | |
451 "points": false, | |
452 "renderer": "flot", | |
453 "seriesOverrides": [ | |
454 { | |
455 "$$hashKey": "object:337", | |
456 "alias": "Frequency", | |
457 "yaxis": 2, | |
458 "zindex": -1 | |
459 } | |
460 ], | |
461 "spaceLength": 10, | |
462 "stack": false, | |
463 "steppedLine": false, | |
464 "targets": [ | |
465 { | |
466 "datasource": { | |
467 "type": "postgres", | |
468 "uid": "000000004" | |
469 }, | |
470 "format": "time_series", | |
471 "group": [], | |
472 "metricColumn": "none", | |
473 "rawQuery": true, | |
474 "rawSql": "SELECT\n $__time(date),\n grid_voltage AS \"Voltage\",\n grid_freq AS \"Frequency\"\nFROM\n pw2\nWHERE\n $__timeFilter(date)\n", | |
475 "refId": "A", | |
476 "select": [ | |
477 [ | |
478 { | |
479 "params": [ | |
480 "value" | |
481 ], | |
482 "type": "column" | |
483 } | |
484 ] | |
485 ], | |
486 "timeColumn": "time", | |
487 "where": [ | |
488 { | |
489 "name": "$__timeFilter", | |
490 "params": [], | |
491 "type": "macro" | |
492 } | |
493 ] | |
494 } | |
495 ], | |
496 "thresholds": [], | |
497 "timeRegions": [], | |
498 "title": "Grid", | |
499 "tooltip": { | |
500 "shared": true, | |
501 "sort": 0, | |
502 "value_type": "individual" | |
503 }, | |
504 "type": "graph", | |
505 "xaxis": { | |
506 "mode": "time", | |
507 "show": true, | |
508 "values": [] | |
509 }, | |
510 "yaxes": [ | |
511 { | |
512 "$$hashKey": "object:266", | |
513 "decimals": 1, | |
514 "format": "volt", | |
515 "label": "", | |
516 "logBase": 1, | |
517 "max": "260", | |
518 "min": "230", | |
519 "show": true | |
520 }, | |
521 { | |
522 "$$hashKey": "object:267", | |
523 "decimals": 2, | |
524 "format": "short", | |
525 "label": "", | |
526 "logBase": 1, | |
527 "max": "51", | |
528 "min": "49", | |
529 "show": true | |
530 } | |
531 ], | |
532 "yaxis": { | |
533 "align": false | |
534 } | |
535 } | |
536 ], | |
537 "refresh": "", | |
538 "schemaVersion": 36, | |
539 "style": "dark", | |
540 "tags": [], | |
541 "templating": { | |
542 "list": [] | |
543 }, | |
544 "time": { | |
545 "from": "now/d", | |
546 "to": "now/d" | |
547 }, | |
548 "timepicker": { | |
549 "hidden": false, | |
550 "refresh_intervals": [ | |
551 "5s", | |
552 "10s", | |
553 "30s", | |
554 "1m", | |
555 "5m", | |
556 "15m", | |
557 "30m", | |
558 "1h", | |
559 "2h", | |
560 "1d" | |
561 ] | |
562 }, | |
563 "timezone": "", | |
564 "title": "Powerwall", | |
565 "uid": "IsSsdrTZz", | |
566 "version": 24, | |
567 "weekStart": "" | |
568 } |