Blue Iris Long Delay with CodeProject Object Detection

Vettester

Getting comfortable
Joined
Feb 5, 2017
Messages
748
Reaction score
704
Have you tried adding your MQTT trigger to "Immediate {pre-altert) actions..." to see if that helps?

Screen Shot 2024-03-22 at 7.20.08 PM.png
 

curtis-r

n3wb
Joined
Dec 10, 2023
Messages
14
Reaction score
1
Location
USA
Have you tried adding your MQTT trigger to "Immediate {pre-altert) actions..." to see if that helps?
But then wouldn't that often be a false MQTT in the cases that AI doesn't confirm? Or are you just suggesting this as a test?
 

Vettester

Getting comfortable
Joined
Feb 5, 2017
Messages
748
Reaction score
704
Or are you just suggesting this as a test?
Just as a test to see if speeds up your MQTT times. If it does then then you know AI is the issue and you can work on decreasing your processing times.
 

roymickton

Young grasshopper
Joined
Jun 1, 2023
Messages
31
Reaction score
12
Location
UK
@curtis-r

Did you get anywhere with this? I have a similar setup to you and I am finding my AI confirmation is about 2 seconds after motion, but then MQTT publish can be another 27 seconds. I have my MQTT going off to my Home Assistant which in turn turns on my outside flood-light, but with such long delays it isn't doing what I want.

Are you running your BI on a Windows VM or bare-metal?
 

roymickton

Young grasshopper
Joined
Jun 1, 2023
Messages
31
Reaction score
12
Location
UK
Think I've just worked out what is going on here.......haha

When I actually stare at my logs, the MQTT publish happens with 500ms of AI detection. And then another MQTT comes to tell me the motion/AI has cleared.

I'm going to try set this up so logging doesn't group items together. I want a log of every separate event.
 

roymickton

Young grasshopper
Joined
Jun 1, 2023
Messages
31
Reaction score
12
Location
UK
Can't work out how to make the log show every event in a timeline.

However, if you save the logs to a .txt is shows the full timeline.....

3 12/04/2024 13:25:32.822 IPC1 Motion_A
0 12/04/2024 13:25:34.045 IPC1 AI: [ipcam-general] person:93% [996,727 1873,1298] 122ms
0 12/04/2024 13:25:34.040 IPC1 AI: person:93%
0 12/04/2024 13:25:34.275 IPC1 MQTT: Publish OK to BlueIris/IPC1/Status
3 12/04/2024 13:25:40.958 IPC2 Motion_A
0 12/04/2024 13:25:42.164 IPC2 AI: [ipcam-general] person:87% [148,421 1067,1027] 73ms
0 12/04/2024 13:25:42.178 IPC2 AI: person:87%
0 12/04/2024 13:25:42.508 IPC2 MQTT: Publish OK to BlueIris/IPC2/Status
3 12/04/2024 13:25:51.783 IPC1 Re-trigger: Motion_A
0 12/04/2024 13:25:52.898 IPC1 AI: [ipcam-general] person:94% [904,380 1573,904] 76ms
0 12/04/2024 13:25:52.803 IPC1 AI: person:94%
0 12/04/2024 13:25:53.035 IPC1 MQTT: Publish OK to BlueIris/IPC1/Status (this is the detector resetting after the break-point)
0 12/04/2024 13:26:13.008 IPC2 MQTT: Publish OK to BlueIris/IPC2/Status (this is the detector resetting after the break-point)
0 12/04/2024 13:26:17.546 IPC1 MQTT: Publish OK to BlueIris/IPC1/Status (this is the detector resetting after the break-point, as I caused a re-trigger)
 

actran

Getting comfortable
Joined
May 8, 2016
Messages
806
Reaction score
732
@roymickton Are you sending MQTT for "On Alert", and then another one for "On Reset"?

Just in case you did not know, the "On Reset" MQTT msg is not required if you configured your Home Assistant binary sensors like this:
Code:
 # MQTT
mqtt:
  binary_sensor:
   - name: "Person at Front Door"
      object_id: "person_at_front_door"
      state_topic: "Processed/person/Doorbell"
      value_template: "{{ value_json.state }}"
      json_attributes_topic: "Processed/person/Doorbell"
      off_delay: 15
Meaning, use "off_delay" config.
 

roymickton

Young grasshopper
Joined
Jun 1, 2023
Messages
31
Reaction score
12
Location
UK
@roymickton Are you sending MQTT for "On Alert", and then another one for "On Reset"?

Just in case you did not know, the "On Reset" MQTT msg is not required if you configured your Home Assistant binary sensors like this:
Code:
 # MQTT
mqtt:
  binary_sensor:
   - name: "Person at Front Door"
      object_id: "person_at_front_door"
      state_topic: "Processed/person/Doorbell"
      value_template: "{{ value_json.state }}"
      json_attributes_topic: "Processed/person/Doorbell"
      off_delay: 15
Meaning, use "off_delay" config.
I did not know that. I'll have to look into that.
 

curtis-r

n3wb
Joined
Dec 10, 2023
Messages
14
Reaction score
1
Location
USA
If you don't have BI MQTT Reset and are monitoring MQTT outside of Home Assistant (such as MQTT Explorer), I suspect the initial alert would stay 'ON'. Of course this may not matter to anyone but probably safest to just have BI reset the MQTT to 'OFF'. But @actran I wasn't aware of the Home Assistant off_delay option, so that's good to know, but I also acquire the sensors through the BI Integration rather than manual yaml entries.

Just to provide an update to the issue that started this thread, I've gone down quite the rabbit hole, but unfortunately I can't say what solved at least my MQTT delay issue, but I CAN say that BI's GUI log is not accurate. For any debugging, one needs to use the .txt master log. Look at these two events. The GUI shows a delay of 12 seconds from the motion to MQTT. The proper log, less than 3 seconds, which is when Home Assistant received the MQTT.

BlueIris_jNDa8tJuxj.jpg

editplus_pGexDWiqsX.jpg
 
Top