Triggers, alerts and AI

gu3st

n3wb
Joined
May 13, 2022
Messages
8
Reaction score
5
Location
South Africa
Hi guys

I have BI set up with 6 Loryta (Andy) 5442 cams. I make use of IVS rules to trigger the camera, which then sends the image to CodeProject AIServer running on a separate machine, and if it detects a person, an alert is generated. If no person is detected, it cancels the alert.

This all works perfectly.

Now I'm looking for a way to manually trigger an alert that bypasses AI. The use case is this: my home alarm system is hooked up to Home Assistant. Sometimes I get false alarms (cat's, plants, wind, etc). When the alarm triggers, I would like to generate an alert in BI so I can review in the morning to see what may have caused the false alarm and possibly remedy it (cut the plants down, etc).

I've found functionality through the HTTP API where I can trigger a camera (or group of cameras), but if I trigger the camera on a false alarm, then AI doesn't detect a person and then cancels the alert.

I've found another HTTP command which allows me to take the last trigger and set it to confirmed - but I'm worried that by doing this manually, I may "overwrite" a real alarm (person detected) with my manually confirmed alert, which will screw around with the metadata/text on the alert.

So is there another way to do this, other than calling an external trigger and then overwriting the latest (cancelled) alert to confirmed?

I've thought about using cloned cameras and switching off AI for the cloned cameras, but I'm concerned about using double the storage space for recordings. Is there a way around this? Or am I maybe misunderstanding how cloned cameras work?

Appreciate the help.
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
25,212
Reaction score
49,121
Location
USA
Several different ways you can go about it. Two that immediate come to mind include:

You could put an alert in under Immediate Actions that will bypass the AI

1678228289479.png

Or you could do the clone camera and only record on triggers and then under clips and archive put it to a different location with a different retention policy like 3 days or a week or whatever you want to be able to review those. Then it won't double the storage and would be a fraction of it.
 

Mike A.

Known around here
Joined
May 6, 2017
Messages
3,839
Reaction score
6,412
Why "double up" on the AI by using both on-cam IVS and Code Project. You can set the IVS to only trigger on person and by-pass the rest?
 

JL-F1

Getting the hang of it
Joined
Jun 12, 2020
Messages
120
Reaction score
73
Location
USA
If you didn't have the camera trigger on IVS(ONVIF/Camera's digital input)
and you used BI motion detection
then in AI you could check the box 'apply to motions triggers only'

then you could HTTP or MQTT and external alert and AI would not look at it

I have a camera set like this
it activates on motion and uses AI to check for person
Also If the back gate is opened Home assistant uses MQTT to trigger and flag the camera
Since my alerts only activate on 'person'
I don't get an alert sent to phone, but the camera records and I can go back and look at the flagged alert from the gate
 

gu3st

n3wb
Joined
May 13, 2022
Messages
8
Reaction score
5
Location
South Africa
Thanks for the quick replies!

@wittaj I can't quite seem to figure out how to bypass AI using Immediate Actions. However, I was a bit silly and didn't consider making the cloned camera only record on triggers, rather than continuous - which would obviously drastically cut down on space requirements, so thanks for that!

@Mike A. I initially set it up like this to try and offload as much of the processing off my BI server - as I'm only running an old i7 2600. I will try this method and see how the CPU holds up. We get a lot of wind here so some of the cameras are pretty constantly in motion, but will see how it goes.

@JL-F1 thanks, I think this is the method I'm going to go for, for now, and see how my CPU holds up. If CPU can't handle it, I'll go for the cloned camera recording only on triggers.

Thanks guys :)
 

Mike A.

Known around here
Joined
May 6, 2017
Messages
3,839
Reaction score
6,412
You don't really need the CodeProject side if all that you're trying to do is only trigger on person. Just use the IVS set for person. That will offload most all of the rest from your server.

You can use the BI integration to easily trigger a cam from some other sensor, etc. in HA. You don't even need to use MQTT in that direction, the functionality of the integration alone works fine to do that. I use that to trigger various cams from Hue motion sensors that I have around. The other direction, triggering some HA action from an event generated by the cam, you do need to use MQTT or some other way of picking up and passing it.
 

gokuro

n3wb
Joined
Aug 18, 2023
Messages
2
Reaction score
0
Location
Nashville, TN
Hi guys

I have BI set up with 6 Loryta (Andy) 5442 cams. I make use of IVS rules to trigger the camera, which then sends the image to CodeProject AIServer running on a separate machine, and if it detects a person, an alert is generated. If no person is detected, it cancels the alert.

This all works perfectly.

Now I'm looking for a way to manually trigger an alert that bypasses AI. The use case is this: my home alarm system is hooked up to Home Assistant. Sometimes I get false alarms (cat's, plants, wind, etc). When the alarm triggers, I would like to generate an alert in BI so I can review in the morning to see what may have caused the false alarm and possibly remedy it (cut the plants down, etc).

I've found functionality through the HTTP API where I can trigger a camera (or group of cameras), but if I trigger the camera on a false alarm, then AI doesn't detect a person and then cancels the alert.

I've found another HTTP command which allows me to take the last trigger and set it to confirmed - but I'm worried that by doing this manually, I may "overwrite" a real alarm (person detected) with my manually confirmed alert, which will screw around with the metadata/text on the alert.

So is there another way to do this, other than calling an external trigger and then overwriting the latest (cancelled) alert to confirmed?

I've thought about using cloned cameras and switching off AI for the cloned cameras, but I'm concerned about using double the storage space for recordings. Is there a way around this? Or am I maybe misunderstanding how cloned cameras work?

Appreciate the help.
could you share your finding on how to trigger a camera from http api? I have found a few samples but none are working for me.

I have turned off authentication for local network and still I get "Authorization required" with each command I send


Code:
MacBook2017:~ keith$ curl -v 'http://10.0.0.21:81/admin?camera=OD6&manrec=1'
*   Trying 10.0.0.21:81...
* Connected to 10.0.0.21 (10.0.0.21) port 81 (#0)
> GET /admin?camera=OD6&manrec=1 HTTP/1.1
> Host: 10.0.0.21:81
> User-Agent: curl/7.79.1
> Accept: */*
>
* Mark bundle as not supporting multiuse
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Server: BlueServer/5.7.9.1
< Date: Sat, 19 Aug 2023 03:04:02 GMT
< P3P: CP="CAO COR CURa ADMa DEVa OUR IND ONL COM DEM PRE"
< Access-Control-Allow-Origin: *
< Set-Cookie: session=6b394098263c207f3c74049222c13e75; path=/
< Connection: close
< Cache-Control: no-cache, no-store
< Content-Length: 22
<
* Closing connection 0
Authorization required
 
Last edited:

Alaska Country

Getting comfortable
Joined
Jun 10, 2021
Messages
452
Reaction score
660
Location
Alaska
This may be of assistance. There are a few more HTTP API's that could work depending on model and FW. It is a matter of trial and error and a lot of testing.


To trigger the cameras on BI a Hubitat C7 hub is used to process the SET statements. If using time as a trigger, then 30 mins prior to sunset and 30 mins after sunrise are a good starting point. However, have now switch from time to LUX as illumination takes care of those dark cloudy days.

There us also a nice 'how to' on using the PTZ setting on BI to trigger the cameras by using BI's ability to send a SET statements based on sunset/sunrise plus or minus your selected time offset.
 
Last edited:

gokuro

n3wb
Joined
Aug 18, 2023
Messages
2
Reaction score
0
Location
Nashville, TN
This may be of assistance. There are a few more HTTP API's that could work depending on model and FW. It is a matter of trial and error and a lot of testing.


To trigger the cameras on BI a Hubitat C7 hub is used to process the SET statements. If using time as a trigger, then 30 mins prior to sunset and 30 mins after sunrise are a good starting point. However, have now switch from time to LUX as illumination takes care of those dark cloudy days.

There us also a nice 'how to' on using the PTZ setting on BI to trigger the cameras by using BI's ability to send a SET statements based on sunset/sunrise plus or minus your selected time offset.
thanks but that seems to be to alter the camera directly, I am looking to control blue iris functions
 
Top