Bring a live demo for your customers and team using Tago instead of showing a Powerpoint file! This application creates data in your Tago account to simulate a device using the content created in a Google Spreadsheet. Tago will transfer the data from each row of your spreadsheet one-by-one to help you to share how your connect product will look like even before you add real hardware (sensors) on it. The speed of the simulation will depend on the Time Interval that you define to run the script (with a minimum interval of 30 seconds). It is an automated way to simulate a real device.
-
Create a Google Spreadsheet by following this template: Training Spreadsheet.
-
The variables to be inserted should be located in the first row of the spreadsheet. Values should be included in the cells below in the same column. The variable names should not contain comma or spaces; also the values should not contain comma;
-
Make sure that your spreadsheet is set for Public Visualization so that Tago is able to access it. To do this, click in Share > Advanced > Change (Anyone who has the link can view) > Select ON - Anyone with the link > Can view or Can Edit.
-
Create a new Analysis in the Tago admin website, click on the tab Examples and take download of the Scheduler.
-
Go back to the "General information" tab and configure your analysis.
- Put a name for your analysis;
- Put 'Timer disabled' here until it verifies that everything is working, after that you can put a desired time to run your simulation;
- Let's run in Tago;
- Upload the file
scheduler.js.tago.js
file you downloaded in the examples tab; - Script language used for this script, select Node;
- Click on Save button.
-
Create a new device: Device > + > Put the name for your device > Save.
-
Get a token from the device that will receive the simulated data. Select the device you just created > Tokens > Copy a token.
-
Go back to analysis you just created.
-
Click on the tab Environment Variables and create new variables:
- Put the "key" with the name device_token and at "value" paste the token of your device;
- Put the "key" "url" with the name url, and at "value" paste the URL from your Google Spreadsheet;
- Click on Save button.
- Go to the Analysis, in the Tago admin, and select your analysis.
- Click on the tab Console.
- Click on Run Script.
- Check the Console to see if there is any error or if it is running successful.
- If everything is normal, go to Time interval to run this script and put to run in the time that you want.
You can input some reserved variables in your spreadsheet, that will not be write into your bucket. These variables can trigger special conditions when the script get's to that line, such as to send email or add color propertie to the variables written at that moment. The reserved variables are:
- time: Will become a propertie of all variables generated by the spreadsheet. It defines a time for the variable to be added; the time can be in the future or in the past. Make sure to use the format "MM/DD/YYYY HH:mm";
- email: Send an e-mail to the address. Use with email_msg to personalize the message.
- email_msg: Body of the message to be sent. Use it with email.
Used by some widgets to display points, messages, colors, and icons. Here is the list of fields that are used by Tago widgets.
- x: Used for Layers X coordinate;
- y: Used for Layers Y coordinate;
- icon: Used for ImakeMarker to put icons;
- intensity: Used for HeatMap to points intensity;
- color: Used for Tables and Layers to display colors.
For more details about metadata, visit the documentation:
- Layers: https://tago.elevio.help/en/articles/28-layer
- Tables: https://tago.elevio.help/en/articles/22-table
To use in the spreadsheet, see below:
- Example 1: On the first row put metadata.color -> The color property will be sent to all the variables.
- Example 2: On the first row put your_variable_name.metadata.color -> The color will be sent only to the variable that was requested.
Unit is used to show different types of symbols that represent the unit of the variable.
To use in the spreadsheet, see below:
- Example: On the first row put unit.your_variable_name -> The unit will be sent only to the variable.