@brcarls You can configure BI5 to run a local program or script in "On alert..." Your script would encapsulate the if-then logic you require.
If you have Home Assistant (or similar home automation platform), BI5 can send that event with &PLATE value via HTTP or MQTT. Then in Home Assistant, you can configure an automation to do whatever you want, including controlling lights, sirens, etc...
Home Assistant automation would be more configurable since you can add additional conditions and/or other triggers like time of day, alarm system status as part of the logic for taking action.
I have something set up in Node Red to do the same thing, although I haven't had cause to watch for any tags yet. I don't use Home Assistant - I'm using Hubitat for home automation - but I think standing up Node Red is probably quicker and easier than Home Assistant, so it might be a good option unless you want Home Assistant for other things.
I send LPR alert information to MQTT so that I can log the tags in a database via Node Red. I have a separate flow in Node Red that uses a function node to check the tags. Unless you have really easy-to-read tags in your locale and a really good view of each tag, you probably want to account for partial matches as well as exact matches. If it's important enough to have real-time alerts set up, then it's probably important enough to be notified when a tag is read that is very similar to the one you are watching for.
I'll 'spoiler' the rest of the details to avoid cluttering up the thread:
My flow is fairly simple.. MQTT -> Function to compare the read to a list of tags -> Switch for whether the hit was exact or partial -> Change node to set up my notification -> Send to my notification server
My function is below. This is still a work in progress and it could be made better with a little effort.
The MQTT message is JSON format and the tag that was detected is in msg.payload.plate. On the 4th line of my function I list the tags I want to watch for, including all the partial cases I think might result from misreading. So for ABC1234 I might enter the full tag, but also BC123, C1234, ABC123, etc. The more partial tags, the more false hits I'll get, but the less change of missing a hit.
The result of the function is I get either a message saying there was an exact match, or a message saying what plate was read and what it matched from the list.
If I'm watching for ABC1234 and the LPR reads 8C1234 (missing the first character, mis-reading the B), it would generate a msg.notfiy_text of: "Partial matches: Tag 8C1234 matched C1234"
If I get time to try to enhance this, I think it would be useful to be able to list the full tag I'm looking for, a text description/reason, and the partial elements for just that tag, so the message could be something like:
"Tag 8C1234 is a partial match for ABC1234 - Blue Honda Accord - car break-ins"
Looks like I'm going to have to dig a bit deeper into multi-dimensional arrays.
My function is below. This is still a work in progress and it could be made better with a little effort.
The MQTT message is JSON format and the tag that was detected is in msg.payload.plate. On the 4th line of my function I list the tags I want to watch for, including all the partial cases I think might result from misreading. So for ABC1234 I might enter the full tag, but also BC123, C1234, ABC123, etc. The more partial tags, the more false hits I'll get, but the less change of missing a hit.
Code:
var tag = msg.payload.plate
/tags to watch for
var check_for = ['ABC1234', 'BC123', 'C1234', 'ABC123']
const partial = check_for.filter(el => tag.includes(el))
/exact match
if ( check_for.includes(tag) )
{
msg.notify_text = 'Exact Match - ' + tag + " "
msg.hit_type = 'exact'
return msg;
}
else if ( partial.length > 0 )
{
/partial match
msg.notify_text = "Partial matches: Tag " + tag + " matched " + partial
msg.hit_type = 'partial'
return msg;
}
else
{
/no match
return null;
}
The result of the function is I get either a message saying there was an exact match, or a message saying what plate was read and what it matched from the list.
If I'm watching for ABC1234 and the LPR reads 8C1234 (missing the first character, mis-reading the B), it would generate a msg.notfiy_text of: "Partial matches: Tag 8C1234 matched C1234"
If I get time to try to enhance this, I think it would be useful to be able to list the full tag I'm looking for, a text description/reason, and the partial elements for just that tag, so the message could be something like:
"Tag 8C1234 is a partial match for ABC1234 - Blue Honda Accord - car break-ins"
Looks like I'm going to have to dig a bit deeper into multi-dimensional arrays.
Edit: enhanced version is down-thread - Blue Iris and CodeProject.AI ALPR
Last edited: