Device Emulator Functions
Functions are helper variables that you can add into your payload when using the Device Emulator, and each function has a purpose. To add a function into your payload, click on thebutton and select a function.
You can use functions both in the JSON payload and the Raw payload types.
List of functions
- $random$: This function will be replaced by a random number that ranges from 0 to 100 whenever you send your payload.
- $randomBoolean$: This function will be replaced by a random boolean (true or false) whenever you send your payload.
- $busRoute$: This function will be replaced by a sequential bus route through Chicago. The location will change to a new one every time you send your payload. You should only use this function in the location field of a JSON payload.
- $sequential$: This function will be replaced by a number that is increased by 1 every time you send your payload.
- $sequentialHex$: This function will be replaced by a hexadecimal that is increased by 1 every time you send your payload. If you are using this function in a JSON payload, you should wrap it around quotes (
"$sequentialHex$"
). - $timestamp$: This function will be replaced by the current date and time as timestamp since epoch unix.
- $date$: This function will be replaced by the current date in the format
YYYY-MM-DD
. If you are using this function in a JSON payload, you should wrap it around quotes ("$date$"
).
If you are unsure of how to use functions, look for samples in the editor.
After adding the functions into your payload, you may wish to see how your payload will look like once you send it to our servers. You can do so by pressing the View Formatted Payload button.
This window will show which results your functions will have once the payload is sent to our servers.
You may also copy the formatted payload and use it in an external application, such as Postman.
Related Articles
Device Emulator
The device emulator is a powerful tool for developers to send data as if it was sent by a real device. The emulator is intuitive and requires just a few clicks to validate and send your data package. To access the device emulator, go to the Device ...
Using the Device Emulator
If you want a quick way to send data to your applications, but you don't have your hardware device available at the moment, or you simply need to send data to debug your applications, you can do that very easily using the Device Emulator. To access ...
Device Token
The secret key used between TagoIO and your device is called a Device Token. Any access from a device will only be granted with a valid token. This token should be kept in secret and only be shared with those you trust. Each time a device is created, ...
Data Analytics
Transform your raw sensor data to generate actionable insights using visual calculations. Data Analytics enables operations such as averaging, summing, finding maximum and minimum values, and more, directly on your widget variables. This feature ...
Device List Widget
The Device List widget is a table that dynamically populates with information about your devices, such as names, tags, configuration parameters, and IDs. It can't access devices' data, however. 1. Editing the device list It works as a dynamic table, ...