How do I use the Rule Action 'show the devices from metadata'?

I believe my question is similar to the one here:

https://supportcommunity.milestonesys.com/s/question/0D50O000049u32pSAA/sdk-attach-metadata-when-triggering-external-event?language=en_US

Here’s what I’ve done so far:

Under Tools → Actions → Generic Events, I have created a data source that receives TCP strings

Under Generic Events, I have created a generic event that watches for a string that contains “johntest” sent to the previously created data source

Under Rules, I have created a rule that creates a Log Entry when the previously created generic event is triggered.

I have executed a short python program that sends the string ‘xxjohntestyyy’ in a TCP data packet to the data source defined above.

I observe that a log entry was created.

So far, so good…

Now, instead of creating a log entry, I want my Rule Action to be "Set to show

I note that when I select the option, I get two choices. “Use devices from metadata” and “Select devices”.

Obviously, this rule will me more flexible if I can pass the desired device in metadata.

But where does this metadata come from? As far as I can tell, the only place would be from the string passed in the TCP data packet.

Am I wrong about this?

If I am wrong about this, where does the metadata come from?

If I am not wrong about this, how do I format the string in the data packet to identify what camera I want to show on the Smart Wall?

I suspect it might have something to do with the information I get when I Ctrl-Click on the camera preview under the device tree that looks like this:

ID = ED96863F-ABDA-444C-8AC8-60EABE117F72

Edge = A3EF6F2D-51F2-48B0-BA78-EBA65BB3AA0F

But I don’t know for sure and even if it was, how does that need to be encoded in the string?

If you could help with this, I’d really appreciate it.

Also, I note that the next Rule - Set to show text ‘’ only allows hard coded message in the rule definition. If it were possible to pass the desired text message via the string in the TCP packet that initiates the Generic Event, that would be much more flexible.

For what it’s worth, here is the previously mentioned Python program:

import socket
 
 
def send_tcp_packet():
 
   # Server details
 
   server_ip = '###.###.###.###'
 
   server_port = 1238
 
 
   # Data to be sent
 
   data = 'xxjohntestyy'
 
 
   # Create a socket object
 
   client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 
 
   try:
 
       # Connect to the server
 
       client_socket.connect((server_ip, server_port))
 
 
       # Send the data
 
       client_socket.send(data.encode())
 
 
       # Receive and print the response
 
       response = client_socket.recv(1024).decode()
 
       print("Response received:", response)
 
 
   except ConnectionRefusedError:
 
       print("Connection refused. Make sure the server is running.")
 
 
   finally:
 
       # Close the socket
 
       client_socket.close()
 
 
# Call the function to send the TCP packet
 
send_tcp_packet()
 
 

Generic events do not offer support for “Use devices from metadata”. User-defined events and analytics events does.

You can see the scenario with a user-defined event if you run the ConfigAccessViaSDK sample, pick “Physical hierarchy”, pick a user-defined event and click the trigger button.

https://doc.developer.milestonesys.com/html/index.html?base=samples/componentsamples/configaccessviasdk/readme.html&tree=tree_2.html

https://github.com/milestonesys/mipsdk-samples-component

Okay, if generic events don’t offer that support, then why is it presented as an option when I’m making a rule from a generic event action? At least it is in 2022 R2…

Bigger picture question - I have an alarm system that I would like to configure to send TCP packets to Milestone to display relevant cameras when nearby alarms are set off. It looks like I could create an individual generic event/rule combo for each location, but is there a more efficient way to do that?

Generic events have the capacity to evaluate the passed string for matching - is there any possibility that in the future the capability to pass parameters via the string might be incorporated into the Rule processing?

I think you should explore the Analytics Event Trigger via XML and then use analytics events instead of Generic Events.

https://doc.developer.milestonesys.com/html/index.html?base=samples/protocolsamples/triggeranalyticseventxml/readme.html&tree=tree_3.html

Generic Events is a special case, they were introduced in a previous generation of the XProtect VMS and I am not optimistic about Milestone extending their capabilities as they have not been changed for many years.

If you switch to analytics events you can include further metadata and you can develop your own rule actions in the future. (Example - https://doc.developer.milestonesys.com/html/index.html?base=samples/pluginsamples/bataction/readme.html&tree=tree_1.html )

Note: Even without developing rule actions the support for rules with “Use devices from metadata” is there to use directly when working with Analytics Events.