Grafana dashboard: PM2.5
Description: AirMonitor-PM2.5


{
  "__inputs": [
    {
      "name": "DS_AIRMONITOR",
      "label": "AirMonitor",
      "description": "",
      "type": "datasource",
      "pluginId": "influxdb",
      "pluginName": "InfluxDB"
    }
  ],
  "__requires": [
    {
      "type": "panel",
      "id": "gauge",
      "name": "Gauge",
      "version": ""
    },
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "7.0.3"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "influxdb",
      "name": "InfluxDB",
      "version": "1.0.0"
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": 13603,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1603135855362,
  "links": [],
  "panels": [
    {
      "datasource": "${DS_AIRMONITOR}",
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {},
          "displayName": "PM2.5",
          "mappings": [],
          "max": 100,
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "#EAB839",
                "value": 50
              },
              {
                "color": "red",
                "value": 100
              }
            ]
          },
          "unit": "percent"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 7,
        "x": 0,
        "y": 0
      },
      "id": 4,
      "interval": "10m",
      "options": {
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "mean"
          ],
          "fields": "",
          "values": false
        },
        "showThresholdLabels": true,
        "showThresholdMarkers": true
      },
      "pluginVersion": "7.0.3",
      "targets": [
        {
          "alias": "PM2.5",
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            }
          ],
          "measurement": "pm25",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT last(\"value\") * 4 FROM \"pm25\" WHERE  (\"long\" =~ /^$longitude$/ AND \"lat\" =~ /^$latitude$/)",
          "rawQuery": true,
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": [
            {
              "key": "lat",
              "operator": "=",
              "value": "52.3911"
            }
          ]
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "PM2.5 ostatni pomiar [%]",
      "transparent": true,
      "type": "gauge"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_AIRMONITOR}",
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 13,
        "w": 16,
        "x": 0,
        "y": 8
      },
      "hiddenSeries": false,
      "id": 2,
      "interval": ">30m",
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": true,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "connected",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "PM2.5 %",
          "yaxis": 2
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "alias": "PM2.5 µg/m3",
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT moving_average(mean(\"value\"), 10) FROM \"pm25\" WHERE  (\"long\" =~ /^$longitude$/ AND \"lat\" =~ /^$latitude$/) AND $timeFilter -6h GROUP BY time($__interval), \"lat\" fill(null)",
          "rawQuery": true,
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": []
        },
        {
          "alias": "PM2.5 %",
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT moving_average(mean(\"value\"), 10) *4 FROM \"pm25\" WHERE  (\"long\" =~ /^$longitude$/ AND \"lat\" =~ /^$latitude$/) AND $timeFilter -6h GROUP BY time($__interval), \"lat\" fill(null)",
          "rawQuery": true,
          "refId": "B",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": []
        }
      ],
      "thresholds": [
        {
          "colorMode": "critical",
          "fill": true,
          "line": true,
          "op": "gt",
          "value": 50,
          "yaxis": "left"
        },
        {
          "colorMode": "warning",
          "fill": true,
          "line": true,
          "op": "gt",
          "value": 25,
          "yaxis": "left"
        },
        {
          "colorMode": "ok",
          "fill": true,
          "line": true,
          "op": "lt",
          "value": 25,
          "yaxis": "left"
        }
      ],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "PM2.5 [30m]",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "transparent": true,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "decimals": 0,
          "format": "conμgm3",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": "0",
          "show": true
        },
        {
          "decimals": 0,
          "format": "percent",
          "label": "",
          "logBase": 1,
          "max": null,
          "min": "0",
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    }
  ],
  "schemaVersion": 25,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_AIRMONITOR}",
        "definition": "SHOW TAG VALUES FROM \"pm25\" WITH KEY = \"lat\" WHERE lat =~ /.*/",
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "latitude",
        "options": [],
        "query": "SHOW TAG VALUES FROM \"pm25\" WITH KEY = \"lat\" WHERE lat =~ /.*/",
        "refresh": 1,
        "regex": "\\d+\\.\\d+",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_AIRMONITOR}",
        "definition": "SHOW TAG VALUES FROM \"pm25\" WITH KEY = \"long\" WHERE long =~ /.*/",
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "longitude",
        "options": [],
        "query": "SHOW TAG VALUES FROM \"pm25\" WITH KEY = \"long\" WHERE long =~ /.*/",
        "refresh": 1,
        "regex": "\\d+\\.\\d+",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "browser",
  "title": "PM2.5",
  "uid": "I4UlYYoWz",
  "version": 1,
  "description": "AirMonitor-PM2.5"
}