From 066dca7ed0d995de4ab6ccbdfdd6c1df74fc9025 Mon Sep 17 00:00:00 2001 From: Dave Schmid Date: Thu, 3 Oct 2024 15:23:03 -0500 Subject: [PATCH] Add files via upload --- .../shared/kasa_collector-device_details.json | 1898 ++++---- .../kasa_collector-energy_by_device.json | 3257 +++++++------ .../kasa_collector-energy_by_measurement.json | 4181 ++++++++--------- .../shared/kasa_collector-energy_by_time.json | 1777 ++++--- grafana/shared/kasa_collector-status.json | 2411 +++++----- 5 files changed, 6899 insertions(+), 6625 deletions(-) diff --git a/grafana/shared/kasa_collector-device_details.json b/grafana/shared/kasa_collector-device_details.json index 04b75f8..be82b84 100644 --- a/grafana/shared/kasa_collector-device_details.json +++ b/grafana/shared/kasa_collector-device_details.json @@ -1,70 +1,68 @@ { "__inputs": [ - { - "name": "DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA", - "label": "InfluxDB - influxdb02 - Tylephony - kasa", - "description": "", - "type": "datasource", - "pluginId": "influxdb", - "pluginName": "InfluxDB" - }, - { - "name": "DS_INFLUXDB_- KASA", - "label": "InfluxDB - kasa", - "description": "", - "type": "datasource", - "pluginId": "influxdb", - "pluginName": "InfluxDB" - } + { + "name": "InfluxDB - Kasa Collector", + "label": "InfluxDB - Kasa Collector", + "description": "", + "type": "datasource", + "pluginId": "influxdb", + "pluginName": "InfluxDB" + } ], "__elements": {}, "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "11.0.0" - }, - { - "type": "datasource", - "id": "influxdb", - "name": "InfluxDB", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "table", - "name": "Table", - "version": "" - }, - { - "type": "panel", - "id": "timeseries", - "name": "Time series", - "version": "" - } - ], - "annotations": { - "list": [ { - "builtIn": 1, - "datasource": { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "11.1.3" + }, + { + "type": "datasource", + "id": "influxdb", + "name": "InfluxDB", + "version": "1.0.0" + }, + { "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" + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "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" + } + ] }, "description": "Kasa Collector provides a way of collecting real-time energy data from Kasa Smart Plugs. These Grafana dashboards offer visualizations for their Current, Voltage, Power, and Total Watt Hours.", "editable": true, @@ -72,812 +70,1100 @@ "graphTooltip": 0, "id": null, "links": [ - { - "asDropdown": true, - "icon": "external link", - "includeVars": true, - "keepTime": true, - "tags": [ - "kasa-collector" - ], - "targetBlank": false, - "title": "Kasa Collector - Dashboards", - "tooltip": "", - "type": "dashboards", - "url": "" - } + { + "asDropdown": true, + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "kasa-collector" + ], + "targetBlank": false, + "title": "Kasa Collector - Dashboards", + "tooltip": "", + "type": "dashboards", + "url": "" + } ], "liveNow": false, "panels": [ - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "transparent", - "mode": "fixed" + { + "datasource": { + "type": "influxdb", + "uid": "${data_source}" }, - "custom": { - "align": "auto", - "cellOptions": { - "type": "auto" - }, - "inspect": false + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "transparent", + "mode": "fixed" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Software" + }, + "properties": [ + { + "id": "custom.width", + "value": 227 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "device_alias" + }, + "properties": [ + { + "id": "custom.width", + "value": 228 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "State" + }, + "properties": [ + { + "id": "mappings", + "value": [ + { + "options": { + "0": { + "color": "dark-green", + "index": 0, + "text": "Off" + }, + "1": { + "color": "green", + "index": 1, + "text": "On" + } + }, + "type": "value" + } + ] + }, + { + "id": "custom.cellOptions", + "value": { + "mode": "gradient", + "type": "color-background" + } + }, + { + "id": "custom.align", + "value": "center" + }, + { + "id": "custom.width", + "value": 45 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "LED" + }, + "properties": [ + { + "id": "mappings", + "value": [ + { + "options": { + "0": { + "color": "blue", + "index": 0, + "text": "On" + }, + "1": { + "color": "dark-blue", + "index": 1, + "text": "Off" + } + }, + "type": "value" + } + ] + }, + { + "id": "custom.cellOptions", + "value": { + "mode": "gradient", + "type": "color-background" + } + }, + { + "id": "custom.align", + "value": "center" + }, + { + "id": "custom.width", + "value": 45 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Hardware Version" + }, + "properties": [ + { + "id": "custom.align", + "value": "center" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "HW" + }, + "properties": [ + { + "id": "custom.width", + "value": 46 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Model" + }, + "properties": [ + { + "id": "custom.width", + "value": 94 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "MAC" + }, + "properties": [ + { + "id": "custom.width", + "value": 152 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Device Name" + }, + "properties": [ + { + "id": "custom.width", + "value": 249 + } + ] + } + ] }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Software Version" - }, - "properties": [ - { - "id": "custom.width", - "value": 249 - } - ] + "gridPos": { + "h": 21, + "w": 14, + "x": 0, + "y": 0 }, - { - "matcher": { - "id": "byName", - "options": "device_alias" - }, - "properties": [ - { - "id": "custom.width", - "value": 228 - } - ] + "id": 1, + "maxDataPoints": 1, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": false, + "displayName": "Device Name" + } + ] }, - { - "matcher": { - "id": "byName", - "options": "Relay State" - }, - "properties": [ + "pluginVersion": "11.1.3", + "targets": [ { - "id": "mappings", - "value": [ - { - "options": { - "0": { - "color": "dark-green", - "index": 0, - "text": "Off" + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" }, - "1": { - "color": "green", - "index": 1, - "text": "On" + { + "params": [ + "device_alias::tag" + ], + "type": "tag" } - }, - "type": "value" - } - ] - }, + ], + "limit": "1", + "measurement": "sysinfo", + "orderByTime": "DESC", + "policy": "default", + "refId": "A", + "resultFormat": "table", + "select": [ + [ + { + "params": [ + "feature" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "Feature" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "hw_ver" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "HW" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "mac" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "MAC" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "model" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "Model" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "sw_ver" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "Software" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "relay_state" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "State" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "led_off" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "LED" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "ntc_state" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "NTC State" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "active_mode" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "Active Mode" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "device_alias::tag", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] + } + ], + "title": "Device Details", + "transformations": [ { - "id": "custom.cellOptions", - "value": { - "mode": "gradient", - "type": "color-background" - } + "id": "filterByValue", + "options": { + "filters": [ + { + "config": { + "id": "isNotNull", + "options": {} + }, + "fieldName": "device_alias" + } + ], + "match": "all", + "type": "include" + } }, { - "id": "custom.align", - "value": "center" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "LED" - }, - "properties": [ - { - "id": "mappings", - "value": [ - { - "options": { - "0": { - "color": "blue", - "index": 0, - "text": "On" + "id": "organize", + "options": { + "excludeByName": { + "Active Mode": true, + "Feature": true, + "NTC State": true, + "Time": true }, - "1": { - "color": "dark-blue", - "index": 1, - "text": "Off" + "includeByName": {}, + "indexByName": {}, + "renameByName": { + "device_alias": "Device Name" } - }, - "type": "value" } - ] - }, - { - "id": "custom.cellOptions", - "value": { - "mode": "gradient", - "type": "color-background" - } - }, - { - "id": "custom.align", - "value": "center" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Hardware Version" - }, - "properties": [ - { - "id": "custom.align", - "value": "center" } - ] - } - ] - }, - "gridPos": { - "h": 19, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 1, - "maxDataPoints": 1, - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": "", - "reducer": [ - "sum" ], - "show": false - }, - "showHeader": true, - "sortBy": [ - { - "desc": false, - "displayName": "Device Name" - } - ] + "type": "table" }, - "pluginVersion": "11.0.0", - "targets": [ - { + { "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + "type": "influxdb", + "uid": "${data_source}" }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "device_alias::tag" - ], - "type": "tag" - } - ], - "limit": "1", - "measurement": "sysinfo", - "orderByTime": "DESC", - "policy": "default", - "refId": "A", - "resultFormat": "table", - "select": [ - [ - { - "params": [ - "feature" - ], - "type": "field" - }, - { - "params": [], - "type": "last" - }, - { - "params": [ - "Feature" - ], - "type": "alias" - } - ], - [ - { - "params": [ - "hw_ver" - ], - "type": "field" - }, - { - "params": [], - "type": "last" - }, - { - "params": [ - "Hardware Version" - ], - "type": "alias" - } - ], - [ - { - "params": [ - "mac" - ], - "type": "field" - }, - { - "params": [], - "type": "last" - }, - { - "params": [ - "MAC" - ], - "type": "alias" - } - ], - [ - { - "params": [ - "model" - ], - "type": "field" - }, - { - "params": [], - "type": "last" - }, - { - "params": [ - "Model" - ], - "type": "alias" - } - ], - [ - { - "params": [ - "sw_ver" - ], - "type": "field" - }, - { - "params": [], - "type": "last" - }, - { - "params": [ - "Software Version" - ], - "type": "alias" - } - ], - [ - { - "params": [ - "relay_state" - ], - "type": "field" - }, - { - "params": [], - "type": "last" - }, - { - "params": [ - "Relay State" - ], - "type": "alias" - } - ], - [ - { - "params": [ - "led_off" - ], - "type": "field" - }, - { - "params": [], - "type": "last" - }, - { - "params": [ - "LED" - ], - "type": "alias" - } - ], - [ - { - "params": [ - "ntc_state" - ], - "type": "field" - }, - { - "params": [], - "type": "last" - }, - { - "params": [ - "NTC State" - ], - "type": "alias" - } - ], - [ - { - "params": [ - "active_mode" - ], - "type": "field" + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "transparent", + "mode": "fixed" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } }, - { - "params": [], - "type": "last" + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "On Time" + }, + "properties": [ + { + "id": "unit", + "value": "s" + }, + { + "id": "custom.width", + "value": 100 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "device_alias" + }, + "properties": [] + }, + { + "matcher": { + "id": "byName", + "options": "State" + }, + "properties": [ + { + "id": "mappings", + "value": [ + { + "options": { + "0": { + "color": "dark-green", + "index": 0, + "text": "Off" + }, + "1": { + "color": "green", + "index": 1, + "text": "On" + } + }, + "type": "value" + } + ] + }, + { + "id": "custom.cellOptions", + "value": { + "mode": "gradient", + "type": "color-background" + } + }, + { + "id": "custom.align", + "value": "center" + }, + { + "id": "custom.width", + "value": 45 + } + ] + } + ] + }, + "gridPos": { + "h": 21, + "w": 10, + "x": 14, + "y": 0 + }, + "id": 3, + "maxDataPoints": 1, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false }, + "showHeader": true, + "sortBy": [ + { + "desc": false, + "displayName": "Device Name" + }, + { + "desc": false, + "displayName": "Plug Name" + } + ] + }, + "pluginVersion": "11.1.3", + "targets": [ { - "params": [ - "Active Mode" - ], - "type": "alias" + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "plug_alias::tag" + ], + "type": "tag" + }, + { + "params": [ + "device_alias::tag" + ], + "type": "tag" + } + ], + "limit": "1", + "measurement": "sysinfo_child", + "orderByTime": "DESC", + "policy": "default", + "refId": "A", + "resultFormat": "table", + "select": [ + [ + { + "params": [ + "state" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "State" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "on_time" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "On Time" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "device_alias::tag", + "operator": "=~", + "value": "/^$device_alias$/" + }, + { + "condition": "AND", + "key": "plug_alias::tag", + "operator": "=~", + "value": "/^$plug_alias$/" + } + ] } - ] ], - "tags": [ - { - "key": "device_alias::tag", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - } - ], - "title": "Device Details", - "transformations": [ - { - "id": "filterByValue", - "options": { - "filters": [ - { - "config": { - "id": "isNotNull", - "options": {} - }, - "fieldName": "device_alias" - }, + "title": "Plug Details", + "transformations": [ { - "config": { - "id": "isNotNull", - "options": {} - }, - "fieldName": "Feature" + "id": "organize", + "options": { + "excludeByName": { + "Feature": true, + "Time": true + }, + "includeByName": {}, + "indexByName": { + "On Time": 4, + "State": 3, + "Time": 0, + "device_alias": 1, + "plug_alias": 2 + }, + "renameByName": { + "State": "", + "device_alias": "Device Name", + "plug_alias": "Plug Name" + } + } } - ], - "match": "all", - "type": "include" - } - }, - { - "id": "organize", - "options": { - "excludeByName": { - "Feature": true, - "Time": true - }, - "includeByName": {}, - "indexByName": {}, - "renameByName": { - "device_alias": "Device Name" - } - } - } - ], - "type": "table" - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + ], + "type": "table" }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } + { + "datasource": { + "type": "influxdb", + "uid": "${data_source}" }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "dBm" }, - { - "color": "red", - "value": 80 - } - ] + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Office - Power Strip" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-blue", + "mode": "fixed" + } + } + ] + } + ] }, - "unit": "dBm" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Office - Power Strip" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "light-blue", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 24, - "x": 0, - "y": 19 - }, - "id": 2, - "interval": "$interval", - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "alias": "$tag_device_alias", - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 21 }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "device_alias" - ], - "type": "tag" - } - ], - "measurement": "sysinfo", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "rssi" - ], - "type": "field" + "id": 2, + "interval": "$interval", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ { - "params": [], - "type": "mean" + "alias": "$tag_device_alias", + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "device_alias" + ], + "type": "tag" + } + ], + "measurement": "sysinfo", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "rssi" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] } - ] ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - } - ], - "title": "RSSI", - "type": "timeseries" - } + "title": "RSSI", + "type": "timeseries" + } ], "refresh": "1m", "schemaVersion": 39, "tags": [ - "influxdb", - "kasa-collector" + "influxdb", + "kasa-collector" ], "templating": { - "list": [ - { - "current": { - "selected": false, - "text": "InfluxDB - influxdb02 - Tylephony - kasa", - "value": "P0A3FFFCFD014D9A1" - }, - "hide": 0, - "includeAll": false, - "label": "Data Source", - "multi": false, - "name": "data_source", - "options": [], - "query": "influxdb", - "queryValue": "", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "type": "datasource" - }, - { - "current": {}, - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- KASA}" - }, - "definition": "SHOW TAG VALUES WITH KEY = \"device_alias\"", - "hide": 0, - "includeAll": true, - "label": "Device", - "multi": true, - "name": "device_alias", - "options": [], - "query": "SHOW TAG VALUES WITH KEY = \"device_alias\"", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 5, - "type": "query" - }, - { - "current": {}, - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- KASA}" - }, - "definition": "SHOW TAG VALUES WITH KEY = \"plug_alias\" WHERE \"device_alias\" =~ /^$device_alias$/", - "hide": 0, - "includeAll": true, - "label": "Plug", - "multi": true, - "name": "plug_alias", - "options": [], - "query": "SHOW TAG VALUES WITH KEY = \"plug_alias\" WHERE \"device_alias\" =~ /^$device_alias$/", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 5, - "type": "query" - }, - { - "current": { - "selected": false, - "text": "America/Chicago", - "value": "America/Chicago" - }, - "description": "Time Zone of your devices", - "hide": 0, - "includeAll": false, - "label": "Time Zone", - "multi": false, - "name": "tz", - "options": [ - { - "selected": false, - "text": "America/New_York", - "value": "America/New_York" - }, - { - "selected": true, - "text": "America/Chicago", - "value": "America/Chicago" - }, - { - "selected": false, - "text": "America/Denver", - "value": "America/Denver" - }, - { - "selected": false, - "text": "America/Los_Angeles", - "value": "America/Los_Angeles" - }, - { - "selected": false, - "text": "America/Anchorage", - "value": "America/Anchorage" - }, - { - "selected": false, - "text": "America/Adak", - "value": "America/Adak" - } - ], - "query": "America/New_York,America/Chicago, America/Denver, America/Los_Angeles,America/Anchorage,America/Adak", - "queryValue": "", - "skipUrlSync": false, - "type": "custom" - }, - { - "auto": true, - "auto_count": 30, - "auto_min": "10s", - "current": { - "selected": false, - "text": "5m", - "value": "5m" - }, - "hide": 0, - "label": "Interval", - "name": "interval", - "options": [ - { - "selected": false, - "text": "auto", - "value": "$__auto_interval_interval" - }, - { - "selected": false, - "text": "5s", - "value": "5s" - }, - { - "selected": false, - "text": "15s", - "value": "15s" - }, - { - "selected": false, - "text": "30s", - "value": "30s" - }, - { - "selected": false, - "text": "1m", - "value": "1m" - }, - { - "selected": true, - "text": "5m", - "value": "5m" - }, - { - "selected": false, - "text": "10m", - "value": "10m" - }, - { - "selected": false, - "text": "15m", - "value": "15m" - }, + "list": [ { - "selected": false, - "text": "1h", - "value": "1h" + "current": {}, + "hide": 0, + "includeAll": false, + "label": "Data Source", + "multi": false, + "name": "data_source", + "options": [], + "query": "influxdb", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" }, { - "selected": false, - "text": "3h", - "value": "3h" - }, - { - "selected": false, - "text": "6h", - "value": "6h" - }, - { - "selected": false, - "text": "12h", - "value": "12h" + "current": {}, + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "definition": "SHOW TAG VALUES WITH KEY = \"device_alias\"", + "hide": 0, + "includeAll": true, + "label": "Device", + "multi": true, + "name": "device_alias", + "options": [], + "query": "SHOW TAG VALUES WITH KEY = \"device_alias\"", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 5, + "type": "query" }, { - "selected": false, - "text": "1d", - "value": "1d" + "current": {}, + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "definition": "SHOW TAG VALUES WITH KEY = \"plug_alias\" WHERE \"device_alias\" =~ /^$device_alias$/", + "hide": 0, + "includeAll": true, + "label": "Plug", + "multi": true, + "name": "plug_alias", + "options": [], + "query": "SHOW TAG VALUES WITH KEY = \"plug_alias\" WHERE \"device_alias\" =~ /^$device_alias$/", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 5, + "type": "query" }, { - "selected": false, - "text": "3d", - "value": "3d" + "current": { + "selected": false, + "text": "America/Chicago", + "value": "America/Chicago" + }, + "description": "Time Zone of your devices", + "hide": 0, + "includeAll": false, + "label": "Time Zone", + "multi": false, + "name": "tz", + "options": [ + { + "selected": false, + "text": "America/New_York", + "value": "America/New_York" + }, + { + "selected": true, + "text": "America/Chicago", + "value": "America/Chicago" + }, + { + "selected": false, + "text": "America/Denver", + "value": "America/Denver" + }, + { + "selected": false, + "text": "America/Los_Angeles", + "value": "America/Los_Angeles" + }, + { + "selected": false, + "text": "America/Anchorage", + "value": "America/Anchorage" + }, + { + "selected": false, + "text": "America/Adak", + "value": "America/Adak" + } + ], + "query": "America/New_York,America/Chicago, America/Denver, America/Los_Angeles,America/Anchorage,America/Adak", + "queryValue": "", + "skipUrlSync": false, + "type": "custom" }, { - "selected": false, - "text": "1w", - "value": "1w" + "auto": true, + "auto_count": 30, + "auto_min": "10s", + "current": { + "selected": false, + "text": "5m", + "value": "5m" + }, + "hide": 0, + "label": "Interval", + "name": "interval", + "options": [ + { + "selected": false, + "text": "auto", + "value": "$__auto_interval_interval" + }, + { + "selected": false, + "text": "5s", + "value": "5s" + }, + { + "selected": false, + "text": "15s", + "value": "15s" + }, + { + "selected": false, + "text": "30s", + "value": "30s" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": true, + "text": "5m", + "value": "5m" + }, + { + "selected": false, + "text": "10m", + "value": "10m" + }, + { + "selected": false, + "text": "15m", + "value": "15m" + }, + { + "selected": false, + "text": "1h", + "value": "1h" + }, + { + "selected": false, + "text": "3h", + "value": "3h" + }, + { + "selected": false, + "text": "6h", + "value": "6h" + }, + { + "selected": false, + "text": "12h", + "value": "12h" + }, + { + "selected": false, + "text": "1d", + "value": "1d" + }, + { + "selected": false, + "text": "3d", + "value": "3d" + }, + { + "selected": false, + "text": "1w", + "value": "1w" + } + ], + "query": "5s,15s,30s,1m,5m,10m,15m,1h,3h,6h,12h,1d,3d,1w", + "queryValue": "", + "refresh": 2, + "skipUrlSync": false, + "type": "interval" } - ], - "query": "5s,15s,30s,1m,5m,10m,15m,1h,3h,6h,12h,1d,3d,1w", - "queryValue": "", - "refresh": 2, - "skipUrlSync": false, - "type": "interval" - } - ] + ] }, "time": { - "from": "now-24h", - "to": "now" + "from": "now-24h", + "to": "now" }, - "timeRangeUpdatedDuringEditOrView": false, "timepicker": {}, "timezone": "", "title": "Kasa Collector - Device Details", "uid": "lux4rd0labs_kasa_04", - "version": 19, + "version": 20, "weekStart": "" } \ No newline at end of file diff --git a/grafana/shared/kasa_collector-energy_by_device.json b/grafana/shared/kasa_collector-energy_by_device.json index bc0ff30..40782c6 100644 --- a/grafana/shared/kasa_collector-energy_by_device.json +++ b/grafana/shared/kasa_collector-energy_by_device.json @@ -1,62 +1,62 @@ { "__inputs": [ - { - "name": "DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA", - "label": "InfluxDB - influxdb02 - Tylephony - kasa", - "description": "", - "type": "datasource", - "pluginId": "influxdb", - "pluginName": "InfluxDB" - } + { + "name": "InfluxDB - Kasa Collector", + "label": "InfluxDB - Kasa Collector", + "description": "", + "type": "datasource", + "pluginId": "influxdb", + "pluginName": "InfluxDB" + } ], "__elements": {}, "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "11.0.0" - }, - { - "type": "datasource", - "id": "influxdb", - "name": "InfluxDB", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "stat", - "name": "Stat", - "version": "" - }, - { - "type": "panel", - "id": "timeseries", - "name": "Time series", - "version": "" - } - ], - "annotations": { - "list": [ { - "builtIn": 1, - "datasource": { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "11.1.3" + }, + { "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" + "id": "influxdb", + "name": "InfluxDB", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "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" + } + ] }, "description": "Kasa Collector provides a way of collecting real-time energy data from Kasa Smart Plugs. These Grafana dashboards offer visualizations for their Current, Voltage, Power, and Total Watt Hours.", "editable": true, @@ -64,1690 +64,1689 @@ "graphTooltip": 0, "id": null, "links": [ - { - "asDropdown": true, - "icon": "external link", - "includeVars": true, - "keepTime": true, - "tags": [ - "kasa-collector" - ], - "targetBlank": false, - "title": "Kasa Collector - Dashboards", - "tooltip": "", - "type": "dashboards", - "url": "" - } + { + "asDropdown": true, + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "kasa-collector" + ], + "targetBlank": false, + "title": "Kasa Collector - Dashboards", + "tooltip": "", + "type": "dashboards", + "url": "" + } ], "liveNow": false, "panels": [ - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "dark-purple", - "mode": "fixed" - }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - }, - "unit": "mwatt" - }, - "overrides": [] - }, - "id": 19, - "interval": "$interval", - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "text": {}, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "11.0.0", - "targets": [ - { + { "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + "type": "influxdb", + "uid": "${data_source}" }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "device_alias" - ], - "type": "tag" - }, - { - "params": [ - "previous" - ], - "type": "fill" - } - ], - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "power_mw" - ], - "type": "field" + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "dark-purple", + "mode": "fixed" + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "mwatt" }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - } - ], - "title": "Power (Combined)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "Total", - "mode": "reduceRow", - "reduce": { - "reducer": "sum" - }, - "replaceFields": true - } - } - ], - "type": "stat" - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "semi-dark-blue", - "mode": "fixed" - }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - }, - "unit": "watth" - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 6, - "x": 6, - "y": 0 - }, - "id": 20, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "text": {}, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "11.0.0", - "targets": [ - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + "overrides": [] }, - "groupBy": [ - { - "params": [ - "1h" - ], - "type": "time" - }, - { - "params": [ - "device_alias" - ], - "type": "tag" - } - ], - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "total_wh" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" + "id": 19, + "interval": "$interval", + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, - { - "params": [], - "type": "difference" + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.1.3", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "device_alias" + ], + "type": "tag" + }, + { + "params": [ + "previous" + ], + "type": "fill" + } + ], + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "power_mw" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] } - ] ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - } - ], - "title": "Watt-Hours (Combined)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "Combined", - "mode": "reduceRow", - "reduce": { - "reducer": "sum" - }, - "replaceFields": true - } - } - ], - "type": "stat" - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "semi-dark-yellow", - "mode": "fixed" - }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null + "title": "Power (Combined)", + "transformations": [ + { + "id": "calculateField", + "options": { + "alias": "Total", + "mode": "reduceRow", + "reduce": { + "reducer": "sum" + }, + "replaceFields": true + } } - ] - }, - "unit": "mamp" - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 6, - "x": 12, - "y": 0 - }, - "id": 21, - "interval": "$interval", - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "text": {}, - "textMode": "auto", - "wideLayout": true + "type": "stat" }, - "pluginVersion": "11.0.0", - "targets": [ - { + { "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + "type": "influxdb", + "uid": "${data_source}" }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "device_alias" - ], - "type": "tag" - }, - { - "params": [ - "previous" - ], - "type": "fill" - } - ], - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "current_ma" - ], - "type": "field" + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "semi-dark-blue", + "mode": "fixed" + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "watth" }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - } - ], - "title": "Current (Combined)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "Total", - "mode": "reduceRow", - "reduce": { - "reducer": "sum" - }, - "replaceFields": true - } - } - ], - "type": "stat" - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "dark-red", - "mode": "fixed" + "overrides": [] }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] + "gridPos": { + "h": 3, + "w": 6, + "x": 6, + "y": 0 }, - "unit": "mvolt" - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 6, - "x": 18, - "y": 0 - }, - "id": 22, - "interval": "$interval", - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "text": {}, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "11.0.0", - "targets": [ - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "previous" - ], - "type": "fill" - } - ], - "hide": true, - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "voltage_mv" - ], - "type": "field" + "id": 20, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "previous" - ], - "type": "fill" - } + "pluginVersion": "11.1.3", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "1h" + ], + "type": "time" + }, + { + "params": [ + "device_alias" + ], + "type": "tag" + } + ], + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total_wh" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [], + "type": "difference" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] + } ], - "hide": false, - "measurement": "kasa_energy", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT mean(\"voltage_mv\") FROM \"emeter\" WHERE (\"device_alias\" =~ /^$device_alias$/) AND \"voltage_mv\" > 100000 AND $timeFilter GROUP BY time($__interval) fill(previous)", - "rawQuery": true, - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "voltage_mv" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" + "title": "Watt-Hours (Combined)", + "transformations": [ + { + "id": "calculateField", + "options": { + "alias": "Combined", + "mode": "reduceRow", + "reduce": { + "reducer": "sum" + }, + "replaceFields": true + } } - ] ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - } - ], - "title": "Voltage (Mean)", - "type": "stat" - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "uDxwFcOGz" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 3 + "type": "stat" }, - "id": 24, - "panels": [], - "targets": [ - { + { "datasource": { - "type": "prometheus", - "uid": "uDxwFcOGz" - }, - "refId": "A" - } - ], - "title": "Devices", - "type": "row" - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } + "type": "influxdb", + "uid": "${data_source}" }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "semi-dark-yellow", + "mode": "fixed" + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "mamp" }, - { - "color": "red", - "value": 80 - } - ] + "overrides": [] }, - "unit": "none" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Watts" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "semi-dark-purple", - "mode": "fixed" - } - }, - { - "id": "unit", - "value": "mwatt" - }, - { - "id": "custom.axisPlacement", - "value": "left" - }, - { - "id": "custom.fillOpacity", - "value": 0 - }, - { - "id": "custom.gradientMode", - "value": "none" - } - ] + "gridPos": { + "h": 3, + "w": 6, + "x": 12, + "y": 0 }, - { - "matcher": { - "id": "byName", - "options": "Watt-Hours" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "semi-dark-blue", - "mode": "fixed" - } - }, - { - "id": "unit", - "value": "watth" - }, - { - "id": "custom.axisPlacement", - "value": "left" - }, - { - "id": "custom.drawStyle", - "value": "line" - }, - { - "id": "custom.lineWidth", - "value": 3 - }, - { - "id": "custom.lineStyle", - "value": { - "dash": [ - 30, - 3, - 3 + "id": 21, + "interval": "$interval", + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" ], - "fill": "dash" - } - }, - { - "id": "custom.gradientMode", - "value": "none" + "fields": "", + "values": false }, - { - "id": "custom.fillOpacity", - "value": 0 - } - ] + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true }, - { - "matcher": { - "id": "byName", - "options": "Current" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "semi-dark-yellow", - "mode": "fixed" - } - }, - { - "id": "unit", - "value": "mamp" - }, - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.fillOpacity", - "value": 0 - }, - { - "id": "custom.gradientMode", - "value": "opacity" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Voltage" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "dark-red", - "mode": "fixed" - } - }, - { - "id": "unit", - "value": "mvolt" - }, - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.gradientMode", - "value": "none" - }, - { - "id": "custom.fillOpacity", - "value": 0 + "pluginVersion": "11.1.3", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "device_alias" + ], + "type": "tag" + }, + { + "params": [ + "previous" + ], + "type": "fill" + } + ], + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "current_ma" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 4 - }, - "id": 3, - "interval": "$interval", - "maxPerRow": 2, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "repeat": "device_alias", - "repeatDirection": "h", - "targets": [ - { - "alias": "Watts", - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } ], - "hide": false, - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "power_mw" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" + "title": "Current (Combined)", + "transformations": [ + { + "id": "calculateField", + "options": { + "alias": "Total", + "mode": "reduceRow", + "reduce": { + "reducer": "sum" + }, + "replaceFields": true + } } - ] ], - "tags": [ - { - "key": "device_alias::tag", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - }, - { - "alias": "Watt-Hours", + "type": "stat" + }, + { "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + "type": "influxdb", + "uid": "${data_source}" }, - "groupBy": [ - { - "params": [ - "1h" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "hide": false, - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "total_wh" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "dark-red", + "mode": "fixed" + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "mvolt" }, - { - "params": [], - "type": "non_negative_difference" - } - ] - ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - }, - { - "alias": "Current", - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + "overrides": [] }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "hide": false, - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "C", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "current_ma" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - }, - { - "alias": "Voltage", - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + "gridPos": { + "h": 3, + "w": 6, + "x": 18, + "y": 0 }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "hide": false, - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "D", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "voltage_mv" - ], - "type": "field" + "id": 22, + "interval": "$interval", + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - }, - { - "alias": "Voltage", - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "hide": true, - "measurement": "kasa_energy", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT mean(\"voltage_mv\") FROM \"emeter\" WHERE (\"device_alias\" =~ /^$device_alias$/) AND \"voltage_mv\" > 100000 AND $timeFilter GROUP BY time($__interval) fill(null)", - "rawQuery": true, - "refId": "E", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "voltage_mv" - ], - "type": "field" + "pluginVersion": "11.1.3", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "previous" + ], + "type": "fill" + } + ], + "hide": true, + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "voltage_mv" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] }, { - "params": [], - "type": "mean" + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "previous" + ], + "type": "fill" + } + ], + "hide": false, + "measurement": "kasa_energy", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT mean(\"voltage_mv\") FROM \"emeter\" WHERE (\"device_alias\" =~ /^$device_alias$/) AND \"voltage_mv\" > 100000 AND $timeFilter GROUP BY time($__interval) fill(previous)", + "rawQuery": true, + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "voltage_mv" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] } - ] ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - } - ], - "title": "$device_alias", - "type": "timeseries" - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "uDxwFcOGz" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 104 + "title": "Voltage (Mean)", + "type": "stat" }, - "id": 30, - "panels": [], - "targets": [ - { + { + "collapsed": false, "datasource": { - "type": "prometheus", - "uid": "uDxwFcOGz" - }, - "refId": "A" - } - ], - "title": "Plugs", - "type": "row" - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "type": "prometheus", + "uid": "uDxwFcOGz" }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 3 }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 + "id": 24, + "panels": [], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "uDxwFcOGz" + }, + "refId": "A" } - ] + ], + "title": "Devices", + "type": "row" + }, + { + "datasource": { + "type": "influxdb", + "uid": "${data_source}" }, - "unit": "none", - "unitScale": true - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Watts" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "semi-dark-purple", - "mode": "fixed" - } - }, - { - "id": "unit", - "value": "mwatt" + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" }, - { - "id": "custom.axisPlacement", - "value": "left" - }, - { - "id": "custom.fillOpacity", - "value": 0 - }, - { - "id": "custom.gradientMode", - "value": "none" - } - ] + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Watts" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "semi-dark-purple", + "mode": "fixed" + } + }, + { + "id": "unit", + "value": "mwatt" + }, + { + "id": "custom.axisPlacement", + "value": "left" + }, + { + "id": "custom.fillOpacity", + "value": 0 + }, + { + "id": "custom.gradientMode", + "value": "none" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Watt-Hours" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "semi-dark-blue", + "mode": "fixed" + } + }, + { + "id": "unit", + "value": "watth" + }, + { + "id": "custom.axisPlacement", + "value": "left" + }, + { + "id": "custom.drawStyle", + "value": "line" + }, + { + "id": "custom.lineWidth", + "value": 3 + }, + { + "id": "custom.lineStyle", + "value": { + "dash": [ + 30, + 3, + 3 + ], + "fill": "dash" + } + }, + { + "id": "custom.gradientMode", + "value": "none" + }, + { + "id": "custom.fillOpacity", + "value": 0 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Current" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "semi-dark-yellow", + "mode": "fixed" + } + }, + { + "id": "unit", + "value": "mamp" + }, + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "custom.fillOpacity", + "value": 0 + }, + { + "id": "custom.gradientMode", + "value": "opacity" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Voltage" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-red", + "mode": "fixed" + } + }, + { + "id": "unit", + "value": "mvolt" + }, + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "custom.gradientMode", + "value": "none" + }, + { + "id": "custom.fillOpacity", + "value": 0 + } + ] + } + ] }, - { - "matcher": { - "id": "byName", - "options": "Watt-Hours" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "semi-dark-blue", - "mode": "fixed" - } - }, - { - "id": "unit", - "value": "watth" - }, - { - "id": "custom.axisPlacement", - "value": "left" - }, - { - "id": "custom.drawStyle", - "value": "line" - }, - { - "id": "custom.lineWidth", - "value": 3 - }, - { - "id": "custom.lineStyle", - "value": { - "dash": [ - 30, - 3, - 3 - ], - "fill": "dash" - } - }, - { - "id": "custom.gradientMode", - "value": "none" - }, - { - "id": "custom.fillOpacity", - "value": 0 - } - ] + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 4 }, - { - "matcher": { - "id": "byName", - "options": "Current" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "semi-dark-yellow", - "mode": "fixed" - } - }, - { - "id": "unit", - "value": "mamp" - }, - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.fillOpacity", - "value": 0 + "id": 3, + "interval": "$interval", + "maxPerRow": 2, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, - { - "id": "custom.gradientMode", - "value": "opacity" + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "none" } - ] }, - { - "matcher": { - "id": "byName", - "options": "Voltage" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "dark-red", - "mode": "fixed" - } + "repeat": "device_alias", + "repeatDirection": "h", + "targets": [ + { + "alias": "Watts", + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": false, + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "power_mw" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "device_alias::tag", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] }, { - "id": "unit", - "value": "mvolt" + "alias": "Watt-Hours", + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "1h" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": false, + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total_wh" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [], + "type": "non_negative_difference" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] }, { - "id": "custom.axisPlacement", - "value": "right" + "alias": "Current", + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": false, + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "C", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "current_ma" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] }, { - "id": "custom.gradientMode", - "value": "none" + "alias": "Voltage", + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": false, + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "D", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "voltage_mv" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] }, { - "id": "custom.fillOpacity", - "value": 0 + "alias": "Voltage", + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": true, + "measurement": "kasa_energy", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT mean(\"voltage_mv\") FROM \"emeter\" WHERE (\"device_alias\" =~ /^$device_alias$/) AND \"voltage_mv\" > 100000 AND $timeFilter GROUP BY time($__interval) fill(null)", + "rawQuery": true, + "refId": "E", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "voltage_mv" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 105 - }, - "id": 56, - "interval": "$interval", - "maxPerRow": 2, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } + ], + "title": "$device_alias", + "type": "timeseries" }, - "repeat": "plug_alias", - "repeatDirection": "h", - "targets": [ - { - "alias": "Watts", + { + "collapsed": false, "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + "type": "prometheus", + "uid": "uDxwFcOGz" }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "hide": false, - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "power_mw" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 134 + }, + "id": 30, + "panels": [], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "uDxwFcOGz" + }, + "refId": "A" } - ] ], - "tags": [ - { - "key": "plug_alias", - "operator": "=~", - "value": "/^$plug_alias$/" - }, - { - "condition": "AND", - "key": "equipment_type::tag", - "operator": "=", - "value": "plug" - } - ] - }, - { - "alias": "Watt-Hours", + "title": "Plugs", + "type": "row" + }, + { "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + "type": "influxdb", + "uid": "${data_source}" }, - "groupBy": [ - { - "params": [ - "1h" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "hide": false, - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "total_wh" - ], - "type": "field" + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none", + "unitScale": true }, - { - "params": [], - "type": "mean" + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Watts" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "semi-dark-purple", + "mode": "fixed" + } + }, + { + "id": "unit", + "value": "mwatt" + }, + { + "id": "custom.axisPlacement", + "value": "left" + }, + { + "id": "custom.fillOpacity", + "value": 0 + }, + { + "id": "custom.gradientMode", + "value": "none" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Watt-Hours" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "semi-dark-blue", + "mode": "fixed" + } + }, + { + "id": "unit", + "value": "watth" + }, + { + "id": "custom.axisPlacement", + "value": "left" + }, + { + "id": "custom.drawStyle", + "value": "line" + }, + { + "id": "custom.lineWidth", + "value": 3 + }, + { + "id": "custom.lineStyle", + "value": { + "dash": [ + 30, + 3, + 3 + ], + "fill": "dash" + } + }, + { + "id": "custom.gradientMode", + "value": "none" + }, + { + "id": "custom.fillOpacity", + "value": 0 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Current" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "semi-dark-yellow", + "mode": "fixed" + } + }, + { + "id": "unit", + "value": "mamp" + }, + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "custom.fillOpacity", + "value": 0 + }, + { + "id": "custom.gradientMode", + "value": "opacity" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Voltage" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-red", + "mode": "fixed" + } + }, + { + "id": "unit", + "value": "mvolt" + }, + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "custom.gradientMode", + "value": "none" + }, + { + "id": "custom.fillOpacity", + "value": 0 + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 135 + }, + "id": 56, + "interval": "$interval", + "maxPerRow": 2, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, - { - "params": [], - "type": "non_negative_difference" + "tooltip": { + "mode": "multi", + "sort": "none" } - ] - ], - "tags": [ - { - "key": "plug_alias", - "operator": "=~", - "value": "/^$plug_alias$/" - }, - { - "condition": "AND", - "key": "equipment_type::tag", - "operator": "=", - "value": "plug" - } - ] - }, - { - "alias": "Current", - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "hide": false, - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "C", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "current_ma" - ], - "type": "field" + "repeat": "plug_alias", + "repeatDirection": "h", + "targets": [ + { + "alias": "Watts", + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": false, + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "power_mw" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "plug_alias", + "operator": "=~", + "value": "/^$plug_alias$/" + }, + { + "condition": "AND", + "key": "equipment_type::tag", + "operator": "=", + "value": "plug" + } + ] }, { - "params": [], - "type": "mean" - } - ] - ], - "tags": [ - { - "key": "plug_alias", - "operator": "=~", - "value": "/^$plug_alias$/" - }, - { - "condition": "AND", - "key": "equipment_type::tag", - "operator": "=", - "value": "plug" - } - ] - }, - { - "alias": "Voltage", - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "hide": false, - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "D", - "resultFormat": "time_series", - "select": [ - [ + "alias": "Watt-Hours", + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "1h" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": false, + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total_wh" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [], + "type": "non_negative_difference" + } + ] + ], + "tags": [ + { + "key": "plug_alias", + "operator": "=~", + "value": "/^$plug_alias$/" + }, + { + "condition": "AND", + "key": "equipment_type::tag", + "operator": "=", + "value": "plug" + } + ] + }, { - "params": [ - "voltage_mv" - ], - "type": "field" + "alias": "Current", + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": false, + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "C", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "current_ma" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "plug_alias", + "operator": "=~", + "value": "/^$plug_alias$/" + }, + { + "condition": "AND", + "key": "equipment_type::tag", + "operator": "=", + "value": "plug" + } + ] }, { - "params": [], - "type": "mean" + "alias": "Voltage", + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": false, + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "D", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "voltage_mv" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "plug_alias", + "operator": "=~", + "value": "/^$plug_alias$/" + }, + { + "condition": "AND", + "key": "equipment_type::tag", + "operator": "=", + "value": "plug" + } + ] } - ] ], - "tags": [ - { - "key": "plug_alias", - "operator": "=~", - "value": "/^$plug_alias$/" - }, - { - "condition": "AND", - "key": "equipment_type::tag", - "operator": "=", - "value": "plug" - } - ] - } - ], - "title": "$plug_alias", - "type": "timeseries" - } + "title": "$plug_alias", + "type": "timeseries" + } ], "refresh": "1m", "schemaVersion": 39, "tags": [ - "influxdb", - "kasa-collector" + "influxdb", + "kasa-collector" ], "templating": { - "list": [ - { - "current": { - "selected": false, - "text": "InfluxDB - influxdb02 - Tylephony - kasa", - "value": "P0A3FFFCFD014D9A1" - }, - "hide": 0, - "includeAll": false, - "label": "Data Source", - "multi": false, - "name": "data_source", - "options": [], - "query": "influxdb", - "queryValue": "", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "type": "datasource" - }, - { - "current": {}, - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "definition": "SHOW TAG VALUES WITH KEY = \"device_alias\"", - "hide": 0, - "includeAll": true, - "label": "Device", - "multi": true, - "name": "device_alias", - "options": [], - "query": "SHOW TAG VALUES WITH KEY = \"device_alias\"", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 5, - "type": "query" - }, - { - "current": {}, - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "definition": "SHOW TAG VALUES WITH KEY = \"plug_alias\" WHERE \"device_alias\" =~ /^$device_alias$/", - "hide": 0, - "includeAll": true, - "label": "Plug", - "multi": true, - "name": "plug_alias", - "options": [], - "query": "SHOW TAG VALUES WITH KEY = \"plug_alias\" WHERE \"device_alias\" =~ /^$device_alias$/", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 5, - "type": "query" - }, - { - "auto": true, - "auto_count": 30, - "auto_min": "10s", - "current": { - "selected": false, - "text": "5m", - "value": "5m" - }, - "hide": 0, - "label": "Interval", - "name": "interval", - "options": [ - { - "selected": false, - "text": "auto", - "value": "$__auto_interval_interval" - }, - { - "selected": false, - "text": "5s", - "value": "5s" - }, + "list": [ { - "selected": false, - "text": "15s", - "value": "15s" + "current": {}, + "hide": 0, + "includeAll": false, + "label": "Data Source", + "multi": false, + "name": "data_source", + "options": [], + "query": "influxdb", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" }, { - "selected": false, - "text": "30s", - "value": "30s" - }, - { - "selected": false, - "text": "1m", - "value": "1m" - }, - { - "selected": true, - "text": "5m", - "value": "5m" - }, - { - "selected": false, - "text": "10m", - "value": "10m" - }, - { - "selected": false, - "text": "15m", - "value": "15m" - }, - { - "selected": false, - "text": "1h", - "value": "1h" - }, - { - "selected": false, - "text": "3h", - "value": "3h" - }, - { - "selected": false, - "text": "6h", - "value": "6h" - }, - { - "selected": false, - "text": "12h", - "value": "12h" - }, - { - "selected": false, - "text": "1d", - "value": "1d" + "current": {}, + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "definition": "SHOW TAG VALUES WITH KEY = \"device_alias\"", + "hide": 0, + "includeAll": true, + "label": "Device", + "multi": true, + "name": "device_alias", + "options": [], + "query": "SHOW TAG VALUES WITH KEY = \"device_alias\"", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 5, + "type": "query" }, { - "selected": false, - "text": "3d", - "value": "3d" + "current": {}, + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "definition": "SHOW TAG VALUES WITH KEY = \"plug_alias\" WHERE \"device_alias\" =~ /^$device_alias$/", + "hide": 0, + "includeAll": true, + "label": "Plug", + "multi": true, + "name": "plug_alias", + "options": [], + "query": "SHOW TAG VALUES WITH KEY = \"plug_alias\" WHERE \"device_alias\" =~ /^$device_alias$/", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 5, + "type": "query" }, { - "selected": false, - "text": "1w", - "value": "1w" + "auto": true, + "auto_count": 30, + "auto_min": "10s", + "current": { + "selected": false, + "text": "5m", + "value": "5m" + }, + "hide": 0, + "label": "Interval", + "name": "interval", + "options": [ + { + "selected": false, + "text": "auto", + "value": "$__auto_interval_interval" + }, + { + "selected": false, + "text": "5s", + "value": "5s" + }, + { + "selected": false, + "text": "15s", + "value": "15s" + }, + { + "selected": false, + "text": "30s", + "value": "30s" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": true, + "text": "5m", + "value": "5m" + }, + { + "selected": false, + "text": "10m", + "value": "10m" + }, + { + "selected": false, + "text": "15m", + "value": "15m" + }, + { + "selected": false, + "text": "1h", + "value": "1h" + }, + { + "selected": false, + "text": "3h", + "value": "3h" + }, + { + "selected": false, + "text": "6h", + "value": "6h" + }, + { + "selected": false, + "text": "12h", + "value": "12h" + }, + { + "selected": false, + "text": "1d", + "value": "1d" + }, + { + "selected": false, + "text": "3d", + "value": "3d" + }, + { + "selected": false, + "text": "1w", + "value": "1w" + } + ], + "query": "5s,15s,30s,1m,5m,10m,15m,1h,3h,6h,12h,1d,3d,1w", + "queryValue": "", + "refresh": 2, + "skipUrlSync": false, + "type": "interval" } - ], - "query": "5s,15s,30s,1m,5m,10m,15m,1h,3h,6h,12h,1d,3d,1w", - "queryValue": "", - "refresh": 2, - "skipUrlSync": false, - "type": "interval" - } - ] + ] }, "time": { - "from": "now-24h", - "to": "now" + "from": "now-24h", + "to": "now" }, - "timeRangeUpdatedDuringEditOrView": false, "timepicker": {}, "timezone": "", "title": "Kasa Collector - Energy (By Device)", "uid": "lux4rd0labs_kasa_01", - "version": 16, + "version": 17, "weekStart": "" } \ No newline at end of file diff --git a/grafana/shared/kasa_collector-energy_by_measurement.json b/grafana/shared/kasa_collector-energy_by_measurement.json index 2eb8018..7fc2b4e 100644 --- a/grafana/shared/kasa_collector-energy_by_measurement.json +++ b/grafana/shared/kasa_collector-energy_by_measurement.json @@ -1,70 +1,62 @@ { "__inputs": [ - { - "name": "DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA", - "label": "InfluxDB - influxdb02 - Tylephony - kasa", - "description": "", - "type": "datasource", - "pluginId": "influxdb", - "pluginName": "InfluxDB" - }, - { - "name": "DS_INFLUXDB_- KASA", - "label": "InfluxDB - kasa", - "description": "", - "type": "datasource", - "pluginId": "influxdb", - "pluginName": "InfluxDB" - } + { + "name": "DS_INFLUXDB_- BUILD01 - TYLE - KASA-COLLECTOR", + "label": "InfluxDB - build01 - Tyle - kasa-collector", + "description": "", + "type": "datasource", + "pluginId": "influxdb", + "pluginName": "InfluxDB" + } ], "__elements": {}, "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "11.0.0" - }, - { - "type": "datasource", - "id": "influxdb", - "name": "InfluxDB", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "stat", - "name": "Stat", - "version": "" - }, - { - "type": "panel", - "id": "timeseries", - "name": "Time series", - "version": "" - } - ], - "annotations": { - "list": [ { - "builtIn": 1, - "datasource": { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "11.1.3" + }, + { "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" + "id": "influxdb", + "name": "InfluxDB", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "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" + } + ] }, "description": "Kasa Collector provides a way of collecting real-time energy data from Kasa Smart Plugs. These Grafana dashboards offer visualizations for their Current, Voltage, Power, and Total Watt Hours.", "editable": true, @@ -72,2182 +64,2181 @@ "graphTooltip": 0, "id": null, "links": [ - { - "asDropdown": true, - "icon": "external link", - "includeVars": true, - "keepTime": true, - "tags": [ - "kasa-collector" - ], - "targetBlank": false, - "title": "Kasa Collector - Dashboards", - "tooltip": "", - "type": "dashboards", - "url": "" - } + { + "asDropdown": true, + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "kasa-collector" + ], + "targetBlank": false, + "title": "Kasa Collector - Dashboards", + "tooltip": "", + "type": "dashboards", + "url": "" + } ], "liveNow": false, "panels": [ - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "dark-purple", - "mode": "fixed" - }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - }, - "unit": "mwatt" - }, - "overrides": [] - }, - "id": 19, - "interval": "$interval", - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "text": {}, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "11.0.0", - "targets": [ - { + { "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + "type": "influxdb", + "uid": "${data_source}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "dark-purple", + "mode": "fixed" + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "mwatt" + }, + "overrides": [] }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "device_alias" - ], - "type": "tag" - }, - { - "params": [ - "previous" - ], - "type": "fill" - } - ], - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "power_mw" - ], - "type": "field" + "id": 19, + "interval": "$interval", + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.1.3", + "targets": [ { - "params": [], - "type": "mean" + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "device_alias" + ], + "type": "tag" + }, + { + "params": [ + "previous" + ], + "type": "fill" + } + ], + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "power_mw" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] } - ] ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - } - ], - "title": "Power (Combined)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "Total", - "mode": "reduceRow", - "reduce": { - "reducer": "sum" - }, - "replaceFields": true - } - } - ], - "type": "stat" - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "semi-dark-blue", - "mode": "fixed" - }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ + "title": "Power (Combined)", + "transformations": [ { - "color": "green", - "value": null + "id": "calculateField", + "options": { + "alias": "Total", + "mode": "reduceRow", + "reduce": { + "reducer": "sum" + }, + "replaceFields": true + } } - ] - }, - "unit": "watth" - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 6, - "x": 6, - "y": 0 - }, - "id": 24, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "text": {}, - "textMode": "auto", - "wideLayout": true + "type": "stat" }, - "pluginVersion": "11.0.0", - "targets": [ - { + { "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "groupBy": [ - { - "params": [ - "1h" - ], - "type": "time" - }, - { - "params": [ - "device_alias" - ], - "type": "tag" - } - ], - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "total_wh" - ], - "type": "field" + "type": "influxdb", + "uid": "${data_source}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "semi-dark-blue", + "mode": "fixed" + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "watth" }, - { - "params": [], - "type": "mean" - }, - { - "params": [], - "type": "non_negative_difference" - } - ] - ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - } - ], - "title": "Watt-Hours (Combined)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "Combined", - "mode": "reduceRow", - "reduce": { - "reducer": "sum" - }, - "replaceFields": true - } - } - ], - "type": "stat" - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "semi-dark-yellow", - "mode": "fixed" + "overrides": [] }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - }, - "unit": "mamp" - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 6, - "x": 12, - "y": 0 - }, - "id": 21, - "interval": "$interval", - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "text": {}, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "11.0.0", - "targets": [ - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + "gridPos": { + "h": 3, + "w": 6, + "x": 6, + "y": 0 }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "device_alias" - ], - "type": "tag" - }, - { - "params": [ - "previous" - ], - "type": "fill" - } - ], - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "current_ma" - ], - "type": "field" + "id": 24, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.1.3", + "targets": [ { - "params": [], - "type": "mean" + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "1h" + ], + "type": "time" + }, + { + "params": [ + "device_alias" + ], + "type": "tag" + } + ], + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total_wh" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [], + "type": "non_negative_difference" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] } - ] ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - } - ], - "title": "Current (Combined)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "Total", - "mode": "reduceRow", - "reduce": { - "reducer": "sum" - }, - "replaceFields": true - } - } - ], - "type": "stat" - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "dark-red", - "mode": "fixed" - }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ + "title": "Watt-Hours (Combined)", + "transformations": [ { - "color": "green", - "value": null + "id": "calculateField", + "options": { + "alias": "Combined", + "mode": "reduceRow", + "reduce": { + "reducer": "sum" + }, + "replaceFields": true + } } - ] - }, - "unit": "mvolt" - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 6, - "x": 18, - "y": 0 - }, - "id": 22, - "interval": "$interval", - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "text": {}, - "textMode": "auto", - "wideLayout": true + "type": "stat" }, - "pluginVersion": "11.0.0", - "targets": [ - { + { "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + "type": "influxdb", + "uid": "${data_source}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "semi-dark-yellow", + "mode": "fixed" + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "mamp" + }, + "overrides": [] }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "previous" - ], - "type": "fill" - } - ], - "hide": true, - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "voltage_mv" - ], - "type": "field" + "gridPos": { + "h": 3, + "w": 6, + "x": 12, + "y": 0 + }, + "id": 21, + "interval": "$interval", + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.1.3", + "targets": [ { - "params": [], - "type": "mean" + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "device_alias" + ], + "type": "tag" + }, + { + "params": [ + "previous" + ], + "type": "fill" + } + ], + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "current_ma" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] } - ] - ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "previous" - ], - "type": "fill" - } ], - "hide": false, - "measurement": "kasa_energy", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT mean(\"voltage_mv\") FROM \"emeter\" WHERE (\"device_alias\" =~ /^$device_alias$/) AND \"voltage_mv\" > 100000 AND $timeFilter GROUP BY time($__interval) fill(previous)", - "rawQuery": true, - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ + "title": "Current (Combined)", + "transformations": [ { - "params": [ - "voltage_mv" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" + "id": "calculateField", + "options": { + "alias": "Total", + "mode": "reduceRow", + "reduce": { + "reducer": "sum" + }, + "replaceFields": true + } } - ] ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - } - ], - "title": "Voltage (Mean)", - "type": "stat" - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "uDxwFcOGz" + "type": "stat" }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 3 - }, - "id": 13, - "panels": [], - "targets": [ - { + { "datasource": { - "type": "prometheus", - "uid": "uDxwFcOGz" + "type": "influxdb", + "uid": "${data_source}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "dark-red", + "mode": "fixed" + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "mvolt" + }, + "overrides": [] }, - "refId": "A" - } - ], - "title": "Devices", - "type": "row" - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "gridPos": { + "h": 3, + "w": 6, + "x": 18, + "y": 0 }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } + "id": 22, + "interval": "$interval", + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ + "pluginVersion": "11.1.3", + "targets": [ { - "color": "green", - "value": null + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "previous" + ], + "type": "fill" + } + ], + "hide": true, + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "voltage_mv" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] }, { - "color": "red", - "value": 80 - } - ] - }, - "unit": "mwatt" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Office - Power Strip" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "light-blue", - "mode": "fixed" - } + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "previous" + ], + "type": "fill" + } + ], + "hide": false, + "measurement": "kasa_energy", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT mean(\"voltage_mv\") FROM \"emeter\" WHERE (\"device_alias\" =~ /^$device_alias$/) AND \"voltage_mv\" > 100000 AND $timeFilter GROUP BY time($__interval) fill(previous)", + "rawQuery": true, + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "voltage_mv" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] } - ] - } - ] - }, - "gridPos": { - "h": 11, - "w": 6, - "x": 0, - "y": 4 - }, - "id": 3, - "interval": "$interval", - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } + ], + "title": "Voltage (Mean)", + "type": "stat" }, - "targets": [ - { - "alias": "$tag_device_alias", + { + "collapsed": false, "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "device_alias" - ], - "type": "tag" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "hide": false, - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "power_mw" - ], - "type": "field" - }, + "type": "prometheus", + "uid": "uDxwFcOGz" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 3 + }, + "id": 13, + "panels": [], + "targets": [ { - "params": [], - "type": "mean" + "datasource": { + "type": "prometheus", + "uid": "uDxwFcOGz" + }, + "refId": "A" } - ] ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - } - ], - "title": "Power", - "type": "timeseries" - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + "title": "Devices", + "type": "row" }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "bars", - "fillOpacity": 30, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null + { + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "mwatt" }, - { - "color": "red", - "value": 80 + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Office - Power Strip" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-blue", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 11, + "w": 6, + "x": 0, + "y": 4 + }, + "id": 3, + "interval": "$interval", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "none" } - ] }, - "unit": "watth" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Office - Power Strip" - }, - "properties": [ + "targets": [ { - "id": "color", - "value": { - "fixedColor": "light-blue", - "mode": "fixed" - } + "alias": "$tag_device_alias", + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "device_alias" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": false, + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "power_mw" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] } - ] - } - ] - }, - "gridPos": { - "h": 11, - "w": 6, - "x": 6, - "y": 4 - }, - "id": 4, - "interval": "$interval", - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } + ], + "title": "Power", + "type": "timeseries" }, - "targets": [ - { - "alias": "$tag_device_alias", + { "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "groupBy": [ - { - "params": [ - "1h" - ], - "type": "time" - }, - { - "params": [ - "device_alias" - ], - "type": "tag" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "total_wh" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" + "type": "influxdb", + "uid": "${data_source}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "bars", + "fillOpacity": 30, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "watth" }, - { - "params": [], - "type": "non_negative_difference" - } - ] - ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - } - ], - "title": "Watt-Hours", - "type": "timeseries" - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Office - Power Strip" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-blue", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 11, + "w": 6, + "x": 6, + "y": 4 + }, + "id": 4, + "interval": "$interval", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, - { - "color": "red", - "value": 80 + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "none" } - ] }, - "unit": "mamp" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Office - Power Strip" - }, - "properties": [ + "targets": [ { - "id": "color", - "value": { - "fixedColor": "light-blue", - "mode": "fixed" - } + "alias": "$tag_device_alias", + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "1h" + ], + "type": "time" + }, + { + "params": [ + "device_alias" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total_wh" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [], + "type": "non_negative_difference" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] } - ] - } - ] - }, - "gridPos": { - "h": 11, - "w": 6, - "x": 12, - "y": 4 - }, - "id": 2, - "interval": "$interval", - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } + ], + "title": "Watt-Hours", + "type": "timeseries" }, - "targets": [ - { - "alias": "$tag_device_alias", + { "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "device_alias" - ], - "type": "tag" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "hide": true, - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "current_ma" - ], - "type": "field" + "type": "influxdb", + "uid": "${data_source}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "mamp" }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - }, - { - "alias": "$tag_device_alias", - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "device_alias" - ], - "type": "tag" - }, - { - "params": [ - "0" - ], - "type": "fill" - } - ], - "hide": false, - "measurement": "kasa_energy", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT mean(\"current_ma\") FROM \"emeter\" WHERE (\"device_alias\" =~ /^$device_alias$/) AND \"current_ma\" > 1 AND $timeFilter GROUP BY time($__interval), \"device_alias\" fill(null)", - "rawQuery": true, - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "current_ma" - ], - "type": "field" + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Office - Power Strip" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-blue", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 11, + "w": 6, + "x": 12, + "y": 4 + }, + "id": 2, + "interval": "$interval", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, - { - "params": [], - "type": "mean" + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "none" } - ] - ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - } - ], - "title": "Current", - "type": "timeseries" - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ + "targets": [ { - "color": "green", - "value": null + "alias": "$tag_device_alias", + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "device_alias" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": true, + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "current_ma" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] }, { - "color": "red", - "value": 80 + "alias": "$tag_device_alias", + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "device_alias" + ], + "type": "tag" + }, + { + "params": [ + "0" + ], + "type": "fill" + } + ], + "hide": false, + "measurement": "kasa_energy", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT mean(\"current_ma\") FROM \"emeter\" WHERE (\"device_alias\" =~ /^$device_alias$/) AND \"current_ma\" > 1 AND $timeFilter GROUP BY time($__interval), \"device_alias\" fill(null)", + "rawQuery": true, + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "current_ma" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] } - ] - }, - "unit": "mvolt" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Office - Power Strip" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "light-blue", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 11, - "w": 6, - "x": 18, - "y": 4 - }, - "id": 5, - "interval": "$interval", - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } + ], + "title": "Current", + "type": "timeseries" }, - "targets": [ - { - "alias": "$tag_device_alias", + { "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "device_alias" - ], - "type": "tag" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "hide": true, - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "voltage_mv" - ], - "type": "field" + "type": "influxdb", + "uid": "${data_source}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "mvolt" }, - { - "params": [], - "type": "mean" + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Office - Power Strip" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-blue", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 11, + "w": 6, + "x": 18, + "y": 4 + }, + "id": 5, + "interval": "$interval", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "none" } - ] - ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - }, - { - "alias": "$tag_device_alias", - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "device_alias" - ], - "type": "tag" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "hide": false, - "measurement": "kasa_energy", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT mean(\"voltage_mv\") FROM \"emeter\" WHERE (\"device_alias\" =~ /^$device_alias$/) AND \"voltage_mv\" > 100000 AND $timeFilter GROUP BY time($__interval), \"device_alias\" fill(null)", - "rawQuery": true, - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ + "targets": [ { - "params": [ - "voltage_mv" - ], - "type": "field" + "alias": "$tag_device_alias", + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "device_alias" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": true, + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "voltage_mv" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] }, { - "params": [], - "type": "mean" + "alias": "$tag_device_alias", + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "device_alias" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": false, + "measurement": "kasa_energy", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT mean(\"voltage_mv\") FROM \"emeter\" WHERE (\"device_alias\" =~ /^$device_alias$/) AND \"voltage_mv\" > 100000 AND $timeFilter GROUP BY time($__interval), \"device_alias\" fill(null)", + "rawQuery": true, + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "voltage_mv" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] } - ] ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - } - ], - "title": "Voltage", - "type": "timeseries" - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "uDxwFcOGz" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 15 + "title": "Voltage", + "type": "timeseries" }, - "id": 15, - "panels": [], - "targets": [ - { + { + "collapsed": false, "datasource": { - "type": "prometheus", - "uid": "uDxwFcOGz" - }, - "refId": "A" - } - ], - "title": "Plugs", - "type": "row" - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ + "type": "prometheus", + "uid": "uDxwFcOGz" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 15 + }, + "id": 15, + "panels": [], + "targets": [ { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "mwatt" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Office - Power Strip" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "light-blue", - "mode": "fixed" - } + "datasource": { + "type": "prometheus", + "uid": "uDxwFcOGz" + }, + "refId": "A" } - ] - } - ] - }, - "gridPos": { - "h": 11, - "w": 6, - "x": 0, - "y": 16 - }, - "id": 9, - "interval": "$interval", - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } + ], + "title": "Plugs", + "type": "row" }, - "targets": [ - { - "alias": "$tag_plug_alias", + { "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "plug_alias" - ], - "type": "tag" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "hide": false, - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "power_mw" - ], - "type": "field" + "type": "influxdb", + "uid": "${data_source}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "mwatt" }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [ - { - "key": "plug_alias", - "operator": "=~", - "value": "/^$plug_alias$/" - } - ] - } - ], - "title": "Power", - "type": "timeseries" - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "bars", - "fillOpacity": 29, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Office - Power Strip" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-blue", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 11, + "w": 6, + "x": 0, + "y": 16 + }, + "id": 9, + "interval": "$interval", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, - { - "color": "red", - "value": 80 + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "none" } - ] }, - "unit": "watth" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Office - Power Strip" - }, - "properties": [ + "targets": [ { - "id": "color", - "value": { - "fixedColor": "light-blue", - "mode": "fixed" - } + "alias": "$tag_plug_alias", + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "plug_alias" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": false, + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "power_mw" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "plug_alias", + "operator": "=~", + "value": "/^$plug_alias$/" + } + ] } - ] - } - ] - }, - "gridPos": { - "h": 11, - "w": 6, - "x": 6, - "y": 16 - }, - "id": 10, - "interval": "$interval", - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } + ], + "title": "Power", + "type": "timeseries" }, - "targets": [ - { - "alias": "$tag_plug_alias", + { "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "groupBy": [ - { - "params": [ - "1h" - ], - "type": "time" - }, - { - "params": [ - "plug_alias" - ], - "type": "tag" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "hide": false, - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "total_wh" - ], - "type": "field" + "type": "influxdb", + "uid": "${data_source}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "bars", + "fillOpacity": 29, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "watth" }, - { - "params": [], - "type": "mean" - }, - { - "params": [], - "type": "non_negative_difference" - } - ] - ], - "tags": [ - { - "key": "plug_alias", - "operator": "=~", - "value": "/^$plug_alias$/" - } - ] - } - ], - "title": "Watt-Hours", - "type": "timeseries" - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Office - Power Strip" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-blue", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 11, + "w": 6, + "x": 6, + "y": 16 + }, + "id": 10, + "interval": "$interval", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, - { - "color": "red", - "value": 80 + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "none" } - ] }, - "unit": "mamp" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Office - Power Strip" - }, - "properties": [ + "targets": [ { - "id": "color", - "value": { - "fixedColor": "light-blue", - "mode": "fixed" - } + "alias": "$tag_plug_alias", + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "1h" + ], + "type": "time" + }, + { + "params": [ + "plug_alias" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": false, + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total_wh" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [], + "type": "non_negative_difference" + } + ] + ], + "tags": [ + { + "key": "plug_alias", + "operator": "=~", + "value": "/^$plug_alias$/" + } + ] } - ] - } - ] - }, - "gridPos": { - "h": 11, - "w": 6, - "x": 12, - "y": 16 - }, - "id": 8, - "interval": "$interval", - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } + ], + "title": "Watt-Hours", + "type": "timeseries" }, - "targets": [ - { - "alias": "$tag_plug_alias", + { "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "plug_alias" - ], - "type": "tag" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "hide": false, - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "current_ma" - ], - "type": "field" + "type": "influxdb", + "uid": "${data_source}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "mamp" }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [ - { - "key": "plug_alias", - "operator": "=~", - "value": "/^$plug_alias$/" - } - ] - } - ], - "title": "Current", - "type": "timeseries" - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Office - Power Strip" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-blue", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 11, + "w": 6, + "x": 12, + "y": 16 + }, + "id": 8, + "interval": "$interval", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, - { - "color": "red", - "value": 80 + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "none" } - ] }, - "unit": "mvolt" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Office - Power Strip" - }, - "properties": [ + "targets": [ { - "id": "color", - "value": { - "fixedColor": "light-blue", - "mode": "fixed" - } + "alias": "$tag_plug_alias", + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "plug_alias" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": false, + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "current_ma" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "plug_alias", + "operator": "=~", + "value": "/^$plug_alias$/" + } + ] } - ] - } - ] - }, - "gridPos": { - "h": 11, - "w": 6, - "x": 18, - "y": 16 - }, - "id": 11, - "interval": "$interval", - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } + ], + "title": "Current", + "type": "timeseries" }, - "targets": [ - { - "alias": "$tag_plug_alias", + { "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "plug_alias" - ], - "type": "tag" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "hide": true, - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "voltage_mv" - ], - "type": "field" + "type": "influxdb", + "uid": "${data_source}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "mvolt" }, - { - "params": [], - "type": "mean" + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Office - Power Strip" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-blue", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 11, + "w": 6, + "x": 18, + "y": 16 + }, + "id": 11, + "interval": "$interval", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "none" } - ] - ], - "tags": [ - { - "key": "plug_alias", - "operator": "=~", - "value": "/^$plug_alias$/" - } - ] - }, - { - "alias": "$tag_plug_alias", - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "plug_alias" - ], - "type": "tag" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "hide": false, - "measurement": "kasa_energy", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT mean(\"voltage_mv\") FROM \"emeter\" WHERE (\"plug_alias\" =~ /^$plug_alias$/) AND \"voltage_mv\" > 100000 AND $timeFilter GROUP BY time($__interval), \"plug_alias\" fill(null)", - "rawQuery": true, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ + "targets": [ { - "params": [ - "voltage_mv" - ], - "type": "field" + "alias": "$tag_plug_alias", + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "plug_alias" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": true, + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "voltage_mv" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "plug_alias", + "operator": "=~", + "value": "/^$plug_alias$/" + } + ] }, { - "params": [], - "type": "mean" + "alias": "$tag_plug_alias", + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "plug_alias" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": false, + "measurement": "kasa_energy", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT mean(\"voltage_mv\") FROM \"emeter\" WHERE (\"plug_alias\" =~ /^$plug_alias$/) AND \"voltage_mv\" > 100000 AND $timeFilter GROUP BY time($__interval), \"plug_alias\" fill(null)", + "rawQuery": true, + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "voltage_mv" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "plug_alias", + "operator": "=~", + "value": "/^$plug_alias$/" + } + ] } - ] ], - "tags": [ - { - "key": "plug_alias", - "operator": "=~", - "value": "/^$plug_alias$/" - } - ] - } - ], - "title": "Voltage", - "type": "timeseries" - } + "title": "Voltage", + "type": "timeseries" + } ], "refresh": "30s", "schemaVersion": 39, "tags": [ - "influxdb", - "kasa-collector" + "influxdb", + "kasa-collector" ], "templating": { - "list": [ - { - "current": { - "selected": false, - "text": "InfluxDB - influxdb02 - Tylephony - kasa", - "value": "P0A3FFFCFD014D9A1" - }, - "hide": 0, - "includeAll": false, - "label": "Data Source", - "multi": false, - "name": "data_source", - "options": [], - "query": "influxdb", - "queryValue": "", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "type": "datasource" - }, - { - "current": {}, - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- KASA}" - }, - "definition": "SHOW TAG VALUES WITH KEY = \"device_alias\"", - "hide": 0, - "includeAll": true, - "label": "Device", - "multi": true, - "name": "device_alias", - "options": [], - "query": "SHOW TAG VALUES WITH KEY = \"device_alias\"", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 5, - "type": "query" - }, - { - "current": {}, - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- KASA}" - }, - "definition": "SHOW TAG VALUES WITH KEY = \"plug_alias\" WHERE \"device_alias\" =~ /^$device_alias$/", - "hide": 0, - "includeAll": true, - "label": "Plug", - "multi": true, - "name": "plug_alias", - "options": [], - "query": "SHOW TAG VALUES WITH KEY = \"plug_alias\" WHERE \"device_alias\" =~ /^$device_alias$/", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 5, - "type": "query" - }, - { - "auto": true, - "auto_count": 30, - "auto_min": "10s", - "current": { - "selected": false, - "text": "5m", - "value": "5m" - }, - "hide": 0, - "label": "Interval", - "name": "interval", - "options": [ - { - "selected": false, - "text": "auto", - "value": "$__auto_interval_interval" - }, - { - "selected": false, - "text": "5s", - "value": "5s" - }, - { - "selected": false, - "text": "15s", - "value": "15s" - }, + "list": [ { - "selected": false, - "text": "30s", - "value": "30s" + "current": {}, + "hide": 0, + "includeAll": false, + "label": "Data Source", + "multi": false, + "name": "data_source", + "options": [], + "query": "influxdb", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" }, { - "selected": false, - "text": "1m", - "value": "1m" - }, - { - "selected": true, - "text": "5m", - "value": "5m" - }, - { - "selected": false, - "text": "10m", - "value": "10m" - }, - { - "selected": false, - "text": "15m", - "value": "15m" - }, - { - "selected": false, - "text": "1h", - "value": "1h" - }, - { - "selected": false, - "text": "3h", - "value": "3h" - }, - { - "selected": false, - "text": "6h", - "value": "6h" - }, - { - "selected": false, - "text": "12h", - "value": "12h" - }, - { - "selected": false, - "text": "1d", - "value": "1d" + "current": {}, + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "definition": "SHOW TAG VALUES WITH KEY = \"device_alias\"", + "hide": 0, + "includeAll": true, + "label": "Device", + "multi": true, + "name": "device_alias", + "options": [], + "query": "SHOW TAG VALUES WITH KEY = \"device_alias\"", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 5, + "type": "query" }, { - "selected": false, - "text": "3d", - "value": "3d" + "current": {}, + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "definition": "SHOW TAG VALUES WITH KEY = \"plug_alias\" WHERE \"device_alias\" =~ /^$device_alias$/", + "hide": 0, + "includeAll": true, + "label": "Plug", + "multi": true, + "name": "plug_alias", + "options": [], + "query": "SHOW TAG VALUES WITH KEY = \"plug_alias\" WHERE \"device_alias\" =~ /^$device_alias$/", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 5, + "type": "query" }, { - "selected": false, - "text": "1w", - "value": "1w" + "auto": true, + "auto_count": 30, + "auto_min": "10s", + "current": { + "selected": false, + "text": "5m", + "value": "5m" + }, + "hide": 0, + "label": "Interval", + "name": "interval", + "options": [ + { + "selected": false, + "text": "auto", + "value": "$__auto_interval_interval" + }, + { + "selected": false, + "text": "5s", + "value": "5s" + }, + { + "selected": false, + "text": "15s", + "value": "15s" + }, + { + "selected": false, + "text": "30s", + "value": "30s" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": true, + "text": "5m", + "value": "5m" + }, + { + "selected": false, + "text": "10m", + "value": "10m" + }, + { + "selected": false, + "text": "15m", + "value": "15m" + }, + { + "selected": false, + "text": "1h", + "value": "1h" + }, + { + "selected": false, + "text": "3h", + "value": "3h" + }, + { + "selected": false, + "text": "6h", + "value": "6h" + }, + { + "selected": false, + "text": "12h", + "value": "12h" + }, + { + "selected": false, + "text": "1d", + "value": "1d" + }, + { + "selected": false, + "text": "3d", + "value": "3d" + }, + { + "selected": false, + "text": "1w", + "value": "1w" + } + ], + "query": "5s,15s,30s,1m,5m,10m,15m,1h,3h,6h,12h,1d,3d,1w", + "queryValue": "", + "refresh": 2, + "skipUrlSync": false, + "type": "interval" } - ], - "query": "5s,15s,30s,1m,5m,10m,15m,1h,3h,6h,12h,1d,3d,1w", - "queryValue": "", - "refresh": 2, - "skipUrlSync": false, - "type": "interval" - } - ] + ] }, "time": { - "from": "now-24h", - "to": "now" + "from": "now-24h", + "to": "now" }, - "timeRangeUpdatedDuringEditOrView": false, "timepicker": {}, "timezone": "", "title": "Kasa Collector - Energy (By Measurement)", "uid": "lux4rd0labs_kasa_02", - "version": 20, + "version": 21, "weekStart": "" } \ No newline at end of file diff --git a/grafana/shared/kasa_collector-energy_by_time.json b/grafana/shared/kasa_collector-energy_by_time.json index 3b83176..152eef2 100644 --- a/grafana/shared/kasa_collector-energy_by_time.json +++ b/grafana/shared/kasa_collector-energy_by_time.json @@ -1,64 +1,62 @@ { "__inputs": [ - { - "name": "DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA", - "label": "InfluxDB - influxdb02 - Tylephony - kasa", - "description": "", - "type": "datasource", - "pluginId": "influxdb", - "pluginName": "InfluxDB" - }, - { - "name": "DS_INFLUXDB_- KASA", - "label": "InfluxDB - kasa", - "description": "", - "type": "datasource", - "pluginId": "influxdb", - "pluginName": "InfluxDB" - } + { + "name": "DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA", + "label": "InfluxDB - influxdb02 - Tylephony - kasa", + "description": "", + "type": "datasource", + "pluginId": "influxdb", + "pluginName": "InfluxDB" + } ], "__elements": {}, "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "11.0.0" - }, - { - "type": "datasource", - "id": "influxdb", - "name": "InfluxDB", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "table", - "name": "Table", - "version": "" - } - ], - "annotations": { - "list": [ { - "builtIn": 1, - "datasource": { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "11.1.3" + }, + { + "type": "datasource", + "id": "influxdb", + "name": "InfluxDB", + "version": "1.0.0" + }, + { "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" + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "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" + } + ] }, "description": "Kasa Collector provides a way of collecting real-time energy data from Kasa Smart Plugs. These Grafana dashboards offer visualizations for their Current, Voltage, Power, and Total Watt Hours.", "editable": true, @@ -66,926 +64,919 @@ "graphTooltip": 0, "id": null, "links": [ - { - "asDropdown": true, - "icon": "external link", - "includeVars": true, - "keepTime": true, - "tags": [ - "kasa-collector" - ], - "targetBlank": false, - "title": "Kasa Collector - Dashboards", - "tooltip": "", - "type": "dashboards", - "url": "" - } + { + "asDropdown": true, + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "kasa-collector" + ], + "targetBlank": false, + "title": "Kasa Collector - Dashboards", + "tooltip": "", + "type": "dashboards", + "url": "" + } ], "liveNow": false, "panels": [ - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "uDxwFcOGz" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 30, - "panels": [], - "targets": [ - { + { + "collapsed": false, "datasource": { - "type": "prometheus", - "uid": "uDxwFcOGz" - }, - "refId": "A" - } - ], - "title": "Watt Hours", - "type": "row" - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "continuous-BlYlRd" + "type": "prometheus", + "uid": "uDxwFcOGz" }, - "custom": { - "align": "center", - "cellOptions": { - "mode": "gradient", - "type": "color-background" - }, - "inspect": false - }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - }, - "unit": "watth" - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.Cost*/" - }, - "properties": [ - { - "id": "unit", - "value": "currencyUSD" - } - ] + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 }, - { - "matcher": { - "id": "byName", - "options": "Time" - }, - "properties": [ - { - "id": "unit", - "value": "time:ddd, MMM Do, 'YY" - }, - { - "id": "custom.width", - "value": 153 - }, + "id": 30, + "panels": [], + "targets": [ { - "id": "custom.cellOptions", - "value": { - "type": "auto" - } + "datasource": { + "type": "prometheus", + "uid": "uDxwFcOGz" + }, + "refId": "A" } - ] - } - ] - }, - "gridPos": { - "h": 9, - "w": 24, - "x": 0, - "y": 1 - }, - "id": 24, - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": "", - "reducer": [ - "sum" ], - "show": false - }, - "showHeader": true, - "sortBy": [ - { - "desc": true, - "displayName": "Time" - } - ] + "title": "Watt Hours", + "type": "row" }, - "pluginVersion": "11.0.0", - "targets": [ - { - "alias": "$tag_device_alias", + { "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + "type": "influxdb", + "uid": "${data_source}" }, - "groupBy": [ - { - "params": [ - "$interval" - ], - "type": "time" - }, - { - "params": [ - "device_alias" - ], - "type": "tag" - } - ], - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "total_wh" - ], - "type": "field" + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-BlYlRd" + }, + "custom": { + "align": "center", + "cellOptions": { + "mode": "gradient", + "type": "color-background" + }, + "inspect": false + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "watth" }, - { - "params": [], - "type": "mean" + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.Cost*/" + }, + "properties": [ + { + "id": "unit", + "value": "currencyUSD" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Time" + }, + "properties": [ + { + "id": "unit", + "value": "time:ddd, MMM Do, 'YY" + }, + { + "id": "custom.width", + "value": 153 + }, + { + "id": "custom.cellOptions", + "value": { + "type": "auto" + } + } + ] + } + ] + }, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 1 + }, + "id": 24, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "Time" + } + ] + }, + "pluginVersion": "11.1.3", + "targets": [ { - "params": [], - "type": "non_negative_difference" + "alias": "$tag_device_alias", + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + }, + { + "params": [ + "device_alias" + ], + "type": "tag" + } + ], + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total_wh" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [], + "type": "non_negative_difference" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ], + "tz": "$tz" } - ] ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } + "title": "Device (By Day)", + "transformations": [ + { + "id": "seriesToColumns", + "options": {} + } ], - "tz": "$tz" - } - ], - "title": "Device (By Day)", - "transformations": [ - { - "id": "seriesToColumns", - "options": {} - } - ], - "type": "table" - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + "type": "table" }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "continuous-BlYlRd" + { + "datasource": { + "type": "influxdb", + "uid": "${data_source}" }, - "custom": { - "align": "center", - "cellOptions": { - "mode": "gradient", - "type": "color-background" - }, - "inspect": false + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-BlYlRd" + }, + "custom": { + "align": "center", + "cellOptions": { + "mode": "gradient", + "type": "color-background" + }, + "inspect": false + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "watth" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Time" + }, + "properties": [ + { + "id": "unit", + "value": "time:ddd, MMM Do, 'YY" + }, + { + "id": "custom.width", + "value": 151 + }, + { + "id": "custom.cellOptions", + "value": { + "type": "auto" + } + } + ] + } + ] }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] + "gridPos": { + "h": 10, + "w": 24, + "x": 0, + "y": 10 }, - "unit": "watth" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Time" - }, - "properties": [ - { - "id": "unit", - "value": "time:ddd, MMM Do, 'YY" + "id": 27, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "Time" + } + ] + }, + "pluginVersion": "11.1.3", + "targets": [ { - "id": "custom.width", - "value": 151 - }, + "alias": "$tag_plug_alias", + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + }, + { + "params": [ + "plug_alias" + ], + "type": "tag" + } + ], + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total_wh" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [], + "type": "non_negative_difference" + } + ] + ], + "tags": [ + { + "key": "plug_alias", + "operator": "=~", + "value": "/^$plug_alias$/" + } + ], + "tz": "$tz" + } + ], + "title": "Plug (By Day)", + "transformations": [ { - "id": "custom.cellOptions", - "value": { - "type": "auto" - } + "id": "seriesToColumns", + "options": {} } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 10 - }, - "id": 27, - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": "", - "reducer": [ - "sum" ], - "show": false - }, - "showHeader": true, - "sortBy": [ - { - "desc": true, - "displayName": "Time" - } - ] + "type": "table" }, - "pluginVersion": "11.0.0", - "targets": [ - { - "alias": "$tag_plug_alias", + { + "collapsed": true, "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + "type": "prometheus", + "uid": "uDxwFcOGz" }, - "groupBy": [ - { - "params": [ - "$interval" - ], - "type": "time" - }, - { - "params": [ - "plug_alias" - ], - "type": "tag" - } - ], - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "total_wh" - ], - "type": "field" - }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 20 + }, + "id": 32, + "panels": [ { - "params": [], - "type": "mean" + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-BlYlRd" + }, + "custom": { + "align": "center", + "cellOptions": { + "mode": "gradient", + "type": "color-background" + }, + "inspect": false + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + } + ] + }, + "unit": "currencyUSD" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Time" + }, + "properties": [ + { + "id": "unit", + "value": "time:ddd, MMM Do, 'YY" + }, + { + "id": "custom.width", + "value": 130 + }, + { + "id": "custom.cellOptions", + "value": { + "type": "auto" + } + } + ] + } + ] + }, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 21 + }, + "id": 26, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "Time" + } + ] + }, + "pluginVersion": "11.1.3", + "targets": [ + { + "alias": "$tag_device_alias", + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + }, + { + "params": [ + "device_alias" + ], + "type": "tag" + } + ], + "hide": false, + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total_wh" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [], + "type": "non_negative_difference" + }, + { + "params": [ + "* $cost / 1000" + ], + "type": "math" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ], + "tz": "$tz" + } + ], + "title": "Device (By Day)", + "transformations": [ + { + "id": "seriesToColumns", + "options": {} + } + ], + "type": "table" }, { - "params": [], - "type": "non_negative_difference" + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-BlYlRd" + }, + "custom": { + "align": "center", + "cellOptions": { + "mode": "gradient", + "type": "color-background" + }, + "inspect": false + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + } + ] + }, + "unit": "currencyUSD" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Time" + }, + "properties": [ + { + "id": "unit", + "value": "time:ddd, MMM Do, 'YY" + }, + { + "id": "custom.width", + "value": 130 + }, + { + "id": "custom.cellOptions", + "value": { + "type": "auto" + } + } + ] + } + ] + }, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 27 + }, + "id": 28, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "Time" + } + ] + }, + "pluginVersion": "11.1.3", + "targets": [ + { + "alias": "$tag_plug_alias", + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + }, + { + "params": [ + "plug_alias" + ], + "type": "tag" + } + ], + "hide": false, + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total_wh" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [], + "type": "non_negative_difference" + }, + { + "params": [ + "* $cost / 1000" + ], + "type": "math" + } + ] + ], + "tags": [ + { + "key": "plug_alias", + "operator": "=~", + "value": "/^$plug_alias$/" + } + ], + "tz": "$tz" + } + ], + "title": "Plug (By Day)", + "transformations": [ + { + "id": "seriesToColumns", + "options": {} + } + ], + "type": "table" } - ] ], - "tags": [ - { - "key": "plug_alias", - "operator": "=~", - "value": "/^$plug_alias$/" - } + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "uDxwFcOGz" + }, + "refId": "A" + } ], - "tz": "$tz" - } - ], - "title": "Plug (By Day)", - "transformations": [ - { - "id": "seriesToColumns", - "options": {} - } - ], - "type": "table" - }, - { - "collapsed": true, - "datasource": { - "type": "prometheus", - "uid": "uDxwFcOGz" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 20 - }, - "id": 32, - "panels": [ - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + "title": "Cost", + "type": "row" + } + ], + "refresh": "", + "schemaVersion": 39, + "tags": [ + "influxdb", + "kasa-collector" + ], + "templating": { + "list": [ + { + "current": {}, + "hide": 0, + "includeAll": false, + "label": "Data Source", + "multi": false, + "name": "data_source", + "options": [], + "query": "influxdb", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "continuous-BlYlRd" + { + "current": {}, + "datasource": { + "type": "influxdb", + "uid": "${data_source}" }, - "custom": { - "align": "center", - "cellOptions": { - "mode": "gradient", - "type": "color-background" - }, - "inspect": false + "definition": "SHOW TAG VALUES WITH KEY = \"device_alias\"", + "hide": 0, + "includeAll": true, + "label": "Device", + "multi": true, + "name": "device_alias", + "options": [], + "query": "SHOW TAG VALUES WITH KEY = \"device_alias\"", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 5, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "influxdb", + "uid": "${data_source}" }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ + "definition": "SHOW TAG VALUES WITH KEY = \"plug_alias\" WHERE \"device_alias\" =~ /^$device_alias$/", + "hide": 0, + "includeAll": true, + "label": "Plug", + "multi": true, + "name": "plug_alias", + "options": [], + "query": "SHOW TAG VALUES WITH KEY = \"plug_alias\" WHERE \"device_alias\" =~ /^$device_alias$/", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 5, + "type": "query" + }, + { + "current": { + "selected": true, + "text": ".1181", + "value": ".1181" + }, + "description": "Cost per Kilowatt Hour", + "hide": 0, + "label": "Cost per kWh", + "name": "cost", + "options": [ { - "color": "green" + "selected": true, + "text": ".1181", + "value": ".1181" } - ] + ], + "query": ".1181", + "skipUrlSync": false, + "type": "textbox" + }, + { + "current": { + "selected": false, + "text": "America/Chicago", + "value": "America/Chicago" }, - "unit": "currencyUSD", - "unitScale": true - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Time" - }, - "properties": [ + "description": "Time Zone of your devices", + "hide": 0, + "includeAll": false, + "label": "Time Zone", + "multi": false, + "name": "tz", + "options": [ { - "id": "unit", - "value": "time:ddd, MMM Do, 'YY" + "selected": false, + "text": "America/New_York", + "value": "America/New_York" }, { - "id": "custom.width", - "value": 130 + "selected": true, + "text": "America/Chicago", + "value": "America/Chicago" }, { - "id": "custom.cellOptions", - "value": { - "type": "auto" - } + "selected": false, + "text": "America/Denver", + "value": "America/Denver" + }, + { + "selected": false, + "text": "America/Los_Angeles", + "value": "America/Los_Angeles" + }, + { + "selected": false, + "text": "America/Anchorage", + "value": "America/Anchorage" + }, + { + "selected": false, + "text": "America/Adak", + "value": "America/Adak" } - ] - } - ] - }, - "gridPos": { - "h": 6, - "w": 24, - "x": 0, - "y": 14 - }, - "id": 26, - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": "", - "reducer": [ - "sum" ], - "show": false - }, - "showHeader": true, - "sortBy": [ - { - "desc": true, - "displayName": "Time" - } - ] + "query": "America/New_York,America/Chicago, America/Denver, America/Los_Angeles,America/Anchorage,America/Adak", + "queryValue": "", + "skipUrlSync": false, + "type": "custom" }, - "pluginVersion": "10.3.1", - "targets": [ - { - "alias": "$tag_device_alias", - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + { + "auto": true, + "auto_count": 30, + "auto_min": "10s", + "current": { + "selected": true, + "text": "1d", + "value": "1d" }, - "groupBy": [ - { - "params": [ - "$interval" - ], - "type": "time" - }, - { - "params": [ - "device_alias" - ], - "type": "tag" - } - ], - "hide": false, - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ + "hide": 0, + "label": "Interval", + "name": "interval", + "options": [ { - "params": [ - "total_wh" - ], - "type": "field" + "selected": false, + "text": "auto", + "value": "$__auto_interval_interval" }, { - "params": [], - "type": "mean" + "selected": false, + "text": "5s", + "value": "5s" }, { - "params": [], - "type": "non_negative_difference" + "selected": false, + "text": "15s", + "value": "15s" }, { - "params": [ - "* $cost / 1000" - ], - "type": "math" - } - ] - ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } - ], - "tz": "$tz" - } - ], - "title": "Device (By Day)", - "transformations": [ - { - "id": "seriesToColumns", - "options": {} - } - ], - "type": "table" - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "continuous-BlYlRd" - }, - "custom": { - "align": "center", - "cellOptions": { - "mode": "gradient", - "type": "color-background" - }, - "inspect": false - }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ + "selected": false, + "text": "30s", + "value": "30s" + }, { - "color": "green" - } - ] - }, - "unit": "currencyUSD", - "unitScale": true - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Time" - }, - "properties": [ + "selected": false, + "text": "1m", + "value": "1m" + }, { - "id": "unit", - "value": "time:ddd, MMM Do, 'YY" + "selected": false, + "text": "5m", + "value": "5m" }, { - "id": "custom.width", - "value": 130 + "selected": false, + "text": "10m", + "value": "10m" }, { - "id": "custom.cellOptions", - "value": { - "type": "auto" - } - } - ] - } - ] - }, - "gridPos": { - "h": 6, - "w": 24, - "x": 0, - "y": 20 - }, - "id": 28, - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true, - "sortBy": [ - { - "desc": true, - "displayName": "Time" - } - ] - }, - "pluginVersion": "10.3.1", - "targets": [ - { - "alias": "$tag_plug_alias", - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "groupBy": [ - { - "params": [ - "$interval" - ], - "type": "time" - }, - { - "params": [ - "plug_alias" - ], - "type": "tag" - } - ], - "hide": false, - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ + "selected": false, + "text": "15m", + "value": "15m" + }, + { + "selected": false, + "text": "1h", + "value": "1h" + }, { - "params": [ - "total_wh" - ], - "type": "field" + "selected": false, + "text": "3h", + "value": "3h" }, { - "params": [], - "type": "mean" + "selected": false, + "text": "6h", + "value": "6h" }, { - "params": [], - "type": "non_negative_difference" + "selected": false, + "text": "12h", + "value": "12h" }, { - "params": [ - "* $cost / 1000" - ], - "type": "math" + "selected": true, + "text": "1d", + "value": "1d" + }, + { + "selected": false, + "text": "3d", + "value": "3d" + }, + { + "selected": false, + "text": "1w", + "value": "1w" } - ] - ], - "tags": [ - { - "key": "plug_alias", - "operator": "=~", - "value": "/^$plug_alias$/" - } ], - "tz": "$tz" - } - ], - "title": "Plug (By Day)", - "transformations": [ - { - "id": "seriesToColumns", - "options": {} - } - ], - "type": "table" - } - ], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "uDxwFcOGz" - }, - "refId": "A" - } - ], - "title": "Cost", - "type": "row" - } - ], - "refresh": "", - "schemaVersion": 39, - "tags": [ - "influxdb", - "kasa-collector" - ], - "templating": { - "list": [ - { - "current": { - "selected": false, - "text": "InfluxDB - influxdb02 - Tylephony - kasa", - "value": "P0A3FFFCFD014D9A1" - }, - "hide": 0, - "includeAll": false, - "label": "Data Source", - "multi": false, - "name": "data_source", - "options": [], - "query": "influxdb", - "queryValue": "", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "type": "datasource" - }, - { - "current": {}, - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- KASA}" - }, - "definition": "SHOW TAG VALUES WITH KEY = \"device_alias\"", - "hide": 0, - "includeAll": true, - "label": "Device", - "multi": true, - "name": "device_alias", - "options": [], - "query": "SHOW TAG VALUES WITH KEY = \"device_alias\"", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 5, - "type": "query" - }, - { - "current": {}, - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- KASA}" - }, - "definition": "SHOW TAG VALUES WITH KEY = \"plug_alias\" WHERE \"device_alias\" =~ /^$device_alias$/", - "hide": 0, - "includeAll": true, - "label": "Plug", - "multi": true, - "name": "plug_alias", - "options": [], - "query": "SHOW TAG VALUES WITH KEY = \"plug_alias\" WHERE \"device_alias\" =~ /^$device_alias$/", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 5, - "type": "query" - }, - { - "current": { - "selected": true, - "text": ".1181", - "value": ".1181" - }, - "description": "Cost per Kilowatt Hour", - "hide": 0, - "label": "Cost per kWh", - "name": "cost", - "options": [ - { - "selected": true, - "text": ".1181", - "value": ".1181" + "query": "5s,15s,30s,1m,5m,10m,15m,1h,3h,6h,12h,1d,3d,1w", + "queryValue": "", + "refresh": 2, + "skipUrlSync": false, + "type": "interval" } - ], - "query": ".1181", - "skipUrlSync": false, - "type": "textbox" - }, - { - "current": { - "selected": false, - "text": "America/Chicago", - "value": "America/Chicago" - }, - "description": "Time Zone of your devices", - "hide": 0, - "includeAll": false, - "label": "Time Zone", - "multi": false, - "name": "tz", - "options": [ - { - "selected": false, - "text": "America/New_York", - "value": "America/New_York" - }, - { - "selected": true, - "text": "America/Chicago", - "value": "America/Chicago" - }, - { - "selected": false, - "text": "America/Denver", - "value": "America/Denver" - }, - { - "selected": false, - "text": "America/Los_Angeles", - "value": "America/Los_Angeles" - }, - { - "selected": false, - "text": "America/Anchorage", - "value": "America/Anchorage" - }, - { - "selected": false, - "text": "America/Adak", - "value": "America/Adak" - } - ], - "query": "America/New_York,America/Chicago, America/Denver, America/Los_Angeles,America/Anchorage,America/Adak", - "queryValue": "", - "skipUrlSync": false, - "type": "custom" - }, - { - "auto": true, - "auto_count": 30, - "auto_min": "10s", - "current": { - "selected": false, - "text": "1d", - "value": "1d" - }, - "hide": 0, - "label": "Interval", - "name": "interval", - "options": [ - { - "selected": false, - "text": "auto", - "value": "$__auto_interval_interval" - }, - { - "selected": false, - "text": "5s", - "value": "5s" - }, - { - "selected": false, - "text": "15s", - "value": "15s" - }, - { - "selected": false, - "text": "30s", - "value": "30s" - }, - { - "selected": false, - "text": "1m", - "value": "1m" - }, - { - "selected": false, - "text": "5m", - "value": "5m" - }, - { - "selected": false, - "text": "10m", - "value": "10m" - }, - { - "selected": false, - "text": "15m", - "value": "15m" - }, - { - "selected": false, - "text": "1h", - "value": "1h" - }, - { - "selected": false, - "text": "3h", - "value": "3h" - }, - { - "selected": false, - "text": "6h", - "value": "6h" - }, - { - "selected": false, - "text": "12h", - "value": "12h" - }, - { - "selected": true, - "text": "1d", - "value": "1d" - }, - { - "selected": false, - "text": "3d", - "value": "3d" - }, - { - "selected": false, - "text": "1w", - "value": "1w" - } - ], - "query": "5s,15s,30s,1m,5m,10m,15m,1h,3h,6h,12h,1d,3d,1w", - "queryValue": "", - "refresh": 2, - "skipUrlSync": false, - "type": "interval" - } - ] + ] }, "time": { - "from": "now-7d", - "to": "now" + "from": "now-7d", + "to": "now" }, - "timeRangeUpdatedDuringEditOrView": false, "timepicker": {}, "timezone": "", "title": "Kasa Collector - Energy (By Time)", "uid": "lux4rd0labs_kasa_03", - "version": 15, + "version": 5, "weekStart": "" } \ No newline at end of file diff --git a/grafana/shared/kasa_collector-status.json b/grafana/shared/kasa_collector-status.json index 5655cb8..93d082c 100644 --- a/grafana/shared/kasa_collector-status.json +++ b/grafana/shared/kasa_collector-status.json @@ -1,56 +1,62 @@ { "__inputs": [ - { - "name": "DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA", - "label": "InfluxDB - influxdb02 - Tylephony - kasa", - "description": "", - "type": "datasource", - "pluginId": "influxdb", - "pluginName": "InfluxDB" - } + { + "name": "DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA", + "label": "InfluxDB - influxdb02 - Tylephony - kasa", + "description": "", + "type": "datasource", + "pluginId": "influxdb", + "pluginName": "InfluxDB" + } ], "__elements": {}, "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "11.0.0" - }, - { - "type": "datasource", - "id": "influxdb", - "name": "InfluxDB", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "stat", - "name": "Stat", - "version": "" - } - ], - "annotations": { - "list": [ { - "builtIn": 1, - "datasource": { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "11.1.3" + }, + { "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" + "id": "influxdb", + "name": "InfluxDB", + "version": "1.0.0" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "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" + } + ] }, "description": "Kasa Collector provides a way of collecting real-time energy data from Kasa Smart Plugs. These Grafana dashboards offer visualizations for their Current, Voltage, Power, and Total Watt Hours.", "editable": true, @@ -58,1234 +64,1235 @@ "graphTooltip": 0, "id": null, "links": [ - { - "asDropdown": true, - "icon": "external link", - "includeVars": true, - "keepTime": true, - "tags": [ - "kasa-collector" - ], - "targetBlank": false, - "title": "Kasa Collector - Dashboards", - "tooltip": "", - "type": "dashboards", - "url": "" - } + { + "asDropdown": true, + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "kasa-collector" + ], + "targetBlank": false, + "title": "Kasa Collector - Dashboards", + "tooltip": "", + "type": "dashboards", + "url": "" + } ], "liveNow": false, "panels": [ - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "dark-purple", - "mode": "fixed" + { + "datasource": { + "type": "influxdb", + "uid": "${data_source}" }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "dark-purple", + "mode": "fixed" + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "mwatt" + }, + "overrides": [] }, - "unit": "mwatt" - }, - "overrides": [] - }, - "id": 19, - "interval": "$interval", - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "text": {}, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "11.0.0", - "targets": [ - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + "id": 19, + "interval": "$interval", + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "device_alias" - ], - "type": "tag" - }, - { - "params": [ - "previous" - ], - "type": "fill" - } - ], - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "power_mw" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" + "pluginVersion": "11.1.3", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "device_alias" + ], + "type": "tag" + }, + { + "params": [ + "previous" + ], + "type": "fill" + } + ], + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "power_mw" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] } - ] ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - } - ], - "title": "Power (Combined)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "Total", - "mode": "reduceRow", - "reduce": { - "reducer": "sum" - }, - "replaceFields": true - } - } - ], - "type": "stat" - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "semi-dark-blue", - "mode": "fixed" - }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null + "title": "Power (Combined)", + "transformations": [ + { + "id": "calculateField", + "options": { + "alias": "Total", + "mode": "reduceRow", + "reduce": { + "reducer": "sum" + }, + "replaceFields": true + } } - ] - }, - "unit": "watth" - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 6, - "x": 6, - "y": 0 - }, - "id": 20, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "text": {}, - "textMode": "auto", - "wideLayout": true + "type": "stat" }, - "pluginVersion": "11.0.0", - "targets": [ - { + { "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + "type": "influxdb", + "uid": "${data_source}" }, - "groupBy": [ - { - "params": [ - "1h" - ], - "type": "time" - }, - { - "params": [ - "device_alias" - ], - "type": "tag" - } - ], - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "total_wh" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - }, - { - "params": [], - "type": "difference" - } - ] - ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - } - ], - "title": "Watt-Hours (Combined)", - "transformations": [ - { - "id": "calculateField", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "semi-dark-blue", + "mode": "fixed" + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "watth" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 6, + "x": 6, + "y": 0 + }, + "id": 20, "options": { - "alias": "Combined", - "mode": "reduceRow", - "reduce": { - "reducer": "sum" - }, - "replaceFields": true - } - } - ], - "type": "stat" - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "semi-dark-yellow", - "mode": "fixed" + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null + "pluginVersion": "11.1.3", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "1h" + ], + "type": "time" + }, + { + "params": [ + "device_alias" + ], + "type": "tag" + } + ], + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total_wh" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [], + "type": "difference" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] + } + ], + "title": "Watt-Hours (Combined)", + "transformations": [ + { + "id": "calculateField", + "options": { + "alias": "Combined", + "mode": "reduceRow", + "reduce": { + "reducer": "sum" + }, + "replaceFields": true + } } - ] - }, - "unit": "mamp" - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 6, - "x": 12, - "y": 0 - }, - "id": 21, - "interval": "$interval", - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "text": {}, - "textMode": "auto", - "wideLayout": true + "type": "stat" }, - "pluginVersion": "11.0.0", - "targets": [ - { + { "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + "type": "influxdb", + "uid": "${data_source}" }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "device_alias" - ], - "type": "tag" - }, - { - "params": [ - "previous" - ], - "type": "fill" - } - ], - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "current_ma" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - } - ], - "title": "Current (Combined)", - "transformations": [ - { - "id": "calculateField", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "semi-dark-yellow", + "mode": "fixed" + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "mamp" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 6, + "x": 12, + "y": 0 + }, + "id": 21, + "interval": "$interval", "options": { - "alias": "Total", - "mode": "reduceRow", - "reduce": { - "reducer": "sum" - }, - "replaceFields": true - } - } - ], - "type": "stat" - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "dark-red", - "mode": "fixed" + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null + "pluginVersion": "11.1.3", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "device_alias" + ], + "type": "tag" + }, + { + "params": [ + "previous" + ], + "type": "fill" + } + ], + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "current_ma" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] } - ] - }, - "unit": "mvolt" - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 6, - "x": 18, - "y": 0 - }, - "id": 22, - "interval": "$interval", - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "text": {}, - "textMode": "auto", - "wideLayout": true + "title": "Current (Combined)", + "transformations": [ + { + "id": "calculateField", + "options": { + "alias": "Total", + "mode": "reduceRow", + "reduce": { + "reducer": "sum" + }, + "replaceFields": true + } + } + ], + "type": "stat" }, - "pluginVersion": "11.0.0", - "targets": [ - { + { "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + "type": "influxdb", + "uid": "${data_source}" }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "previous" - ], - "type": "fill" - } - ], - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "voltage_mv" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "dark-red", + "mode": "fixed" + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "mvolt" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 6, + "x": 18, + "y": 0 + }, + "id": 22, + "interval": "$interval", + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.1.3", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "previous" + ], + "type": "fill" + } + ], + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "voltage_mv" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] } - ] ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - } - ], - "title": "Voltage (Mean)", - "type": "stat" - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "uDxwFcOGz" + "title": "Voltage (Mean)", + "type": "stat" }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 3 - }, - "id": 24, - "panels": [], - "targets": [ - { + { + "collapsed": false, "datasource": { - "type": "prometheus", - "uid": "uDxwFcOGz" + "type": "prometheus", + "uid": "uDxwFcOGz" }, - "refId": "A" - } - ], - "title": "Devices", - "type": "row" - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 3 }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "#4CAE4F", - "value": null - }, - { - "color": "#53AD49", - "value": 42769.2308 - }, - { - "color": "#59AC43", - "value": 79538.4615 - }, - { - "color": "#5FAA3E", - "value": 116307.6923 - }, - { - "color": "#65A938", - "value": 153076.9231 - }, - { - "color": "#6AA732", - "value": 189846.1538 - }, - { - "color": "#6FA62C", - "value": 226615.3846 - }, - { - "color": "#75A425", - "value": 263384.6154 - }, - { - "color": "#7AA31E", - "value": 300153.8462 - }, - { - "color": "#7FA117", - "value": 336923.0769 - }, - { - "color": "#839F0D", - "value": 373692.3077 - }, - { - "color": "#889E02", - "value": 410461.5385 - }, - { - "color": "#8D9C00", - "value": 447230.7692 - }, - { - "color": "#929A00", - "value": 484000 - }, - { - "color": "#969800", - "value": 520769.2308 - }, - { - "color": "#9B9600", - "value": 557538.4615 - }, - { - "color": "#A09300", - "value": 594307.6923 - }, - { - "color": "#A49100", - "value": 631076.9231 - }, - { - "color": "#A98F00", - "value": 667846.1538 - }, - { - "color": "#AD8C00", - "value": 704615.3846 - }, - { - "color": "#B18A00", - "value": 741384.6154 - }, - { - "color": "#B68700", - "value": 778153.8462 - }, - { - "color": "#BA8400", - "value": 814923.0769 - }, - { - "color": "#BE8100", - "value": 851692.3077 - }, - { - "color": "#C27E00", - "value": 888461.5385 - }, - { - "color": "#C67B00", - "value": 925230.7692 - }, - { - "color": "#CA7800", - "value": 962000 - }, - { - "color": "#CE7500", - "value": 998769.2308 - }, - { - "color": "#D27100", - "value": 1035538.4615 - }, - { - "color": "#D66E00", - "value": 1072307.6923 - }, - { - "color": "#D96A00", - "value": 1109076.9231 - }, - { - "color": "#DD6600", - "value": 1145846.1538 - }, - { - "color": "#E06207", - "value": 1182615.3846 - }, - { - "color": "#E45E10", - "value": 1219384.6154 - }, - { - "color": "#E75917", - "value": 1256153.8462 - }, - { - "color": "#EA551E", - "value": 1292923.0769 - }, - { - "color": "#ED5024", - "value": 1329692.3077 - }, - { - "color": "#EF4B29", - "value": 1366461.5385 - }, - { - "color": "#F2462F", - "value": 1403230.7692 - }, - { - "color": "#F44034", - "value": 1440000 + "id": 24, + "panels": [], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "uDxwFcOGz" + }, + "refId": "A" } - ] - }, - "unit": "mwatt" - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 4, - "x": 0, - "y": 4 - }, - "id": 3, - "interval": "$interval", - "maxPerRow": 6, - "options": { - "colorMode": "background", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "last" ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "text": {}, - "textMode": "auto", - "wideLayout": true + "title": "Devices", + "type": "row" }, - "pluginVersion": "11.0.0", - "repeat": "device_alias", - "repeatDirection": "h", - "targets": [ - { - "alias": "Watts", + { "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + "type": "influxdb", + "uid": "${data_source}" }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "hide": false, - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "power_mw" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#4CAE4F", + "value": null + }, + { + "color": "#53AD49", + "value": 42769.2308 + }, + { + "color": "#59AC43", + "value": 79538.4615 + }, + { + "color": "#5FAA3E", + "value": 116307.6923 + }, + { + "color": "#65A938", + "value": 153076.9231 + }, + { + "color": "#6AA732", + "value": 189846.1538 + }, + { + "color": "#6FA62C", + "value": 226615.3846 + }, + { + "color": "#75A425", + "value": 263384.6154 + }, + { + "color": "#7AA31E", + "value": 300153.8462 + }, + { + "color": "#7FA117", + "value": 336923.0769 + }, + { + "color": "#839F0D", + "value": 373692.3077 + }, + { + "color": "#889E02", + "value": 410461.5385 + }, + { + "color": "#8D9C00", + "value": 447230.7692 + }, + { + "color": "#929A00", + "value": 484000 + }, + { + "color": "#969800", + "value": 520769.2308 + }, + { + "color": "#9B9600", + "value": 557538.4615 + }, + { + "color": "#A09300", + "value": 594307.6923 + }, + { + "color": "#A49100", + "value": 631076.9231 + }, + { + "color": "#A98F00", + "value": 667846.1538 + }, + { + "color": "#AD8C00", + "value": 704615.3846 + }, + { + "color": "#B18A00", + "value": 741384.6154 + }, + { + "color": "#B68700", + "value": 778153.8462 + }, + { + "color": "#BA8400", + "value": 814923.0769 + }, + { + "color": "#BE8100", + "value": 851692.3077 + }, + { + "color": "#C27E00", + "value": 888461.5385 + }, + { + "color": "#C67B00", + "value": 925230.7692 + }, + { + "color": "#CA7800", + "value": 962000 + }, + { + "color": "#CE7500", + "value": 998769.2308 + }, + { + "color": "#D27100", + "value": 1035538.4615 + }, + { + "color": "#D66E00", + "value": 1072307.6923 + }, + { + "color": "#D96A00", + "value": 1109076.9231 + }, + { + "color": "#DD6600", + "value": 1145846.1538 + }, + { + "color": "#E06207", + "value": 1182615.3846 + }, + { + "color": "#E45E10", + "value": 1219384.6154 + }, + { + "color": "#E75917", + "value": 1256153.8462 + }, + { + "color": "#EA551E", + "value": 1292923.0769 + }, + { + "color": "#ED5024", + "value": 1329692.3077 + }, + { + "color": "#EF4B29", + "value": 1366461.5385 + }, + { + "color": "#F2462F", + "value": 1403230.7692 + }, + { + "color": "#F44034", + "value": 1440000 + } + ] + }, + "unit": "mwatt" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 0, + "y": 4 + }, + "id": 3, + "interval": "$interval", + "maxPerRow": 6, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.1.3", + "repeat": "device_alias", + "repeatDirection": "h", + "targets": [ + { + "alias": "Watts", + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": false, + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "power_mw" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "device_alias", + "operator": "=~", + "value": "/^$device_alias$/" + } + ] } - ] ], - "tags": [ - { - "key": "device_alias", - "operator": "=~", - "value": "/^$device_alias$/" - } - ] - } - ], - "title": "$device_alias", - "type": "stat" - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "uDxwFcOGz" + "title": "$device_alias", + "type": "stat" }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 20 - }, - "id": 30, - "panels": [], - "targets": [ - { + { + "collapsed": false, "datasource": { - "type": "prometheus", - "uid": "uDxwFcOGz" + "type": "prometheus", + "uid": "uDxwFcOGz" }, - "refId": "A" - } - ], - "title": "Plugs", - "type": "row" - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 16 }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "#4CAE4F", - "value": null - }, - { - "color": "#53AD49", - "value": 42769.2308 - }, - { - "color": "#59AC43", - "value": 79538.4615 - }, - { - "color": "#5FAA3E", - "value": 116307.6923 - }, - { - "color": "#65A938", - "value": 153076.9231 - }, - { - "color": "#6AA732", - "value": 189846.1538 - }, - { - "color": "#6FA62C", - "value": 226615.3846 - }, - { - "color": "#75A425", - "value": 263384.6154 - }, - { - "color": "#7AA31E", - "value": 300153.8462 - }, - { - "color": "#7FA117", - "value": 336923.0769 - }, - { - "color": "#839F0D", - "value": 373692.3077 - }, - { - "color": "#889E02", - "value": 410461.5385 - }, - { - "color": "#8D9C00", - "value": 447230.7692 - }, - { - "color": "#929A00", - "value": 484000 - }, - { - "color": "#969800", - "value": 520769.2308 - }, - { - "color": "#9B9600", - "value": 557538.4615 - }, - { - "color": "#A09300", - "value": 594307.6923 - }, - { - "color": "#A49100", - "value": 631076.9231 - }, - { - "color": "#A98F00", - "value": 667846.1538 - }, - { - "color": "#AD8C00", - "value": 704615.3846 - }, - { - "color": "#B18A00", - "value": 741384.6154 - }, - { - "color": "#B68700", - "value": 778153.8462 - }, - { - "color": "#BA8400", - "value": 814923.0769 - }, - { - "color": "#BE8100", - "value": 851692.3077 - }, - { - "color": "#C27E00", - "value": 888461.5385 - }, - { - "color": "#C67B00", - "value": 925230.7692 - }, - { - "color": "#CA7800", - "value": 962000 - }, - { - "color": "#CE7500", - "value": 998769.2308 - }, - { - "color": "#D27100", - "value": 1035538.4615 - }, - { - "color": "#D66E00", - "value": 1072307.6923 - }, - { - "color": "#D96A00", - "value": 1109076.9231 - }, - { - "color": "#DD6600", - "value": 1145846.1538 - }, - { - "color": "#E06207", - "value": 1182615.3846 - }, - { - "color": "#E45E10", - "value": 1219384.6154 - }, - { - "color": "#E75917", - "value": 1256153.8462 - }, - { - "color": "#EA551E", - "value": 1292923.0769 - }, - { - "color": "#ED5024", - "value": 1329692.3077 - }, - { - "color": "#EF4B29", - "value": 1366461.5385 - }, - { - "color": "#F2462F", - "value": 1403230.7692 - }, - { - "color": "#F44034", - "value": 1440000 + "id": 30, + "panels": [], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "uDxwFcOGz" + }, + "refId": "A" } - ] - }, - "unit": "mwatt" - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 4, - "x": 0, - "y": 21 - }, - "id": 73, - "interval": "$interval", - "maxPerRow": 6, - "options": { - "colorMode": "background", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "last" ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "text": {}, - "textMode": "auto", - "wideLayout": true + "title": "Plugs", + "type": "row" }, - "pluginVersion": "11.0.0", - "repeat": "plug_alias", - "repeatDirection": "h", - "targets": [ - { - "alias": "Watts", + { "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" + "type": "influxdb", + "uid": "${data_source}" }, - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "previous" - ], - "type": "fill" - } - ], - "hide": false, - "measurement": "emeter", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "power_mw" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#4CAE4F", + "value": null + }, + { + "color": "#53AD49", + "value": 42769.2308 + }, + { + "color": "#59AC43", + "value": 79538.4615 + }, + { + "color": "#5FAA3E", + "value": 116307.6923 + }, + { + "color": "#65A938", + "value": 153076.9231 + }, + { + "color": "#6AA732", + "value": 189846.1538 + }, + { + "color": "#6FA62C", + "value": 226615.3846 + }, + { + "color": "#75A425", + "value": 263384.6154 + }, + { + "color": "#7AA31E", + "value": 300153.8462 + }, + { + "color": "#7FA117", + "value": 336923.0769 + }, + { + "color": "#839F0D", + "value": 373692.3077 + }, + { + "color": "#889E02", + "value": 410461.5385 + }, + { + "color": "#8D9C00", + "value": 447230.7692 + }, + { + "color": "#929A00", + "value": 484000 + }, + { + "color": "#969800", + "value": 520769.2308 + }, + { + "color": "#9B9600", + "value": 557538.4615 + }, + { + "color": "#A09300", + "value": 594307.6923 + }, + { + "color": "#A49100", + "value": 631076.9231 + }, + { + "color": "#A98F00", + "value": 667846.1538 + }, + { + "color": "#AD8C00", + "value": 704615.3846 + }, + { + "color": "#B18A00", + "value": 741384.6154 + }, + { + "color": "#B68700", + "value": 778153.8462 + }, + { + "color": "#BA8400", + "value": 814923.0769 + }, + { + "color": "#BE8100", + "value": 851692.3077 + }, + { + "color": "#C27E00", + "value": 888461.5385 + }, + { + "color": "#C67B00", + "value": 925230.7692 + }, + { + "color": "#CA7800", + "value": 962000 + }, + { + "color": "#CE7500", + "value": 998769.2308 + }, + { + "color": "#D27100", + "value": 1035538.4615 + }, + { + "color": "#D66E00", + "value": 1072307.6923 + }, + { + "color": "#D96A00", + "value": 1109076.9231 + }, + { + "color": "#DD6600", + "value": 1145846.1538 + }, + { + "color": "#E06207", + "value": 1182615.3846 + }, + { + "color": "#E45E10", + "value": 1219384.6154 + }, + { + "color": "#E75917", + "value": 1256153.8462 + }, + { + "color": "#EA551E", + "value": 1292923.0769 + }, + { + "color": "#ED5024", + "value": 1329692.3077 + }, + { + "color": "#EF4B29", + "value": 1366461.5385 + }, + { + "color": "#F2462F", + "value": 1403230.7692 + }, + { + "color": "#F44034", + "value": 1440000 + } + ] + }, + "unit": "mwatt" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 0, + "y": 17 + }, + "id": 73, + "interval": "$interval", + "maxPerRow": 6, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.1.3", + "repeat": "plug_alias", + "repeatDirection": "h", + "targets": [ + { + "alias": "Watts", + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "previous" + ], + "type": "fill" + } + ], + "hide": false, + "measurement": "emeter", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "power_mw" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "plug_alias", + "operator": "=~", + "value": "/^$plug_alias$/" + } + ] } - ] ], - "tags": [ - { - "key": "plug_alias", - "operator": "=~", - "value": "/^$plug_alias$/" - } - ] - } - ], - "title": "$plug_alias", - "type": "stat" - } + "title": "$plug_alias", + "type": "stat" + } ], "refresh": "5m", "schemaVersion": 39, "tags": [ - "influxdb", - "kasa-collector" + "influxdb", + "kasa-collector" ], "templating": { - "list": [ - { - "current": { - "selected": false, - "text": "InfluxDB - influxdb02 - Tylephony - kasa", - "value": "P0A3FFFCFD014D9A1" - }, - "hide": 0, - "includeAll": false, - "label": "Data Source", - "multi": false, - "name": "data_source", - "options": [], - "query": "influxdb", - "queryValue": "", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "type": "datasource" - }, - { - "current": {}, - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "definition": "SHOW TAG VALUES FROM \"emeter\" WITH KEY = \"device_alias\"", - "hide": 0, - "includeAll": true, - "label": "Device", - "multi": true, - "name": "device_alias", - "options": [], - "query": "SHOW TAG VALUES FROM \"emeter\" WITH KEY = \"device_alias\"", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 5, - "type": "query" - }, - { - "current": {}, - "datasource": { - "type": "influxdb", - "uid": "${DS_INFLUXDB_- INFLUXDB02 - TYLEPHONY - KASA}" - }, - "definition": "SHOW TAG VALUES FROM \"emeter\" WITH KEY = \"plug_alias\" WHERE \"device_alias\" =~ /^$device_alias$/", - "hide": 0, - "includeAll": true, - "label": "Plug", - "multi": true, - "name": "plug_alias", - "options": [], - "query": "SHOW TAG VALUES FROM \"emeter\" WITH KEY = \"plug_alias\" WHERE \"device_alias\" =~ /^$device_alias$/", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 5, - "type": "query" - }, - { - "auto": true, - "auto_count": 30, - "auto_min": "10s", - "current": { - "selected": false, - "text": "5m", - "value": "5m" - }, - "hide": 0, - "label": "Interval", - "name": "interval", - "options": [ - { - "selected": false, - "text": "auto", - "value": "$__auto_interval_interval" - }, - { - "selected": false, - "text": "5s", - "value": "5s" - }, + "list": [ { - "selected": false, - "text": "15s", - "value": "15s" + "current": {}, + "hide": 0, + "includeAll": false, + "label": "Data Source", + "multi": false, + "name": "data_source", + "options": [], + "query": "influxdb", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" }, { - "selected": false, - "text": "30s", - "value": "30s" + "current": {}, + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "definition": "SHOW TAG VALUES FROM \"emeter\" WITH KEY = \"device_alias\"", + "hide": 0, + "includeAll": true, + "label": "Device", + "multi": true, + "name": "device_alias", + "options": [], + "query": "SHOW TAG VALUES FROM \"emeter\" WITH KEY = \"device_alias\"", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 5, + "type": "query" }, { - "selected": false, - "text": "1m", - "value": "1m" + "current": {}, + "datasource": { + "type": "influxdb", + "uid": "${data_source}" + }, + "definition": "SHOW TAG VALUES FROM \"emeter\" WITH KEY = \"plug_alias\" WHERE \"device_alias\" =~ /^$device_alias$/", + "hide": 0, + "includeAll": true, + "label": "Plug", + "multi": true, + "name": "plug_alias", + "options": [], + "query": "SHOW TAG VALUES FROM \"emeter\" WITH KEY = \"plug_alias\" WHERE \"device_alias\" =~ /^$device_alias$/", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 5, + "type": "query" }, { - "selected": true, - "text": "5m", - "value": "5m" - }, - { - "selected": false, - "text": "10m", - "value": "10m" - }, - { - "selected": false, - "text": "15m", - "value": "15m" - }, - { - "selected": false, - "text": "1h", - "value": "1h" - }, - { - "selected": false, - "text": "3h", - "value": "3h" - }, - { - "selected": false, - "text": "6h", - "value": "6h" - }, - { - "selected": false, - "text": "12h", - "value": "12h" - }, - { - "selected": false, - "text": "1d", - "value": "1d" - }, - { - "selected": false, - "text": "3d", - "value": "3d" - }, - { - "selected": false, - "text": "1w", - "value": "1w" + "auto": true, + "auto_count": 30, + "auto_min": "10s", + "current": { + "selected": false, + "text": "5m", + "value": "5m" + }, + "hide": 0, + "label": "Interval", + "name": "interval", + "options": [ + { + "selected": false, + "text": "auto", + "value": "$__auto_interval_interval" + }, + { + "selected": false, + "text": "5s", + "value": "5s" + }, + { + "selected": false, + "text": "15s", + "value": "15s" + }, + { + "selected": false, + "text": "30s", + "value": "30s" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": true, + "text": "5m", + "value": "5m" + }, + { + "selected": false, + "text": "10m", + "value": "10m" + }, + { + "selected": false, + "text": "15m", + "value": "15m" + }, + { + "selected": false, + "text": "1h", + "value": "1h" + }, + { + "selected": false, + "text": "3h", + "value": "3h" + }, + { + "selected": false, + "text": "6h", + "value": "6h" + }, + { + "selected": false, + "text": "12h", + "value": "12h" + }, + { + "selected": false, + "text": "1d", + "value": "1d" + }, + { + "selected": false, + "text": "3d", + "value": "3d" + }, + { + "selected": false, + "text": "1w", + "value": "1w" + } + ], + "query": "5s,15s,30s,1m,5m,10m,15m,1h,3h,6h,12h,1d,3d,1w", + "queryValue": "", + "refresh": 2, + "skipUrlSync": false, + "type": "interval" } - ], - "query": "5s,15s,30s,1m,5m,10m,15m,1h,3h,6h,12h,1d,3d,1w", - "queryValue": "", - "refresh": 2, - "skipUrlSync": false, - "type": "interval" - } - ] + ] }, "time": { - "from": "now-24h", - "to": "now" + "from": "now-24h", + "to": "now" }, - "timeRangeUpdatedDuringEditOrView": false, "timepicker": {}, "timezone": "", "title": "Kasa Collector - Status", "uid": "lux4rd0labs_kasa_05", - "version": 17, + "version": 18, "weekStart": "" } \ No newline at end of file