From e877a254ce3de4fcdeac1052d73351013a66a55a Mon Sep 17 00:00:00 2001 From: gx Date: Wed, 20 May 2026 20:50:20 +0100 Subject: [PATCH] =?UTF-8?q?controller:=20fix=20MQTT=20topic=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20motion=20=E2=80=94=20frigate//motion/state=20(?= =?UTF-8?q?=D0=BD=D0=B5=20/motion)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Frigate publishes на /motion/state ("ON"/"OFF") — а bare /motion это SET-topic для control. Subscribe pattern был неправильный → bridge не получал motion events → red border не загорался при motion. Live verified после fix: real motion от parking/gate_lpr/back_yard cameras триггерит upsert cell__border с motion theme (red #FF0000, 4px, opacity 1.0). Co-Authored-By: Claude Opus 4.7 --- controller/cuda_grid_controller/frigate_bridge.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/controller/cuda_grid_controller/frigate_bridge.py b/controller/cuda_grid_controller/frigate_bridge.py index 0153dc4..451a5db 100644 --- a/controller/cuda_grid_controller/frigate_bridge.py +++ b/controller/cuda_grid_controller/frigate_bridge.py @@ -83,7 +83,9 @@ class FrigateBridge: if not self.cfg.enabled: return [] base = self.cfg.base_topic.rstrip("/") - return [f"{base}/+/motion", f"{base}/events"] + # Frigate publishes state на `frigate//motion/state` ("ON"/"OFF"), + # а `frigate//motion` — это SET-topic (control). Subscribe строго к /state. + return [f"{base}/+/motion/state", f"{base}/events"] def _cell_border_id(self, cell: int) -> str: return f"cell_{cell}_border" @@ -136,9 +138,9 @@ class FrigateBridge: base = self.cfg.base_topic.rstrip("/") - # frigate//motion - if topic.startswith(f"{base}/") and topic.endswith("/motion"): - cam = topic[len(base) + 1 : -len("/motion")] + # frigate//motion/state + if topic.startswith(f"{base}/") and topic.endswith("/motion/state"): + cam = topic[len(base) + 1 : -len("/motion/state")] await self._handle_motion(cam, payload.strip().upper()) return