{
  "__inputs": [
    {
      "name": "DS_INFLUXDB",
      "label": "InfluxDB",
      "type": "datasource",
      "pluginId": "influxdb",
      "pluginName": "InfluxDB"
    }
  ],
  "title": "ETECH LAB · Centrale termica / Plant room",
  "uid": "etechlab-centrale",
  "tags": [
    "etechlab",
    "brick",
    "heating"
  ],
  "timezone": "browser",
  "schemaVersion": 39,
  "version": 1,
  "time": {
    "from": "now-7d",
    "to": "now"
  },
  "refresh": "5m",
  "panels": [
    {
      "id": 1,
      "type": "timeseries",
      "title": "Mandata e ritorno / Flow and return (°C)",
      "gridPos": {
        "x": 0,
        "y": 0,
        "w": 18,
        "h": 9
      },
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_INFLUXDB}"
      },
      "targets": [
        {
          "refId": "Mte",
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB}"
          },
          "rawQuery": true,
          "resultFormat": "time_series",
          "query": "SELECT mean(\"value\") FROM \"°C\" WHERE (\"entity_id\" = 'mandata_radiante') AND $timeFilter GROUP BY time($__interval) fill(previous)",
          "alias": "mandata_radiante"
        },
        {
          "refId": "Rte",
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB}"
          },
          "rawQuery": true,
          "resultFormat": "time_series",
          "query": "SELECT mean(\"value\") FROM \"°C\" WHERE (\"entity_id\" = 'ritorno_radiante') AND $timeFilter GROUP BY time($__interval) fill(previous)",
          "alias": "ritorno_radiante"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "celsius",
          "custom": {
            "lineWidth": 2,
            "fillOpacity": 0
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "mandata_radiante"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "#F7B32B"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "ritorno_radiante"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "#A9D3EF"
                }
              }
            ]
          }
        ]
      },
      "options": {
        "legend": {
          "displayMode": "list",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "multi"
        }
      }
    },
    {
      "id": 2,
      "type": "stat",
      "title": "Temperatura esterna / Outdoor",
      "gridPos": {
        "x": 18,
        "y": 0,
        "w": 6,
        "h": 5
      },
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_INFLUXDB}"
      },
      "targets": [
        {
          "refId": "Tna",
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB}"
          },
          "rawQuery": true,
          "resultFormat": "time_series",
          "query": "SELECT mean(\"value\") FROM \"°C\" WHERE (\"entity_id\" = 'temperatura_esterna') AND $timeFilter GROUP BY time($__interval) fill(previous)",
          "alias": "temperatura_esterna"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "celsius",
          "decimals": 1,
          "color": {
            "mode": "fixed",
            "fixedColor": "#123E7C"
          }
        }
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ]
        },
        "colorMode": "value",
        "graphMode": "none"
      }
    },
    {
      "id": 3,
      "type": "stat",
      "title": "Ore di funzionamento oggi / Running hours today",
      "gridPos": {
        "x": 18,
        "y": 5,
        "w": 6,
        "h": 5
      },
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_INFLUXDB}"
      },
      "targets": [
        {
          "refId": "Ggi",
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB}"
          },
          "rawQuery": true,
          "resultFormat": "time_series",
          "query": "SELECT last(\"value\") FROM \"h\" WHERE (\"entity_id\" = 'generatore_ore_oggi') AND $timeFilter",
          "alias": "generatore_ore_oggi"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "h",
          "decimals": 1,
          "color": {
            "mode": "fixed",
            "fixedColor": "#123E7C"
          }
        }
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ]
        },
        "colorMode": "value",
        "graphMode": "none"
      }
    },
    {
      "id": 4,
      "type": "stat",
      "title": "Accensioni oggi / Starts today",
      "gridPos": {
        "x": 18,
        "y": 10,
        "w": 6,
        "h": 5
      },
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_INFLUXDB}"
      },
      "targets": [
        {
          "refId": "Ggi",
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB}"
          },
          "rawQuery": true,
          "resultFormat": "time_series",
          "query": "SELECT last(\"value\") FROM \"count\" WHERE (\"entity_id\" = 'generatore_accensioni_oggi') AND $timeFilter",
          "alias": "generatore_accensioni_oggi"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "none",
          "decimals": 0,
          "color": {
            "mode": "fixed",
            "fixedColor": "#123E7C"
          }
        }
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ]
        },
        "colorMode": "value",
        "graphMode": "none"
      }
    },
    {
      "id": 5,
      "type": "barchart",
      "title": "Gas al giorno / Gas per day (m³)",
      "gridPos": {
        "x": 0,
        "y": 9,
        "w": 18,
        "h": 9
      },
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_INFLUXDB}"
      },
      "targets": [
        {
          "refId": "G",
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB}"
          },
          "rawQuery": true,
          "resultFormat": "time_series",
          "query": "SELECT spread(\"value\") FROM \"m³\" WHERE (\"entity_id\" = 'gas_contatore') AND $timeFilter GROUP BY time(1d) fill(0)",
          "alias": "gas"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "m³",
          "color": {
            "mode": "fixed",
            "fixedColor": "#123E7C"
          }
        }
      },
      "options": {
        "xTickLabelRotation": -45,
        "showValue": "never"
      }
    },
    {
      "id": 6,
      "type": "state-timeline",
      "title": "Zone / Zones (°C)",
      "gridPos": {
        "x": 0,
        "y": 18,
        "w": 24,
        "h": 8
      },
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_INFLUXDB}"
      },
      "targets": [
        {
          "refId": "Ta1",
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB}"
          },
          "rawQuery": true,
          "resultFormat": "time_series",
          "query": "SELECT mean(\"value\") FROM \"°C\" WHERE (\"entity_id\" = 'temperatura_zona1') AND $timeFilter GROUP BY time(1h) fill(previous)",
          "alias": "temperatura_zona1"
        },
        {
          "refId": "Ta2",
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB}"
          },
          "rawQuery": true,
          "resultFormat": "time_series",
          "query": "SELECT mean(\"value\") FROM \"°C\" WHERE (\"entity_id\" = 'temperatura_zona2') AND $timeFilter GROUP BY time(1h) fill(previous)",
          "alias": "temperatura_zona2"
        },
        {
          "refId": "Ta3",
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB}"
          },
          "rawQuery": true,
          "resultFormat": "time_series",
          "query": "SELECT mean(\"value\") FROM \"°C\" WHERE (\"entity_id\" = 'temperatura_zona3') AND $timeFilter GROUP BY time(1h) fill(previous)",
          "alias": "temperatura_zona3"
        },
        {
          "refId": "Ta4",
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB}"
          },
          "rawQuery": true,
          "resultFormat": "time_series",
          "query": "SELECT mean(\"value\") FROM \"°C\" WHERE (\"entity_id\" = 'temperatura_zona4') AND $timeFilter GROUP BY time(1h) fill(previous)",
          "alias": "temperatura_zona4"
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "celsius",
          "color": {
            "mode": "continuous-BlYlRd"
          },
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "#A9D3EF",
                "value": null
              },
              {
                "color": "#FCE3A6",
                "value": 19.5
              },
              {
                "color": "#F7B32B",
                "value": 21.5
              }
            ]
          }
        }
      },
      "options": {
        "showValue": "never"
      }
    }
  ],
  "description": "Esempio dagli articoli del blog ETECH LAB. Le misure seguono lo schema dell’integrazione InfluxDB di Home Assistant (measurement = unità, tag entity_id, campo value): rinomina le entità con quelle del tuo impianto. Example dashboard: rename entities to match your system."
}