briis/securityspy

is binary_sensor.motion_<CameraName> active if SecuritySpy records continuously?

Closed this issue · 13 comments

Thanks for making this integration.
I can get images from my cameras into a dashboard but I'm not getting any activity on the motion sensors.
Could this be because I'm not using motion detection to trigger recording?

image

briis commented

Yes, motion detection will only work if Motion Detection is enabled on the Camera (Mode C)
There is nothing I can do about this, as the event stream only reports motion when it is enabled.

ok thanks, if motion detection is enabled in SS (as in my screenshot) but not used to trigger capture, should they appear in the event stream?

briis commented

Despite that setting, they will only appear if you have Armed Motion setting. Try and press the M letter on top of a camera window and select Armed 24/7 then you should start seeing motion events occuring.

Despite setting the "M" option to "Armed 24/7" I still don't see any events on binary_sensor.motion_CameraName
Is this the right sensor to use in HA?

Is there any log of the SS events I can check?
In SS preferences, under cameras/CameraName/Motion capture, I enabled Image capture in response to motion trigger. This generated lots of images from that camera which (I think) tells me that motion capture is firing in SS.

Hello, did you resolve your issue? I am having issue where motion detected is not clearing.

briis commented

No, I have not had time to look in to this yet.

Briis, I've experimented with SecuritySpy's HomeKit integration and believe motion detection is flagged there (confirming my SS configuration does detect motion) but I prefer the configurability of HomeAssistant so am looking forward to trying an update if you find time to look at it.

briis commented

I will do it as soon as I can.

briis commented

You are not fogotten, Hopefully I will have time during this week to look at it.

briis commented

So I have been digging a bit more in to what triggers what, and also why it works for me, and maybe not for all.

I use the EVENT STREAM described here to watch for events that are happening, including motion detection, Arming and Disarming etc. There are two events that can start a motion event: TRIGGER_M and MOTION. However there is no event that flags that a Motion event is completed. So what I do is: Under Camera Settings and Motion Settings, I have activated Movie Capture and set the Capture type to One movie per Event, then I watch for the FILE event, which is triggered when the Motion event has stopped and the Video file is written.

Without this setup, you will get a motion event triggered, but it will never go back to OFF. With the current API there is not more I can do about this. If we could just get Bensoftware to add a Motion OFF event, then things would be a lot easier. (I have just posted an ask for that in the SS forum)

Also, Motion Events only occur when Armed M is enabled. So it is not enough to have Continous Capture enabled, you must have Motion Capture enabled.

I have not experimented with the Homekit Integration, but I am sure it uses a different approach to getting the data from SS. But I might have a look to see if there is anything I can sniff up.

Hi Briis, thanks for the update.
I believe I've configured SS as you describe.
I had a look at the eventstream from my SS instance and can see the events below, including a FILE event, but I still don't seem to get any events in HA.

Now I've learnt how to see this event stream I think it's the CLASSIFY event that is most interesting for my use.
I have a hardware rather than software background but where I've come across events they refer to atomic points in time so don't have discrete starts and ends. I'm hoping to turn a light on for a period so only need a single CLASSIFY HUMAN event.

--eventStreamBoundary
Content-Type: text/plain
Content-Length: 42
20210505160234 76 3 MOTION 932 348 320 296
--eventStreamBoundary
Content-Type: text/plain
Content-Length: 42
20210505160234 77 3 MOTION 852 439 320 198
--eventStreamBoundary
Content-Type: text/plain
Content-Length: 42
20210505160234 78 3 MOTION 786 477 320 198
--eventStreamBoundary
Content-Type: text/plain
Content-Length: 42
20210505160234 79 3 MOTION 692 492 320 198
--eventStreamBoundary
Content-Type: text/plain
Content-Length: 40
20210505160234 80 3 CLASSIFY VEHICLE 100
--eventStreamBoundary
Content-Type: text/plain
Content-Length: 33
20210505160234 81 3 TRIGGER_M 256
--eventStreamBoundary
Content-Type: text/plain
Content-Length: 33
20210505160234 82 3 TRIGGER_A 256
--eventStreamBoundary
Content-Type: text/plain
Content-Length: 42
20210505160234 83 3 MOTION 626 507 320 198
--eventStreamBoundary
Content-Type: text/plain
Content-Length: 42
20210505160235 84 3 MOTION 266 516 480 204
--eventStreamBoundary
Content-Type: text/plain
Content-Length: 42
20210505160235 85 3 MOTION 200 564 372 156
--eventStreamBoundary
Content-Type: text/plain
Content-Length: 24
20210505160241 86 X NULL
--eventStreamBoundary
Content-Type: text/plain
Content-Length: 125
20210505160245 87 3 FILE /Volumes/USB_SecuritySpy/SecuritySpy/Captured Files/Front/2021-05-05/05-05-2021 16-02-08 M Front.m4v
--eventStreamBoundary
briis commented

I have preped for the CLASSIFY EVENT, but until I get this done. If you look at the attributes of the binary motion sensors created, there is already an Attribute called event_object. If AI is enabled this will contain either Human or Vehicle, if that is detected. I get this from the TRIGGER_M event. I will work on catching the CLASSIFY event also.

briis commented

No activity on this issue for a long time. Closing now.