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

Motion sets as on despite nobody in the room #244

Closed
Buster14 opened this issue Apr 21, 2022 · 11 comments
Closed

Motion sets as on despite nobody in the room #244

Buster14 opened this issue Apr 21, 2022 · 11 comments

Comments

@Buster14
Copy link

Buster14 commented Apr 21, 2022

Version of the custom_component : v2.2.2

-->

Configuration

mqtt:
  host: 192.168.0.153
  user: passwd
  password: passwd
cameras:
  camera_1: # <------ Name the camera
    ffmpeg:
      inputs:
        - path: rtsp://admin:passwd@192.168.200.206:1206/Streaming/Channels/2/# <----- Update for your camera
          roles:
            - detect
            - rtmp
    rtmp:
      enabled: False # <-- RTMP should be disabled if your stream is not H264
    detect:
      width: 1280 # <---- update for your camera's resolution
      height: 720 # <---- update for your camera's resolution
    motion:
      mask:    
        - 0,71,408,62,407,25,0,25  
    zones:
      zone_0:
        coordinates: 0,538,29,571,93,632,117,668,139,673,200,673,315,678,447,680,559,681,636,668,774,663,896,663,1010,661,1075,646,1047,594,1051,520,1012,425,961,362,905,306,808,307,688,286,541,284,381,281,184,286

Add your logs here.

Describe the bug :

I have set frigate with masks and zones, and i'm trying to use its motion entity as a trigger, [switch.camera_1_detect]
The mask is already covering the timestamp, and nobody's supposed to be triggering the motion since the place is closed.
But why does the entity always reports as on?

Debug log

I will followup the logs soon, the place is crowded already.


Add your logs here.

@NickM-27
Copy link
Sponsor Collaborator

A couple things here:

  1. Even though it's called motion sensor, it has nothing to do with motion, just presence.
  2. You will want to check your camera for a false positive showing up as a person using the debug view in frigate.

@Buster14
Copy link
Author

Ok i was under the impression it works just like hikvision add on where it would turn off and on based on motion detected.
I don't mind using presence either as long as it detects human in the room.
Basically what i need is, IF there is human in the room, then do X.
#2 will do once the store is closed, right now it's too crowded to filter false positive.

@NickM-27
Copy link
Sponsor Collaborator

NickM-27 commented Apr 21, 2022

Basically what i need is, IF there is human in the room, then do X.

Yes, that's how it works today

#2 will do once the store is closed, right now it's too crowded to filter false positive.

Sure, it's going to definitely be true right now if there's people there. If it's still true when store is closed then it's likely a false positive somewhere.

@Buster14
Copy link
Author

Basically what i need is, IF there is human in the room, then do X.

Yes, that's how it works today

#2 will do once the store is closed, right now it's too crowded to filter false positive.

Sure, it's going to definitely be true right now if there's people there. If it's still true when store is closed then it's likely a false positive somewhere.

Actually when i posted that the store was closed..

i just tested it again with my spare cam, i simply leave it at my office like this, there's nobody in the room, timestamps already covered, but the sensor still says on... even after i set the state to off it would go back to on almost immediately

debug

@NickM-27
Copy link
Sponsor Collaborator

@Buster14 Which sensor are you referring to that says on? Screenshot of that would be helpful.

Also, does the frigate debug view show that it sees anything?

@Buster14
Copy link
Author

debugview
sensor

These ?
There's nothing on event either..

@NickM-27
Copy link
Sponsor Collaborator

Oh, that switch is for enabling or disabling object detection, that is not a "sensor" and does not represent any information for what frigate is detecting.

@NickM-27
Copy link
Sponsor Collaborator

The sensors should be used for the purpose you are describing

Screen Shot 2022-04-21 at 11 55 36 AM

@Buster14
Copy link
Author

Ah no wonder ! Found the right sensor just now, the symbol is the same thats why i mistook it.
Thanks again for the quick help nick i will monitor again once my place is open.

@nanosonde
Copy link

A couple things here:

1. Even though it's called motion sensor, it has nothing to do with motion, just presence.

@NickM-27 @blakeblackshear
This should be put into the docs! I have searched hours why the binary motion sensor does not reset to the "clear" state again while a stationary object is considered stationary and not moving for a long time. It kept staying in the state "detected".
Even for stationary objects I would have expected that the motion sensor only triggers while the stationary object moves and/or enters/leaves a zone.
Now I wonder how to have a binary sensor that indicates if a stationary object is moving within the zone.
Entering/leaving the zone should be easy as I just need to trigger on changes of the object count in that zone.

BTW (only cosmetic): According to the HA docs it seems that there is even the correct device class "presence": https://www.home-assistant.io/integrations/binary_sensor/
Even "occupancy" and "moving" might be considered here as well.

@NickM-27
Copy link
Sponsor Collaborator

NickM-27 commented Apr 26, 2022

@NickM-27 @blakeblackshear This should be put into the docs! I have searched hours why the binary motion sensor does not reset to the "clear" state again while a stationary object is considered stationary and not moving for a long time. It kept staying in the state "detected". Even for stationary objects I would have expected that the motion sensor only triggers while the stationary object moves and/or enters/leaves a zone. Now I wonder how to have a binary sensor that indicates if a stationary object is moving within the zone. Entering/leaving the zone should be easy as I just need to trigger on changes of the object count in that zone.

I'll take a look at the docs and see, this might fit better in the home assistant integration readme or elsewhere.

BTW (only cosmetic): According to the HA docs it seems that there is even the correct device class "presence": https://www.home-assistant.io/integrations/binary_sensor/ Even "occupancy" and "moving" might be considered here as well.

It already has the device class set as motion. Could be set to something else but then the name would need to be changed too which would break setups.

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

No branches or pull requests

3 participants