You have encouraged me to dig into setting up variables in InfluxQL in grafana. This morning I was able to set it up on a few of them.
The HVAC graph was just kind of a experiment similarly, i have a graph that shows the state of motion sensors.
It shouldn't be to hard to add those other stats to the HVAC activity graph, I really like what you have done with the Hub Info dashboard.
Here is that HVAC activity Dashboard updated as i think you suggested. It I put the outdoor temp near the top with the HVAC Activity so you can see how the outside temp effects it's run times and such. One catch is that this is still using InfluxQL for the backend query.
{
"__inputs": [
{
"name": "DS_INFLUXDB",
"label": "InfluxDB",
"description": "",
"type": "datasource",
"pluginId": "influxdb",
"pluginName": "InfluxDB"
}
],
"__elements": {},
"__requires": [
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "10.0.3"
},
{
"type": "datasource",
"id": "influxdb",
"name": "InfluxDB",
"version": "1.0.0"
},
{
"type": "panel",
"id": "state-timeline",
"name": "State timeline",
"version": ""
},
{
"type": "panel",
"id": "timeseries",
"name": "Time series",
"version": ""
}
],
"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": 0,
"id": null,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "fixed"
},
"custom": {
"fillOpacity": 70,
"lineWidth": 0,
"spanNulls": false
},
"displayName": "HVAC Activity",
"mappings": [
{
"options": {
"cooling": {
"color": "dark-blue",
"index": 3,
"text": "Cooling"
},
"fan\\ only": {
"color": "dark-green",
"index": 2,
"text": "Circulation Only"
},
"heating": {
"color": "dark-red",
"index": 0,
"text": "Heating"
},
"idle": {
"color": "transparent",
"index": 1,
"text": "Idle"
}
},
"type": "value"
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 23,
"x": 0,
"y": 0
},
"id": 2,
"options": {
"alignValue": "left",
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"mergeValues": true,
"rowHeight": 0.9,
"showValue": "never",
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"alias": "$tag_deviceName",
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB}"
},
"groupBy": [
{
"params": [
"$__interval"
],
"type": "time"
},
{
"params": [
"deviceName"
],
"type": "tag"
}
],
"measurement": "thermostatOperatingState",
"orderByTime": "ASC",
"policy": "$datasource_InfluxDB",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"value"
],
"type": "field"
},
{
"params": [],
"type": "distinct"
}
]
],
"tags": [
{
"key": "deviceName",
"operator": "=~",
"value": "/^$thermostat$/"
}
]
}
],
"title": "HVAC Activity",
"type": "state-timeline"
},
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "Temperature",
"axisPlacement": "left",
"axisWidth": 80,
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 23,
"x": 0,
"y": 5
},
"id": 4,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"alias": "$tag_deviceName",
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB}"
},
"groupBy": [
{
"params": [
"$__interval"
],
"type": "time"
},
{
"params": [
"deviceName"
],
"type": "tag"
},
{
"params": [
"linear"
],
"type": "fill"
}
],
"measurement": "temperature",
"orderByTime": "ASC",
"policy": "$datasource_InfluxDB",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": [
{
"key": "deviceName",
"operator": "=~",
"value": "/^$outdoor_Temp_Sensors$/"
}
]
}
],
"title": "HVAC Aux Temp Sensors",
"type": "timeseries"
},
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "Temperature",
"axisPlacement": "left",
"axisWidth": 80,
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 23,
"x": 0,
"y": 11
},
"id": 5,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"alias": "$tag_deviceName",
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB}"
},
"groupBy": [
{
"params": [
"$__interval"
],
"type": "time"
},
{
"params": [
"deviceName"
],
"type": "tag"
},
{
"params": [
"linear"
],
"type": "fill"
}
],
"measurement": "temperature",
"orderByTime": "ASC",
"policy": "$datasource_InfluxDB",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": [
{
"key": "deviceName",
"operator": "=~",
"value": "/^$hvac_temp_Sensors$/"
}
]
}
],
"title": "HVAC Aux Temp Sensors",
"type": "timeseries"
},
{
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "Temperature",
"axisPlacement": "left",
"axisWidth": 80,
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 23,
"x": 0,
"y": 17
},
"id": 6,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"alias": "$tag_deviceName",
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB}"
},
"groupBy": [
{
"params": [
"$__interval"
],
"type": "time"
},
{
"params": [
"deviceName"
],
"type": "tag"
},
{
"params": [
"linear"
],
"type": "fill"
}
],
"measurement": "temperature",
"orderByTime": "ASC",
"policy": "$datasource_InfluxDB",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": [
{
"key": "deviceName",
"operator": "=~",
"value": "/^$alt_Indoor_Temp$/"
}
]
}
],
"title": "HVAC Aux Temp Sensors",
"type": "timeseries"
}
],
"refresh": "",
"schemaVersion": 38,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"current": {
"selected": false,
"text": "InfluxDB",
"value": "InfluxDB"
},
"hide": 0,
"includeAll": false,
"label": "Database",
"multi": false,
"name": "datasource_InfluxDB",
"options": [],
"query": "influxdb",
"queryValue": "",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"type": "datasource"
},
{
"current": {},
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB}"
},
"definition": "select DISTINCT(\"deviceName\") FROM (select * from \"thermostatMode\" where $timeFilter)",
"hide": 0,
"includeAll": false,
"label": "Thermostat",
"multi": true,
"name": "thermostat",
"options": [],
"query": "select DISTINCT(\"deviceName\") FROM (select * from \"thermostatMode\" where $timeFilter)",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
},
{
"current": {},
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB}"
},
"definition": "select DISTINCT(\"deviceName\") FROM (select * from \"temperature\" where $timeFilter)",
"hide": 0,
"includeAll": false,
"label": "HVAC Temp Sensors",
"multi": true,
"name": "hvac_temp_Sensors",
"options": [],
"query": "select DISTINCT(\"deviceName\") FROM (select * from \"temperature\" where $timeFilter)",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
},
{
"current": {},
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB}"
},
"definition": "select DISTINCT(\"deviceName\") FROM (select * from \"temperature\" where $timeFilter)",
"hide": 0,
"includeAll": false,
"label": "Outdoor Sensors",
"multi": true,
"name": "outdoor_Temp_Sensors",
"options": [],
"query": "select DISTINCT(\"deviceName\") FROM (select * from \"temperature\" where $timeFilter)",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
},
{
"current": {},
"datasource": {
"type": "influxdb",
"uid": "${DS_INFLUXDB}"
},
"definition": "select DISTINCT(\"deviceName\") FROM (select * from \"temperature\" where $timeFilter)",
"hide": 0,
"includeAll": false,
"label": "Alternate Indoor Temp Sensors",
"multi": true,
"name": "alt_Indoor_Temp",
"options": [],
"query": "select DISTINCT(\"deviceName\") FROM (select * from \"temperature\" where $timeFilter)",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
}
]
},
"time": {
"from": "now-2d",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "HVAC Activity",
"uid": "iliPwTJnz",
"version": 25,
"weekStart": ""
}