VorlonCD / bi-aidetection

Alarm system for Blue Iris based on Artificial Intelligence.
https://ipcamtalk.com/threads/tool-tutorial-free-ai-person-detection-for-blue-iris.37330/
GNU General Public License v2.0
203 stars 45 forks source link

No external trigger in BI from AI Tool #273

Open aesterling opened 3 years ago

aesterling commented 3 years ago

The BI log does not show an "EXTERNAL" trigger from AI Tool for the Back_Door camera. However, the AI Tool log shows the trigger URL was called. In BI's alerts list, the confirmed and annotated images but I'm not getting push notifications from BI and trying to determine why BI doesn't show an external trigger. Do you see anything in the AI Tool log that may be the problem?

Thanks!

AI Tool log for a confirmed person: Screen Shot 2021-08-22 at 10 49 32 AM

BI log shows the original motion which caused the image to be sent to AI Tool, but it doesn't show an external trigger returned from AI Tool: Screen Shot 2021-08-22 at 11 00 35 AM

However, the alert is confirmed and shows the annotated image: Screen Shot 2021-08-22 at 11 17 50 AM

VorlonCD commented 3 years ago

Latest version of BI? Perhaps related to this? https://github.com/VorlonCD/bi-aidetection/issues/266

aesterling commented 3 years ago

Thanks, @VorlonCD - yes, running latest BI release as of writing (5.4.9.18) but I can't say if this is a new problem. Will read through the other issue you linked.

tankdeer commented 3 years ago

I am seeing this same behavior, but only on recent versions of BI. On 5.5.0.15, it seems to work OK. On anything newer, I have the same symptoms of the alert never being confirmed, and as such, never running the BI alert tasks (Push notification, MQTT updates to Home Assistant, etc)

Since others are reporting it on different BI releases, makes me think it might be an environmental issue, hardware dependent, or some strange combination of versions, so I am not sure if it's a BI bug, or related to the delay issue mentioned.

I am running AITool 2.0.1206.7861

VorlonCD commented 2 years ago

@tankdeer I have kind of same issue with the latest BI. While I do get alerts listed in the BI clips list, my BI ALERT ACTIONS never trigger. I have it set up with a SINGLE camera doing all the work not like the original AITOOL method of have duplicate cameras. I suspect if I switched back to dupe cameras it may fix, but I havent gone through the effort of testing yet. Also, I have a few cameras that never seem to record video even when it has been correctly triggered/alerted.

tankdeer commented 2 years ago

Interesting. I never set it up the original way with duplicate cameras. By the time I'd discovered the tool, the single camera method was available, and frankly seemed easier. One inconsistent thing is it seems like half the time the alert gets cancelled, and therefore isn't on the normal clip list - but I see it if I look at cancelled only. That makes me wonder if it's related to the delay issue/request you linked to

All my cameras record 24/7, so no issues on that part.

VorlonCD commented 2 years ago

@tankdeer - the trigger URL seems to be really picky in BI 5.5.2.5? I think this is working for me now...

[BlueIrisURL]/admin?camera=[camera]&trigger&user=[Username]&pw=[Password]&flagalert=2&memo=[summary]&jpeg=[ImagePathEscaped]

The order of the parameters seems to matter??

tankdeer commented 2 years ago

Hmm. OK. I'll give it a shot later this week when I have time to kill a couple hours fighting this again, lol

tankdeer commented 2 years ago

Ok, sorry for the delay. I just got around to testing this, and unfortunately it's still an issue. I changed all my trigger URLs as suggested, installed the latest version of BI (5.5.3.7), and the latest version of AITOOL (2.1.6).

My tests showed pretty much the exact behavior as before - the camera would get triggered, AITOOL would confirm it, but it would never get confirmed in BI, so it never ran the alert actions. It seems like 5.5.0.15 is the magic release for me. Funny that other users have other releases that work or don't for them.

One thing I did notice, and I can't say if it did this before or not. Previously, I used flagalert=1 (flagged) on my trigger URL. However I changed it to flagaert=2 (confirmed) based on your recommend URL. Although the end result is the same, the alerts do show as flagged (but not confirmed) in my timeline view. This is odd, as I don't have anything to my knowledge that should flag them (flagalert=3 for example). So what is causing them to be flagged, but not confirmed?

I am starting to wonder if this is at all related to BI trying to implement Deepstack natively? Perhaps a conflict on their end of some sort. I don't have the native DS enabled, but these alerts are getting flagged somehow anyways.

In the meantime, it looks like I'm stuck on 5.5.0.15

tankdeer commented 2 years ago

Tested this again today with the latest versions of BI & AITOOL. Unfortunately still an issue.

Crowa-X commented 2 years ago

Tested this again today with the latest versions of BI & AITOOL. Unfortunately still an issue.

I just tried the latest update yesterday and came here to update that it still isn't fixed, but you beat me to it. Your suggestion of rolling back to 5.5.0.15 fixed it for me last month. So you are not the only one this is happening to. Thanks for your tip on the last working version.

VorlonCD commented 2 years ago

@tankdeer @Crowa-X - Yup, mine is mostly working on 5.5.3.7, but I cant get it to work with anything higher. Havent tried rolling back to 5.5.0.15 yet. Also havent tried the very latest build within the last 3 weeks or so.

I get everything to show up correctly and record in the ALERTS panel, but most of the time my "ON ALERT" actions such as playing a sound don't play consistently with 5.5.3.7. Its random when they do. Also, I had to switch each camera over to recording "Continuously" otherwise it doesnt always show the clip in Alerts. However, thats not really a problem because i have plenty of space and AITOOL is playing the sound and talking rather than using BI On Alerts.

you-wouldnt-believe.wav | Talk:There is a [label] by the sunroom

(That only works in the latest version 2.1.6.0)

If you pay for BI support you could try logging a bug.

Crowa-X commented 2 years ago

@tankdeer @Crowa-X - Yup, mine is mostly working on 5.5.3.7, but I cant get it to work with anything higher. Havent tried rolling back to 5.5.0.15 yet. Also havent tried the very latest build within the last 3 weeks or so.

I get everything to show up correctly and record in the ALERTS panel, but most of the time my "ON ALERT" actions such as playing a sound don't play consistently with 5.5.3.7. Its random when they do. Also, I had to switch each camera over to recording "Continuously" otherwise it doesnt always show the clip in Alerts. However, thats not really a problem because i have plenty of space and AITOOL is playing the sound and talking rather than using BI On Alerts.

you-wouldnt-believe.wav | Talk:There is a [label] by the sunroom

(That only works in the latest version 2.1.6.0)

If you pay for BI support you could try logging a bug.

I was able to contact support and they gave me a suggestion. They said the issue was because Blue Iris already triggered it so it is ignoring AI Tool. In the alerts tab for the camera, select "also re-triggers" on the Fire When section.

I have only tried it a few times by walking past my camera, but it seems like it may be working. I will update more when I have time to fully test it out but thought this might help others in their testing.

Village-Guy commented 2 years ago

I tested enabling re-triggers today with the latest BI release. Unfortunately, although BI started to action alerts it resulted in BI failing to record the full 30 second break time set. I ended up with random length clips. Initially I thought this might be caused by AI Tool sending Cancel commands, alas it continued recording random clips after disabling the AI Tool Cancel command. I am now considering cancelling my BI subscription, it appears BI has returned to the philosophy of only supporting users that record continuously which I guess is probably most of their paying subscribers. Fortunately after regressing through BI releases, version 5.5.0.15 appears to be solid.

tankdeer commented 2 years ago

I finally got around to enabling "also re-triggers" and testing with the latest release. So far so good, as it does appear that now allows it to alert. BI obviously changed something with how these triggers behave.

@Village-Guy I am a continuous recorder myself, but have you tried changing the record setting on yours to be "On Alert" instead of "On Trigger"? I would think that would solve your issue with random clip lengths

Village-Guy commented 2 years ago

Record "On Alert" is the normal setting for use with AITOOL. Motion Trigger is set to capture JPEGS which are analysed by AITOOL. If an item within a JPEG is recognised it sends an ALERT to BI. By setting Record "On Trigger" AITOOL is bypassed and a recording will be made on every motion trigger.

tankdeer commented 2 years ago

Fair point. That does seem odd, and possibly like a bug on BI side though.

glassbase commented 10 months ago

This may be from 2022... I discovered recently what the issue might be related to this.

I have been struggling with this for a few months as I moved my BI to a new tower, paid BI maintenance, upgraded BI to latest version (was running a BI version from 2021 or 2022) AND also switched to the single camera method. Too many changes I know :(

I use MQTT topic BlueIris/&CAM/&TYPE in BI alert actions. And subsequently watch topic BlueIris/_MyCameraName_/EXTERNAL in Home Assistant for motion states.

Steps:

  1. Camera gets triggered by MOTION_A
  2. Image sent to AI Tool
  3. AI Tool confirms and triggers back the camera (EXTERNAL)
  4. Now there is a double trigger on the camera
  5. BI does not publish 2 MQTT topics of &TYPE
  6. Instead, BI publishes a blank &TYPE at `BlueIris/&CAM/blank'

I submitted the info the BI support. He says he is fixing in 5.8.2.4