Anomaly Detection > Implementing Anomaly Detection > Preparing ThingWorx for Anomaly Detection
  
Preparing ThingWorx for Anomaly Detection
Before configuring ThingWorx for Anomaly Detection, be sure you have completed all of the prerequisite activities listed in Implementing Anomaly Detection.
1. In ThingWorx Composer, configure the Alert Processing Subsystem to point to the Training and Results services URIs:
Navigate to SYSTEM > Subsystems.
Open the Alert Processing Subsystem.
From the menu at the top, select Configuration to open the subsystem’s Configuration page.
Enter values for the following fields:
Anomaly Detection Training Service URI — Points to where you installed the Training service.
Example: http://localhost:8090/training
Anomaly Detection Results Service URI — Points to where you installed the Results service.
Example: http://localhost:8096/results/models
Click Save.
2. Create a new Value Stream that will store data from your edge device:
Click New at the top of the Composer window and select the Value Streams option. A Choose Template dialog box opens.
In the Value Stream option, click OK.
Enter a Name for the new Value Stream.
Click Save.
3. Create a new remote Thing that will represent the edge device that you want to monitor:
Click New at the top of the Composer window and select the Thing option.
Enter a Name for the new Thing.
In Base Thing Template, select a template that reflects the edge device you want to monitor, such as RemoteThing.
In Value Stream, select the name of the value stream you created above (Step 2).
Click Save.
The following video demonstrates how to create a specific type of remote Thing (an industrial gateway) and connect it to a KEPServer using simulated data.
Connecting Kepware to ThingWorx for Anomaly Detection
4. Configure your edge device to communicate with the remote Thing you created above. You will need the following information to configure your device:
The host URL and port where your ThingWorx instance is running. For example localhost and 8080.
The name of the remote Thing you created above (Step 3).
An Application Key.
If you need to create a new key:
Click New at the top of the Composer window and select the Application Keys option.
Enter a Name for the new key.
Select a User Name Reference for the new key (such as Superuser or System).
Click Save.
Make sure your device has successfully connected to the remote Thing before continuing. If the connection is successful, the isConnected property under Remote Thing will show a check mark in the Value column.
5. Add properties to the remote Thing and bind them to the corresponding properties on the edge device:
Click Add next to My Properties. A New Property panel opens on the right.
In the panel, enter the Name and Base Type of the property.
Click Logged to maintain a history of the property values.
In the Binding field, select the Remotely bound option.
In the Remote Property Name field, click the drop down arrow and select from the properties available on your edge device. (If you are working in a Thing Template or Thing Shape, there is no drop down to select properties. You will have to enter the property name in a text field.)
In the Push Type field, select the Always Pushed option.
Click to save the property and close the panel.
Follow the same procedure to add and bind additional properties.
Click Save to save the updated remote Thing.
Click Refresh. If the properties are bound successfully and data from the edge device is changing, you will see the numbers in the Values column of your bound properties update.
You are now ready to create an anomaly alert so that you can monitor data from the edge device. See Creating an Anomaly Alert.