{
  "uid": "home-assistant",
  "title": "Home Assistant – Climate, Air & Power",
  "tags": [
    "homeassistant",
    "home"
  ],
  "timezone": "browser",
  "editable": true,
  "graphTooltip": 1,
  "refresh": "1m",
  "time": {
    "from": "now-24h",
    "to": "now"
  },
  "schemaVersion": 39,
  "version": 5,
  "templating": {
    "list": []
  },
  "annotations": {
    "list": []
  },
  "panels": [
    {
      "id": 1,
      "type": "row",
      "title": "🌡️ Climate",
      "collapsed": false,
      "gridPos": {
        "x": 0,
        "y": 0,
        "w": 24,
        "h": 1
      },
      "panels": []
    },
    {
      "id": 2,
      "type": "stat",
      "title": "Temperature now",
      "description": "Green 18–26 °C is comfortable. The network rack alerts above 35 °C.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 1,
        "w": 12,
        "h": 5
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.h5075_5299_temperature\"}",
          "legendFormat": "Living room",
          "refId": "A",
          "range": false,
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.thermo_bedroom_temperature\"}",
          "legendFormat": "Bedroom",
          "refId": "B",
          "range": false,
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.thermo_kitchen_temperature\"}",
          "legendFormat": "Kitchen",
          "refId": "C",
          "range": false,
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.thermo_network_rack_temperature\"}",
          "legendFormat": "Network rack",
          "refId": "D",
          "range": false,
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.thermo_outdoor_temperature\"}",
          "legendFormat": "Outdoor",
          "refId": "E",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "celsius",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "blue",
                "value": null
              },
              {
                "color": "green",
                "value": 18
              },
              {
                "color": "orange",
                "value": 26
              },
              {
                "color": "red",
                "value": 30
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 1
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value_and_name",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 3,
      "type": "stat",
      "title": "Humidity now",
      "description": "40–60 % is ideal indoors. Above 65 % for 2 hours raises a mould alert (indoor rooms only). Outdoor is shown in neutral blue.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 12,
        "y": 1,
        "w": 12,
        "h": 5
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.h5075_5299_humidity\"}",
          "legendFormat": "Living room",
          "refId": "A",
          "range": false,
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.thermo_bedroom_humidity\"}",
          "legendFormat": "Bedroom",
          "refId": "B",
          "range": false,
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.thermo_kitchen_humidity\"}",
          "legendFormat": "Kitchen",
          "refId": "C",
          "range": false,
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.thermo_network_rack_humidity\"}",
          "legendFormat": "Network rack",
          "refId": "D",
          "range": false,
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.thermo_outdoor_humidity\"}",
          "legendFormat": "Outdoor",
          "refId": "E",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "percent",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "orange",
                "value": null
              },
              {
                "color": "green",
                "value": 35
              },
              {
                "color": "orange",
                "value": 60
              },
              {
                "color": "red",
                "value": 65
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 0
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Outdoor"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "blue"
                }
              }
            ]
          }
        ]
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value_and_name",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 4,
      "type": "timeseries",
      "title": "Temperature by room",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 6,
        "w": 12,
        "h": 9
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.h5075_5299_temperature\"}",
          "legendFormat": "Living room",
          "refId": "A",
          "range": true,
          "instant": false
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.thermo_bedroom_temperature\"}",
          "legendFormat": "Bedroom",
          "refId": "B",
          "range": true,
          "instant": false
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.thermo_kitchen_temperature\"}",
          "legendFormat": "Kitchen",
          "refId": "C",
          "range": true,
          "instant": false
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.thermo_network_rack_temperature\"}",
          "legendFormat": "Network rack",
          "refId": "D",
          "range": true,
          "instant": false
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.thermo_outdoor_temperature\"}",
          "legendFormat": "Outdoor",
          "refId": "E",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "celsius",
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 2,
            "fillOpacity": 10,
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "mode": "none",
              "group": "A"
            }
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Outdoor"
            },
            "properties": [
              {
                "id": "custom.lineStyle",
                "value": {
                  "fill": "dash",
                  "dash": [
                    10,
                    10
                  ]
                }
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "#8AB8FF"
                }
              }
            ]
          }
        ]
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "right",
          "calcs": [
            "lastNotNull",
            "min",
            "max"
          ]
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 5,
      "type": "timeseries",
      "title": "Humidity by room",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 12,
        "y": 6,
        "w": 12,
        "h": 9
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.h5075_5299_humidity\"}",
          "legendFormat": "Living room",
          "refId": "A",
          "range": true,
          "instant": false
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.thermo_bedroom_humidity\"}",
          "legendFormat": "Bedroom",
          "refId": "B",
          "range": true,
          "instant": false
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.thermo_kitchen_humidity\"}",
          "legendFormat": "Kitchen",
          "refId": "C",
          "range": true,
          "instant": false
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.thermo_network_rack_humidity\"}",
          "legendFormat": "Network rack",
          "refId": "D",
          "range": true,
          "instant": false
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.thermo_outdoor_humidity\"}",
          "legendFormat": "Outdoor",
          "refId": "E",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "percent",
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 2,
            "fillOpacity": 10,
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "mode": "none",
              "group": "A"
            }
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Outdoor"
            },
            "properties": [
              {
                "id": "custom.lineStyle",
                "value": {
                  "fill": "dash",
                  "dash": [
                    10,
                    10
                  ]
                }
              },
              {
                "id": "color",
                "value": {
                  "mode": "fixed",
                  "fixedColor": "#8AB8FF"
                }
              }
            ]
          }
        ]
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "right",
          "calcs": [
            "lastNotNull",
            "min",
            "max"
          ]
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 6,
      "type": "row",
      "title": "🌬️ Air quality",
      "collapsed": false,
      "gridPos": {
        "x": 0,
        "y": 15,
        "w": 24,
        "h": 1
      },
      "panels": []
    },
    {
      "id": 7,
      "type": "stat",
      "title": "CO₂",
      "description": "Below 800 ppm is fresh air. Above 1200 ppm: open a window.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 16,
        "w": 4,
        "h": 5
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.alpstuga_air_quality_monitor_carbon_dioxide\"}",
          "legendFormat": "ALPSTUGA",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "ppm",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "yellow",
                "value": 800
              },
              {
                "color": "orange",
                "value": 1200
              },
              {
                "color": "red",
                "value": 1500
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 0,
          "noValue": "Sensor offline"
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value_and_name",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 8,
      "type": "stat",
      "title": "PM2.5 now",
      "description": "Fine dust. Below 12 µg/m³ is good (WHO daily guideline: 15).",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 4,
        "y": 16,
        "w": 10,
        "h": 5
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.alpstuga_air_quality_monitor_pm2_5\"}",
          "legendFormat": "ALPSTUGA",
          "refId": "A",
          "range": false,
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.living_room_air_quality_monitor_pm25\"}",
          "legendFormat": "Living room monitor",
          "refId": "B",
          "range": false,
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.air_purifier_pm2_5\"}",
          "legendFormat": "Air purifier 1",
          "refId": "C",
          "range": false,
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.air_purifier_pm2_5_2\"}",
          "legendFormat": "Air purifier 2",
          "refId": "D",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "conμgm3",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "yellow",
                "value": 12
              },
              {
                "color": "orange",
                "value": 35
              },
              {
                "color": "red",
                "value": 55
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 0
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value_and_name",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 9,
      "type": "stat",
      "title": "VOC index",
      "description": "Sensirion VOC index: 100 is the normal average, above 250 means strong odours or fumes.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 14,
        "y": 16,
        "w": 4,
        "h": 5
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.living_room_air_quality_monitor_voc_index\"}",
          "legendFormat": "Living room",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "none",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "yellow",
                "value": 150
              },
              {
                "color": "orange",
                "value": 250
              },
              {
                "color": "red",
                "value": 400
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 0
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value_and_name",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 10,
      "type": "bargauge",
      "title": "Purifier filter life",
      "description": "Alert below 10 %.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 18,
        "y": 16,
        "w": 6,
        "h": 5
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.air_purifier_filter_lifetime\"}",
          "legendFormat": "Air purifier 1",
          "refId": "A",
          "range": true,
          "instant": false
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.air_purifier_filter_lifetime_2\"}",
          "legendFormat": "Air purifier 2",
          "refId": "B",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "percent",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "orange",
                "value": 10
              },
              {
                "color": "green",
                "value": 25
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "min": 0,
          "max": 100
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "orientation": "horizontal",
        "displayMode": "gradient",
        "showUnfilled": true,
        "valueMode": "color",
        "namePlacement": "left",
        "sizing": "auto"
      }
    },
    {
      "id": 11,
      "type": "timeseries",
      "title": "PM2.5 history",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 21,
        "w": 12,
        "h": 8
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.alpstuga_air_quality_monitor_pm2_5\"}",
          "legendFormat": "ALPSTUGA",
          "refId": "A",
          "range": true,
          "instant": false
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.living_room_air_quality_monitor_pm25\"}",
          "legendFormat": "Living room monitor",
          "refId": "B",
          "range": true,
          "instant": false
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.air_purifier_pm2_5\"}",
          "legendFormat": "Air purifier 1",
          "refId": "C",
          "range": true,
          "instant": false
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.air_purifier_pm2_5_2\"}",
          "legendFormat": "Air purifier 2",
          "refId": "D",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "conμgm3",
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 2,
            "fillOpacity": 10,
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "mode": "none",
              "group": "A"
            }
          },
          "min": 0
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "right",
          "calcs": [
            "lastNotNull",
            "min",
            "max"
          ]
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 12,
      "type": "timeseries",
      "title": "CO₂ & VOC history",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 12,
        "y": 21,
        "w": 12,
        "h": 8
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.alpstuga_air_quality_monitor_carbon_dioxide\"}",
          "legendFormat": "CO₂ (ppm)",
          "refId": "A",
          "range": true,
          "instant": false
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=\"sensor.living_room_air_quality_monitor_voc_index\"}",
          "legendFormat": "VOC index",
          "refId": "B",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "none",
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 2,
            "fillOpacity": 10,
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "mode": "none",
              "group": "A"
            }
          },
          "min": 0
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "VOC index"
            },
            "properties": [
              {
                "id": "custom.axisPlacement",
                "value": "right"
              }
            ]
          }
        ]
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "right",
          "calcs": [
            "lastNotNull",
            "min",
            "max"
          ]
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 13,
      "type": "row",
      "title": "⚡ Power & UPS",
      "collapsed": false,
      "gridPos": {
        "x": 0,
        "y": 29,
        "w": 24,
        "h": 1
      },
      "panels": []
    },
    {
      "id": 14,
      "type": "stat",
      "title": "All plugs now",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 30,
        "w": 4,
        "h": 6
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum(hass_sensor_power_w{entity=~\"sensor.smart_plug_.*\"})",
          "legendFormat": "Total",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "watt",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "orange",
                "value": 500
              },
              {
                "color": "red",
                "value": 1500
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 0
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 15,
      "type": "bargauge",
      "title": "Power now per plug",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 4,
        "y": 30,
        "w": 8,
        "h": 6
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "label_replace(hass_sensor_power_w{entity=~\"sensor.smart_plug_.*\"}, \"device\", \"$1\", \"friendly_name\", \"Smart Plug - (.*?)( Power| Current consumption| Energy| Total consumption)?\")",
          "legendFormat": "{{device}}",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "watt",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "orange",
                "value": 300
              },
              {
                "color": "red",
                "value": 1000
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "min": 0
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "orientation": "horizontal",
        "displayMode": "gradient",
        "showUnfilled": true,
        "valueMode": "color",
        "namePlacement": "left",
        "sizing": "auto"
      }
    },
    {
      "id": 16,
      "type": "bargauge",
      "title": "Energy in selected time range",
      "description": "kWh used per plug in the time range picked at the top right (e.g. Last 24 hours, Last 7 days).",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 12,
        "y": 30,
        "w": 12,
        "h": 6
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "label_replace(increase(hass_sensor_energy_kwh{entity=~\"sensor.smart_plug_.*_energy|sensor.smart_plug_desk_total_consumption\"}[$__range]), \"device\", \"$1\", \"friendly_name\", \"Smart Plug - (.*?)( Power| Current consumption| Energy| Total consumption)?\")",
          "legendFormat": "{{device}}",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "kwatth",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "blue",
                "value": null
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "min": 0
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "orientation": "horizontal",
        "displayMode": "gradient",
        "showUnfilled": true,
        "valueMode": "color",
        "namePlacement": "left",
        "sizing": "auto"
      }
    },
    {
      "id": 17,
      "type": "timeseries",
      "title": "Power per plug",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 36,
        "w": 24,
        "h": 8
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "label_replace(hass_sensor_power_w{entity=~\"sensor.smart_plug_.*\"}, \"device\", \"$1\", \"friendly_name\", \"Smart Plug - (.*?)( Power| Current consumption| Energy| Total consumption)?\")",
          "legendFormat": "{{device}}",
          "refId": "A",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "watt",
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 2,
            "fillOpacity": 40,
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "mode": "normal",
              "group": "A"
            }
          },
          "min": 0
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "right",
          "calcs": [
            "lastNotNull",
            "min",
            "max"
          ]
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 18,
      "type": "row",
      "title": "📅 Energy per month",
      "collapsed": false,
      "gridPos": {
        "x": 0,
        "y": 44,
        "w": 24,
        "h": 1
      },
      "panels": []
    },
    {
      "id": 19,
      "type": "bargauge",
      "title": "This month so far",
      "description": "kWh per plug since the 1st of this month.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 45,
        "w": 8,
        "h": 7
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum by (device) (label_replace(increase(hass_sensor_energy_kwh{entity=~\"sensor.smart_plug_.*_energy|sensor.smart_plug_desk_total_consumption\"}[$__range]), \"device\", \"$1\", \"friendly_name\", \"Smart Plug - (.*?)( Energy| Total consumption)?\"))",
          "legendFormat": "{{device}}",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "kwatth",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "blue",
                "value": null
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "min": 0
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "orientation": "horizontal",
        "displayMode": "gradient",
        "showUnfilled": true,
        "valueMode": "color",
        "namePlacement": "left",
        "sizing": "auto"
      },
      "timeFrom": "now/M"
    },
    {
      "id": 20,
      "type": "stat",
      "title": "This month total",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 8,
        "y": 45,
        "w": 4,
        "h": 7
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum(sum by (device) (label_replace(increase(hass_sensor_energy_kwh{entity=~\"sensor.smart_plug_.*_energy|sensor.smart_plug_desk_total_consumption\"}[$__range]), \"device\", \"$1\", \"friendly_name\", \"Smart Plug - (.*?)( Energy| Total consumption)?\")))",
          "legendFormat": "Total",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "kwatth",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "blue",
                "value": null
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 1
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      },
      "timeFrom": "now/M"
    },
    {
      "id": 21,
      "type": "bargauge",
      "title": "Last month",
      "description": "kWh per plug for the whole previous calendar month.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 12,
        "y": 45,
        "w": 8,
        "h": 7
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum by (device) (label_replace(increase(hass_sensor_energy_kwh{entity=~\"sensor.smart_plug_.*_energy|sensor.smart_plug_desk_total_consumption\"}[$__range]), \"device\", \"$1\", \"friendly_name\", \"Smart Plug - (.*?)( Energy| Total consumption)?\"))",
          "legendFormat": "{{device}}",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "kwatth",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "purple",
                "value": null
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "min": 0
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "orientation": "horizontal",
        "displayMode": "gradient",
        "showUnfilled": true,
        "valueMode": "color",
        "namePlacement": "left",
        "sizing": "auto"
      },
      "timeFrom": "now/M",
      "timeShift": "1M/M"
    },
    {
      "id": 22,
      "type": "stat",
      "title": "Last month total",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 20,
        "y": 45,
        "w": 4,
        "h": 7
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum(sum by (device) (label_replace(increase(hass_sensor_energy_kwh{entity=~\"sensor.smart_plug_.*_energy|sensor.smart_plug_desk_total_consumption\"}[$__range]), \"device\", \"$1\", \"friendly_name\", \"Smart Plug - (.*?)( Energy| Total consumption)?\")))",
          "legendFormat": "Total",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "kwatth",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "purple",
                "value": null
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 1
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      },
      "timeFrom": "now/M",
      "timeShift": "1M/M"
    },
    {
      "id": 23,
      "type": "barchart",
      "title": "Monthly energy per plug (last 12 months)",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "description": "Calendar months, stacked per plug. Prometheus keeps 2 years of data.",
      "gridPos": {
        "x": 0,
        "y": 52,
        "w": 12,
        "h": 9
      },
      "timeFrom": "now-11M/M",
      "interval": "1d",
      "maxDataPoints": 400,
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum by (device) (label_replace(increase(hass_sensor_energy_kwh{entity=~\"sensor.smart_plug_.*_energy|sensor.smart_plug_desk_total_consumption\"}[1d] offset -1d), \"device\", \"$1\", \"friendly_name\", \"Smart Plug - (.*?)( Energy| Total consumption)?\"))",
          "legendFormat": "{{device}}",
          "refId": "A",
          "range": true,
          "instant": false
        }
      ],
      "transformations": [
        {
          "id": "joinByField",
          "options": {
            "byField": "Time",
            "mode": "outer"
          }
        },
        {
          "id": "formatTime",
          "options": {
            "timeField": "Time",
            "outputFormat": "YYYY-MM",
            "useTimezone": true
          }
        },
        {
          "id": "groupBy",
          "options": {
            "fields": {
              "Time": {
                "operation": "groupby",
                "aggregations": []
              },
              "Desk": {
                "operation": "aggregate",
                "aggregations": [
                  "sum"
                ]
              },
              "Internet": {
                "operation": "aggregate",
                "aggregations": [
                  "sum"
                ]
              },
              "iPhone Charger": {
                "operation": "aggregate",
                "aggregations": [
                  "sum"
                ]
              },
              "NAS": {
                "operation": "aggregate",
                "aggregations": [
                  "sum"
                ]
              },
              "TV": {
                "operation": "aggregate",
                "aggregations": [
                  "sum"
                ]
              },
              "Washing Machine": {
                "operation": "aggregate",
                "aggregations": [
                  "sum"
                ]
              }
            }
          }
        },
        {
          "id": "organize",
          "options": {
            "renameByName": {
              "Desk (sum)": "Desk",
              "Internet (sum)": "Internet",
              "iPhone Charger (sum)": "iPhone Charger",
              "NAS (sum)": "NAS",
              "TV (sum)": "TV",
              "Washing Machine (sum)": "Washing Machine",
              "Time": "Month"
            }
          }
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "kwatth",
          "decimals": 1,
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "fillOpacity": 80,
            "lineWidth": 0
          }
        },
        "overrides": []
      },
      "options": {
        "stacking": "normal",
        "showValue": "never",
        "xField": "Month",
        "groupWidth": 0.7,
        "barWidth": 0.9,
        "orientation": "auto",
        "legend": {
          "displayMode": "table",
          "placement": "right",
          "calcs": [
            "sum"
          ],
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 24,
      "type": "timeseries",
      "title": "Daily energy per plug (last 30 days)",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 12,
        "y": 52,
        "w": 12,
        "h": 9
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sum by (device) (label_replace(increase(hass_sensor_energy_kwh{entity=~\"sensor.smart_plug_.*_energy|sensor.smart_plug_desk_total_consumption\"}[1d] offset -1d), \"device\", \"$1\", \"friendly_name\", \"Smart Plug - (.*?)( Energy| Total consumption)?\"))",
          "legendFormat": "{{device}}",
          "refId": "A",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "kwatth",
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "drawStyle": "bars",
            "lineWidth": 1,
            "fillOpacity": 80,
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "mode": "normal",
              "group": "A"
            }
          },
          "min": 0
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "right",
          "calcs": [
            "sum",
            "mean"
          ]
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "timeFrom": "now-30d/d",
      "interval": "1d"
    },
    {
      "id": 25,
      "type": "stat",
      "title": "UPS load",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 61,
        "w": 6,
        "h": 5
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=~\"sensor.ugreen_(usp_)?load\"}",
          "legendFormat": "{{friendly_name}}",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "percent",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "orange",
                "value": 60
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 0
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value_and_name",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 26,
      "type": "stat",
      "title": "UPS battery",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 6,
        "y": 61,
        "w": 6,
        "h": 5
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=~\"sensor.ugreen_(usp_)?battery_charge\"}",
          "legendFormat": "{{friendly_name}}",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "percent",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "orange",
                "value": 50
              },
              {
                "color": "green",
                "value": 90
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "decimals": 0
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value_and_name",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 27,
      "type": "stat",
      "title": "UPS runtime on battery",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 12,
        "y": 61,
        "w": 4,
        "h": 5
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "hass_sensor_duration_s{entity=\"sensor.ugreen_battery_runtime\"} or hass_sensor_duration_min{entity=\"sensor.ugreen_battery_runtime\"} * 60",
          "legendFormat": "Ugreen",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "s",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "orange",
                "value": 600
              },
              {
                "color": "green",
                "value": 1200
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": []
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 28,
      "type": "timeseries",
      "title": "UPS input voltage",
      "description": "Ugreen runs on a ~19 V DC adapter, Ugreen-UPS on 230 V mains. A drop towards 0 V means a power cut.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 16,
        "y": 61,
        "w": 8,
        "h": 5
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=~\"sensor.ugreen_(usp_)?input_voltage\"}",
          "legendFormat": "{{friendly_name}}",
          "refId": "A",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "volt",
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 2,
            "fillOpacity": 10,
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "mode": "none",
              "group": "A"
            }
          }
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "right",
          "calcs": [
            "lastNotNull",
            "min",
            "max"
          ]
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 29,
      "type": "row",
      "title": "🔋 Devices & health",
      "collapsed": false,
      "gridPos": {
        "x": 0,
        "y": 66,
        "w": 24,
        "h": 1
      },
      "panels": []
    },
    {
      "id": 30,
      "type": "bargauge",
      "title": "Battery levels",
      "description": "Lowest first. Sensor batteries alert below 15 %.",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 67,
        "w": 8,
        "h": 8
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "sort(hass_sensor_battery_percent)",
          "legendFormat": "{{friendly_name}}",
          "refId": "A",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "percent",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "orange",
                "value": 15
              },
              {
                "color": "yellow",
                "value": 30
              },
              {
                "color": "green",
                "value": 50
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "min": 0,
          "max": 100
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "orientation": "horizontal",
        "displayMode": "gradient",
        "showUnfilled": true,
        "valueMode": "color",
        "namePlacement": "left",
        "sizing": "auto"
      }
    },
    {
      "id": 31,
      "type": "stat",
      "title": "Zigbee",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 8,
        "y": 67,
        "w": 8,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "hass_binary_sensor_state{entity=\"binary_sensor.zigbee2mqtt_bridge_connection_state\"}",
          "legendFormat": "Zigbee2MQTT",
          "refId": "A",
          "range": false,
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "hass_binary_sensor_state{entity=\"binary_sensor.slzb_mr5u_ethernet\"}",
          "legendFormat": "SLZB Ethernet",
          "refId": "B",
          "range": false,
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "hass_binary_sensor_state{entity=\"binary_sensor.slzb_mr5u_internet\"}",
          "legendFormat": "SLZB Internet",
          "refId": "C",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "none",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "green",
                "value": 1
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [
            {
              "type": "value",
              "options": {
                "0": {
                  "text": "Offline",
                  "color": "red"
                },
                "1": {
                  "text": "Online",
                  "color": "green"
                }
              }
            }
          ]
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value_and_name",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 32,
      "type": "stat",
      "title": "Air purifiers",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 16,
        "y": 67,
        "w": 8,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "hass_fan_state{entity=\"fan.air_purifier\"}",
          "legendFormat": "Purifier 1",
          "refId": "A",
          "range": false,
          "instant": true
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "hass_fan_state{entity=\"fan.air_purifier_2\"}",
          "legendFormat": "Purifier 2",
          "refId": "B",
          "range": false,
          "instant": true
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "none",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "text",
                "value": null
              },
              {
                "color": "green",
                "value": 1
              }
            ]
          },
          "color": {
            "mode": "thresholds"
          },
          "mappings": [
            {
              "type": "value",
              "options": {
                "0": {
                  "text": "Off"
                },
                "1": {
                  "text": "On",
                  "color": "green"
                }
              }
            }
          ]
        },
        "overrides": []
      },
      "options": {
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "colorMode": "background",
        "graphMode": "none",
        "textMode": "value_and_name",
        "justifyMode": "center",
        "orientation": "auto",
        "wideLayout": true
      }
    },
    {
      "id": 33,
      "type": "timeseries",
      "title": "Zigbee coordinator temperature",
      "description": "",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 8,
        "y": 71,
        "w": 16,
        "h": 4
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "{__name__=~\"hass_sensor_.+\", entity=~\"sensor.slzb_mr5u_.*_temp.*\"}",
          "legendFormat": "{{friendly_name}}",
          "refId": "A",
          "range": true,
          "instant": false
        }
      ],
      "fieldConfig": {
        "defaults": {
          "unit": "celsius",
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 2,
            "fillOpacity": 10,
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "mode": "none",
              "group": "A"
            }
          }
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "displayMode": "table",
          "placement": "right",
          "calcs": [
            "lastNotNull",
            "min",
            "max"
          ]
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      }
    },
    {
      "id": 34,
      "type": "table",
      "title": "Unavailable entities right now",
      "datasource": {
        "type": "prometheus",
        "uid": "prometheus"
      },
      "gridPos": {
        "x": 0,
        "y": 75,
        "w": 24,
        "h": 7
      },
      "description": "Devices Home Assistant currently can't reach (dead battery, out of range, unplugged). Empty = all good.",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "prometheus"
          },
          "expr": "hass_entity_available == 0",
          "legendFormat": "",
          "refId": "A",
          "range": false,
          "instant": true,
          "format": "table"
        }
      ],
      "fieldConfig": {
        "defaults": {},
        "overrides": []
      },
      "options": {
        "showHeader": true,
        "sortBy": [
          {
            "displayName": "Name",
            "desc": false
          }
        ]
      },
      "transformations": [
        {
          "id": "organize",
          "options": {
            "includeByName": {
              "friendly_name": true,
              "entity": true,
              "domain": true
            },
            "renameByName": {
              "friendly_name": "Name",
              "entity": "Entity ID",
              "domain": "Type"
            },
            "indexByName": {
              "friendly_name": 0,
              "entity": 1,
              "domain": 2
            }
          }
        }
      ]
    }
  ]
}