apiVersion: v1
kind: ConfigMap
metadata:
  namespace: monitoring
  name: kube-prometheus-stack-custom-dashboard-home-assistant
  labels:
    grafana_dashboard: "1"
data:
  home-assistant.json: |-
    {
      "annotations": {
        "list": [
          {
            "builtIn": 1,
            "datasource": "-- Grafana --",
            "enable": true,
            "hide": true,
            "iconColor": "rgba(0, 211, 255, 1)",
            "name": "Annotations & Alerts",
            "type": "dashboard"
          }
        ]
      },
      "editable": true,
      "gnetId": null,
      "graphTooltip": 0,
      "links": [],
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": null,
          "fill": 0,
          "fillGradient": 0,
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 0,
            "y": 0
          },
          "hiddenSeries": false,
          "id": 2,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "nullPointMode": "null",
          "options": {
            "alertThreshold": true
          },
          "percentage": false,
          "pluginVersion": "8.0.3",
          "pointradius": 2,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "exemplar": true,
              "expr": "(sum by(friendly_name) (homeassistant_sensor_temperature_celsius{friendly_name!~\"Living Room Thermostat|Upstairs Thermostat|Subaru Crosstrek External Temp\"})) * (9/5) + 32",
              "interval": "",
              "legendFormat": "{{friendly_name}}",
              "refId": "A"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Temperature",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:26",
              "format": "fahrenheit",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "$$hashKey": "object:27",
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": null,
          "fill": 0,
          "fillGradient": 0,
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 12,
            "y": 0
          },
          "hiddenSeries": false,
          "id": 4,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "nullPointMode": "null",
          "options": {
            "alertThreshold": true
          },
          "percentage": false,
          "pluginVersion": "8.0.3",
          "pointradius": 2,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "exemplar": true,
              "expr": "sum by(friendly_name) (homeassistant_sensor_humidity_percent)",
              "interval": "",
              "legendFormat": "{{friendly_name}}",
              "refId": "A"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Humidity",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:55",
              "format": "humidity",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "$$hashKey": "object:56",
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": null,
          "fill": 0,
          "fillGradient": 0,
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 0,
            "y": 8
          },
          "hiddenSeries": false,
          "id": 6,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "nullPointMode": "null",
          "options": {
            "alertThreshold": true
          },
          "percentage": false,
          "pluginVersion": "8.0.3",
          "pointradius": 2,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "exemplar": true,
              "expr": "sum by(friendly_name) (homeassistant_light_brightness_percent)",
              "interval": "",
              "legendFormat": "{{friendly_name}}",
              "refId": "A"
            },
            {
              "exemplar": true,
              "expr": "sum by(friendly_name) (switch_state{friendly_name=~\"Roof Lights|Salt Lamp\"}) * 100",
              "hide": false,
              "interval": "",
              "legendFormat": "{{friendly_name}}",
              "refId": "B"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Lights",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:119",
              "format": "percent",
              "label": null,
              "logBase": 1,
              "max": "100",
              "min": null,
              "show": true
            },
            {
              "$$hashKey": "object:120",
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": null,
          "fill": 0,
          "fillGradient": 0,
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 12,
            "y": 8
          },
          "hiddenSeries": false,
          "id": 12,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "nullPointMode": "null",
          "options": {
            "alertThreshold": true
          },
          "percentage": false,
          "pluginVersion": "8.0.3",
          "pointradius": 2,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "exemplar": true,
              "expr": "sum by(friendly_name) (homeassistant_sensor_illuminance_percent{friendly_name=~\".*Illuminance\"})",
              "interval": "",
              "legendFormat": "{{friendly_name}}",
              "refId": "A"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Illuminance",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:969",
              "format": "percent",
              "label": null,
              "logBase": 1,
              "max": "100",
              "min": null,
              "show": true
            },
            {
              "$$hashKey": "object:970",
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "backgroundColor": "rgba(128,128,128,0.1)",
          "colorMaps": [
            {
              "$$hashKey": "object:472",
              "color": "#F2495C",
              "text": "Away"
            },
            {
              "$$hashKey": "object:541",
              "color": "#73BF69",
              "text": "Home"
            }
          ],
          "crosshairColor": "#8F070C",
          "datasource": null,
          "display": "timeline",
          "expandFromQueryS": 0,
          "extendLastValue": true,
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 0,
            "y": 16
          },
          "highlightOnMouseover": true,
          "id": 10,
          "legendSortBy": "-ms",
          "lineColor": "rgba(0,0,0,0.1)",
          "metricNameColor": "#000000",
          "pluginVersion": "7.5.3",
          "rangeMaps": [
            {
              "$$hashKey": "object:477",
              "from": "null",
              "text": "N/A",
              "to": "null"
            }
          ],
          "rowHeight": 50,
          "showLegend": true,
          "showLegendNames": true,
          "showLegendPercent": true,
          "showLegendTime": true,
          "showLegendValues": true,
          "showTimeAxis": true,
          "targets": [
            {
              "exemplar": true,
              "expr": "sum by(friendly_name) (homeassistant_person_state)",
              "interval": "",
              "legendFormat": "{{friendly_name}}",
              "refId": "A"
            }
          ],
          "textSize": 24,
          "textSizeTime": 12,
          "timeOptions": [
            {
              "name": "Years",
              "value": "years"
            },
            {
              "name": "Months",
              "value": "months"
            },
            {
              "name": "Weeks",
              "value": "weeks"
            },
            {
              "name": "Days",
              "value": "days"
            },
            {
              "name": "Hours",
              "value": "hours"
            },
            {
              "name": "Minutes",
              "value": "minutes"
            },
            {
              "name": "Seconds",
              "value": "seconds"
            },
            {
              "name": "Milliseconds",
              "value": "milliseconds"
            }
          ],
          "timePrecision": {
            "name": "Minutes",
            "value": "minutes"
          },
          "timeTextColor": "#d8d9da",
          "title": "Presence",
          "type": "natel-discrete-panel",
          "units": "short",
          "use12HourClock": false,
          "useTimePrecision": false,
          "valueMaps": [
            {
              "$$hashKey": "object:475",
              "op": "=",
              "text": "Away",
              "value": "null"
            },
            {
              "$$hashKey": "object:509",
              "op": "=",
              "text": "Away",
              "value": "0"
            },
            {
              "$$hashKey": "object:511",
              "op": "=",
              "text": "Away",
              "value": "off"
            },
            {
              "$$hashKey": "object:513",
              "op": "=",
              "text": "Home",
              "value": "1"
            },
            {
              "$$hashKey": "object:515",
              "op": "=",
              "text": "Home",
              "value": "on"
            }
          ],
          "valueTextColor": "#000000",
          "writeAllValues": false,
          "writeLastValue": true,
          "writeMetricNames": false
        },
        {
          "backgroundColor": "rgba(128,128,128,0.1)",
          "colorMaps": [
            {
              "$$hashKey": "object:719",
              "color": "#F2495C",
              "text": "Off"
            },
            {
              "$$hashKey": "object:763",
              "color": "#73BF69",
              "text": "On"
            }
          ],
          "crosshairColor": "#8F070C",
          "datasource": null,
          "display": "timeline",
          "expandFromQueryS": 0,
          "extendLastValue": true,
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 12,
            "y": 16
          },
          "highlightOnMouseover": true,
          "id": 8,
          "legendSortBy": "-ms",
          "lineColor": "rgba(0,0,0,0.1)",
          "metricNameColor": "#000000",
          "pluginVersion": "7.5.3",
          "rangeMaps": [
            {
              "$$hashKey": "object:724",
              "from": "null",
              "text": "N/A",
              "to": "null"
            }
          ],
          "rowHeight": 50,
          "showLegend": true,
          "showLegendNames": true,
          "showLegendPercent": true,
          "showLegendValues": true,
          "showTimeAxis": true,
          "targets": [
            {
              "exemplar": true,
              "expr": "sum by(friendly_name) (homeassistant_binary_sensor_state{friendly_name=~\".*TV\"})",
              "interval": "",
              "legendFormat": "{{friendly_name}}",
              "refId": "A"
            }
          ],
          "textSize": 24,
          "textSizeTime": 12,
          "timeFrom": null,
          "timeOptions": [
            {
              "name": "Years",
              "value": "years"
            },
            {
              "name": "Months",
              "value": "months"
            },
            {
              "name": "Weeks",
              "value": "weeks"
            },
            {
              "name": "Days",
              "value": "days"
            },
            {
              "name": "Hours",
              "value": "hours"
            },
            {
              "name": "Minutes",
              "value": "minutes"
            },
            {
              "name": "Seconds",
              "value": "seconds"
            },
            {
              "name": "Milliseconds",
              "value": "milliseconds"
            }
          ],
          "timePrecision": {
            "name": "Minutes",
            "value": "minutes"
          },
          "timeShift": null,
          "timeTextColor": "#d8d9da",
          "title": "TV Usage",
          "type": "natel-discrete-panel",
          "units": "short",
          "use12HourClock": false,
          "useTimePrecision": false,
          "valueMaps": [
            {
              "$$hashKey": "object:722",
              "op": "=",
              "text": "Off",
              "value": "null"
            },
            {
              "$$hashKey": "object:759",
              "op": "=",
              "text": "Off",
              "value": "0"
            },
            {
              "$$hashKey": "object:761",
              "op": "=",
              "text": "On",
              "value": "1"
            },
            {
              "$$hashKey": "object:813",
              "op": "=",
              "text": "Off",
              "value": "off"
            },
            {
              "$$hashKey": "object:815",
              "op": "=",
              "text": "On",
              "value": "on"
            }
          ],
          "valueTextColor": "#000000",
          "writeAllValues": false,
          "writeLastValue": true,
          "writeMetricNames": false
        }
      ],
      "refresh": false,
      "schemaVersion": 30,
      "style": "dark",
      "tags": [],
      "templating": {
        "list": []
      },
      "time": {
        "from": "now-12h",
        "to": "now"
      },
      "timepicker": {},
      "timezone": "",
      "title": "Home Assistant",
      "uid": "g5zK8e9Mz",
      "version": 2
    }
