Giter Club home page Giter Club logo

analysis-scheduler's Introduction

What this script does

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.

How to run the script

  • 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.
    alt text

  • Go back to the "General information" tab and configure your analysis.
    alt text

  1. Put a name for your analysis;
  2. Put 'Timer disabled' here until it verifies that everything is working, after that you can put a desired time to run your simulation;
  3. Let's run in Tago;
  4. Upload the file scheduler.js.tago.js file you downloaded in the examples tab;
  5. Script language used for this script, select Node;
  6. 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:

  1. Put the "key" with the name device_token and at "value" paste the token of your device;
  2. Put the "key" "url" with the name url, and at "value" paste the URL from your Google Spreadsheet;
  3. Click on Save button.
  • I'ts variables should be according to the image:
    alt text

Check if it is Running

  • 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.

Google Spreadsheet and private properties

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.

Metadata

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:

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

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.

analysis-scheduler's People

Contributors

fabianoeger avatar vitorfdl avatar fabioer avatar

Watchers

James Cloos avatar Emir Marques avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.