{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "datasource",
          "uid": "grafana"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 1,
  "id": 13,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "datasource": {
        "type": "postgres",
        "uid": "GsMLeqLnz"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "left",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 0,
            "gradientMode": "none",
            "hideFrom": {
              "graph": false,
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "celsius"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byFrameRefID",
              "options": "Thermostaat"
            },
            "properties": [
              {
                "id": "custom.lineWidth",
                "value": 2
              },
              {
                "id": "custom.fillOpacity",
                "value": 0
              },
              {
                "id": "custom.gradientMode",
                "value": "opacity"
              },
              {
                "id": "custom.lineInterpolation",
                "value": "stepAfter"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "verwarming aan"
            },
            "properties": [
              {
                "id": "custom.lineInterpolation",
                "value": "stepAfter"
              },
              {
                "id": "custom.lineWidth",
                "value": 0
              },
              {
                "id": "custom.fillOpacity",
                "value": 31
              },
              {
                "id": "custom.axisPlacement",
                "value": "hidden"
              },
              {
                "id": "unit",
                "value": "none"
              },
              {
                "id": "color",
                "value": {
                  "fixedColor": "yellow",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "heating temp"
            },
            "properties": [
              {
                "id": "custom.lineInterpolation",
                "value": "stepAfter"
              },
              {
                "id": "displayName",
                "value": "heating temp - 45"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "thermostaat temp"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "semi-dark-red",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "voelt als"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "semi-dark-yellow",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "__systemRef": "hideSeriesFrom",
            "matcher": {
              "id": "byNames",
              "options": {
                "mode": "exclude",
                "names": [
                  "thermostaat",
                  "temperatuur",
                  "buiten temp",
                  "verwarming aan"
                ],
                "prefix": "All except:",
                "readOnly": true
              }
            },
            "properties": [
              {
                "id": "custom.hideFrom",
                "value": {
                  "legend": false,
                  "tooltip": false,
                  "viz": true
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 10,
        "w": 24,
        "x": 0,
        "y": 10
      },
      "id": 14,
      "options": {
        "graph": {},
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "pluginVersion": "7.5.11",
      "targets": [
        {
          "datasource": {
            "type": "postgres",
            "uid": "GsMLeqLnz"
          },
          "editorMode": "code",
          "format": "time_series",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  last_updated_ts as \"time\",\n  state ::decimal as \"buiten temp\"\nFROM states\nWHERE $__unixEpochFilter(last_updated_ts)\n  AND metadata_id = ( SELECT metadata_id FROM states_meta WHERE entity_id = 'sensor.buiten_temperature' )\n  AND state !~ 'un(available|known)'\nORDER BY 1",
          "refId": "Buiten",
          "select": [
            [
              {
                "params": [
                  "mean"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "statistics_short_term",
          "timeColumn": "created",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": {
            "type": "postgres",
            "uid": "GsMLeqLnz"
          },
          "editorMode": "code",
          "format": "time_series",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT last_updated_ts as \"time\",\n  state::decimal as \"thermostaat\"\nFROM states\nWHERE $__unixEpochFilter(last_updated_ts)\n  AND metadata_id = ( SELECT metadata_id FROM states_meta WHERE entity_id = 'number.thermostat_hc1_seltemp' )\n  AND state !~ 'un(available|known)'\nUNION\n(SELECT\n   $__from,\n   state ::decimal AS \"thermostaat\"\n FROM states\n WHERE\n   metadata_id = ( SELECT metadata_id FROM states_meta WHERE entity_id = 'number.thermostat_hc1_seltemp' )\n   AND last_updated_ts < $__from\n   AND state !~ 'un(available|known)'\n ORDER BY last_updated_ts DESC LIMIT 1)\nUNION\n(SELECT\n   date_part('epoch',now()) as \"time\",\n   state ::decimal AS \"thermostaat\"\n FROM states\n WHERE\n   metadata_id = ( SELECT metadata_id FROM states_meta WHERE entity_id = 'number.thermostat_hc1_seltemp' )\n   AND last_updated_ts < $__from\n   AND state !~ 'un(available|known)'\n ORDER BY last_updated_ts DESC LIMIT 1)\nORDER BY 1\n  ",
          "refId": "Thermostaat",
          "select": [
            [
              {
                "params": [
                  "mean"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "statistics_short_term",
          "timeColumn": "created",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": {
            "type": "postgres",
            "uid": "GsMLeqLnz"
          },
          "editorMode": "code",
          "format": "time_series",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT last_updated_ts as \"time\",\n  state::decimal as \"temperatuur\"\nFROM states\nWHERE $__unixEpochFilter(last_updated_ts)\n  AND metadata_id = ( SELECT metadata_id FROM states_meta WHERE entity_id = 'sensor.thermostat_hc1_currtemp' )\n  AND state !~ 'un(available|known)'\nORDER BY 1\n  ",
          "refId": "Thermostat temperature",
          "select": [
            [
              {
                "params": [
                  "mean"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "statistics_short_term",
          "timeColumn": "created",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": {
            "type": "postgres",
            "uid": "GsMLeqLnz"
          },
          "editorMode": "code",
          "format": "time_series",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  last_updated_ts as \"time\",\n  CASE state WHEN 'on' THEN 1 ELSE 0 END as \"verwarming aan\"\nFROM states\nWHERE $__unixEpochFilter(last_updated_ts)\n  AND metadata_id = ( SELECT metadata_id FROM states_meta WHERE entity_id = 'binary_sensor.boiler_heatingactive' )\n  AND state !~ 'un(available|known)'\nUNION\n(SELECT\n  date_part('epoch',now()) as \"time\",\n  CASE state WHEN 'on' THEN 1 ELSE 0 END as \"verwarming aan\"\n FROM states\n WHERE\n  metadata_id = ( SELECT metadata_id FROM states_meta WHERE entity_id = 'binary_sensor.boiler_heatingactive' )\n  AND state !~ 'un(available|known)'\n ORDER BY last_updated_ts DESC LIMIT 1)\nORDER BY 1",
          "refId": "Verwarming",
          "select": [
            [
              {
                "params": [
                  "mean"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "statistics_short_term",
          "timeColumn": "created",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "Warmte",
      "transparent": true,
      "type": "timeseries"
    }
  ],
  "refresh": false,
  "schemaVersion": 37,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": []
  },
  "time": {
    "from": "2023-04-23T16:00:00.000Z",
    "to": "2023-04-24T08:00:00.000Z"
  },
  "timepicker": {
    "hidden": false
  },
  "timezone": "",
  "title": "Verwarming Overzicht",
  "uid": "cQ46XxeD4y",
  "version": 6,
  "weekStart": ""
}
