Person detection via direct MQTT instead of HA entities
- Electron main process subscribes to Frigate's MQTT topics (frigate/<camera>/person and frigate/events) directly via mqtt.js, bypassing the broken HA MQTT integration - Watched cameras: Front_Porch, FPE, Porch_Downstairs, Driveway_door - On person detection, exits photo-frame idle and shows full-screen camera feed for 30 seconds - Removed HA entity-based person detection code (entityToCameraName, personDetectionEntities config dependency) - Deleted unused useFrigateDetection HTTP polling hook (superseded)
This commit is contained in:
@@ -16,6 +16,7 @@ export interface ElectronAPI {
|
||||
frigate: {
|
||||
startStream: (rtspUrl: string) => Promise<boolean>;
|
||||
stopStream: () => Promise<boolean>;
|
||||
onPersonDetected: (callback: (camera: string) => void) => () => void;
|
||||
};
|
||||
app: {
|
||||
quit: () => void;
|
||||
@@ -57,6 +58,11 @@ const electronAPI: ElectronAPI = {
|
||||
frigate: {
|
||||
startStream: (rtspUrl: string) => ipcRenderer.invoke('frigate:startStream', rtspUrl),
|
||||
stopStream: () => ipcRenderer.invoke('frigate:stopStream'),
|
||||
onPersonDetected: (callback: (camera: string) => void) => {
|
||||
const handler = (_event: IpcRendererEvent, camera: string) => callback(camera);
|
||||
ipcRenderer.on('frigate:personDetected', handler);
|
||||
return () => ipcRenderer.removeListener('frigate:personDetected', handler);
|
||||
},
|
||||
},
|
||||
app: {
|
||||
quit: () => ipcRenderer.invoke('app:quit'),
|
||||
|
||||
Reference in New Issue
Block a user