diff --git a/docker/main.py b/docker/main.py index 2a2fa2d..cd8fdd0 100644 --- a/docker/main.py +++ b/docker/main.py @@ -130,7 +130,7 @@ def handle_event(event_id): logger.debug(f"Skipping already emailed event: {event_id}") return - clip_url = f"{HOMEASSISTANT_URL}/api/frigate/notifications/{event_id}/{event_info['camera']}/clip.mp4" + clip_url = f"{HOMEASSISTANT_URL}/api/events/{event_id}/snapshot.jpg" message = f"A {event_info['event_label']} was detected on camera: {event_info['camera']}.\nEvent ID: {event_id}" send_email(message, event_info['snapshot_urls'], event_info['event_label'], clip_url) @@ -161,7 +161,7 @@ def on_message(client, userdata, message): logger.info(f"Event from camera '{camera}' with label '{event_label}' and zones '{zones}' blocked by alert rules.") return - snapshot_url = f"{HOMEASSISTANT_IP}/api/frigate/notifications/{event_id}/snapshot.jpg" + snapshot_url = f"{HOMEASSISTANT_IP}/api/events/{event_id}/snapshot.jpg" if event_id not in event_cache: # First time seeing this event diff --git a/log.py b/log.py index 134c391..de91924 100644 --- a/log.py +++ b/log.py @@ -126,7 +126,7 @@ def handle_event(event_id): logging.warning(f"No cached info found for event ID: {event_id} on handle_event") return - clip_url = f"{HOMEASSISTANT_URL}/api/frigate/notifications/{event_id}/{event_info['camera']}/clip.mp4" + clip_url = f"{HOMEASSISTANT_URL}/api/events/{event_id}/snapshot.jpg" email_message = f"A {event_info['event_label']} was detected on camera {event_info['camera']}.\nEvent ID: {event_id}" send_email(email_message, event_info['snapshot_urls'], event_info['event_label'], clip_url) @@ -162,7 +162,7 @@ def on_message(client, userdata, message): logging.info(f"Event from camera '{camera}' with label '{event_label}' and zones '{zones}' blocked by alert rules.") return - snapshot_url = f"{HOMEASSISTANT_IP}/api/frigate/notifications/{event_id}/snapshot.jpg" + snapshot_url = f"{HOMEASSISTANT_IP}/api/events/{event_id}/snapshot.jpg" if event_id in event_cache: event_cache[event_id]['snapshot_urls'].append(snapshot_url) diff --git a/main.py b/main.py index 2a2fa2d..cd8fdd0 100644 --- a/main.py +++ b/main.py @@ -130,7 +130,7 @@ def handle_event(event_id): logger.debug(f"Skipping already emailed event: {event_id}") return - clip_url = f"{HOMEASSISTANT_URL}/api/frigate/notifications/{event_id}/{event_info['camera']}/clip.mp4" + clip_url = f"{HOMEASSISTANT_URL}/api/events/{event_id}/snapshot.jpg" message = f"A {event_info['event_label']} was detected on camera: {event_info['camera']}.\nEvent ID: {event_id}" send_email(message, event_info['snapshot_urls'], event_info['event_label'], clip_url) @@ -161,7 +161,7 @@ def on_message(client, userdata, message): logger.info(f"Event from camera '{camera}' with label '{event_label}' and zones '{zones}' blocked by alert rules.") return - snapshot_url = f"{HOMEASSISTANT_IP}/api/frigate/notifications/{event_id}/snapshot.jpg" + snapshot_url = f"{HOMEASSISTANT_IP}/api/events/{event_id}/snapshot.jpg" if event_id not in event_cache: # First time seeing this event