Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image entity/snapshot to update at start of event #15859

Open
geftactics opened this issue Jan 6, 2025 · 10 comments
Open

Image entity/snapshot to update at start of event #15859

geftactics opened this issue Jan 6, 2025 · 10 comments
Labels
enhancement New feature or request

Comments

@geftactics
Copy link

geftactics commented Jan 6, 2025

Describe what you are trying to accomplish and why in non technical terms
Since 0.14 frigaate no longer appears to send a snapshot image as a message MQTT as soon as the object detection has happened. We only seem to get this once the event has finished or cleared, which results in alerts in home assistant having an old or stale picture entity image attached to the alert.

Describe the solution you'd like
Update picture entity image with the snapshot as soon as the object event starts.

Additional context
This has been discussed in a few places, where we can see a lot more detailed comments and investigation:

  1. Image entity update delay frigate-hass-integration#705
  2. [Support]: 14.0 MQTT Camera Snapshot not Updating #11696
@NickM-27
Copy link
Collaborator

NickM-27 commented Jan 6, 2025

This is already the case, updates for the snapshot are sent for the object when it is first detected and not considered a best object, and then for the object when a better frame is found for it

else:
self.best_objects[object_type] = obj
for c in self.callbacks["snapshot"]:
c(self.name, self.best_objects[object_type], frame_name)

@geftactics
Copy link
Author

Possible to add some debug logging here? I really don't think these are getting sent out when object is initially detected, I only seem to get an update when the object is no longer there...

@NickM-27
Copy link
Collaborator

NickM-27 commented Jan 6, 2025

definitely possible, but it will likely be included in the refactor in 0.16 for this area. However, this related code never changed so I don't think it is a feature request but rather some bug that does not make any sense

@mathmaniac43
Copy link
Contributor

I have adjusted my Home Assistant automation to take a new snapshot as a workaround, but could revert to the image from MQTT to help diagnose if we find a path forward to debug. I believe I was (usually) getting the image from the prior detection, instead of the newest detection.

@NickM-27
Copy link
Collaborator

NickM-27 commented Jan 6, 2025

the current logic sends an image when an object stops being detected. Is it possible that the newer object image is just getting overwritten by the older object that has left, as opposed to the new object image never being sent?

@def1149
Copy link

def1149 commented Jan 7, 2025

My notifications are based on HA object detection events and I rarely (<<<1/100) get a stale snapshot.
I suspect some rare glitch.
I'm running the latest 0.15 build. It seems solid.

@NickM-27
Copy link
Collaborator

NickM-27 commented Jan 7, 2025

I am in the same boat, it appears that there may be some bug only prevalent with certain configurations. Not really worth spending the time to figure out what the bug is since that area of the code is currently being refactored anyway

@geftactics
Copy link
Author

I rarely (<<<1/100) get a stale snapshot

@def1149 - Do your objects that trigger alert usually stay in frame for a long time? I think this has some bearing on it...

@def1149
Copy link

def1149 commented Jan 10, 2025

I rarely (<<<1/100) get a stale snapshot

@def1149 - Do your objects that trigger alert usually stay in frame for a long time? I think this has some bearing on it...
I'm not sure what "stay in frame means"
These object triggers are people walking up to my front door and entering a zone.

@def1149
Copy link

def1149 commented Jan 10, 2025

In my case, I want a snapshot to go with an alert as soon as the object is detected, not when it is no longer detected. This seems to happen most of the time because the bottom of the bounding box on the object aligns with the zone border, and sometimes the snapshot is before it aligns with the border which is OK. I don't want notifications to mobile devices delayed for snapshots as there is already an inherent delay due to push communication delay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants