To Create a Simulator Object you'll perform the following steps
- Create a Simulator Object
- Define simulator fields using the simulator syntax
- Schedule the Object using the Global Action
Creating a Simulator Object
A simulator object it just like any other object, you can create it and assign it to an Account within your Foundry instance. Each field that you create on the Object will be used as the json element name in the simulator payload. For example, if you create a field on the object then the simulator will include the element "temperature" within the payload of your MQTT Feed. Each field should be defined as a String type. You can add as many fields as you like, however this is one required field named "Simulator MQTT Topic", that must be added to the object.
Simulator Field Syntax
Once the object type is defined, you'll then need to create an "new object" and enter the field values. While the field name determines what elements will be included in the payload, the value that is chirped by the simulator is based upon the following syntax.
- Random Number between x and y- [x-y]
For example, [25-100] would chirp a random number between 25 and 100 - Value that counts from x to y incremented by i - [x-y]-i++
For example, [1-10]-1++, would chirp 1 the first time, 2, then 3, etc until it reaches 10 and would then start back over at 1
Similar, [1.0-2.0]-.1++, would count from 1.0 to 2.0 in increments of .1 and then return to 1.0 - Picklist - values enters into a picklist will be randomly picked
- Static String - if you enter a static string, like "ABD12345" as the value for a field called "serial_number", this value will be always include in the payload.
- Simulator MQTT Topic - this is the topic that you want the device to chirp on
Running the Simulator
To Run the Simulator:
- Go to advanced Search, and enter criteria to find all of the Simulator records you created
- Select the Objects
- Under the Action menu, select "Lambda Invoke"
- From the Type Menu select "Simulator"
If you click "Send Now" all of your simulator object will fire just once. To schedule the Simulator, click the "Schedule" button and set your frequency. If you require more than once a minute simulation, you a decimal in the frequency for the minute.
This Object Definition:
Will create this payload