-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
FEAT: Ability to set sub labels for specific events #2949
FEAT: Ability to set sub labels for specific events #2949
Conversation
@blakeblackshear I will be testing this for at least the next few days (I setup some automations in HASS to set the sub label automatically) and will ping you when it is ready for review, but I wanted to make sure it is something you agree with / think is a good idea. My plan is to submit a PR to double-take as well so it can be automatic without user-input needed, and then be leveraged by other use cases if users want to, but I want to make sure it makes sense. |
I would format the body as json in the docs. No need to specify the header info as it's pretty standard for all clients that would send json anyway. |
Seeing very weird behavior where the sub_label field disappears after a reboot |
I am going to undo making sub_label null, it seemed to have a lot of data integrity failures and peewee exceptions after a second restart for some reason, not really sure why but using "" works 🤔 |
Making a field nullable in the table definition is not the same thing as setting None as a default value for a non-nullable field. Needs to be like this: sub_label=pw.CharField(max_length=20, null=True), https://docs.peewee-orm.com/en/latest/peewee/api.html#fields |
@blakeblackshear Thanks, I did try that in an earlier commit and I was seeing an error where the migration worked fine but then after another restart the field didn't show up in /api/events and it directly returned Will try again and will see what happens. |
Make sure your database is getting reset back to the previous schema between changes. |
@blakeblackshear I was using |
@blakeblackshear I am glad you mentioned in progress events. I made the changes you suggested and I am still seeing events with sub_label set in progress being reset to null when the event ends. Is there anywhere that I need specifically retain the value of sub_label? Since it isn't specifically being set anywhere I figured it wouldn't. I will do some more digging and see if I can pinpoint where it is happening. |
I am actually seeing this with |
I'm sure there is a way to tell peewee to only update some of the fields. By default it probably passes everything. Previously there wasn't anything that could be updated. |
I think it needs to be an update call rather than a replace. |
@blakeblackshear I tried changing it to an update call. The issue I am having trouble solving is that it seems the db entry is created on the first |
Okay I think I have an idea on how to do this |
Okay I think my solution is clean and should work well in all cases 👍 |
Vaguely related to this, it would be neat to have a hierarchy of labels with increasing precision, for example, person/man/nick, vehicle/car, animal/dog. If you could get a match for animal even if the confidence for dog is too low, say, that would be useful. |
@interbiznw There is the preview docs: https://deploy-preview-2829--frigate-docs.netlify.app/integrations/api#post-apieventsidsub_label If you are using doubletake then the recent versions support this automatically. If you are just using HA then you can use the API directly from within HA. |
Thanks, I am using doubletake but do not see the person name tags automatically? is there something that needs to go in the config? |
Nevermind, found it https://github.com/jakowenko/double-take/#frigate-1 |
Implementation for #2900
This adds an API to update a specific event with the name or type. For example, I am using Double-Take and can use this to add a sub label so it shows in the UI going from
Person
->Person: Nick
.