From 391a8289484e817c350cccd496fada2d3e3da8a7 Mon Sep 17 00:00:00 2001 From: Sterling Archer Date: Wed, 12 Aug 2026 14:45:06 -0700 Subject: [PATCH] Filter monitor to only show Shelly devices referenced by a power profile --- solixauto/monitor.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/solixauto/monitor.py b/solixauto/monitor.py index 9a43f6f..8dd4467 100644 --- a/solixauto/monitor.py +++ b/solixauto/monitor.py @@ -174,9 +174,27 @@ class Sampler: power = meters[channel].get("power") if channel < len(meters) else None return state, power + def _utilized_shelly_files(self): + utilized = set() + for path in list_profiles(paths.POWER_PROFILE_DIR): + try: + power_profile = load_yaml(path) + except Exception: + continue + target = (power_profile.get("target") or {}).get("profile") + if not target: + continue + resolved = paths.resolve_profile(target, "shelly") + if resolved is not None: + utilized.add(resolved.name) + return utilized + def _shelly_devices(self): devices = [] + utilized = self._utilized_shelly_files() for path in list_profiles(paths.SHELLY_PROFILE_DIR): + if path.name not in utilized: + continue try: profile = load_yaml(path) except Exception: