Hi,
I have a Metadata Device and a Camera connected to a Recording Server. Is there a way to set up a rule to trigger an event when the Metadata sends data to the Recording Server, or should this be handled within the plugin code?
Hi,
I have a Metadata Device and a Camera connected to a Recording Server. Is there a way to set up a rule to trigger an event when the Metadata sends data to the Recording Server, or should this be handled within the plugin code?
There is no built-in rule capability to trigger a rule based on the receival of Metadata.
You would be able to develop a plugin, app or service that listens for the Metadata, perhaps even evaluates the contents, and then send an event to trigger a rule.
If you have created the metadata device and camera device it might be an alternative possibility to have the device raise an event. Device events can be used in rules.
Hi @Bo Ellegård Andersen (Milestone Systems) ,
Thank you very much.
I’ve implemented a service that listens for Metadata and evaluates its contents. Now, I need to trigger an alarm definition based on the event. Can I choose the Source from the event that triggers the alarm, because I can’t save the alarm definition without choosing a Source, or should this also be handled within the plugin code?
Here is the code for setting up the event, but which property actually refers to the event returned by the public override Collection GetKnownEventTypes(CultureInfo culture)?
EventHeader eventHeader = new EventHeader()
{
ID = Guid.NewGuid(),
Class = "Device Fault Event",
Type = "Device Fault Event",
Name = "Device Fault Event",
Timestamp = DateTime.Now,
Message = cameraItem.Name,
Source = eventSource
};
ReferenceList referenceList = new ReferenceList();
if (cameraItem != null)
{
referenceList.Add(new Reference() { FQID = cameraItem.FQID });
}
AnalyticsEvent analyticsEvent = new AnalyticsEvent()
{
EventHeader = eventHeader,
StartTime = startTime,
EndTime = endTime,
ReferenceList = referenceList,
ObjectList = new AnalyticsObjectList()
{
new AnalyticsObject()
{
Data = metadata
}
},
};
You have populated the reference list with the camera. The intended design is to use the camera as the source of the event. Only if you have multiple devices should you populate the reference list with additional devices you want to reference, alongside the primary device designated as the source.
Consider a scenario where you later use the analytics event to trigger an alarm. In the alarm definition, you would use the event’s source as the trigger/filter. This way, if the event is triggered by a specific source, the rule will activate accordingly.
Hi @Bo Ellegård Andersen (Milestone Systems),
Yes, I was conducting a test, but there will be four other cameras referenced concerning an item. Are you saying that I need to select each camera individually as a source within the alarm definition, or can I simply indicate that it applies to all cameras? If so, then the following should be acceptable, right?
Yes. In alarm definition you can pick one camera, multiple cameras, camera groups and any combination of cameras and groups, in addition to the All cameras.