{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": null,
  "graphTooltip": 0,
  "id": 1,
  "links": [],
  "panels": [
    {
      "datasource": null,
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "decimals": 1,
          "mappings": [],
          "max": 300,
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "orange",
                "value": 30
              },
              {
                "color": "yellow",
                "value": 100
              },
              {
                "color": "green",
                "value": 160
              }
            ]
          },
          "unit": "watt"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 4,
      "maxDataPoints": 1,
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showThresholdLabels": false,
        "showThresholdMarkers": true,
        "text": {}
      },
      "pluginVersion": "7.5.7",
      "targets": [
        {
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "orderByTime": "ASC",
          "policy": "default",
          "query": "from(bucket: \"influxdb\")\n  |> range(start: -1m)\n  |> filter(fn: (r) =>\n    r._measurement == \"solar\"\n  )\n  |> aggregateWindow(\n    every: 10s,\n    fn: (tables=<-, column) => tables |> median(),\n  )\n  ",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": []
        }
      ],
      "title": "Current Input",
      "transformations": [
        {
          "id": "reduce",
          "options": {
            "includeTimeField": false,
            "mode": "reduceFields",
            "reducers": [
              "mean"
            ]
          }
        },
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "value W"
              ]
            }
          }
        }
      ],
      "type": "gauge"
    },
    {
      "datasource": null,
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "max": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "watth"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 10,
        "x": 0,
        "y": 7
      },
      "id": 8,
      "interval": null,
      "maxDataPoints": 100,
      "options": {
        "colorMode": "value",
        "graphMode": "none",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "7.5.7",
      "targets": [
        {
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "orderByTime": "ASC",
          "policy": "default",
          "query": "from(bucket: \"influxdb\")\r\n  |> range(start: v.timeRangeStart, stop:v.timeRangeStop)\r\n  |> filter(fn: (r) =>\r\n    r._measurement == \"solar\"\r\n  )\r\n  |> aggregateWindow(\r\n    every: $__interval,\r\n    fn: (tables=<-, column) => tables |> median(method: \"estimate_tdigest\"),\r\n  )\r\n  |> cumulativeSum()\r\n  |> map(fn: (r) => ({r with _value: r._value * float(v: int(v: $__interval)) / 1000000000000.0 / 3.6}))\r\n",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": []
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Generated In Period",
      "transformations": [
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "value W"
              ]
            }
          }
        }
      ],
      "type": "stat"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": null,
      "description": "",
      "fieldConfig": {
        "defaults": {},
        "overrides": []
      },
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 8,
        "w": 14,
        "x": 10,
        "y": 7
      },
      "hiddenSeries": false,
      "id": 5,
      "interval": "1m",
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "rightSide": false,
        "show": false,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "maxDataPoints": 150,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "7.5.7",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "orderByTime": "ASC",
          "policy": "default",
          "query": "from(bucket: \"influxdb\")\n  |> range(start: v.timeRangeStart, stop:v.timeRangeStop)\n  |> filter(fn: (r) =>\n    r._measurement == \"solar\"\n  )\n  |> aggregateWindow(\n    every: $__interval,\n    fn: (tables=<-, column) => tables |> median(method: \"estimate_tdigest\"),\n  )",
          "queryType": "randomWalk",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": []
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Power",
      "tooltip": {
        "shared": false,
        "sort": 0,
        "value_type": "individual"
      },
      "transformations": [
        {
          "id": "calculateField",
          "options": {
            "alias": "Power",
            "binary": {
              "left": "value {name=\"solar\", type=\"A\"}",
              "operator": "*",
              "reducer": "sum",
              "right": "value {name=\"solar\", type=\"V\"}"
            },
            "mode": "reduceRow",
            "reduce": {
              "include": [
                "value {name=\"solar\", type=\"W\"}"
              ],
              "reducer": "sum"
            },
            "replaceFields": true
          }
        }
      ],
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:105",
          "format": "watt",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "$$hashKey": "object:106",
          "format": "dateTimeAsLocal",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "datasource": null,
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": null,
            "filterable": false
          },
          "mappings": [
            {
              "from": "",
              "id": 1,
              "text": "",
              "to": "",
              "type": 1
            }
          ],
          "max": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "watth"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Time"
            },
            "properties": [
              {
                "id": "unit",
                "value": "time:DD.MM.YYYY"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 8,
        "w": 14,
        "x": 0,
        "y": 15
      },
      "id": 9,
      "interval": null,
      "maxDataPoints": 500,
      "options": {
        "showHeader": true
      },
      "pluginVersion": "7.5.7",
      "targets": [
        {
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "orderByTime": "ASC",
          "policy": "default",
          "query": "import \"date\"\r\nimport \"experimental\"\r\n\r\nstart_rounded = date.truncate(t: v.timeRangeStart, unit: 1d) //we can pass v.windowPeriod\r\nend_rounded = date.truncate(t: v.timeRangeStop, unit: 1d)\r\nend_rounded2 = experimental.addDuration(d: 1d, to: end_rounded)\r\n\r\nfrom(bucket: \"influxdb\")\r\n  |> range(start: start_rounded, stop: end_rounded2)\r\n  |> filter(fn: (r) =>\r\n    r._measurement == \"solar\"\r\n  )\r\n  |> filter(fn: (r) => r.type == \"W\")\r\n  |> aggregateWindow(\r\n    every: $__interval,\r\n    timeSrc: \"_start\",\r\n    fn: (tables=<-, column) => tables |> median(),\r\n  )\r\n  |> aggregateWindow(\r\n    every: 1d,\r\n    timeSrc: \"_start\",\r\n    fn: (tables=<-, column) => tables |> sum(),\r\n  )\r\n  |> map(fn: (r) => ({r with _value: r._value * float(v: int(v: $__interval)) / 1000000000000.0 / 3.6}))\r\n",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": []
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Generated per day",
      "transformations": [
        {
          "id": "renameByRegex",
          "options": {
            "regex": "value W",
            "renamePattern": "Amount"
          }
        }
      ],
      "type": "table"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": null,
      "description": "",
      "fieldConfig": {
        "defaults": {
          "unit": "volt"
        },
        "overrides": []
      },
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 8,
        "w": 10,
        "x": 14,
        "y": 15
      },
      "hiddenSeries": false,
      "id": 6,
      "interval": "1m",
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "rightSide": false,
        "show": false,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "maxDataPoints": 150,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "7.5.7",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "orderByTime": "ASC",
          "policy": "default",
          "query": "from(bucket: \"influxdb\")\n  |> range(start: v.timeRangeStart, stop:v.timeRangeStop)\n  |> filter(fn: (r) =>\n    r._measurement == \"solar\"\n  )\n  |> aggregateWindow(\n    every: $__interval,\n    fn: (tables=<-, column) => tables |> median(method: \"estimate_tdigest\"),\n  )",
          "queryType": "randomWalk",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": []
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Solar Voltage",
      "tooltip": {
        "shared": false,
        "sort": 0,
        "value_type": "individual"
      },
      "transformations": [
        {
          "id": "calculateField",
          "options": {
            "alias": "Power",
            "binary": {
              "left": "value {name=\"solar\", type=\"A\"}",
              "operator": "*",
              "reducer": "sum",
              "right": "value {name=\"solar\", type=\"V\"}"
            },
            "mode": "reduceRow",
            "reduce": {
              "include": [
                "value {name=\"solar\", type=\"U\"}"
              ],
              "reducer": "sum"
            },
            "replaceFields": true
          }
        }
      ],
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:105",
          "format": "volt",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "$$hashKey": "object:106",
          "format": "dateTimeAsLocal",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    }
  ],
  "refresh": "10s",
  "schemaVersion": 27,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-30m",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "browser",
  "title": "Solar",
  "uid": "jn3v5cV4k",
  "version": 48
}