diff --git a/README.md b/README.md index ec53bbb..00e2640 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Please note that this integration requires RS485 to TCP converter that needs to - **Restart-safe availability** — Last known node readings are persisted and restored on startup, so sensors stay available with the most recent value even before the first live frame arrives (for example after a night restart). -- **Energy accumulation** — Trapezoidal Wh integration with daily reset semantics and monotonic lifetime totals. +- **Energy accumulation** — Trapezoidal Wh integration with proactive midnight reset and monotonic lifetime totals. Daily sensors zero at exactly midnight local time. - **No external dependencies** — The protocol parser library is fully embedded; nothing to install from PyPI. - **Options flow** — Add or remove optimizer modules at any time without reconfiguring. diff --git a/custom_components/pytap/coordinator.py b/custom_components/pytap/coordinator.py index 5831e3b..116941d 100644 --- a/custom_components/pytap/coordinator.py +++ b/custom_components/pytap/coordinator.py @@ -8,7 +8,8 @@ from __future__ import annotations import asyncio -from datetime import datetime +from datetime import datetime, timedelta +from datetime import time as dt_time import logging import threading import time @@ -16,7 +17,7 @@ from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_HOST, CONF_PORT -from homeassistant.core import HomeAssistant +from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.storage import Store from homeassistant.helpers.update_coordinator import DataUpdateCoordinator from homeassistant.util import dt as dt_util @@ -128,6 +129,9 @@ def __init__(self, hass: HomeAssistant, entry: ConfigEntry) -> None: self._listener_task: asyncio.Task | None = None self._stop_event = threading.Event() + # Midnight reset timer handle + self._midnight_reset_unsub: asyncio.TimerHandle | None = None + # Source handle for cancellation — accessed from both threads self._source: Any = None self._source_lock = threading.Lock() @@ -199,6 +203,7 @@ async def async_start_listener(self) -> None: self._async_listen(), name="pytap_listener", ) + self._schedule_midnight_reset() async def _async_listen(self) -> None: """Async wrapper to run the blocking listener in an executor.""" @@ -207,6 +212,10 @@ async def _async_listen(self) -> None: async def async_stop_listener(self) -> None: """Stop the background listener task.""" self._stop_event.set() + # Cancel midnight reset timer + if self._midnight_reset_unsub is not None: + self._midnight_reset_unsub.cancel() + self._midnight_reset_unsub = None # Flush any pending state save if self._save_task is not None: self._save_task.cancel() @@ -229,6 +238,49 @@ async def async_stop_listener(self) -> None: pass self._listener_task = None + def _schedule_midnight_reset(self) -> None: + """Schedule a callback at the next local midnight to reset daily accumulators.""" + now = dt_util.now() + next_midnight = datetime.combine( + now.date() + timedelta(days=1), dt_time.min, tzinfo=now.tzinfo + ) + delay = (next_midnight - now).total_seconds() + self._midnight_reset_unsub = self.hass.loop.call_later( + delay, self._perform_midnight_reset + ) + _LOGGER.debug( + "Scheduled daily reset in %.0f seconds (at %s)", delay, next_midnight + ) + + @callback + def _perform_midnight_reset(self) -> None: + """Reset all daily accumulators and push updated data to sensors.""" + self._midnight_reset_unsub = None + today = dt_util.now().date().isoformat() + _LOGGER.info("Midnight daily reset — resetting daily accumulators for %s", today) + + data_changed = False + for barcode, acc in self._energy_state.items(): + if acc.daily_reset_date == today: + continue + acc.daily_energy_wh = 0.0 + acc.readings_today = 0 + acc.daily_reset_date = today + + node_data = self.data.get("nodes", {}).get(barcode) + if node_data is not None: + node_data["daily_energy_wh"] = 0.0 + node_data["readings_today"] = 0 + node_data["daily_reset_date"] = today + data_changed = True + + if data_changed: + self._schedule_save() + self.async_set_updated_data(dict(self.data)) + + # Re-schedule for the next midnight + self._schedule_midnight_reset() + def _listen(self) -> None: """Blocking listener loop (runs in executor thread). diff --git a/custom_components/pytap/sensor.py b/custom_components/pytap/sensor.py index ee83739..7e843cb 100644 --- a/custom_components/pytap/sensor.py +++ b/custom_components/pytap/sensor.py @@ -382,7 +382,7 @@ async def async_added_to_hass(self) -> None: node = nodes.get(self._barcode) # Only short-circuit to coordinator data if this sensor has a non-None value. if node is not None: - coordinator_value = node.get(self.entity_description.key) + coordinator_value = node.get(self.entity_description.value_key) if coordinator_value is not None: self._handle_coordinator_update() return diff --git a/dashboards/generate_grafana_dashboard.py b/dashboards/generate_grafana_dashboard.py new file mode 100644 index 0000000..aa2816a --- /dev/null +++ b/dashboards/generate_grafana_dashboard.py @@ -0,0 +1,675 @@ +#!/usr/bin/env python3 +"""Generate Grafana dashboard JSON for PV Production. + +Converts the Home Assistant PV Production dashboard (3 views, 26 panels) +into a Grafana dashboard querying InfluxDB v3 via SQL. +""" + +import json + +# --------------------------------------------------------------------------- +# Panel layout definitions (mirrors physical roof arrangement) +# --------------------------------------------------------------------------- +# Each entry: (name, entity_suffix, orientation, grid_row, grid_col_start) +# orientation: "L" = landscape (w=3, h=3), "P" = portrait (w=2, h=4) + +TOP_ROOF_ROW1 = [ + ("C2", "c2", "L", 0, 10), + ("C3", "c3", "L", 0, 13), + ("D12", "d12", "L", 0, 20), +] + +TOP_ROOF_ROW2 = [ + ("C4", "c4", "P", 1, 8), + ("C10", "c10", "P", 1, 10), + ("C9", "c9", "P", 1, 12), + ("C8", "c8", "P", 1, 14), + ("C7", "c7", "P", 1, 16), + ("D13", "d13", "L", 1, 20), +] + +BOTTOM_ROOF_ROW3 = [ + ("C1", "c1", "P", 3, 7), + ("C6", "c6", "P", 3, 9), + ("D6", "d6", "P", 3, 11), + ("D7", "d7", "P", 3, 13), + ("D8", "d8", "P", 3, 15), + ("D9", "d9", "P", 3, 17), + ("C11", "c11", "P", 3, 19), +] + +BOTTOM_ROOF_ROW4 = [ + ("D11", "d11", "P", 4, 3), + ("D5", "d5", "P", 4, 5), + ("C12", "c12", "P", 4, 7), + ("D4", "d4", "P", 4, 9), + ("D3", "d3", "P", 4, 11), + ("D1", "d1", "P", 4, 13), + ("D2", "d2", "P", 4, 15), + ("C5", "c5", "P", 4, 17), + ("C13", "c13", "P", 4, 19), + ("D10", "d10", "P", 4, 21), +] + +ALL_ROOF = TOP_ROOF_ROW1 + TOP_ROOF_ROW2 + BOTTOM_ROOF_ROW3 + BOTTOM_ROOF_ROW4 + +STRING_C = [ + "c1", + "c2", + "c3", + "c4", + "c5", + "c6", + "c7", + "c8", + "c9", + "c10", + "c11", + "c12", + "c13", +] +STRING_D = [ + "d1", + "d2", + "d3", + "d4", + "d5", + "d6", + "d7", + "d8", + "d9", + "d10", + "d11", + "d12", + "d13", +] + +# Grid row -> y-offset within a section (portrait h=4, landscape h=3) +ROW_Y = {0: 0, 1: 3, 3: 8, 4: 12} + +DS = {"uid": "HA", "type": "influxdb"} + +_next_id = 0 + + +def next_id(): + global _next_id + _next_id += 1 + return _next_id + + +def sql_latest(entity_id: str) -> str: + return ( + f'SELECT value FROM "{entity_id}" ' + f"WHERE $__timeFilter(time) " + f"ORDER BY time DESC LIMIT 1" + ) + + +def sql_series(entity_id: str) -> str: + return ( + f'SELECT time, value FROM "{entity_id}" ' + f"WHERE $__timeFilter(time) " + f"ORDER BY time" + ) + + +# --------------------------------------------------------------------------- +# Panel builders +# --------------------------------------------------------------------------- + + +def stat_panel( + panel_id, + title, + entity_id, + x, + y, + w, + h, + color_scheme="continuous-greens", +): + """Single stat panel showing latest value with colored background.""" + return { + "id": panel_id, + "type": "stat", + "title": title, + "datasource": DS, + "gridPos": {"h": h, "w": w, "x": x, "y": y}, + "targets": [ + { + "datasource": DS, + "rawSql": sql_latest(entity_id), + "refId": "A", + "format": "table", + } + ], + "fieldConfig": { + "defaults": { + "color": {"mode": color_scheme}, + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + {"color": "dark-green", "value": None}, + {"color": "green", "value": 30}, + {"color": "light-green", "value": 70}, + ], + }, + }, + "overrides": [], + }, + "options": { + "colorMode": "background", + "graphMode": "none", + "textMode": "value_and_name", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": False, + }, + "justifyMode": "center", + "orientation": "auto", + }, + } + + +def connectivity_stat_panel(panel_id, title, entity_id, x, y, w, h): + """Stat panel with red-to-green color for connectivity.""" + p = stat_panel(panel_id, title, entity_id, x, y, w, h, "continuous-RdYlGr") + p["fieldConfig"]["defaults"]["thresholds"]["steps"] = [ + {"color": "red", "value": None}, + {"color": "yellow", "value": 40}, + {"color": "green", "value": 70}, + ] + return p + + +def timeseries_panel(panel_id, title, entity_ids_labels, x, y, w, h, unit="kWh"): + """Time series panel with one query per entity.""" + targets = [] + for i, (eid, label) in enumerate(entity_ids_labels): + ref = chr(65 + i) # A, B, C, ... + targets.append( + { + "datasource": DS, + "rawSql": sql_series(eid), + "refId": ref, + "format": "time_series", + } + ) + + overrides = [] + for i, (eid, label) in enumerate(entity_ids_labels): + ref = chr(65 + i) + overrides.append( + { + "matcher": {"id": "byFrameRefID", "options": ref}, + "properties": [ + {"id": "displayName", "value": label}, + ], + } + ) + + return { + "id": panel_id, + "type": "timeseries", + "title": title, + "datasource": DS, + "gridPos": {"h": h, "w": w, "x": x, "y": y}, + "targets": targets, + "fieldConfig": { + "defaults": { + "color": {"mode": "palette-classic"}, + "custom": { + "axisBorderShow": False, + "axisCenteredZero": False, + "axisLabel": "", + "drawStyle": "line", + "fillOpacity": 15, + "gradientMode": "scheme", + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": False, + "stacking": {"group": "A", "mode": "none"}, + "thresholdsStyle": {"mode": "off"}, + }, + "unit": unit, + }, + "overrides": overrides, + }, + "options": { + "legend": { + "calcs": ["lastNotNull", "max", "mean"], + "displayMode": "table", + "placement": "bottom", + "showLegend": True, + }, + "tooltip": {"mode": "multi", "sort": "desc"}, + }, + } + + +def bar_gauge_panel( + panel_id, + title, + entity_ids_labels, + x, + y, + w, + h, + unit="watt", + color_scheme="continuous-greens", +): + """Horizontal bar gauge comparing all panels.""" + targets = [] + overrides = [] + for i, (eid, label) in enumerate(entity_ids_labels): + ref = chr(65 + i) + targets.append( + { + "datasource": DS, + "rawSql": sql_latest(eid), + "refId": ref, + "format": "table", + } + ) + overrides.append( + { + "matcher": {"id": "byFrameRefID", "options": ref}, + "properties": [{"id": "displayName", "value": label}], + } + ) + return { + "id": panel_id, + "type": "bargauge", + "title": title, + "datasource": DS, + "gridPos": {"h": h, "w": w, "x": x, "y": y}, + "targets": targets, + "fieldConfig": { + "defaults": { + "color": {"mode": color_scheme}, + "min": 0, + "unit": unit, + "thresholds": { + "mode": "percentage", + "steps": [ + {"color": "dark-green", "value": None}, + {"color": "green", "value": 50}, + ], + }, + }, + "overrides": overrides, + }, + "options": { + "displayMode": "gradient", + "minVizHeight": 16, + "minVizWidth": 75, + "namePlacement": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": False, + }, + "showUnfilled": True, + "sizing": "auto", + "valueMode": "color", + }, + } + + +def row_panel(panel_id, title, y, collapsed=False, panels=None): + r = { + "id": panel_id, + "type": "row", + "title": title, + "gridPos": {"h": 1, "w": 24, "x": 0, "y": y}, + "collapsed": collapsed, + } + if panels: + r["panels"] = panels + return r + + +# --------------------------------------------------------------------------- +# Build roof layout panels for a given metric +# --------------------------------------------------------------------------- + + +def build_roof_section( + y_offset, metric_suffix, unit, color_scheme="continuous-greens", connectivity=False +): + """Build 26 stat panels arranged as the physical roof layout.""" + panels = [] + for name, suffix, orientation, grid_row, grid_col in ALL_ROOF: + entity_id = f"sensor.tigo_ts4_{suffix}_{metric_suffix}" + w = 3 if orientation == "L" else 2 + h = 3 if orientation == "L" else 4 + x = grid_col + y = y_offset + ROW_Y[grid_row] + + if connectivity: + p = connectivity_stat_panel(next_id(), name, entity_id, x, y, w, h) + else: + p = stat_panel(next_id(), name, entity_id, x, y, w, h, color_scheme) + + if unit: + p["fieldConfig"]["defaults"]["unit"] = unit + panels.append(p) + return panels + + +# --------------------------------------------------------------------------- +# Build full dashboard +# --------------------------------------------------------------------------- + + +def build_dashboard(): + panels = [] + y = 0 + + # ── Section 0: System Overview ──────────────────────────────────────── + panels.append(row_panel(next_id(), "⚡ System Overview", y)) + y += 1 + + # Total Power + panels.append( + { + "id": next_id(), + "type": "stat", + "title": "Total System Power", + "datasource": DS, + "gridPos": {"h": 5, "w": 8, "x": 0, "y": y}, + "targets": [ + { + "datasource": DS, + "rawSql": sql_latest("sensor.tigo_max_power"), + "refId": "A", + "format": "table", + } + ], + "fieldConfig": { + "defaults": { + "color": {"mode": "thresholds"}, + "unit": "watt", + "thresholds": { + "mode": "absolute", + "steps": [ + {"color": "dark-red", "value": None}, + {"color": "orange", "value": 50}, + {"color": "green", "value": 200}, + {"color": "dark-green", "value": 400}, + ], + }, + }, + "overrides": [], + }, + "options": { + "colorMode": "background_solid", + "graphMode": "area", + "textMode": "value", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": False, + }, + }, + } + ) + + # Total Daily Energy + panels.append( + { + "id": next_id(), + "type": "stat", + "title": "Max Panel Daily Energy", + "datasource": DS, + "gridPos": {"h": 5, "w": 8, "x": 8, "y": y}, + "targets": [ + { + "datasource": DS, + "rawSql": sql_latest("sensor.tigo_max_daily_energy"), + "refId": "A", + "format": "table", + } + ], + "fieldConfig": { + "defaults": { + "color": {"mode": "thresholds"}, + "unit": "kWh", + "thresholds": { + "mode": "absolute", + "steps": [ + {"color": "dark-red", "value": None}, + {"color": "orange", "value": 0.2}, + {"color": "green", "value": 0.5}, + {"color": "dark-green", "value": 1.0}, + ], + }, + }, + "overrides": [], + }, + "options": { + "colorMode": "background_solid", + "graphMode": "area", + "textMode": "value", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": False, + }, + }, + } + ) + + # Max Readings Today + panels.append( + { + "id": next_id(), + "type": "stat", + "title": "Max Readings Today", + "datasource": DS, + "gridPos": {"h": 5, "w": 8, "x": 16, "y": y}, + "targets": [ + { + "datasource": DS, + "rawSql": sql_latest("sensor.tigo_max_readings_today"), + "refId": "A", + "format": "table", + } + ], + "fieldConfig": { + "defaults": { + "color": {"mode": "thresholds"}, + "thresholds": { + "mode": "absolute", + "steps": [ + {"color": "red", "value": None}, + {"color": "yellow", "value": 10}, + {"color": "green", "value": 50}, + ], + }, + }, + "overrides": [], + }, + "options": { + "colorMode": "background_solid", + "graphMode": "area", + "textMode": "value", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": False, + }, + }, + } + ) + y += 5 + + # ── Section 1: Daily Energy — Roof Layout ───────────────────────────── + panels.append(row_panel(next_id(), "☀️ Daily Energy — Roof Layout", y)) + y += 1 + roof_y = y + energy_panels = build_roof_section(roof_y, "daily_energy", "kWh") + panels.extend(energy_panels) + y = roof_y + 16 # 4 grid rows: 0+3=3, 3+4=7..12+4=16 + + # ── Section 2: Daily Energy — Trends ────────────────────────────────── + panels.append(row_panel(next_id(), "📈 Daily Energy — Trends", y)) + y += 1 + + c_energy = [(f"sensor.tigo_ts4_{s}_daily_energy", s.upper()) for s in STRING_C] + d_energy = [(f"sensor.tigo_ts4_{s}_daily_energy", s.upper()) for s in STRING_D] + panels.append( + timeseries_panel( + next_id(), "String C — Daily Energy", c_energy, 0, y, 12, 10, "kWh" + ) + ) + panels.append( + timeseries_panel( + next_id(), "String D — Daily Energy", d_energy, 12, y, 12, 10, "kWh" + ) + ) + y += 10 + + # ── Section 3: Live Power — Roof Layout ─────────────────────────────── + panels.append(row_panel(next_id(), "⚡ Live Power — Roof Layout", y)) + y += 1 + roof_y = y + power_panels = build_roof_section(roof_y, "power", "watt") + panels.extend(power_panels) + y = roof_y + 16 + + # ── Section 4: Live Power — Trends & Comparison ─────────────────────── + panels.append(row_panel(next_id(), "📈 Live Power — Trends", y)) + y += 1 + + c_power = [(f"sensor.tigo_ts4_{s}_power", s.upper()) for s in STRING_C] + d_power = [(f"sensor.tigo_ts4_{s}_power", s.upper()) for s in STRING_D] + panels.append( + timeseries_panel(next_id(), "String C — Power", c_power, 0, y, 12, 10, "watt") + ) + panels.append( + timeseries_panel(next_id(), "String D — Power", d_power, 12, y, 12, 10, "watt") + ) + y += 10 + + # Bar gauges for quick power comparison + panels.append( + bar_gauge_panel( + next_id(), "String C — Current Power", c_power, 0, y, 12, 10, "watt" + ) + ) + panels.append( + bar_gauge_panel( + next_id(), "String D — Current Power", d_power, 12, y, 12, 10, "watt" + ) + ) + y += 10 + + # ── Section 5: Connectivity — Roof Layout ───────────────────────────── + panels.append(row_panel(next_id(), "📡 Panel Connectivity — Roof Layout", y)) + y += 1 + roof_y = y + conn_panels = build_roof_section(roof_y, "readings_today", None, connectivity=True) + panels.extend(conn_panels) + y = roof_y + 16 + + # ── Section 6: Connectivity — Trends ────────────────────────────────── + panels.append(row_panel(next_id(), "📈 Connectivity — Trends", y)) + y += 1 + + c_conn = [(f"sensor.tigo_ts4_{s}_readings_today", s.upper()) for s in STRING_C] + d_conn = [(f"sensor.tigo_ts4_{s}_readings_today", s.upper()) for s in STRING_D] + panels.append( + timeseries_panel( + next_id(), "String C — Readings Today", c_conn, 0, y, 12, 10, "short" + ) + ) + panels.append( + timeseries_panel( + next_id(), "String D — Readings Today", d_conn, 12, y, 12, 10, "short" + ) + ) + y += 10 + + # ── Assemble dashboard ──────────────────────────────────────────────── + dashboard = { + "__inputs": [ + { + "name": "DS_INFLUXDB", + "label": "HA", + "description": "InfluxDB v3 datasource named HA (SQL query language)", + "type": "datasource", + "pluginId": "influxdb", + "pluginName": "InfluxDB", + } + ], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "10.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": ""}, + {"type": "panel", "id": "bargauge", "name": "Bar gauge", "version": ""}, + ], + "id": None, + "uid": "pv-production", + "title": "PV Production", + "description": ( + "Solar panel monitoring dashboard — 26 Tigo TS4 panels across " + "String C (13) and String D (13). Shows daily energy, live power, " + "and connectivity status arranged in physical roof layout." + ), + "tags": ["solar", "pv", "tigo", "energy"], + "style": "dark", + "timezone": "browser", + "editable": True, + "fiscalYearStartMonth": 0, + "graphTooltip": 1, # shared crosshair + "refresh": "30s", + "schemaVersion": 39, + "version": 1, + "time": {"from": "now-24h", "to": "now"}, + "timepicker": { + "refresh_intervals": ["5s", "10s", "30s", "1m", "5m"], + }, + "templating": {"list": []}, + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": {"type": "grafana", "uid": "-- Grafana --"}, + "enable": True, + "hide": True, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard", + } + ] + }, + "panels": panels, + } + return dashboard + + +if __name__ == "__main__": + dashboard = build_dashboard() + output_path = "/workspaces/pytap/dashboards/pv_production_grafana.json" + with open(output_path, "w") as f: + json.dump(dashboard, f, indent=2) + print(f"Dashboard written to {output_path}") + print(f"Total panels: {len(dashboard['panels'])}") diff --git a/dashboards/grafana/generate_grafana_dashboard.py b/dashboards/grafana/generate_grafana_dashboard.py new file mode 100644 index 0000000..107bd44 --- /dev/null +++ b/dashboards/grafana/generate_grafana_dashboard.py @@ -0,0 +1,736 @@ +#!/usr/bin/env python3 +"""Generate Grafana dashboard JSON for PV Production. + +Converts the Home Assistant PV Production dashboard (3 views, 26 panels) +into a Grafana dashboard querying InfluxDB v3 via SQL. +""" + +import json + +# --------------------------------------------------------------------------- +# Panel layout definitions (mirrors physical roof arrangement) +# --------------------------------------------------------------------------- +# Each entry: (name, entity_suffix, orientation, grid_row, grid_col_start) +# orientation: "L" = landscape (w=3, h=3), "P" = portrait (w=2, h=4) + +TOP_ROOF_ROW1 = [ + ("C2", "c2", "L", 0, 10), + ("C3", "c3", "L", 0, 13), + ("D12", "d12", "L", 0, 20), +] + +TOP_ROOF_ROW2 = [ + ("C4", "c4", "P", 1, 8), + ("C10", "c10", "P", 1, 10), + ("C9", "c9", "P", 1, 12), + ("C8", "c8", "P", 1, 14), + ("C7", "c7", "P", 1, 16), + ("D13", "d13", "L", 1, 20), +] + +BOTTOM_ROOF_ROW3 = [ + ("C1", "c1", "P", 3, 7), + ("C6", "c6", "P", 3, 9), + ("D6", "d6", "P", 3, 11), + ("D7", "d7", "P", 3, 13), + ("D8", "d8", "P", 3, 15), + ("D9", "d9", "P", 3, 17), + ("C11", "c11", "P", 3, 19), +] + +BOTTOM_ROOF_ROW4 = [ + ("D11", "d11", "P", 4, 3), + ("D5", "d5", "P", 4, 5), + ("C12", "c12", "P", 4, 7), + ("D4", "d4", "P", 4, 9), + ("D3", "d3", "P", 4, 11), + ("D1", "d1", "P", 4, 13), + ("D2", "d2", "P", 4, 15), + ("C5", "c5", "P", 4, 17), + ("C13", "c13", "P", 4, 19), + ("D10", "d10", "P", 4, 21), +] + +ALL_ROOF = TOP_ROOF_ROW1 + TOP_ROOF_ROW2 + BOTTOM_ROOF_ROW3 + BOTTOM_ROOF_ROW4 + +STRING_C = [ + "c1", + "c2", + "c3", + "c4", + "c5", + "c6", + "c7", + "c8", + "c9", + "c10", + "c11", + "c12", + "c13", +] +STRING_D = [ + "d1", + "d2", + "d3", + "d4", + "d5", + "d6", + "d7", + "d8", + "d9", + "d10", + "d11", + "d12", + "d13", +] + +# Grid row -> y-offset within a section (portrait h=4, landscape h=3) +ROW_Y = {0: 0, 1: 3, 3: 8, 4: 12} + +DS = {"uid": "HA", "type": "influxdb"} + +# InfluxDB v3: sensors WITH a unit_of_measurement share a table named by that unit. +# Sensors WITHOUT a unit get their own table named "sensor." (with dots). +INFLUX_UNIT_TABLE = { + "daily_energy": "Wh", # UnitOfEnergy.WATT_HOUR + "power": "W", # UnitOfPower.WATT + # Template sensors (tigo.yaml) + "tigo_max_daily_energy": "kWh", + "tigo_max_power": "W", +} + +# Suffixes whose sensors have NO unit — each gets its own table +UNITLESS_SUFFIXES = {"readings_today", "tigo_max_readings_today"} + + +def _entity_id_bare(entity_id: str) -> str: + """Strip 'sensor.' domain prefix to get the bare entity_id.""" + return entity_id.removeprefix("sensor.") + + +def _is_unitless(entity_id: str) -> bool: + """Check if this entity has no unit_of_measurement (own-table mode).""" + bare = _entity_id_bare(entity_id) + if bare in UNITLESS_SUFFIXES: + return True + for suffix in UNITLESS_SUFFIXES: + if bare.endswith(f"_{suffix}"): + return True + return False + + +def _table_for_entity(entity_id: str) -> str: + """Resolve the InfluxDB table for a given HA entity_id.""" + bare = _entity_id_bare(entity_id) + # Check template sensors first (exact match on bare id) + if bare in INFLUX_UNIT_TABLE: + return INFLUX_UNIT_TABLE[bare] + # Per-panel sensors: match on the metric suffix + for suffix, table in INFLUX_UNIT_TABLE.items(): + if bare.endswith(f"_{suffix}"): + return table + return bare # fallback + + +_next_id = 0 + + +def next_id(): + global _next_id + _next_id += 1 + return _next_id + + +def sql_latest(entity_id: str) -> str: + if _is_unitless(entity_id): + # Unitless sensor: own table — use narrow lookback to avoid parquet file limit + return ( + f'SELECT value FROM "{entity_id}" ' + f"WHERE time >= now() - interval '6 hours' " + f"ORDER BY time DESC LIMIT 1" + ) + table = _table_for_entity(entity_id) + bare = _entity_id_bare(entity_id) + return ( + f'SELECT value FROM "{table}" ' + f"WHERE \"entity_id\" = '{bare}' AND $__timeFilter(time) " + f"ORDER BY time DESC LIMIT 1" + ) + + +def sql_series(entity_id: str) -> str: + if _is_unitless(entity_id): + # Unitless sensor: own table — use narrow lookback to avoid parquet file limit + return ( + f'SELECT time, value FROM "{entity_id}" ' + f"WHERE time >= now() - interval '24 hours' " + f"ORDER BY time" + ) + table = _table_for_entity(entity_id) + bare = _entity_id_bare(entity_id) + return ( + f'SELECT time, value FROM "{table}" ' + f"WHERE \"entity_id\" = '{bare}' AND $__timeFilter(time) " + f"ORDER BY time" + ) + + +# --------------------------------------------------------------------------- +# Panel builders +# --------------------------------------------------------------------------- + + +def stat_panel( + panel_id, + title, + entity_id, + x, + y, + w, + h, + color_scheme="continuous-greens", +): + """Single stat panel showing latest value with colored background.""" + return { + "id": panel_id, + "type": "stat", + "title": title, + "datasource": DS, + "gridPos": {"h": h, "w": w, "x": x, "y": y}, + "targets": [ + { + "datasource": DS, + "rawSql": sql_latest(entity_id), + "refId": "A", + "format": "table", + } + ], + "fieldConfig": { + "defaults": { + "color": {"mode": color_scheme}, + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + {"color": "dark-green", "value": None}, + {"color": "green", "value": 30}, + {"color": "light-green", "value": 70}, + ], + }, + }, + "overrides": [], + }, + "options": { + "colorMode": "background", + "graphMode": "none", + "textMode": "value_and_name", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": False, + }, + "justifyMode": "center", + "orientation": "auto", + }, + } + + +def connectivity_stat_panel(panel_id, title, entity_id, x, y, w, h): + """Stat panel with red-to-green color for connectivity.""" + p = stat_panel(panel_id, title, entity_id, x, y, w, h, "continuous-RdYlGr") + p["fieldConfig"]["defaults"]["thresholds"]["steps"] = [ + {"color": "red", "value": None}, + {"color": "yellow", "value": 40}, + {"color": "green", "value": 70}, + ] + return p + + +def timeseries_panel(panel_id, title, entity_ids_labels, x, y, w, h, unit="kWh"): + """Time series panel with one query per entity.""" + targets = [] + for i, (eid, label) in enumerate(entity_ids_labels): + ref = chr(65 + i) # A, B, C, ... + targets.append( + { + "datasource": DS, + "rawSql": sql_series(eid), + "refId": ref, + "format": "time_series", + } + ) + + overrides = [] + for i, (eid, label) in enumerate(entity_ids_labels): + ref = chr(65 + i) + overrides.append( + { + "matcher": {"id": "byFrameRefID", "options": ref}, + "properties": [ + {"id": "displayName", "value": label}, + ], + } + ) + + return { + "id": panel_id, + "type": "timeseries", + "title": title, + "datasource": DS, + "gridPos": {"h": h, "w": w, "x": x, "y": y}, + "targets": targets, + "fieldConfig": { + "defaults": { + "color": {"mode": "palette-classic"}, + "custom": { + "axisBorderShow": False, + "axisCenteredZero": False, + "axisLabel": "", + "drawStyle": "line", + "fillOpacity": 15, + "gradientMode": "scheme", + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "showPoints": "auto", + "spanNulls": False, + "stacking": {"group": "A", "mode": "none"}, + "thresholdsStyle": {"mode": "off"}, + }, + "unit": unit, + }, + "overrides": overrides, + }, + "options": { + "legend": { + "calcs": ["lastNotNull", "max", "mean"], + "displayMode": "table", + "placement": "bottom", + "showLegend": True, + }, + "tooltip": {"mode": "multi", "sort": "desc"}, + }, + } + + +def bar_gauge_panel( + panel_id, + title, + entity_ids_labels, + x, + y, + w, + h, + unit="watt", + color_scheme="continuous-greens", +): + """Horizontal bar gauge comparing all panels.""" + targets = [] + overrides = [] + for i, (eid, label) in enumerate(entity_ids_labels): + ref = chr(65 + i) + targets.append( + { + "datasource": DS, + "rawSql": sql_latest(eid), + "refId": ref, + "format": "table", + } + ) + overrides.append( + { + "matcher": {"id": "byFrameRefID", "options": ref}, + "properties": [{"id": "displayName", "value": label}], + } + ) + return { + "id": panel_id, + "type": "bargauge", + "title": title, + "datasource": DS, + "gridPos": {"h": h, "w": w, "x": x, "y": y}, + "targets": targets, + "fieldConfig": { + "defaults": { + "color": {"mode": color_scheme}, + "min": 0, + "unit": unit, + "thresholds": { + "mode": "percentage", + "steps": [ + {"color": "dark-green", "value": None}, + {"color": "green", "value": 50}, + ], + }, + }, + "overrides": overrides, + }, + "options": { + "displayMode": "gradient", + "minVizHeight": 16, + "minVizWidth": 75, + "namePlacement": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": False, + }, + "showUnfilled": True, + "sizing": "auto", + "valueMode": "color", + }, + } + + +def row_panel(panel_id, title, y, collapsed=False, panels=None): + r = { + "id": panel_id, + "type": "row", + "title": title, + "gridPos": {"h": 1, "w": 24, "x": 0, "y": y}, + "collapsed": collapsed, + } + if panels: + r["panels"] = panels + return r + + +# --------------------------------------------------------------------------- +# Build roof layout panels for a given metric +# --------------------------------------------------------------------------- + + +def build_roof_section( + y_offset, metric_suffix, unit, color_scheme="continuous-greens", connectivity=False +): + """Build 26 stat panels arranged as the physical roof layout.""" + panels = [] + for name, suffix, orientation, grid_row, grid_col in ALL_ROOF: + entity_id = f"sensor.tigo_ts4_{suffix}_{metric_suffix}" + w = 3 if orientation == "L" else 2 + h = 3 if orientation == "L" else 4 + x = grid_col + y = y_offset + ROW_Y[grid_row] + + if connectivity: + p = connectivity_stat_panel(next_id(), name, entity_id, x, y, w, h) + else: + p = stat_panel(next_id(), name, entity_id, x, y, w, h, color_scheme) + + if unit: + p["fieldConfig"]["defaults"]["unit"] = unit + panels.append(p) + return panels + + +# --------------------------------------------------------------------------- +# Build full dashboard +# --------------------------------------------------------------------------- + + +def build_dashboard(): + panels = [] + y = 0 + + # ── Section 0: System Overview ──────────────────────────────────────── + panels.append(row_panel(next_id(), "⚡ System Overview", y)) + y += 1 + + # Total Power + panels.append( + { + "id": next_id(), + "type": "stat", + "title": "Total System Power", + "datasource": DS, + "gridPos": {"h": 5, "w": 8, "x": 0, "y": y}, + "targets": [ + { + "datasource": DS, + "rawSql": sql_latest("sensor.tigo_max_power"), + "refId": "A", + "format": "table", + } + ], + "fieldConfig": { + "defaults": { + "color": {"mode": "thresholds"}, + "unit": "watt", + "thresholds": { + "mode": "absolute", + "steps": [ + {"color": "dark-red", "value": None}, + {"color": "orange", "value": 50}, + {"color": "green", "value": 200}, + {"color": "dark-green", "value": 400}, + ], + }, + }, + "overrides": [], + }, + "options": { + "colorMode": "background_solid", + "graphMode": "area", + "textMode": "value", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": False, + }, + }, + } + ) + + # Total Daily Energy + panels.append( + { + "id": next_id(), + "type": "stat", + "title": "Max Panel Daily Energy", + "datasource": DS, + "gridPos": {"h": 5, "w": 8, "x": 8, "y": y}, + "targets": [ + { + "datasource": DS, + "rawSql": sql_latest("sensor.tigo_max_daily_energy"), + "refId": "A", + "format": "table", + } + ], + "fieldConfig": { + "defaults": { + "color": {"mode": "thresholds"}, + "unit": "kWh", + "thresholds": { + "mode": "absolute", + "steps": [ + {"color": "dark-red", "value": None}, + {"color": "orange", "value": 0.2}, + {"color": "green", "value": 0.5}, + {"color": "dark-green", "value": 1.0}, + ], + }, + }, + "overrides": [], + }, + "options": { + "colorMode": "background_solid", + "graphMode": "area", + "textMode": "value", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": False, + }, + }, + } + ) + + # Max Readings Today + panels.append( + { + "id": next_id(), + "type": "stat", + "title": "Max Readings Today", + "datasource": DS, + "gridPos": {"h": 5, "w": 8, "x": 16, "y": y}, + "targets": [ + { + "datasource": DS, + "rawSql": sql_latest("sensor.tigo_max_readings_today"), + "refId": "A", + "format": "table", + } + ], + "fieldConfig": { + "defaults": { + "color": {"mode": "thresholds"}, + "thresholds": { + "mode": "absolute", + "steps": [ + {"color": "red", "value": None}, + {"color": "yellow", "value": 10}, + {"color": "green", "value": 50}, + ], + }, + }, + "overrides": [], + }, + "options": { + "colorMode": "background_solid", + "graphMode": "area", + "textMode": "value", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": False, + }, + }, + } + ) + y += 5 + + # ── Section 1: Daily Energy — Roof Layout ───────────────────────────── + panels.append(row_panel(next_id(), "☀️ Daily Energy — Roof Layout", y)) + y += 1 + roof_y = y + energy_panels = build_roof_section(roof_y, "daily_energy", "kWh") + panels.extend(energy_panels) + y = roof_y + 16 # 4 grid rows: 0+3=3, 3+4=7..12+4=16 + + # ── Section 2: Daily Energy — Trends ────────────────────────────────── + panels.append(row_panel(next_id(), "📈 Daily Energy — Trends", y)) + y += 1 + + c_energy = [(f"sensor.tigo_ts4_{s}_daily_energy", s.upper()) for s in STRING_C] + d_energy = [(f"sensor.tigo_ts4_{s}_daily_energy", s.upper()) for s in STRING_D] + panels.append( + timeseries_panel( + next_id(), "String C — Daily Energy", c_energy, 0, y, 12, 10, "kWh" + ) + ) + panels.append( + timeseries_panel( + next_id(), "String D — Daily Energy", d_energy, 12, y, 12, 10, "kWh" + ) + ) + y += 10 + + # ── Section 3: Live Power — Roof Layout ─────────────────────────────── + panels.append(row_panel(next_id(), "⚡ Live Power — Roof Layout", y)) + y += 1 + roof_y = y + power_panels = build_roof_section(roof_y, "power", "watt") + panels.extend(power_panels) + y = roof_y + 16 + + # ── Section 4: Live Power — Trends & Comparison ─────────────────────── + panels.append(row_panel(next_id(), "📈 Live Power — Trends", y)) + y += 1 + + c_power = [(f"sensor.tigo_ts4_{s}_power", s.upper()) for s in STRING_C] + d_power = [(f"sensor.tigo_ts4_{s}_power", s.upper()) for s in STRING_D] + panels.append( + timeseries_panel(next_id(), "String C — Power", c_power, 0, y, 12, 10, "watt") + ) + panels.append( + timeseries_panel(next_id(), "String D — Power", d_power, 12, y, 12, 10, "watt") + ) + y += 10 + + # Bar gauges for quick power comparison + panels.append( + bar_gauge_panel( + next_id(), "String C — Current Power", c_power, 0, y, 12, 10, "watt" + ) + ) + panels.append( + bar_gauge_panel( + next_id(), "String D — Current Power", d_power, 12, y, 12, 10, "watt" + ) + ) + y += 10 + + # ── Section 5: Connectivity — Roof Layout ───────────────────────────── + panels.append(row_panel(next_id(), "📡 Panel Connectivity — Roof Layout", y)) + y += 1 + roof_y = y + conn_panels = build_roof_section(roof_y, "readings_today", None, connectivity=True) + panels.extend(conn_panels) + y = roof_y + 16 + + # ── Section 6: Connectivity — Trends ────────────────────────────────── + panels.append(row_panel(next_id(), "📈 Connectivity — Trends", y)) + y += 1 + + c_conn = [(f"sensor.tigo_ts4_{s}_readings_today", s.upper()) for s in STRING_C] + d_conn = [(f"sensor.tigo_ts4_{s}_readings_today", s.upper()) for s in STRING_D] + panels.append( + timeseries_panel( + next_id(), "String C — Readings Today", c_conn, 0, y, 12, 10, "short" + ) + ) + panels.append( + timeseries_panel( + next_id(), "String D — Readings Today", d_conn, 12, y, 12, 10, "short" + ) + ) + y += 10 + + # ── Assemble dashboard ──────────────────────────────────────────────── + dashboard = { + "__inputs": [ + { + "name": "DS_INFLUXDB", + "label": "HA", + "description": "InfluxDB v3 datasource named HA (SQL query language)", + "type": "datasource", + "pluginId": "influxdb", + "pluginName": "InfluxDB", + } + ], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "10.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": ""}, + {"type": "panel", "id": "bargauge", "name": "Bar gauge", "version": ""}, + ], + "id": None, + "uid": "pv-production", + "title": "PV Production", + "description": ( + "Solar panel monitoring dashboard — 26 Tigo TS4 panels across " + "String C (13) and String D (13). Shows daily energy, live power, " + "and connectivity status arranged in physical roof layout." + ), + "tags": ["solar", "pv", "tigo", "energy"], + "style": "dark", + "timezone": "browser", + "editable": True, + "fiscalYearStartMonth": 0, + "graphTooltip": 1, # shared crosshair + "refresh": "30s", + "schemaVersion": 39, + "version": 1, + "time": {"from": "now-24h", "to": "now"}, + "timepicker": { + "refresh_intervals": ["5s", "10s", "30s", "1m", "5m"], + }, + "templating": {"list": []}, + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": {"type": "grafana", "uid": "-- Grafana --"}, + "enable": True, + "hide": True, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard", + } + ] + }, + "panels": panels, + } + return dashboard + + +if __name__ == "__main__": + dashboard = build_dashboard() + output_path = "/workspaces/pytap/dashboards/grafana/pv_production_grafana.json" + with open(output_path, "w") as f: + json.dump(dashboard, f, indent=2) + print(f"Dashboard written to {output_path}") + print(f"Total panels: {len(dashboard['panels'])}") diff --git a/dashboards/grafana/pv_production_grafana.json b/dashboards/grafana/pv_production_grafana.json new file mode 100644 index 0000000..5aae596 --- /dev/null +++ b/dashboards/grafana/pv_production_grafana.json @@ -0,0 +1,10178 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "Solar panel monitoring dashboard \u2014 26 Tigo TS4 panels across String C (13) and String D (13). Shows daily energy, live power, and connectivity status arranged in physical roof layout.", + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 1, + "id": 0, + "links": [], + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 1, + "panels": [], + "title": "\u26a1 Daily Energy", + "type": "row" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 2, + "x": 0, + "y": 1 + }, + "id": 108, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 2, + "y": 1 + }, + "id": 102, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 5, + "y": 1 + }, + "id": 99, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "unit": "kWh", + "max": 2 + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 8, + "y": 1 + }, + "id": 6, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_c2_daily_energy' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C2", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "unit": "kWh", + "max": 2 + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 11, + "y": 1 + }, + "id": 7, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_c3_daily_energy' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C3", + "type": "stat" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 14, + "y": 1 + }, + "id": 100, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "unit": "kWh", + "max": 2 + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 18, + "y": 1 + }, + "id": 8, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_d12_daily_energy' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D12", + "type": "stat" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 0, + "y": 4 + }, + "id": 106, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 2, + "y": 4 + }, + "id": 107, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "unit": "kWh", + "max": 2 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 6, + "y": 4 + }, + "id": 9, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_c4_daily_energy' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C4", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "unit": "kWh", + "max": 2 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 8, + "y": 4 + }, + "id": 10, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_c10_daily_energy' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C10", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "unit": "kWh", + "max": 2 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 10, + "y": 4 + }, + "id": 11, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_c9_daily_energy' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C9", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "unit": "kWh", + "max": 2 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 12, + "y": 4 + }, + "id": 12, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_c8_daily_energy' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C8", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "unit": "kWh", + "max": 2 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 14, + "y": 4 + }, + "id": 13, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_c7_daily_energy' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C7", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "unit": "kWh", + "max": 2 + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 18, + "y": 4 + }, + "id": 14, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_d13_daily_energy' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D13", + "type": "stat" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 19, + "y": 7 + }, + "id": 112, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 1, + "y": 8 + }, + "id": 109, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 6, + "y": 8 + }, + "id": 101, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 9, + "y": 8 + }, + "id": 103, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 12, + "y": 8 + }, + "id": 104, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 15, + "y": 8 + }, + "id": 105, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 0, + "y": 11 + }, + "id": 111, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 2, + "y": 11 + }, + "id": 110, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "unit": "kWh", + "max": 2 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 5, + "y": 11 + }, + "id": 15, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_c1_daily_energy' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C1", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "unit": "kWh", + "max": 2 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 7, + "y": 11 + }, + "id": 16, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_c6_daily_energy' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C6", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "unit": "kWh", + "max": 2 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 9, + "y": 11 + }, + "id": 17, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_d6_daily_energy' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D6", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "unit": "kWh", + "max": 2 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 11, + "y": 11 + }, + "id": 18, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_d7_daily_energy' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D7", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "unit": "kWh", + "max": 2 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 13, + "y": 11 + }, + "id": 19, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_d8_daily_energy' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D8", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "unit": "kWh", + "max": 2 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 15, + "y": 11 + }, + "id": 20, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_d9_daily_energy' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D9", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "unit": "kWh", + "max": 2 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 17, + "y": 11 + }, + "id": 21, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_c11_daily_energy' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C11", + "type": "stat" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 19, + "y": 11 + }, + "id": 113, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "unit": "kWh", + "max": 2 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 0, + "y": 15 + }, + "id": 22, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_d11_daily_energy' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D11", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "unit": "kWh", + "max": 2 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 2, + "y": 15 + }, + "id": 23, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_d5_daily_energy' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D5", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "unit": "kWh", + "max": 2 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 5, + "y": 15 + }, + "id": 24, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_c12_daily_energy' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C12", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "unit": "kWh", + "max": 2 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 7, + "y": 15 + }, + "id": 25, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_d4_daily_energy' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D4", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "unit": "kWh", + "max": 2 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 9, + "y": 15 + }, + "id": 26, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_d3_daily_energy' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D3", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "unit": "kWh", + "max": 2 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 11, + "y": 15 + }, + "id": 27, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_d1_daily_energy' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D1", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "unit": "kWh", + "max": 2 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 13, + "y": 15 + }, + "id": 28, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_d2_daily_energy' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D2", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "unit": "kWh", + "max": 2 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 15, + "y": 15 + }, + "id": 29, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_c5_daily_energy' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C5", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "unit": "kWh", + "max": 2 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 17, + "y": 15 + }, + "id": 30, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_c13_daily_energy' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C13", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "unit": "kWh", + "max": 2 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 19, + "y": 15 + }, + "id": 31, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_d10_daily_energy' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D10", + "type": "stat" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 19 + }, + "id": 32, + "panels": [], + "title": "\ud83d\udcc8 Daily Energy \u2014 Trends", + "type": "row" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 15, + "gradientMode": "scheme", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "kWh" + }, + "overrides": [ + { + "matcher": { + "id": "byFrameRefID", + "options": "A" + }, + "properties": [ + { + "id": "displayName", + "value": "C1" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "B" + }, + "properties": [ + { + "id": "displayName", + "value": "C2" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "C" + }, + "properties": [ + { + "id": "displayName", + "value": "C3" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "D" + }, + "properties": [ + { + "id": "displayName", + "value": "C4" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "E" + }, + "properties": [ + { + "id": "displayName", + "value": "C5" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "F" + }, + "properties": [ + { + "id": "displayName", + "value": "C6" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "G" + }, + "properties": [ + { + "id": "displayName", + "value": "C7" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "H" + }, + "properties": [ + { + "id": "displayName", + "value": "C8" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "I" + }, + "properties": [ + { + "id": "displayName", + "value": "C9" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "J" + }, + "properties": [ + { + "id": "displayName", + "value": "C10" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "K" + }, + "properties": [ + { + "id": "displayName", + "value": "C11" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "L" + }, + "properties": [ + { + "id": "displayName", + "value": "C12" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "M" + }, + "properties": [ + { + "id": "displayName", + "value": "C13" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 20 + }, + "id": 33, + "options": { + "legend": { + "calcs": [ + "lastNotNull", + "max", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_c1_daily_energy' AND $__timeFilter(time) ORDER BY time", + "refId": "A" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_c2_daily_energy' AND $__timeFilter(time) ORDER BY time", + "refId": "B" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_c3_daily_energy' AND $__timeFilter(time) ORDER BY time", + "refId": "C" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_c4_daily_energy' AND $__timeFilter(time) ORDER BY time", + "refId": "D" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_c5_daily_energy' AND $__timeFilter(time) ORDER BY time", + "refId": "E" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_c6_daily_energy' AND $__timeFilter(time) ORDER BY time", + "refId": "F" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_c7_daily_energy' AND $__timeFilter(time) ORDER BY time", + "refId": "G" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_c8_daily_energy' AND $__timeFilter(time) ORDER BY time", + "refId": "H" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_c9_daily_energy' AND $__timeFilter(time) ORDER BY time", + "refId": "I" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_c10_daily_energy' AND $__timeFilter(time) ORDER BY time", + "refId": "J" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_c11_daily_energy' AND $__timeFilter(time) ORDER BY time", + "refId": "K" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_c12_daily_energy' AND $__timeFilter(time) ORDER BY time", + "refId": "L" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_c13_daily_energy' AND $__timeFilter(time) ORDER BY time", + "refId": "M" + } + ], + "title": "String C \u2014 Daily Energy", + "type": "timeseries" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 15, + "gradientMode": "scheme", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "kWh" + }, + "overrides": [ + { + "matcher": { + "id": "byFrameRefID", + "options": "A" + }, + "properties": [ + { + "id": "displayName", + "value": "D1" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "B" + }, + "properties": [ + { + "id": "displayName", + "value": "D2" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "C" + }, + "properties": [ + { + "id": "displayName", + "value": "D3" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "D" + }, + "properties": [ + { + "id": "displayName", + "value": "D4" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "E" + }, + "properties": [ + { + "id": "displayName", + "value": "D5" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "F" + }, + "properties": [ + { + "id": "displayName", + "value": "D6" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "G" + }, + "properties": [ + { + "id": "displayName", + "value": "D7" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "H" + }, + "properties": [ + { + "id": "displayName", + "value": "D8" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "I" + }, + "properties": [ + { + "id": "displayName", + "value": "D9" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "J" + }, + "properties": [ + { + "id": "displayName", + "value": "D10" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "K" + }, + "properties": [ + { + "id": "displayName", + "value": "D11" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "L" + }, + "properties": [ + { + "id": "displayName", + "value": "D12" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "M" + }, + "properties": [ + { + "id": "displayName", + "value": "D13" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 20 + }, + "id": 34, + "options": { + "legend": { + "calcs": [ + "lastNotNull", + "max", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_d1_daily_energy' AND $__timeFilter(time) ORDER BY time", + "refId": "A" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_d2_daily_energy' AND $__timeFilter(time) ORDER BY time", + "refId": "B" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_d3_daily_energy' AND $__timeFilter(time) ORDER BY time", + "refId": "C" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_d4_daily_energy' AND $__timeFilter(time) ORDER BY time", + "refId": "D" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_d5_daily_energy' AND $__timeFilter(time) ORDER BY time", + "refId": "E" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_d6_daily_energy' AND $__timeFilter(time) ORDER BY time", + "refId": "F" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_d7_daily_energy' AND $__timeFilter(time) ORDER BY time", + "refId": "G" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_d8_daily_energy' AND $__timeFilter(time) ORDER BY time", + "refId": "H" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_d9_daily_energy' AND $__timeFilter(time) ORDER BY time", + "refId": "I" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_d10_daily_energy' AND $__timeFilter(time) ORDER BY time", + "refId": "J" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_d11_daily_energy' AND $__timeFilter(time) ORDER BY time", + "refId": "K" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_d12_daily_energy' AND $__timeFilter(time) ORDER BY time", + "refId": "L" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"Wh\" WHERE \"entity_id\" = 'tigo_ts4_d13_daily_energy' AND $__timeFilter(time) ORDER BY time", + "refId": "M" + } + ], + "title": "String D \u2014 Daily Energy", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 30 + }, + "id": 35, + "panels": [], + "title": "\u26a1 Live Power \u2014 Roof Layout", + "type": "row" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 2, + "x": 0, + "y": 31 + }, + "id": 114, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 2, + "y": 31 + }, + "id": 115, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 5, + "y": 31 + }, + "id": 116, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 14, + "y": 31 + }, + "id": 117, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 0, + "y": 34 + }, + "id": 118, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 2, + "y": 34 + }, + "id": 119, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 19, + "y": 37 + }, + "id": 120, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 1, + "y": 38 + }, + "id": 121, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 6, + "y": 38 + }, + "id": 122, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 9, + "y": 38 + }, + "id": 123, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 12, + "y": 38 + }, + "id": 124, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 15, + "y": 38 + }, + "id": 125, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 0, + "y": 41 + }, + "id": 126, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 2, + "y": 41 + }, + "id": 127, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 19, + "y": 41 + }, + "id": 128, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 115 + }, + { + "color": "#4caf50", + "value": 276 + }, + { + "color": "#76ff03", + "value": 391 + } + ] + }, + "unit": "watt", + "max": 460 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 0, + "y": 45 + }, + "id": 52, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d11_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D11", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 115 + }, + { + "color": "#4caf50", + "value": 276 + }, + { + "color": "#76ff03", + "value": 391 + } + ] + }, + "unit": "watt", + "max": 460 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 2, + "y": 45 + }, + "id": 53, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d5_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D5", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 115 + }, + { + "color": "#4caf50", + "value": 276 + }, + { + "color": "#76ff03", + "value": 391 + } + ] + }, + "unit": "watt", + "max": 460 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 6, + "y": 34 + }, + "id": 39, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c4_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C4", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 115 + }, + { + "color": "#4caf50", + "value": 276 + }, + { + "color": "#76ff03", + "value": 391 + } + ] + }, + "unit": "watt", + "max": 460 + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 8, + "y": 31 + }, + "id": 36, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c2_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C2", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 115 + }, + { + "color": "#4caf50", + "value": 276 + }, + { + "color": "#76ff03", + "value": 391 + } + ] + }, + "unit": "watt", + "max": 460 + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 11, + "y": 31 + }, + "id": 37, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c3_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C3", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 115 + }, + { + "color": "#4caf50", + "value": 276 + }, + { + "color": "#76ff03", + "value": 391 + } + ] + }, + "unit": "watt", + "max": 460 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 14, + "y": 34 + }, + "id": 43, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c7_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C7", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 115 + }, + { + "color": "#4caf50", + "value": 276 + }, + { + "color": "#76ff03", + "value": 391 + } + ] + }, + "unit": "watt", + "max": 460 + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 18, + "y": 31 + }, + "id": 38, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d12_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D12", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 115 + }, + { + "color": "#4caf50", + "value": 276 + }, + { + "color": "#76ff03", + "value": 391 + } + ] + }, + "unit": "watt", + "max": 460 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 8, + "y": 34 + }, + "id": 40, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c10_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C10", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 115 + }, + { + "color": "#4caf50", + "value": 276 + }, + { + "color": "#76ff03", + "value": 391 + } + ] + }, + "unit": "watt", + "max": 460 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 10, + "y": 34 + }, + "id": 41, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c9_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C9", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 115 + }, + { + "color": "#4caf50", + "value": 276 + }, + { + "color": "#76ff03", + "value": 391 + } + ] + }, + "unit": "watt", + "max": 460 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 12, + "y": 34 + }, + "id": 42, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c8_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C8", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 115 + }, + { + "color": "#4caf50", + "value": 276 + }, + { + "color": "#76ff03", + "value": 391 + } + ] + }, + "unit": "watt", + "max": 460 + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 18, + "y": 34 + }, + "id": 44, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d13_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D13", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 115 + }, + { + "color": "#4caf50", + "value": 276 + }, + { + "color": "#76ff03", + "value": 391 + } + ] + }, + "unit": "watt", + "max": 460 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 5, + "y": 41 + }, + "id": 45, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c1_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C1", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 115 + }, + { + "color": "#4caf50", + "value": 276 + }, + { + "color": "#76ff03", + "value": 391 + } + ] + }, + "unit": "watt", + "max": 460 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 15, + "y": 41 + }, + "id": 50, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d9_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D9", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 115 + }, + { + "color": "#4caf50", + "value": 276 + }, + { + "color": "#76ff03", + "value": 391 + } + ] + }, + "unit": "watt", + "max": 460 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 17, + "y": 41 + }, + "id": 51, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c11_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C11", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 115 + }, + { + "color": "#4caf50", + "value": 276 + }, + { + "color": "#76ff03", + "value": 391 + } + ] + }, + "unit": "watt", + "max": 460 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 19, + "y": 45 + }, + "id": 61, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d10_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D10", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 115 + }, + { + "color": "#4caf50", + "value": 276 + }, + { + "color": "#76ff03", + "value": 391 + } + ] + }, + "unit": "watt", + "max": 460 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 7, + "y": 41 + }, + "id": 46, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c6_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C6", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 115 + }, + { + "color": "#4caf50", + "value": 276 + }, + { + "color": "#76ff03", + "value": 391 + } + ] + }, + "unit": "watt", + "max": 460 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 9, + "y": 41 + }, + "id": 47, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d6_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D6", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 115 + }, + { + "color": "#4caf50", + "value": 276 + }, + { + "color": "#76ff03", + "value": 391 + } + ] + }, + "unit": "watt", + "max": 460 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 11, + "y": 41 + }, + "id": 48, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d7_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D7", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 115 + }, + { + "color": "#4caf50", + "value": 276 + }, + { + "color": "#76ff03", + "value": 391 + } + ] + }, + "unit": "watt", + "max": 460 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 13, + "y": 41 + }, + "id": 49, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d8_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D8", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 115 + }, + { + "color": "#4caf50", + "value": 276 + }, + { + "color": "#76ff03", + "value": 391 + } + ] + }, + "unit": "watt", + "max": 460 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 5, + "y": 45 + }, + "id": 54, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c12_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C12", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 115 + }, + { + "color": "#4caf50", + "value": 276 + }, + { + "color": "#76ff03", + "value": 391 + } + ] + }, + "unit": "watt", + "max": 460 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 15, + "y": 45 + }, + "id": 59, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c5_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C5", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 115 + }, + { + "color": "#4caf50", + "value": 276 + }, + { + "color": "#76ff03", + "value": 391 + } + ] + }, + "unit": "watt", + "max": 460 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 17, + "y": 45 + }, + "id": 60, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c13_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C13", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 115 + }, + { + "color": "#4caf50", + "value": 276 + }, + { + "color": "#76ff03", + "value": 391 + } + ] + }, + "unit": "watt", + "max": 460 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 7, + "y": 45 + }, + "id": 55, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d4_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D4", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 115 + }, + { + "color": "#4caf50", + "value": 276 + }, + { + "color": "#76ff03", + "value": 391 + } + ] + }, + "unit": "watt", + "max": 460 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 9, + "y": 45 + }, + "id": 56, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d3_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D3", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 115 + }, + { + "color": "#4caf50", + "value": 276 + }, + { + "color": "#76ff03", + "value": 391 + } + ] + }, + "unit": "watt", + "max": 460 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 11, + "y": 45 + }, + "id": 57, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d1_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D1", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 115 + }, + { + "color": "#4caf50", + "value": 276 + }, + { + "color": "#76ff03", + "value": 391 + } + ] + }, + "unit": "watt", + "max": 460 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 13, + "y": 45 + }, + "id": 58, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d2_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D2", + "type": "stat" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 49 + }, + "id": 62, + "panels": [], + "title": "\ud83d\udcc8 Live Power \u2014 Trends", + "type": "row" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 15, + "gradientMode": "scheme", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "watt" + }, + "overrides": [ + { + "matcher": { + "id": "byFrameRefID", + "options": "A" + }, + "properties": [ + { + "id": "displayName", + "value": "C1" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "B" + }, + "properties": [ + { + "id": "displayName", + "value": "C2" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "C" + }, + "properties": [ + { + "id": "displayName", + "value": "C3" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "D" + }, + "properties": [ + { + "id": "displayName", + "value": "C4" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "E" + }, + "properties": [ + { + "id": "displayName", + "value": "C5" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "F" + }, + "properties": [ + { + "id": "displayName", + "value": "C6" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "G" + }, + "properties": [ + { + "id": "displayName", + "value": "C7" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "H" + }, + "properties": [ + { + "id": "displayName", + "value": "C8" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "I" + }, + "properties": [ + { + "id": "displayName", + "value": "C9" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "J" + }, + "properties": [ + { + "id": "displayName", + "value": "C10" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "K" + }, + "properties": [ + { + "id": "displayName", + "value": "C11" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "L" + }, + "properties": [ + { + "id": "displayName", + "value": "C12" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "M" + }, + "properties": [ + { + "id": "displayName", + "value": "C13" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 50 + }, + "id": 63, + "options": { + "legend": { + "calcs": [ + "lastNotNull", + "max", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c1_power' AND $__timeFilter(time) ORDER BY time", + "refId": "A" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c2_power' AND $__timeFilter(time) ORDER BY time", + "refId": "B" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c3_power' AND $__timeFilter(time) ORDER BY time", + "refId": "C" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c4_power' AND $__timeFilter(time) ORDER BY time", + "refId": "D" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c5_power' AND $__timeFilter(time) ORDER BY time", + "refId": "E" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c6_power' AND $__timeFilter(time) ORDER BY time", + "refId": "F" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c7_power' AND $__timeFilter(time) ORDER BY time", + "refId": "G" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c8_power' AND $__timeFilter(time) ORDER BY time", + "refId": "H" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c9_power' AND $__timeFilter(time) ORDER BY time", + "refId": "I" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c10_power' AND $__timeFilter(time) ORDER BY time", + "refId": "J" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c11_power' AND $__timeFilter(time) ORDER BY time", + "refId": "K" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c12_power' AND $__timeFilter(time) ORDER BY time", + "refId": "L" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c13_power' AND $__timeFilter(time) ORDER BY time", + "refId": "M" + } + ], + "title": "String C \u2014 Power", + "type": "timeseries" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 15, + "gradientMode": "scheme", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "watt" + }, + "overrides": [ + { + "matcher": { + "id": "byFrameRefID", + "options": "A" + }, + "properties": [ + { + "id": "displayName", + "value": "D1" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "B" + }, + "properties": [ + { + "id": "displayName", + "value": "D2" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "C" + }, + "properties": [ + { + "id": "displayName", + "value": "D3" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "D" + }, + "properties": [ + { + "id": "displayName", + "value": "D4" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "E" + }, + "properties": [ + { + "id": "displayName", + "value": "D5" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "F" + }, + "properties": [ + { + "id": "displayName", + "value": "D6" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "G" + }, + "properties": [ + { + "id": "displayName", + "value": "D7" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "H" + }, + "properties": [ + { + "id": "displayName", + "value": "D8" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "I" + }, + "properties": [ + { + "id": "displayName", + "value": "D9" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "J" + }, + "properties": [ + { + "id": "displayName", + "value": "D10" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "K" + }, + "properties": [ + { + "id": "displayName", + "value": "D11" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "L" + }, + "properties": [ + { + "id": "displayName", + "value": "D12" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "M" + }, + "properties": [ + { + "id": "displayName", + "value": "D13" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 50 + }, + "id": 64, + "options": { + "legend": { + "calcs": [ + "lastNotNull", + "max", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d1_power' AND $__timeFilter(time) ORDER BY time", + "refId": "A" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d2_power' AND $__timeFilter(time) ORDER BY time", + "refId": "B" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d3_power' AND $__timeFilter(time) ORDER BY time", + "refId": "C" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d4_power' AND $__timeFilter(time) ORDER BY time", + "refId": "D" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d5_power' AND $__timeFilter(time) ORDER BY time", + "refId": "E" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d6_power' AND $__timeFilter(time) ORDER BY time", + "refId": "F" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d7_power' AND $__timeFilter(time) ORDER BY time", + "refId": "G" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d8_power' AND $__timeFilter(time) ORDER BY time", + "refId": "H" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d9_power' AND $__timeFilter(time) ORDER BY time", + "refId": "I" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d10_power' AND $__timeFilter(time) ORDER BY time", + "refId": "J" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d11_power' AND $__timeFilter(time) ORDER BY time", + "refId": "K" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d12_power' AND $__timeFilter(time) ORDER BY time", + "refId": "L" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d13_power' AND $__timeFilter(time) ORDER BY time", + "refId": "M" + } + ], + "title": "String D \u2014 Power", + "type": "timeseries" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-greens" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "dark-green", + "value": 0 + }, + { + "color": "green", + "value": 50 + } + ] + }, + "unit": "watt" + }, + "overrides": [ + { + "matcher": { + "id": "byFrameRefID", + "options": "A" + }, + "properties": [ + { + "id": "displayName", + "value": "C1" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "B" + }, + "properties": [ + { + "id": "displayName", + "value": "C2" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "C" + }, + "properties": [ + { + "id": "displayName", + "value": "C3" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "D" + }, + "properties": [ + { + "id": "displayName", + "value": "C4" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "E" + }, + "properties": [ + { + "id": "displayName", + "value": "C5" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "F" + }, + "properties": [ + { + "id": "displayName", + "value": "C6" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "G" + }, + "properties": [ + { + "id": "displayName", + "value": "C7" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "H" + }, + "properties": [ + { + "id": "displayName", + "value": "C8" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "I" + }, + "properties": [ + { + "id": "displayName", + "value": "C9" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "J" + }, + "properties": [ + { + "id": "displayName", + "value": "C10" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "K" + }, + "properties": [ + { + "id": "displayName", + "value": "C11" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "L" + }, + "properties": [ + { + "id": "displayName", + "value": "C12" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "M" + }, + "properties": [ + { + "id": "displayName", + "value": "C13" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 60 + }, + "id": 65, + "options": { + "displayMode": "gradient", + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "maxVizHeight": 300, + "minVizHeight": 16, + "minVizWidth": 75, + "namePlacement": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showUnfilled": true, + "sizing": "auto", + "valueMode": "color" + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "dataset": "iox", + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c1_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ] + } + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c2_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "B" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c3_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "C" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c4_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "D" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c5_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "E" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c6_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "F" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c7_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "G" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c8_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "H" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c9_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "I" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c10_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "J" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c11_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "K" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c12_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "L" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_c13_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "M" + } + ], + "title": "String C \u2014 Current Power", + "type": "bargauge" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-greens" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "dark-green", + "value": 0 + }, + { + "color": "green", + "value": 50 + } + ] + }, + "unit": "watt" + }, + "overrides": [ + { + "matcher": { + "id": "byFrameRefID", + "options": "A" + }, + "properties": [ + { + "id": "displayName", + "value": "D1" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "B" + }, + "properties": [ + { + "id": "displayName", + "value": "D2" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "C" + }, + "properties": [ + { + "id": "displayName", + "value": "D3" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "D" + }, + "properties": [ + { + "id": "displayName", + "value": "D4" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "E" + }, + "properties": [ + { + "id": "displayName", + "value": "D5" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "F" + }, + "properties": [ + { + "id": "displayName", + "value": "D6" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "G" + }, + "properties": [ + { + "id": "displayName", + "value": "D7" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "H" + }, + "properties": [ + { + "id": "displayName", + "value": "D8" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "I" + }, + "properties": [ + { + "id": "displayName", + "value": "D9" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "J" + }, + "properties": [ + { + "id": "displayName", + "value": "D10" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "K" + }, + "properties": [ + { + "id": "displayName", + "value": "D11" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "L" + }, + "properties": [ + { + "id": "displayName", + "value": "D12" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "M" + }, + "properties": [ + { + "id": "displayName", + "value": "D13" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 60 + }, + "id": 66, + "options": { + "displayMode": "gradient", + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "maxVizHeight": 300, + "minVizHeight": 16, + "minVizWidth": 75, + "namePlacement": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showUnfilled": true, + "sizing": "auto", + "valueMode": "color" + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d1_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d2_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "B" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d3_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "C" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d4_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "D" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d5_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "E" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d6_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "F" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d7_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "G" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d8_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "H" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d9_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "I" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d10_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "J" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d11_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "K" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d12_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "L" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"W\" WHERE \"entity_id\" = 'tigo_ts4_d13_power' AND $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "M" + } + ], + "title": "String D \u2014 Current Power", + "type": "bargauge" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 70 + }, + "id": 67, + "panels": [], + "title": "\ud83d\udce1 Panel Connectivity \u2014 Roof Layout", + "type": "row" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 2, + "x": 0, + "y": 71 + }, + "id": 129, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 2, + "y": 71 + }, + "id": 130, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 5, + "y": 71 + }, + "id": 131, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 14, + "y": 71 + }, + "id": 132, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 0, + "y": 74 + }, + "id": 133, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 2, + "y": 74 + }, + "id": 134, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 19, + "y": 77 + }, + "id": 135, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 1, + "y": 78 + }, + "id": 136, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 6, + "y": 78 + }, + "id": 137, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 9, + "y": 78 + }, + "id": 138, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 12, + "y": 78 + }, + "id": 139, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 15, + "y": 78 + }, + "id": 140, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 0, + "y": 81 + }, + "id": 141, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 2, + "y": 81 + }, + "id": 142, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 19, + "y": 81 + }, + "id": 143, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "", + "mode": "markdown" + }, + "pluginVersion": "12.3.0", + "title": "", + "transparent": true, + "type": "text" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "max": 300 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 0, + "y": 85 + }, + "id": 84, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"sensor.tigo_ts4_d11_readings_today\" WHERE $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D11", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "max": 300 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 2, + "y": 85 + }, + "id": 85, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"sensor.tigo_ts4_d5_readings_today\" WHERE $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D5", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "max": 300 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 6, + "y": 74 + }, + "id": 71, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"sensor.tigo_ts4_c4_readings_today\" WHERE $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C4", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "max": 300 + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 8, + "y": 71 + }, + "id": 68, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"sensor.tigo_ts4_c2_readings_today\" WHERE $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C2", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "max": 300 + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 11, + "y": 71 + }, + "id": 69, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"sensor.tigo_ts4_c3_readings_today\" WHERE $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C3", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "max": 300 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 14, + "y": 74 + }, + "id": 75, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"sensor.tigo_ts4_c7_readings_today\" WHERE $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C7", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "max": 300 + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 18, + "y": 71 + }, + "id": 70, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"sensor.tigo_ts4_d12_readings_today\" WHERE $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D12", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "max": 300 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 8, + "y": 74 + }, + "id": 72, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"sensor.tigo_ts4_c10_readings_today\" WHERE $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C10", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "max": 300 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 10, + "y": 74 + }, + "id": 73, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"sensor.tigo_ts4_c9_readings_today\" WHERE $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C9", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "max": 300 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 12, + "y": 74 + }, + "id": 74, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"sensor.tigo_ts4_c8_readings_today\" WHERE $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C8", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "max": 300 + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 18, + "y": 74 + }, + "id": 76, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"sensor.tigo_ts4_d13_readings_today\" WHERE $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D13", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "max": 300 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 5, + "y": 81 + }, + "id": 77, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"sensor.tigo_ts4_c1_readings_today\" WHERE $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C1", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "max": 300 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 15, + "y": 81 + }, + "id": 82, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"sensor.tigo_ts4_d9_readings_today\" WHERE $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D9", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "max": 300 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 17, + "y": 81 + }, + "id": 83, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"sensor.tigo_ts4_c11_readings_today\" WHERE $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C11", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "max": 300 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 19, + "y": 85 + }, + "id": 93, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"sensor.tigo_ts4_d10_readings_today\" WHERE $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D10", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "max": 300 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 7, + "y": 81 + }, + "id": 78, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"sensor.tigo_ts4_c6_readings_today\" WHERE $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C6", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "max": 300 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 9, + "y": 81 + }, + "id": 79, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"sensor.tigo_ts4_d6_readings_today\" WHERE $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D6", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "max": 300 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 11, + "y": 81 + }, + "id": 80, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"sensor.tigo_ts4_d7_readings_today\" WHERE $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D7", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "max": 300 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 13, + "y": 81 + }, + "id": 81, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"sensor.tigo_ts4_d8_readings_today\" WHERE $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D8", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "max": 300 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 5, + "y": 85 + }, + "id": 86, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"sensor.tigo_ts4_c12_readings_today\" WHERE $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C12", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "max": 300 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 15, + "y": 85 + }, + "id": 91, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"sensor.tigo_ts4_c5_readings_today\" WHERE $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C5", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "max": 300 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 17, + "y": 85 + }, + "id": 92, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"sensor.tigo_ts4_c13_readings_today\" WHERE $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "C13", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "max": 300 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 7, + "y": 85 + }, + "id": 87, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"sensor.tigo_ts4_d4_readings_today\" WHERE $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D4", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "max": 300 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 9, + "y": 85 + }, + "id": 88, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"sensor.tigo_ts4_d3_readings_today\" WHERE $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D3", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "max": 300 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 11, + "y": 85 + }, + "id": 89, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"sensor.tigo_ts4_d1_readings_today\" WHERE $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D1", + "type": "stat" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "#1a1a1a", + "value": 0 + }, + { + "color": "#ff6d00", + "value": 25 + }, + { + "color": "#4caf50", + "value": 60 + }, + { + "color": "#76ff03", + "value": 85 + } + ] + }, + "max": 300 + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 13, + "y": 85 + }, + "id": 90, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "table", + "rawSql": "SELECT value FROM \"sensor.tigo_ts4_d2_readings_today\" WHERE $__timeFilter(time) ORDER BY time DESC LIMIT 1", + "refId": "A" + } + ], + "title": "D2", + "type": "stat" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 89 + }, + "id": 94, + "panels": [], + "title": "\ud83d\udcc8 Connectivity \u2014 Trends", + "type": "row" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 15, + "gradientMode": "scheme", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byFrameRefID", + "options": "A" + }, + "properties": [ + { + "id": "displayName", + "value": "C1" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "B" + }, + "properties": [ + { + "id": "displayName", + "value": "C2" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "C" + }, + "properties": [ + { + "id": "displayName", + "value": "C3" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "D" + }, + "properties": [ + { + "id": "displayName", + "value": "C4" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "E" + }, + "properties": [ + { + "id": "displayName", + "value": "C5" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "F" + }, + "properties": [ + { + "id": "displayName", + "value": "C6" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "G" + }, + "properties": [ + { + "id": "displayName", + "value": "C7" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "H" + }, + "properties": [ + { + "id": "displayName", + "value": "C8" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "I" + }, + "properties": [ + { + "id": "displayName", + "value": "C9" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "J" + }, + "properties": [ + { + "id": "displayName", + "value": "C10" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "K" + }, + "properties": [ + { + "id": "displayName", + "value": "C11" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "L" + }, + "properties": [ + { + "id": "displayName", + "value": "C12" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "M" + }, + "properties": [ + { + "id": "displayName", + "value": "C13" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 90 + }, + "id": 95, + "options": { + "legend": { + "calcs": [ + "lastNotNull", + "max", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"sensor.tigo_ts4_c1_readings_today\" WHERE $__timeFilter(time) ORDER BY time", + "refId": "A" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"sensor.tigo_ts4_c2_readings_today\" WHERE $__timeFilter(time) ORDER BY time", + "refId": "B" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"sensor.tigo_ts4_c3_readings_today\" WHERE $__timeFilter(time) ORDER BY time", + "refId": "C" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"sensor.tigo_ts4_c4_readings_today\" WHERE $__timeFilter(time) ORDER BY time", + "refId": "D" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"sensor.tigo_ts4_c5_readings_today\" WHERE $__timeFilter(time) ORDER BY time", + "refId": "E" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"sensor.tigo_ts4_c6_readings_today\" WHERE $__timeFilter(time) ORDER BY time", + "refId": "F" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"sensor.tigo_ts4_c7_readings_today\" WHERE $__timeFilter(time) ORDER BY time", + "refId": "G" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"sensor.tigo_ts4_c8_readings_today\" WHERE $__timeFilter(time) ORDER BY time", + "refId": "H" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"sensor.tigo_ts4_c9_readings_today\" WHERE $__timeFilter(time) ORDER BY time", + "refId": "I" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"sensor.tigo_ts4_c10_readings_today\" WHERE $__timeFilter(time) ORDER BY time", + "refId": "J" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"sensor.tigo_ts4_c11_readings_today\" WHERE $__timeFilter(time) ORDER BY time", + "refId": "K" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"sensor.tigo_ts4_c12_readings_today\" WHERE $__timeFilter(time) ORDER BY time", + "refId": "L" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"sensor.tigo_ts4_c13_readings_today\" WHERE $__timeFilter(time) ORDER BY time", + "refId": "M" + } + ], + "title": "String C \u2014 Readings Today", + "type": "timeseries" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 15, + "gradientMode": "scheme", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byFrameRefID", + "options": "A" + }, + "properties": [ + { + "id": "displayName", + "value": "D1" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "B" + }, + "properties": [ + { + "id": "displayName", + "value": "D2" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "C" + }, + "properties": [ + { + "id": "displayName", + "value": "D3" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "D" + }, + "properties": [ + { + "id": "displayName", + "value": "D4" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "E" + }, + "properties": [ + { + "id": "displayName", + "value": "D5" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "F" + }, + "properties": [ + { + "id": "displayName", + "value": "D6" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "G" + }, + "properties": [ + { + "id": "displayName", + "value": "D7" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "H" + }, + "properties": [ + { + "id": "displayName", + "value": "D8" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "I" + }, + "properties": [ + { + "id": "displayName", + "value": "D9" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "J" + }, + "properties": [ + { + "id": "displayName", + "value": "D10" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "K" + }, + "properties": [ + { + "id": "displayName", + "value": "D11" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "L" + }, + "properties": [ + { + "id": "displayName", + "value": "D12" + } + ] + }, + { + "matcher": { + "id": "byFrameRefID", + "options": "M" + }, + "properties": [ + { + "id": "displayName", + "value": "D13" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 90 + }, + "id": 96, + "options": { + "legend": { + "calcs": [ + "lastNotNull", + "max", + "mean" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "12.3.0", + "targets": [ + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"sensor.tigo_ts4_d1_readings_today\" WHERE $__timeFilter(time) ORDER BY time", + "refId": "A" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"sensor.tigo_ts4_d2_readings_today\" WHERE $__timeFilter(time) ORDER BY time", + "refId": "B" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"sensor.tigo_ts4_d3_readings_today\" WHERE $__timeFilter(time) ORDER BY time", + "refId": "C" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"sensor.tigo_ts4_d4_readings_today\" WHERE $__timeFilter(time) ORDER BY time", + "refId": "D" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"sensor.tigo_ts4_d5_readings_today\" WHERE $__timeFilter(time) ORDER BY time", + "refId": "E" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"sensor.tigo_ts4_d6_readings_today\" WHERE $__timeFilter(time) ORDER BY time", + "refId": "F" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"sensor.tigo_ts4_d7_readings_today\" WHERE $__timeFilter(time) ORDER BY time", + "refId": "G" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"sensor.tigo_ts4_d8_readings_today\" WHERE $__timeFilter(time) ORDER BY time", + "refId": "H" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"sensor.tigo_ts4_d9_readings_today\" WHERE $__timeFilter(time) ORDER BY time", + "refId": "I" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"sensor.tigo_ts4_d10_readings_today\" WHERE $__timeFilter(time) ORDER BY time", + "refId": "J" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"sensor.tigo_ts4_d11_readings_today\" WHERE $__timeFilter(time) ORDER BY time", + "refId": "K" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"sensor.tigo_ts4_d12_readings_today\" WHERE $__timeFilter(time) ORDER BY time", + "refId": "L" + }, + { + "datasource": { + "type": "influxdb", + "uid": "HA" + }, + "format": "time_series", + "rawSql": "SELECT time, value FROM \"sensor.tigo_ts4_d13_readings_today\" WHERE $__timeFilter(time) ORDER BY time", + "refId": "M" + } + ], + "title": "String D \u2014 Readings Today", + "type": "timeseries" + } + ], + "preload": false, + "refresh": "auto", + "schemaVersion": 42, + "tags": [ + "solar", + "pv", + "tigo", + "energy" + ], + "templating": { + "list": [] + }, + "time": { + "from": "now/d", + "to": "now/d" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m" + ] + }, + "timezone": "browser", + "title": "PV Production", + "uid": "pv-production", + "version": 13 +} diff --git a/dashboards/pv_production.md b/dashboards/pv_production.md index 19d5a7e..1596af7 100644 --- a/dashboards/pv_production.md +++ b/dashboards/pv_production.md @@ -22,6 +22,7 @@ Home Assistant Lovelace dashboard displaying the physical solar panel layout wit |--------|-----------|---------| | Tigo Max Daily Energy | `sensor.tigo_max_daily_energy` | Highest `_daily_energy` across all 26 panels (kWh) | | Tigo Max Readings Today | `sensor.tigo_max_readings_today` | Highest `_readings_today` across all 26 panels | +| Tigo Max Power | `sensor.tigo_max_power` | Highest live `_power` across all 26 panels (W) | These are computed server-side with Jinja2 templates so each button-card only needs a single `states[]` lookup instead of scanning all 26 sensors in JavaScript. @@ -39,6 +40,12 @@ Shows the number of readings received today per panel using `sensor.tigo_ts4__power`. + +**Color scale:** Transparent → Green. Green overlay alpha scales from 0 to 0.7 relative to `sensor.tigo_max_power`. An inner green glow intensifies with output. + ## Physical Layout Both views mirror the actual roof panel arrangement using a 26-column CSS grid. Panels have two orientations matching real hardware: @@ -110,6 +117,16 @@ const hue = Math.round(pct * 120); // 0°=red → 120°=green // Inner glow: hsla(hue, 80%, 50%, 0.7) ``` +### Page 3 color formula (Power) + +```javascript +const max = parseFloat(states['sensor.tigo_max_power']?.state) || 1; +const pct = Math.min(Math.max(val, 0) / max, 1); +const alpha = pct * 0.7; +// Green overlay: rgba(0, 220, 50, alpha) +// Inner glow: rgba(0, 255, 50, 0.8 * pct) +``` + ## YAML Structure YAML anchors keep the file DRY: @@ -120,6 +137,8 @@ YAML anchors keep the file DRY: | `&tile_portrait` | Energy | Portrait (2:3) | All other tiles | | `&conn_tile_landscape` | Connectivity | Landscape (3:2) | C2, C3 tiles (red→green) | | `&conn_tile_portrait` | Connectivity | Portrait (2:3) | All other tiles (red→green) | +| `&pwr_tile_landscape` | Power | Landscape (3:2) | C2, C3 tiles (green by power) | +| `&pwr_tile_portrait` | Power | Portrait (2:3) | All other tiles (green by power) | Both views use the same structural approach: @@ -131,16 +150,19 @@ Each panel card specifies its exact position via `view_layout: { grid-row, grid- ## tigo.yaml — Template Sensors -Server-side Jinja2 template sensors that aggregate all 24 panel values: +Server-side Jinja2 template sensors that aggregate all 26 panel values: ```yaml template: - sensor: - name: "Tigo Max Daily Energy" # sensor.tigo_max_daily_energy - state: "{{ [all 24 _daily_energy states] | map('float', 0) | max }}" + state: "{{ [all 26 _daily_energy states] | map('float', 0) | max }}" - name: "Tigo Max Readings Today" # sensor.tigo_max_readings_today - state: "{{ [all 24 _readings_today states] | map('float', 0) | max }}" + state: "{{ [all 26 _readings_today states] | map('float', 0) | max }}" + + - name: "Tigo Max Power" # sensor.tigo_max_power + state: "{{ [all 26 _power states] | map('float', 0) | max }}" ``` -This offloads the max-value computation from the frontend (previously each of the 48 button-cards scanned all 24 sensors in JS) to a single HA template sensor that updates automatically. +This offloads the max-value computation from the frontend (previously each of the 78 button-cards scanned all 26 sensors in JS) to a single HA template sensor that updates automatically. diff --git a/docs/architecture.md b/docs/architecture.md index 2a70c68..2bfb638 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -256,7 +256,8 @@ The `pytap` library uses blocking I/O (`socket.recv`, `serial.read`). Since Home 1. **Background listener task** — An `asyncio.Task` created at setup that runs the blocking `_listen()` method in the executor via `hass.async_add_executor_job()`. 2. **Event dispatch** — When the executor thread receives parsed events, it schedules `coordinator.async_set_updated_data()` back on the event loop via `hass.loop.call_soon_threadsafe()`. -3. **Cancellation** — On unload, the task is cancelled and the source connection is closed, which unblocks the `read()` call. +3. **Midnight reset timer** — A `call_later` timer on the event loop fires at local midnight to proactively reset daily accumulators, ensuring daily sensors zero at exactly midnight even when no power reports arrive overnight. +4. **Cancellation** — On unload, the task is cancelled, the midnight timer is cancelled, and the source connection is closed, which unblocks the `read()` call. ``` HA Event Loop (main thread) Executor Thread @@ -265,6 +266,7 @@ The `pytap` library uses blocking I/O (`socket.recv`, `serial.read`). Since Home │ async_setup_entry() │ │ ─► create coordinator │ │ ─► start listener task ──────────►│ + │ ─► schedule midnight reset │ │ │ source = connect(config) │ │ parser = create_parser() │ │ @@ -274,10 +276,16 @@ The `pytap` library uses blocking I/O (`socket.recv`, `serial.read`). Since Home │ ◄── call_soon_threadsafe ─────────│ for event in events: │ async_set_updated_data(...) │ dispatch(event) │ │ + │ [midnight] _perform_midnight_ │ + │ reset() → zero daily accum. │ + │ → push update to sensors │ + │ → reschedule for next midnight │ + │ │ │ entities read coordinator.data │ │ and update their state │ │ │ │ async_unload_entry() │ + │ ─► cancel midnight timer │ │ ─► cancel task ──────────────────►│ (source.close() → unblocks read) │ │ exits ``` diff --git a/docs/implementation.md b/docs/implementation.md index 7d3c3f1..bb6fa5f 100644 --- a/docs/implementation.md +++ b/docs/implementation.md @@ -1,6 +1,6 @@ # PyTap — Implementation Document -> Version 0.3.0 · Last updated: February 2026 +> Version 0.3.1 · Last updated: March 2026 This document captures the current implementation state of the PyTap Home Assistant custom component. It describes what has been built, how each module works, the design decisions made during development, and the test coverage in place. @@ -59,7 +59,7 @@ custom_components/pytap/ ├── __init__.py # ~187 lines — Integration lifecycle (setup, teardown, migration, options listener) ├── config_flow.py # 369 lines — Menu-driven config & options flows ├── const.py # ~28 lines — Domain, config keys, defaults, energy tuning constants -├── coordinator.py # ~826 lines — Push-based DataUpdateCoordinator +├── coordinator.py # ~1016 lines — Push-based DataUpdateCoordinator ├── diagnostics.py # ~46 lines — Diagnostics download (config entry diagnostics) ├── energy.py # ~80 lines — Pure trapezoidal energy accumulation helpers ├── manifest.json # 13 lines — HA integration metadata @@ -81,7 +81,7 @@ custom_components/pytap/ tests/ ├── conftest.py # 14 lines — Auto-enable custom integrations fixture ├── test_config_flow.py # 548 lines — 16 config flow tests -├── test_coordinator_persistence.py # ~729 lines — 32 coordinator & persistence tests +├── test_coordinator_persistence.py # ~1100 lines — 36 coordinator & persistence tests ├── test_diagnostics.py # ~172 lines — 4 diagnostics platform tests ├── test_energy.py # ~170 lines — 13 pure energy accumulation tests ├── test_migration.py # ~300 lines — 11 entity migration tests @@ -218,7 +218,7 @@ Four custom `HomeAssistantError` subclasses: `CannotConnect`, `InvalidAuth`, `In ### `coordinator.py` — Data Coordinator -**~680 lines** implementing `PyTapDataUpdateCoordinator`, the core runtime engine. +**~1016 lines** implementing `PyTapDataUpdateCoordinator`, the core runtime engine. #### Class: `PyTapDataUpdateCoordinator` @@ -264,11 +264,13 @@ def __init__(self, hass, entry): ``` async_start_listener() - └── creates background task → _async_listen() - └── executor job → _listen() + ├── creates background task → _async_listen() + │ └── executor job → _listen() + └── schedules midnight reset timer → _schedule_midnight_reset() async_stop_listener() └── sets _stop_event (threading.Event) + └── cancels midnight reset timer └── acquires _source_lock, closes _source (unblocks socket.read) └── awaits task with asyncio.timeout(5) ``` @@ -407,6 +409,10 @@ Pure-logic module implementing trapezoidal energy integration. Intentionally HA- The coordinator calls `accumulate_energy()` from `_handle_power_report` and merges the result into the node data dict. +#### Proactive midnight reset + +In addition to the lazy date-check inside `accumulate_energy()`, the coordinator runs a **proactive midnight reset timer** (`_schedule_midnight_reset` / `_perform_midnight_reset`). This ensures daily sensors (`daily_energy`, `readings_today`) zero at exactly midnight local time, even when no power reports arrive overnight (typical for solar installations). The timer uses `hass.loop.call_later()` and reschedules itself after each reset. + --- ### `sensor.py` — Sensor Platform @@ -736,9 +742,9 @@ All tests mock `validate_connection` to avoid real TCP connections. Tests use `MagicMock(spec=PyTapDataUpdateCoordinator)` to avoid real coordinator initialization. -### Coordinator Persistence Tests (32 tests) +### Coordinator Persistence Tests (36 tests) -Coverage includes coordinator initialization, barcode mapping restoration and purging, deferred power-report handling before infrastructure, save/load behavior, parser-state restore/fallback, stop-flush behavior, and energy-data persistence (`energy_data` save/load with daily reset on new day). +Coverage includes coordinator initialization, barcode mapping restoration and purging, deferred power-report handling before infrastructure, save/load behavior, parser-state restore/fallback, stop-flush behavior, energy-data persistence (`energy_data` save/load with daily reset on new day), and proactive midnight reset behavior (zeroing daily accumulators, skip-if-already-reset, timer rescheduling, and cancellation on stop). ### Diagnostics Platform Tests (4 tests) @@ -999,6 +1005,15 @@ Created this implementation document capturing all development work to date. - Persisted `readings_today` in coordinator store load/save, including date-rollover reset on restore. - Added tests in `tests/test_diagnostics.py` and extended sensor/coordinator/energy tests. - Full suite status after feature: 105 tests passing, ruff clean. + +### Phase 16 — Proactive Midnight Daily Reset + +- **Bug fix:** Daily sensors (`daily_energy`, `readings_today`) previously reset lazily on the first power report after midnight. Since solar panels produce no data overnight, the reset occurred at a random time in the morning when the first reading arrived. +- Added `_schedule_midnight_reset()` and `_perform_midnight_reset()` to the coordinator. A `call_later` timer on the HA event loop fires at exactly midnight local time, zeroes all daily accumulators, updates node data, pushes the update to sensors, and reschedules itself for the next midnight. +- `async_start_listener()` now schedules the midnight reset timer at startup. +- `async_stop_listener()` cancels the midnight reset timer on shutdown. +- Added 4 tests in `TestMidnightReset`: zeroing daily values, skip-if-already-reset, timer rescheduling, and cancellation on stop. + --- ## Future Work diff --git a/tests/test_coordinator_persistence.py b/tests/test_coordinator_persistence.py index 9cfb989..348e83a 100644 --- a/tests/test_coordinator_persistence.py +++ b/tests/test_coordinator_persistence.py @@ -4,7 +4,7 @@ infrastructure state survive restarts via the consolidated HA Store. """ -from datetime import datetime +from datetime import datetime, timedelta from unittest.mock import AsyncMock, MagicMock, patch import pytest @@ -994,3 +994,107 @@ async def test_power_report_overwrites_prepopulated_data( assert node["voltage_in"] == 60.0 # Energy should continue from the loaded accumulator, not reset assert node["total_energy_wh"] >= 5000.0 + + +class TestMidnightReset: + """Test that the midnight reset timer proactively resets daily accumulators.""" + + def test_perform_midnight_reset_zeros_daily_values( + self, hass: HomeAssistant + ) -> None: + """Daily energy and readings should be zeroed by midnight reset.""" + entry = _make_entry(hass) + coordinator = PyTapDataUpdateCoordinator(hass, entry) + coordinator._schedule_save = MagicMock() + coordinator.async_set_updated_data = MagicMock() + + today = dt_util.now().date().isoformat() + yesterday = (dt_util.now().date() - timedelta(days=1)).isoformat() + + coordinator._energy_state["A-1234567B"] = EnergyAccumulator( + daily_energy_wh=150.0, + total_energy_wh=5000.0, + daily_reset_date=yesterday, + last_power_w=0.0, + last_reading_ts=None, + readings_today=42, + ) + coordinator.data["nodes"]["A-1234567B"] = { + "daily_energy_wh": 150.0, + "total_energy_wh": 5000.0, + "readings_today": 42, + "daily_reset_date": yesterday, + } + + coordinator._perform_midnight_reset() + + acc = coordinator._energy_state["A-1234567B"] + assert acc.daily_energy_wh == 0.0 + assert acc.readings_today == 0 + assert acc.daily_reset_date == today + assert acc.total_energy_wh == 5000.0 + + node = coordinator.data["nodes"]["A-1234567B"] + assert node["daily_energy_wh"] == 0.0 + assert node["readings_today"] == 0 + assert node["daily_reset_date"] == today + assert node["total_energy_wh"] == 5000.0 + + coordinator._schedule_save.assert_called_once() + coordinator.async_set_updated_data.assert_called_once() + + def test_perform_midnight_reset_skips_already_reset( + self, hass: HomeAssistant + ) -> None: + """Accumulators already reset for today should not be modified again.""" + entry = _make_entry(hass) + coordinator = PyTapDataUpdateCoordinator(hass, entry) + coordinator._schedule_save = MagicMock() + coordinator.async_set_updated_data = MagicMock() + + today = dt_util.now().date().isoformat() + + coordinator._energy_state["A-1234567B"] = EnergyAccumulator( + daily_energy_wh=50.0, + total_energy_wh=2000.0, + daily_reset_date=today, + last_power_w=100.0, + last_reading_ts=None, + readings_today=10, + ) + + coordinator._perform_midnight_reset() + + acc = coordinator._energy_state["A-1234567B"] + assert acc.daily_energy_wh == 50.0 + assert acc.readings_today == 10 + + coordinator._schedule_save.assert_not_called() + coordinator.async_set_updated_data.assert_not_called() + + def test_perform_midnight_reset_reschedules(self, hass: HomeAssistant) -> None: + """Midnight reset should reschedule itself for the next midnight.""" + entry = _make_entry(hass) + coordinator = PyTapDataUpdateCoordinator(hass, entry) + coordinator._schedule_save = MagicMock() + coordinator.async_set_updated_data = MagicMock() + + coordinator._perform_midnight_reset() + + assert coordinator._midnight_reset_unsub is not None + + def test_stop_cancels_midnight_timer(self, hass: HomeAssistant) -> None: + """Stopping the listener should cancel the midnight reset timer.""" + entry = _make_entry(hass) + coordinator = PyTapDataUpdateCoordinator(hass, entry) + + mock_timer = MagicMock() + coordinator._midnight_reset_unsub = mock_timer + + # async_stop_listener cancels the timer + import asyncio + + asyncio.get_event_loop().run_until_complete(coordinator.async_stop_listener()) + + mock_timer.cancel.assert_called_once() + assert coordinator._midnight_reset_unsub is None diff --git a/tests/test_sensor.py b/tests/test_sensor.py index cc801a3..09cefac 100644 --- a/tests/test_sensor.py +++ b/tests/test_sensor.py @@ -14,6 +14,7 @@ ) from homeassistant.core import HomeAssistant, State from homeassistant.helpers import entity_registry as er +from homeassistant.util import dt as dt_util from pytest_homeassistant_custom_component.common import MockConfigEntry @@ -921,7 +922,7 @@ async def test_restart_restores_snapshot_before_live_stream( ) entry.add_to_hass(hass) - today = "2026-02-24" + today = dt_util.now().date().isoformat() stored_state = { "barcode_to_node": {"A-1234567B": 10}, "discovered_barcodes": [], @@ -977,6 +978,25 @@ async def test_restart_restores_snapshot_before_live_stream( assert power_state.state != STATE_UNAVAILABLE assert float(power_state.state) == 299.2 + # Verify energy sensors restore from coordinator snapshot (not zeroed) + daily_energy_entity_id = ent_reg.async_get_entity_id( + "sensor", DOMAIN, f"{DOMAIN}_A-1234567B_daily_energy" + ) + assert daily_energy_entity_id is not None + daily_energy_state = hass.states.get(daily_energy_entity_id) + assert daily_energy_state is not None + assert daily_energy_state.state != STATE_UNAVAILABLE + assert float(daily_energy_state.state) == 12.5 + + total_energy_entity_id = ent_reg.async_get_entity_id( + "sensor", DOMAIN, f"{DOMAIN}_A-1234567B_total_energy" + ) + assert total_energy_entity_id is not None + total_energy_state = hass.states.get(total_energy_entity_id) + assert total_energy_state is not None + assert total_energy_state.state != STATE_UNAVAILABLE + assert float(total_energy_state.state) == 2000.0 + installation_power_entity_id = ent_reg.async_get_entity_id( "sensor", DOMAIN, f"{DOMAIN}_{entry.entry_id}_installation_power" )