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

Allow stationary objects to be excluded from MQTT occupancy / count topics #7667

Open
ThisIsQasim opened this issue Sep 3, 2023 · 13 comments
Labels
enhancement New feature or request pinned

Comments

@ThisIsQasim
Copy link

Describe what you are trying to accomplish and why in non technical terms
I want to be able to disable detection for certain objects that are no longer in motion so that they don't trigger automations/notifications

Describe the solution you'd like
Allow disabling detection for certain objects that stop moving. Something like this in the config.

objects:
  track:
    - person
    - car
    - motorcycle
    - bicycle
  disable_on_stationary:
    - car
    - motorcycle
    - bicycle

Describe alternatives you've considered
I have considered the Avoiding stationary objects section of the docs but that sounds like a hack to me. The MQTT topics around zones are difficult to setup, the recording events are still triggered and I want to detect moving objects in the entire frame not just a zone.

@ThisIsQasim ThisIsQasim added the enhancement New feature or request label Sep 3, 2023
@NickM-27
Copy link
Sponsor Collaborator

NickM-27 commented Sep 3, 2023

automations/notifications

this can already be done with the stationary field that is included in the MQTT payload, ignoring when stationary == true

@NickM-27 NickM-27 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 3, 2023
@NickM-27
Copy link
Sponsor Collaborator

NickM-27 commented Sep 3, 2023

this type of setup would also be problematic because once an object is no longer tracked as stationary, motion will get it to be picked up again as a new event

@ThisIsQasim
Copy link
Author

this can already be done with the stationary field that is included in the MQTT payload

As far as I understand, this is only included in the events topics and I wanted the behaviour of <camera>/<object> to be customisable since that would be cleaner than subscribing to the global events topic and writing custom filters for all cameras and objects

this type of setup would also be problematic because once an object is no longer tracked as stationary, motion will get it to be picked up again as a new event

The underlying behaviour can stay the same just the UI and MQTT topics don't show stationary objects as "detected".

@NickM-27
Copy link
Sponsor Collaborator

NickM-27 commented Sep 3, 2023

The underlying behaviour can stay the same just the UI and MQTT topics don't show stationary objects as "detected".

Ah, that would be a different request then, I think that would make sense as a property of MQTT config

@NickM-27 NickM-27 changed the title Allow disabling detection for stationary objects Allow stationary objects to be excluded from MQTT topic Sep 3, 2023
@NickM-27 NickM-27 changed the title Allow stationary objects to be excluded from MQTT topic Allow stationary objects to be excluded from MQTT occupancy / count topics Sep 3, 2023
@NickM-27 NickM-27 reopened this Sep 3, 2023
@NickM-27 NickM-27 added the pinned label Sep 3, 2023
@ThisIsQasim
Copy link
Author

I think this is not just limited to MQTT, the UI can also take into account this config and not show an event with a stationary object as “In progress”. Basically an easier and more native support for “Avoiding stationary objects” with the underlying detection mechanism staying the same.

@NickM-27
Copy link
Sponsor Collaborator

NickM-27 commented Sep 3, 2023

No, changing the in progress event structure would be directly affecting the internal structure. Events are essentially tracked objects, if an object is still being tracked then the event is in progress.

@ThisIsQasim
Copy link
Author

So I have this camera that is pointing at a bunch of stationary objects with almost zero empty space to be used as a detection zone as described here. This results in an object count that is always > 0 on the MQTT topic and an endless event of a stationary scene. It’s good to know that the former case is under consideration but it would be even better if the events could be decoupled from detection so that stationary objects can be excluded.

@NickM-27
Copy link
Sponsor Collaborator

NickM-27 commented Sep 3, 2023

I think an example image would be helpful to see

@NickM-27
Copy link
Sponsor Collaborator

NickM-27 commented Sep 3, 2023

By the way this is already possible with the max_frames config but as I said highly discouraged and not designed to be used that way. It is directly working against the way frigate is designed to work as I described.

@ThisIsQasim
Copy link
Author

I think an example image would be helpful to see

I can’t share the actual frame but it’s a garage with multiple vehicles that cover the entire frame. So the frame can’t be divided into entry/exit zones as suggested in the docs. This leaves the vehicles causing an always ongoing event in the UI and a positive presence count in the MQTT topic.

@ThisIsQasim
Copy link
Author

By the way this is already possible with the max_frames config but as I said highly discouraged and not designed to be used that way. It is directly working against the way frigate is designed to work as I described.

Sorry I don’t understand, If this option is discouraged, should I still use it or would you consider planning for a better solution to achieve this?

@NickM-27
Copy link
Sponsor Collaborator

I see the usecase for having a presence count that excludes stationary objects.

But the event in the UI is valid and the way things are meant to work, I don't see that as a problem. Seems like something a much simpler solution like #7746 would address

should I still use it or would you consider planning for a better solution to achieve this?

from the frigate perspective, it is not meant to be used that way, I would not advise it

@ThisIsQasim
Copy link
Author

I see the usecase for having a presence count that excludes stationary objects.

yeah I see an active_objects mode in the recording section. I would love something similar for the MQTT config but on a per object basis.

But the event in the UI is valid and the way things are meant to work, I don't see that as a problem. Seems like something a much simpler solution like #7746 would address

Alright. Maybe I am misunderstanding what’s meant by events but anything that lets me filter out stationary objects would be good enough from that page would be good enough.

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

No branches or pull requests

2 participants