Asker's Object Detection adds a detected string to the Events Notes field so that one ends up with something like "[a] detected;car:87% Motion: Gate Closeup".
This works very well for single Monitors as I can, albeit inefficiently from the Db perspective searching for strings in text fields , delete all events that do not have "detected:" in the Notes.
However, this goes horribly wrong for linked Monitors.
I have Monitor A which is a closeup of the entrance gate linked to Monitors B & C which give a wider angle view.
When Monitor A gets a motion trigger, Monitors B&C trigger and get a cause of "Linked" and "Linked: House Gate" in the Notes field but there is no mechanism for determining which event Id on Monitor A was the trigger. Asker's Objection Detection runs on Monitor A and, if an object is found, changes the Notes field appropriately for the triggering event but obviously not for the linked events on B&C - because it can't determine which ones they are.
This means that my filter on "detected:" will delete the events on Monitors B&C thereby negating the purpose of having the linkage
What I'm proposing is that Events gets a couple more fields like so:
Code: Select all
alter table Events add column LinkedId bigint(20) unsigned default 0 after SecondaryStorageId;
alter table Events add column ObjectScore tinyint(3) unsigned NOT NULL DEFAULT '0' after MaxScore;
create index Events_LinkedId_idx on Events(LinkedId);
create index Events_ObjectScore_idx on Events(ObjectScore);
Code: Select all
update Events set Notes=CONCAT(Notes,<detect string>) where LinkedId=<ThisEventId>
Code: Select all
update Events set Notes=CONCAT(Notes,<detect string>), ObjectScore=<objectscore> where LinkedId=<ThisEventId>
FWIW, I have looked at monitor.cpp where it sets LINKED_CAUSE for the linked monitor's events but my understanding of the code structure is zero so I'm not confident enough to propose a patch but I'm more than happy to contribute with testing code written by someone who does know what they're doing