User-defined event, when triggered via a rule on other events occurring on cameras, does not contain any camera information

The user-defined event My UserDefined Event is being triggered fine, based on the rule I show in the screenshot.

I’m listening for and successfully receive this event in the Event Server where I’ve registered a handler on NewEventIndication.

The problem is that it does not contain any information about the camera that was responsible for indirectly triggering it. The Source is the site itself. I even printed the raw Message given to the handler as the first parameter and it contains no information that can help me identify the camera. I’m on XProtect Essentials+ 2019.

What I’m trying to do is listen to various kinds of system, device etc events (in this case Motion Started) that are triggered against cameras. And by creating a user-defined event this way, make it simpler for the user of the plugin, who can then just create rules like this and customize exactly what events trigger the user-defined event. So a sort of common interface; the plugin will only listen for this user-defined event.

I also tried to ditch this approach and added an item picker on the plugin’s Management Client UI which the user can click on and select the events it wants the plugin to listen. But the item picker never allows selecting system, device, analytics etc events. I even made the item picker without any KindFilter (so no filter)…and still no event item was shown in the select list.

Any help would be appreciated.

The issue is that the “On trigger ” rule will have the wrong source for your purpose, I think you have described this accurately and correct.

One way to solve is might be to develop your own rule action. Please see Bat Action sample. This sample shows how a plug-in in the Event Server can work together with the XProtect rule system. Note how it can take the source of the camera that trigger it. You will need to change the sample code so that instead of executing a batch file it triggers a user defined event. (If reusing code make sure to replace the GUIDs.)

https://doc.developer.milestonesys.com/html/index.html?base=samples/bataction.html&tree=tree_1.html

About the ItemPicker not working with user defined events. For user defined events there is no grouping. Please try to see it with a GetItems where you use SystemDefined ItemHierarchy.

https://doc.developer.milestonesys.com/html/index.html?base=miphelp/class_video_o_s_1_1_platform_1_1_configuration.html&tree=tree_search.html?search=getitems