# Documentation

Welcome to documentation for Thingsup - Enterprise IoT Platform to securely Connect, Manage and Analyse IoT data with Rules Engine, Database Connections and Custom Dashboard Builder


# MQTT Broker

Get started with Thingsup MQTT Broker Service, connect IoT devices over MQTT with device management, secure with authentication/authorization(ACL) mechanism and process data with Rules Engine

### Broker/Server URL

```
mqtt.thingsup.io
```

### Ports

```
1883 - for MQTT over TLS/SSL
8083 - for MQTT over Websockets with TLS/SSL
```

### Broker Security

Thingsup MQTT Broker communicates only with TLS/SSL support on both TCP/Web sockets. Below is the root certificate for TLS verification. You can find it at [Amazon Root CA 1](https://www.amazontrust.com/repository/AmazonRootCA1.pem).

```
-----BEGIN CERTIFICATE-----
MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF
ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6
b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL
MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv
b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj
ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM
9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw
IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6
VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L
93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm
jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC
AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA
A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI
U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs
N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv
o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU
5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy
rqXRfboQnoZsG4q5WTP468SQvvG5
-----END CERTIFICATE-----
```

###


# Add MQTT Device

Add device to Authenticate and Authorize MQTT connection Thingsup MQTT Broker. Provide access control list(ACL) to control publish/subscribe(pub/sub) access to MQTT topics.

### Add Device

![Add MQTT Device](/files/OC1pv7VYdmCIh3RIhw9f)

While adding a device, you need to provide following parameters:

* Device Key
* Password for Your Device&#x20;
* Name of Your Device
* Category for Your Device
* Client ID
* Access control topic with pub, sub or pubsub options

#### Device Key

Entered Device Key will be the Username for MQTT Connection. It always starts with the User's Account ID.

#### Password for your Device

Entered password will be considered as password for MQTT Connection.

{% hint style="info" %}
Please make sure you have noted down password because it will not shown anywhere once device get added.
{% endhint %}

#### Name for your Device

User can give a name for a device. Later user can search device by its name.

#### Category for your Device

User can assign a Category for device. It will be helpful for sorting devices by their category.

#### Client ID

Entered client ID will get used for MQTT Connection.

* Case 1: User can provide fixed client ID.&#x20;
* Case 2: If user is dynamically generating client Id in his code,  then he can provide client ID as **\*.**&#x20;
* Case 3: If single MQTT client is used by many devices then user has to keep it as "**\*".**


# Authorize MQTT Device

Control access of your MQTT device in Thingsup MQTT Broker by specifying access control permissions to publish/subscribe on provided topics.

### Access Control Topic

User can add topic with pub(publish only), sub(subscribe only) and pubsub(Both publish and subscribe) options. It always starts with user's account ID.

Please refer the following image.

![](/files/2dxz5HfY87g9tk0wjlPL)

Once Device gets added to account , user can see a list of devicesadded in 'Device Management' Sectio&#x6E;**.**

![View MQTT Devices](/files/UFvhAJuysjUW6jHg3oJy)

### Edit Device

User can add more access control topics or delete the device by clicking **Edit** button.

![Edit MQTT Device](/files/QMrTfkiUl3FAsYDaoe72)

![Edit MQTT Device](/files/rjiBS1bwQVDZDC9Ii65i)

###


# Test MQTT Connection

Test MQTT Configurations with built-in online MQTT client in Thingsup IoT Platform. Send/Receive or monitor your data via Thingsup MQTT Broker.

### MQTT Client

Now user can use MQTT Client option to establish a MQTT connection and to perform pubsub operations. Go to **Experiment** section from left menu of dashboard and choose **MQTT Client**.&#x20;

Here user need to enter same **Client ID**, **Username** and **Password** used while adding a device.

{% hint style="info" %}
Username will be the Device Key starting with your account ID.The Client ID and Password will be the same you have entered during [**Add Device**](/mqtt/add-mqtt-device) process.&#x20;
{% endhint %}

![MQTT Test Client](/files/FBlb7Qcqm1KydVsy1gNJ)

#### Subscribe to topic

User can subscribe to a topic which he has mentioned while adding device to account.

{% hint style="info" %}
User has to make sure he has chosen *sub* or *pubsub* option to given topic.
{% endhint %}

![Subscribe to MQTT Topic](/files/R0TKAejZezpLEwXmmOUA)

#### Publish to topic

User can publish to a topic which he has mentioned while adding device to account.

{% hint style="info" %}
User has to make sure he has given *pub* or *pubsub* option to given topic.
{% endhint %}

![Publish to MQTT Topic](/files/iXXJQjv08vxYVxLxSB9Q)

User can see the list of *Message already sent* and *Messages Received* in side section.


# Tutorial - MQTT Basics

Watch video tutorial of MQTT basics with Thingsup IoT Platform's MQTT Broker Service. Learn basic operations and configurations via tutorial series.

### Youtube Video&#x20;

<https://youtu.be/pWA5nJoqXYA>


# MySQL Connection

Integrate MySQL in your IoT Solution with Thingsup. Connect MySQL Databases and run queries to insert/get data via MQTT or HTTP APIs.

This provides a connection to User's MySQL Database. User need to provide following parameters to establish a connection to their MySQL database.

* **Host** - Public DNS/IP of MySQL Database
* **Port** - MySQL Port Number
* **Database** - MySQL Database Name
* **Username** - MySQL Username
* **Password** - MySQL Password

![Add MySQL Connection](/files/DpuBO2WXk2jGsNh0vmO1)

Please note the following points:

{% hint style="info" %}

* MySQL Authentication Plugin should be mysql\_native\_password.
* localhost database is not supported. You can connect your local MySQL server with tunneling service like [ngrok](https://ngrok.com/)
  {% endhint %}


# Redis Connection

Integrate Redis in your IoT Solution with Thingsup. Connect Redis Databases and run queries to insert/get data via MQTT or HTTP APIs.

This provides a connection to User's Redis Database. User need to provide following parameters to establish a connection to their Redis database.

* **Host** - Public DNS/IP of Redis Database
* **Port** - Redis Port Number
* **Database** - Database Number 0-15
* **Mode** - Redis Server Type Single/Cluster
* **Password** - Redis Authentication Key

![Add Redis Connection](/files/xYxZNJ2UyeO21A8iIWyC)

Please note the following points:

{% hint style="info" %}

* Database number is not applicable in Cluster Mode.
* localhost database is not supported. You can connect your local Redis server with tunneling service like [ngrok](https://ngrok.com)
  {% endhint %}


# InfluxDB Connection

Integrate InfluxDB in your IoT Solution with Thingsup. Connect InfluxDB Databases and run queries to insert/get data via MQTT or HTTP APIs.

This provides a connection to User's InfluxDB Database. User need to provide following parameters to establish a connection to their InfluxDB database.

* **Host** - Public DNS/IP of InfluxDB Database
* **Port** - InfluxDB Port Number
* **Database** - InfluxDB Database Name
* **Username** - InfluxDB User
* **Password** - InfluxDB Password

![Add InfluxDB Connection](/files/7XL2e2D8edKTmb8W2n2J)

Please note the following points:

{% hint style="info" %}

* InfluxDB Versions 1.X are supported.
* localhost database is not supported. You can connect your local InfluxDB server with tunnelling service like [ngrok](https://ngrok.com)
  {% endhint %}


# AWS Connection

Integrate AWS Services in your IoT Solution with Thingsup. Connect DynamoDB databases or execute AWS Lambda functions on MQTT message or HTTP APIs.

This provides a connection to User's AWS Account. User need to provide following parameters to connect to their AWS Services.&#x20;

* **Connection ID -** Customise connection ID name
* **Access Key  -** AWS account access key
* **Secret Key -** AWS account secret key
* **Region** - In case of multi regional resources, create separate connections.

{% hint style="info" %}
Please refer [AWS Account and Access Keys](https://docs.aws.amazon.com/powershell/latest/userguide/pstools-appendix-sign-up.html)  to know how to get AWS Account's Access Key and Secret Key.
{% endhint %}

![Add AWS Connection](/files/tOrOipF66pyifYuSkI0n)

Please note the following points:

{% hint style="info" %}

* Do not use AWS credentials for Root User.
* Create a IAM User and allow Access to only required Services and ARNs. For more info check [AWS Doc](https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys)
  {% endhint %}

#### AWS Connection Related Thingsup Actions

AWS Connection is required before executing any of the following AWS related Thingsup Actions:

1. [AWS Lambda Invoke Action](/actions/aws-lambda-invoke-action)
2. [AWS SQS Send Message Action](/actions/aws-sqs-send-messsage-action)


# PostgreSQL Connection

Integrate PostgreSQL databases in your IoT Solution with Thingsup.

This provides a connection to User's PostgreSQL Database. User need to provide following parameters to connect to PostgreSQL Database.&#x20;

* **Host -** Public DNS/IP of PostgreSQL Database
* **Port** - PostgreSQL Port Number
* **Database**  - PostgreSQL Database Name
* **Username**  - PostgreSQL User
* **Password** - PostgreSQL Password
* **TLS  - Use TLS for Connection**
* **Thingsup DB**

![Add PostgreSQL Connection](/files/i7ezjZMp2JnZU1FZP5yr)

Please note the following points:

{% hint style="info" %}

* Keep Database as '-' in case of no database name.
* localhost database is not supported. You can connect your local PostgreSQL server with tunnelling service like [ngrok](https://platform.thingsup.io/%22https://ngrok.com/%22)
  {% endhint %}


# MQTT Connection

Integrate your MQTT Broker with Thingsup.

This provides a connection to User's MQTT broker. User need to provide following parameters to connect to MQTT Broker.&#x20;

* **URL** - Public URL of MQTT Broker
  * Use mqtt:// or mqtts\:// or ws\:// or wss\:// in the URL to select connection protocol with SSL/TLS option.
* **Port** - MQTT Port Number
* **AutoClientID**  - Generate random clientID for connection
* **ClientID**  - Fixed ClientID in case of AutoClientID is false
* **Username** - MQTT Username
* **Password**  - MQTT password
* **TLS** - Use TLS for Connection

![Add MQTT Connection](/files/Z2yhqjkeNqr8IQwX7IQR)

Please note the following points:

{% hint style="info" %}

* For Thingsup MQTT Broker, use URL as mqtts\://mqtt.thingsup.io and Port 1883 with TLS set to true
  {% endhint %}


# InfluxDBv2 Connection

Integrate InfluxDBv2 in your IoT Solution with Thingsup. Connect InfluxDB Databases and run queries to insert/get data via MQTT or HTTP APIs.

This provides a connection to User's InfluxDB Database. User need to provide following parameters to establish a connection to their InfluxDB database.

* **URL** - Public URL of InfluxDB Database
  * If you are using InfluxDB Cloud, URL will be similar e.g. <https://us-west-2-1.aws.cloud2.influxdata.com>
* **Token** - Authentication Token for InfluxDB Database.

![Add InfluxDBv2 Connection](/files/kFxlw7Tx5iwFjPEntqG4)

Please note the following points:

{% hint style="info" %}

* You can start using InfluxDB Cloud with [Getting Started Guide](https://cloud2.influxdata.com/login) from Influx Data
  {% endhint %}


# Firebase Connection

Integrate Google Firebase Project with Thingsup.

This provides a connection to User's Google Firebase Project. User need to provide following parameters to connect Firebase project.&#x20;

* **ServiceAccountJSON** - Contents of Service Account JSON Key. Create Service Account for your project using [Get Service Account](https://console.firebase.google.com/project/_/settings/serviceaccounts/adminsdk) guide. This data is always saved encrypted in Thingsup Servers
* **URL** - Database URL of Firebase Project
  * Example: '<https://DATABASE\\_NAME.firebaseio.com>'. More info  [Read here.](https://firebase.google.com/docs/admin/setup)

![Add Firebase Connection](/files/7l3vyIvgX1izptncfmSB)

Please note the following points:

{% hint style="info" %}

* You can start using Firebase with [Getting Started Guide](https://firebase.google.com/docs/guides) from Google Firebase.
  {% endhint %}


# MSG91 Connection

Integrate MSG91 service with Thingsup.

This provides a connection to User's MSG91 account. User need to provide following parameters to connect to MSG91 account.&#x20;

* **AuthorizationKey -** MSG91 Account Authentication Key

![Add MSG91 Connection](/files/RY5lkHfRwtO1tEsVSpuL)

Please note the following points:

{% hint style="info" %}

* Make sure Auth Key is enabled in MSG91 Console
  {% endhint %}

#### MSG91 Connection Related Thingsup Actions

MSG91 Connection is required before executing any of the following MSG91 related Thingsup Actions:

1. [Send MSG91 SMS Action](/actions/send-msg91-sms-action)

   User can set MSG91 SMS Action as alert. For example, suppose if an IoT device is sending temperature data. And if user want to generate an alert like if the temperature goes below 10 Deg C, then he must receive an SMS about it.&#x20;

   User can configure MSG91 Action by customising the message and phone numbers as per requirement.


# MySQL Query Action

Run MySQL query completely serverless via Thingsup IoT Platform. Insert or get data from MySQL with simple MQTT rules engine or HTTP APIs.

This provides a way to run MySQL Query. Before adding MySQL Query Action, user has to define a [**MySQL Connection**](/connections/mysql-connection). User need to provide following parameters to add MySQL Query Action.

#### Query

User can write necessary MySQL static query or MySQL query based on dynamic fields here.

```
SELECT * FROM `books` WHERE `author` = `HC Verma`
```

```
SELECT * FROM test WHERE tutorial_id=1
```

User can write MySQL Query with "?" present on Dynamic Fields also.

```
//Example 1
SELECT * FROM `books` WHERE `author` = ? AND `ID` = ?

//params.push(payload.author);  //as a function
//params.push(payload.id);
```

```
//Example 2
SELECT * FROM test WHERE tutorial_id=?

//params.push(payload.id);  //as a function
```

```
//Example 3
SELECT * FROM `sanju` WHERE `tutorial_id`=? AND `tutorial_title`=?

//params.push(payload.id);    //as a function
//params.push(payload.title);
```

#### Function

* User can write JavaScript code to supply dynamic data to query. Here the "payload" object and "params" array object available in this code which can be used to supply dynamic data to written query.&#x20;
* "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* '?' will be replaced sequentially from params array contents.

```
params.push(payload.author);
params.push(payload.id);
```

#### Connection ID

User need to provide a Connection ID of MySQL database connection.

![Add MySQL Query Action](/files/k4YObWAG2p3vzdrbY4Zr)

Please note the following points:

{% hint style="info" %}

* "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* '?' in Query will be replaced sequentially from params array.
* In case of Static Query don't write anything in Function
* Data Response of MySQL query will be available as Action Response.
  {% endhint %}


# Redis Query Action

Run Redis query completely serverless via Thingsup IoT Platform. Insert or get data from Redis with simple MQTT rules engine or HTTP APIs.

This provides a way to run Redis Query. Before adding Redis Query Action, user has to define a [**Redis Connection**](/connections/redis-connection). User need to provide following parameters to add Redis Query Action.

#### Command

&#x20;User need to provide a Redis Command in Lowercase. Find [Redis Commands](https://redis.io/commands).

#### Function

* User can write JavaScript code to create dynamic Redis query.
* Here the "payload" object and params Array objects available in this code which are directly executed on Redis Connection along with supplied command.
* "payload" object is supplied from Action Trigger like Rules, Action Command etc.

```
//Example 1

params.push(payload.key);

//Command is hgetall
```

```
//Example 2

params.push("getname");  //to get name of current connection
params.push("list");     // to get the list of client connections to the server

//Command is client
```

#### Connection ID

User need to provide a Connection ID of Redis database connection.

![Add Redis Query Action](/files/HAADQC1ItfFwWIbmyma9)

Please note the following points:

{% hint style="info" %}

* "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* Data Response of Redis query will be available as Action Response.
  {% endhint %}


# InfluxDB Read Query Action

Run InfluxDB query completely serverless via Thingsup IoT Platform. Execute a read query on InfluxDB with simple MQTT rules engine or HTTP APIs.

It provides a way to run InfluxDB Query. Before adding InfluxDB Read Action, user has to define a [**InfluxDB Connection**](/connections/influxdb-connection)**.** User need to provide following parameters to add InfluxDB Read Query Action.

#### Function

* User can JavaScript code to create dynamic query.
* Here the "payload" object and "Query" String object available in the code which is directly executed on InfluxDB Connection.
* "payload" object is supplied from Action Trigger like Rules, Action Command etc.

```
//Example 1

Query = "select Count(Result) from MY_MEASUREMENT WHERE time > now() - 24h GROUP BY time(30m) order by time desc"
```

```
//Example 2

Query = `SELECT * FROM "ienergyDigital" WHERE "Current" = 4.17`
```

#### Connection ID

User need to provide Connection ID of InfluxDB database connection.

![Add InfluxDB Read Query](/files/0jv7AIumUWTQoYbjTFyN)

Please note the following points:

{% hint style="info" %}

* "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* Data Response of InfluxDB query will be available as Action Response.
  {% endhint %}


# InfluxDB Write Point Action

Insert or Write point to InfluxDB completely serverless via Thingsup IoT Platform. Insert data in InfluxDB with simple MQTT rules engine or HTTP APIs.

This provides a way to write data point to InfluxDB. Before adding InfluxDB Write Point Action, user has to define a [**InfluxDB Connection**](/connections/influxdb-connection). User need to provide following parameters to add InfluxDB Write Point Action.

#### Measurement

User need to provide Name of InfluxDB measurement.

#### Function

* User can write JavaScript code to create dynamic query.
* Here the "payload" object, tags, fields and timestamp objects available in the code which are directly written on InfluxDB Connection.
* "payload" object is supplied from Action Trigger like Rules, Action Command etc.

```
tags["device"] = payload.devicename;
fields["temperature"] = payload.temperature;
timestamp = null; // Take server Time
```

#### Connection ID

User need to provide Connection ID of InfluxDB database connection.

![Add InfluxDB Write Point Action](/files/TlTgoJgipqDoT6wI5JC6)

Please note the following points:

{% hint style="info" %}

* "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* Data Response of InfluxDB write query will be available as Action Response.
  {% endhint %}


# Send Email Action

Send Email from Thingsup IoT Platform. Create and send customized bulk Emails with MQTT Rules or HTTP APIs for IoT Solutions.

It provides a way to send email. User need to provide following parameters to add Send Email Action.

#### ContentType

User can select option as HTML or Plain Text for ContentType of email.&#x20;

#### Function

* User can write a JavaScript code to create params for this Action. "payload" object and "params" object are available in this code.
* "params" object should hold key-value data pairs of any below mentioned params in their respective data types. "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* Any params passed through Function will override parameters passed through form.

```
params["To"] = payload.emailid
params["Subject"] = "Daily Report -" + new Date();
```

#### To

User can provide multiple comma separated Email IDs.

#### Cc

User can provide multiple comma separated Email IDs.

#### Subject

Subject of Email in String format.

#### Content

Actual content of Email in Plain Text or HTML String

![Add Send Email Action](/files/ZKLNz035MyRoAySrX5In)

![Add Send Email Action](/files/08LklApoyw33fyvCX48d)

Please note the following points:

{% hint style="info" %}

* "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* Data Response of send Email will be available as Action Response.
  {% endhint %}


# DynamoDB PutItem Action

Execute DynamoDB PutItem query completely serverless via Thingsup IoT Platform. Create custom items from MQTT Rules Engine or HTTP APIs.

It provides a way to Insert Single Item in DynamoDB. Before adding DynamoDB PutItem Action, user has to define a [**AWS Connection**](/connections/aws-connection). User need to provide following parameters to add DynamoDB PutItem Action.

#### TableName

User's DynamoDB Tablename

#### Function

* User can write a JavaScript code to create "DynamoDB Item".
* "payload" object and "item" object is available in this code. Item object should hold key-value data pairs. Keys are DynamoDB column names and Values are corresponding string/number/boolean values.
* "payload" object is supplied from Action Trigger like Rules, Action Command etc.

```
item["Customer"] = payload.customer; // value from payload 
//OR
item["Customer"] = "abc";   //"some static value"

//Here 'Customer' is DynamoDB column name and payload.customer is it's value.
```

#### Connection ID

Connection ID of AWS Connection.

![Add DynamoDB PutItem Action](/files/4pJ6KkfCE8S1r4FGAsY1)

Please note the following points:

{% hint style="info" %}

* "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* Data Response of PutItem will be available as Action Response.
* Find more details about PutItem in [AWS Doc](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html)
  {% endhint %}


# DynamoDB UpdateItem Action

Execute DynamoDB UpdateItem query completely serverless via Thingsup IoT Platform. Create custom items from MQTT Rules Engine or HTTP APIs.

It provides a way to update Item in DynamoDB. Before adding DynamoDB UpdateItem Action, user has to define a [**AWS Connection**](/connections/aws-connection). User need to provide following parameters to add DynamoDB UpdateItem Action.

#### TableName

User's DynamoDB Tablename

#### Function

* JavaScript code to update "DynamoDB Item".
* "payload" object and "params" object is available in this code. params object should hold key-value data pairs as mentioned in [AWS Doc](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#update-property). "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* Any params passed through Function will override parameters passed through form.

#### Connection ID

Connection ID of AWS Connection.

#### ConditionExpression

User can provide a condition expression here. Check [AWS Doc](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#update-property) for more information.

#### UpdateExpression

User can provide a update expression here. Check [AWS Doc](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#update-property) for more information.

#### key

User can provide a primary key here. Check [AWS Doc](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#update-property) for more information.

#### ExpressionAttributeValues

User can provide a ExpressionAttributeValues here. Check [AWS Doc](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#update-property) for more information.

#### ExpressionAttributeNames

User can provide a ExpressionAttributeNames here. Check [AWS Doc](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#update-property) for more information.

```
//"id" and "name" are the column names inside DynamoDB table.
//It contains a entry having id="2" and name="abc"
//Following are the fields you need mention in form to change the name value to "pqr" of id having value 2.

#b = :id_val                    //Condition Expression
set #a = :x                     //Update Expression
{"id":"2"}                      //key
{ ":x":"pqr" , ":id_val":"2" }  //ExpressionAttributeValues
{ "#a" : "name","#b":"id" }     //ExpressionAttributeNames

```

![Add DynamoDB UpdateItem Action](/files/rRAhqtbgS5jmxxel8Ay5)

Please note the following points:

{% hint style="info" %}

* "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* Data Response of UpdateItem will be available as Action Response.
  {% endhint %}


# DynamoDB GetItem Action

Execute DynamoDB GetItem query completely serverless via Thingsup IoT Platform. Create custom query from MQTT Rules Engine or HTTP APIs.

It provides a way to get Item from DynamoDB. Before adding DynamoDB GetItem Action, user has to define a [**AWS Connection**](/connections/aws-connection). User need to provide following parameters to add DynamoDB GetItem Action.

#### TableName

User's DynamoDB Tablename

#### Function

* &#x20;JavaScript code to get "DynamoDB Item".
* &#x20;"payload" object and "params" object is available in this code. params object should hold key-value data pairs as mentioned in [AWS Doc](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#get-property). "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* Any params passed through Function will override parameters passed through form.

#### Connection ID

Connection ID of AWS Connection.

#### Key

User can provide a primary key here. Check [AWS Doc](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#get-property) for more information.

#### ProjectionExpression

User can provide a ProjectionExpression here. Check [AWS Doc](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#get-property) for more information.

#### ExpressionAttributeNames

User can provide a ExpressionAttributeValues here. Check [AWS Doc](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#get-property) for more information.

```
//"id" and "name" are the column names inside DynamoDB table.
//It contains a entry having id=2 and name="abc"
//Following is the field you need mention in form to get the entries from table id having value 2.

{"id":"2"}  //key
```

![Add DynamoDB GetItem Action](/files/CRn73hdLaz0lzo9cY7vD)

Please note the following points:

{% hint style="info" %}

* "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* Data Response of GetItem will be available as Action Response.
  {% endhint %}


# DynamoDB Query Action

Execute DynamoDB query completely serverless via Thingsup IoT Platform. Create custom query from MQTT Rules Engine or HTTP APIs.

It provides a way to perform a query on DynamoDB. Before adding DynamoDB Query Action, user has to define a [**AWS Connection**](/connections/aws-connection). User need to provide following parameters to add DynamoDB Query Action.

#### TableName

User's DynamoDB Tablename

#### Function

* &#x20;JavaScript code to Query "DynamoDB".
* &#x20;"payload" object and "params" object is available in this code. params object should hold key-value data pairs as mentioned in [AWS Doc](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#query-property). "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* Any params passed through Function will override parameters passed through form.

#### Connection ID

Connection ID of AWS Connection.

#### Limit

User can set limit here.

#### KeyConditionExpression

User can provide a KeyConditionExpression here. Check [AWS Doc](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#query-property) for more information.

#### ExpressionAttributeValues

User can provide a ExpressionAttributeValues here. Check [AWS Doc](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#query-property) for more information.

#### ExpressionAttributeNames

User can provide a ExpressionAttributeNames here. Check [AWS Doc](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#query-property) for more information.

#### FilterExpression

User can provide a FilterExpression here. Check [AWS Doc](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#query-property) for more information.

#### ProjectionExpression

User can provide a ProjectionExpression here. Check [AWS Doc](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#query-property) for more information.

```
//Example 1
//Let "id" and "name" are the column names inside DynamoDB table.
//It contains a entry having id=2 and name="abc"
//Following are the fields you need mention in form to get the entries from table id having value 2.

#a = :id_val     //KeyConditionExpression
{"#a":"id" }     //ExpressionAttributeNames
{":id_val":2}    //ExpressionAttributeValues
```

![Add DynamoDB Query Action](/files/rpXzO3uhZR1ox5hsVoNd)

Please note the following points:

{% hint style="info" %}

* "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* Data Response of Query will be available as Action Response.
  {% endhint %}


# DynamoDB Scan Action

Execute DynamoDB Scan query completely serverless via Thingsup IoT Platform. Create custom query from MQTT Rules Engine or HTTP APIs.

It provides a way to perform a scan in DynamoDB. Before adding DynamoDB Scan Action, user has to define a [**AWS Connection**](/connections/aws-connection). User need to provide following parameters to add DynamoDB Scan Action.

#### TableName

User's DynamoDB Tablename

#### Function

* JavaScript code to Scan "DynamoDB".&#x20;
* "payload" object and "params" object is available in this code. params object should hold key-value data pairs as mentioned in [AWS Doc](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#scan-property). "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* &#x20;Any params passed through Function will override parameters passed through form.

#### Connection ID

Connection ID of AWS Connection.

#### Limit

User can set limit here.

#### ExpressionAttributeValues

User can provide a ExpressionAttributeValues here. Check [AWS Doc](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#scan-property) for more information.

#### ExpressionAttributeNames

User can provide a ExpressionAttributeNames here. Check [AWS Doc](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#scan-property) for more information.

#### FilterExpression

User can provide a FilterExpression here. Check [AWS Doc](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#scan-property) for more information.

#### ProjectionExpression

User can provide a ProjectionExpression here. Check [AWS Doc](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#scan-property) for more information.

```
//Example 1
//Let "id" and "name" are the column names inside DynamoDB table.
//It contains a entry having id=1 and name="abc"
//Following are the fields you need mention in form to get the entry from table id having value 1.

{"#a":"id"}   //ExpressionAttributeNames
{":id" : 1}   //ExpressionAttributeValues
#a = :id      //FilterExpression
```

```
//Example 2
//Let "id" and "name" are the column names inside DynamoDB table.
//It contains a entry having id=1 and name="abc"
//Following are the fields you need mention in form to get the entries from table id having value greater than 1.

{"#a":"id"}   //ExpressionAttributeNames
{":id" : 1}   //ExpressionAttributeValues
#a > :id      //FilterExpression

//you can use limit parameter to set limit.
```

![Add DynamoDB Scan Action](/files/zijOfYgpJELu3qJHJgQu)

Please note the following points:

{% hint style="info" %}

* "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* Data Response of Scan will be available as Action Response.
  {% endhint %}


# DynamoDB DeleteItem Action

Execute DynamoDB DeleteItem query completely serverless via Thingsup IoT Platform. Create custom query from MQTT Rules Engine or HTTP APIs.

It provides a way to delete item from DynamoDB. Before adding DynamoDB DeleteItem Action, user has to define a [**AWS Connection**](/connections/aws-connection). User need to provide following parameters to add DynamoDB DeleteItem Action.

#### TableName

User's DynamoDB Tablename

#### Function

* &#x20;JavaScript code to Delete "DynamoDB Item".
* &#x20;"payload" object and "params" object is available in this code. params object should hold key-value data pairs as mentioned in [AWS Doc](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#delete-property). "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* Any params passed through Function will override parameters passed through form.

#### Connection ID

Connection ID of AWS Connection.

#### Key

&#x20;User need to provide a key here. Check [AWS Doc](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#delete-property)

```
//Example 1
//Let "id" and "name" are the column names inside DynamoDB table.
//It contains a entry having id=1 and name="abc"
//Following is the field you need mention in form to delete the entry from table id having value 1.

{"id":"1"}     //key
```

![Add DynamoDB DeleteItem Action](/files/CmnaTqP6ZsUEFZH5qcVY)

Please note the following points:

{% hint style="info" %}

* "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* Data Response of delete Item will be available as Action Response.
  {% endhint %}


# PostgreSQL Query Action

Execute PostgreSQL query completely serverless via Thingsup IoT Platform. Create custom query from MQTT Rules Engine or HTTP APIs.

This provides a way to run PostgreSQL Query. Before adding PostgreSQL Query Action, user has to define a [**PostgreSQL Connection**](/connections/postgresql-connection). User need to provide following parameters to add PostgreSQL Query Action.

#### Query

&#x20;PostgreSQL Query with "$1/$2/$3...$n" present on Dynamic Fields

```
SELECT * FROM books WHERE author = $1
```

#### Function

* User can write JavaScript code to supply dynamic data to query.
* "payload" object and "params" array object is available in this code which can be used to supply dynamic data to written query.
* '$n' will be replaced sequentially from nth parameter from params array contents.

```
//Example 1

params.push(payload.author);

```

#### Connection ID

User need to provide a Connection ID of PostgreSQL database connection.

![Add PostgreSQL Query Action](/files/nX5gmJHx3CfgCabFAFDp)

Please note the following points:

{% hint style="info" %}

* "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* '$n' in Query will be replaced sequentially from params array.
* In case of Static Query don't write anything in Function
* Data Response of PostgreSQL query will be available as Action Response.
  {% endhint %}


# InfluxDBv2 Read Query Action

Execute InfluxDBv2 read query completely serverless via Thingsup IoT Platform. Create custom query from MQTT Rules Engine or HTTP APIs.

This provides a way to run InfluxDbv2 read Query. Before adding InfluxDBv2 Read Query Action, user has to define a [**InfluxDBv2 Connection**](/connections/influxdbv2-connection). User need to provide following parameters to add InfluxDBv2 Read Query Action.

#### Function

* User can write JavaScript code to create dynamic query.
* "payload" object and "Query" String object is available in this code which is directly executed on InfluxDB Connection.
* &#x20;Query should be written as per [Flux Specifications.](https://www.influxdata.com/products/flux/)

```
//Example 1

Query = `from(bucket: "bucket") |> range(start: -1h)`

```

#### Org

User need to provide Org name of InfluxDB database.

#### BeautifyResult

If set to Yes, it modifies raw data into more readable form. And if set to No, it keeps raw data from database

#### Connection ID

User need to provide a Connection ID of InfluxDBv2 database connection.

![Add InfluxDBv2 Read Query Action](/files/QCAmi4KariWXW1akYSNs)

Please note the following points:

{% hint style="info" %}

* "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* Data Response of InfluxDB query will be available as Action Response.
* Only InfluxDB 2.X Databases are supported.
  {% endhint %}


# InfluxDBv2 Write Point Action

Insert or Write point to InfluxDBv2 completely serverless via Thingsup IoT Platform. Insert data in InfluxDBv2 with simple MQTT rules engine or HTTP APIs.

This provides a way to provide write point to InfluxDBv2. Before adding InfluxDBv2 Write Point Action, user has to define a [**InfluxDBv2 Connection**](/connections/influxdbv2-connection). User need to provide following parameters to add InfluxDBv2 Write Point Action.

#### Measurement

User need to provide name of InfluxDB measurement.

#### Function

* User can write JavaScript code to create dynamic query.
* "payload" object, tags, fields and timestamp objects are available in this code which are directly written on InfluxDBv2 Connection.

```
//Example 1

tags["device"] = payload.devicename;
fields["temperature"] = payload.temperature;
timestamp = null; // Take server Time

```

#### Bucket

User need to provide bucket name of InfluxDB database.

#### Org

User need to provide Org name of InfluxDB database.

#### Connection ID

User need to provide a Connection ID of InfluxDBv2 database connection.

![Add InfluxDBv2 Write Point Action](/files/FlLHfdvG9xPJdJ0eVrl0)

Please note the following points:

{% hint style="info" %}

* "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* Data Response of InfluxDB query will be available as Action Response.
* Only InfluxDB 2.X Databases are supported.
  {% endhint %}


# Firebase Cloud Firestore Action

Execute Firebase Cloud Firestore query completely serverless via Thingsup IoT Platform. Create custom query from MQTT Rules Engine or HTTP APIs.

This provides a way to perform queries on Firebase Cloud Firestore. Before adding Firebase Cloud Firestore Action, user has to define a [**Firebase Connection**.](/connections/firebase-connection) User need to provide following parameters to perform Firebase Cloud Firestore related queries.

#### Action

User need to select Cloud Firestore Operation e.g. Set, Get, Update, Delete

#### Function

* User can write JavaScript code to create dynamic query.
* "payload" object, collection, where, orderby, doc objects are available in this code which are directly used in Cloud Firestore operations.

```
//Example 1

payload["time"] = Date.now(); // Modify Payload

collection = "cities"; //Override collection here

orderby = { "name":"desc"} ; // Use orderby for Get Operation 

doc = ""; // If doc value is not required.

where.push({ // If where conditions are used in Get Query
key:"state",
condition:"==",
value:"CA"
})

```

#### Collection

User need to provide collection name for Firestore operation.

#### Doc

User need to provide Doc name for Firestore operation. if not required, override to "" in Function.

#### Limit

User can set Limit No. of Responses in case of Get Query.

#### Connection ID

User need to provide a Connection ID of Firebase database connection.

![Add Firebase Cloud Firestore Action](/files/dHChTH3EBTIuWOEZ18u7)

Please note the following points:

{% hint style="info" %}

* Get more details at [Google Cloud Firestore.](https://firebase.google.com/docs/firestore/quickstart)
* "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* Data Response of operation will be available as Action Response.
  {% endhint %}


# Firebase RealTime Database Action

Execute Firebase RealTime Database query completely serverless via Thingsup IoT Platform. Create custom query from MQTT Rules Engine or HTTP APIs.

This provides a way to perform queries on Firebase RealTime Database. Before adding Firebase RealTime Database Action, user has to define a [**Firebase Connection**.](/connections/firebase-connection) User need to provide following parameters to perform Firebase RealTime Database related queries.

#### Action

User need to select RealTime Database Operation e.g. Set, Get, Update, Delete

#### Function

* User can write JavaScript code to create dynamic query.
* "payload" and ref objects are available in this code which are directly used in database operations.

```
//Example 1

payload["time"] = Date.now(); // Modify Payload

ref = "cities/Pune"; //Override Ref here
```

#### Ref

User need to provide Ref name for Database operation.

#### Connection ID

User need to provide a Connection ID of Firebase connection.

![Add Firebase RealTime Database Action](/files/MZOUdPfFiFf7DpJqAb4B)

Please note the following points:

{% hint style="info" %}

* Get more details at [Google Firebase Realtime Database.](https://firebase.google.com/docs/database/web/start)
* "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* Data Response of operation will be available as Action Response.
  {% endhint %}


# Firebase Messaging Action

Execute Firebase Messaging completely serverless via Thingsup IoT Platform. Create custom query from MQTT Rules Engine or HTTP APIs.

This provides a way to perform queries on Firebase Messaging. Before adding Firebase Messaging Action, user has to define a [**Firebase Connection**.](/connections/firebase-connection) User need to provide following parameters to perform Firebase Messaging.

#### Function

* User can write JavaScript code to create dynamic messages to send to FCM.
* "payload" and messages objects are available in this code which are directly used to send messages.

```
//Example 1

messages.push({ notification: {title: 'Price drop', body: '5% off all electronics'},
topic: '/topic/' + payload.userid,
});
```

#### Connection ID

User need to provide a Connection ID of Firebase connection.

![Add Firebase Messaging Action](/files/bf6pqD0gf8lZjR4Cpd2v)

Please note the following points:

{% hint style="info" %}

* Get more details at [Google Firebase Cloud Messaging.](https://firebase.google.com/docs/cloud-messaging/send-message)
* "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* Data Response of operation will be available as Action Response.
  {% endhint %}


# AWS Lambda Invoke Action

Run AWS Lambda function completely serverless via Thingsup IoT Platform.

This provides a way to invode AWS Lambda function. Before adding AWS lambda Invoke Action, user has to define a [**AWS Connection**](/connections/aws-connection). User need to provide following parameters to invoke AWS Lambda Function.

#### FunctionName

* &#x20;AWS Lambda function name which can be specified as below
  * Function name - my-function (name-only), my-function:v1 (with alias).
  * Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.
  * Partial ARN - 123456789012:function:my-function.

#### InvocationType

In case of RequestResponse, Action will wait till Lambda function execution is completed. Event invocation type will complete action immediately, without waiting for Lambda response.

#### Function

* Javascript code to supply dynamic data to lambda function.
* "payload" object coming from rule or action trigger is available in this code, function can be used to modify payload before sending to lambda.

```
//Example 1

payload["speed"] = (payload.speed*5)/18; 
//Convert data on the go from km/hr to m/s.
```

#### Connection ID

User need to provide a Connection ID of AWS connection.

![Add AWS Lambda Invoke Action](/files/tCtl2gTsy0gDipFkX6uG)

Please note the following points:

{% hint style="info" %}

* "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* Data Response of Lambda execution will be available as Action Response.
  {% endhint %}


# AWS SQS Send Messsage Action

Send message to AWS SQS completely serverless via Thingsup IoT Platform.

This provides a way to send message AWS SQS. Before adding AWS SQS message Action, user has to define a [**AWS Connection**](/connections/aws-connection). User need to provide following parameters to invode AWS SQS send message action.

#### QueryURL

* &#x20;User need to provide AWS SQS queue url.

#### DeletionInSeconds

User need to provide delay in seconds for FIFO queues, Keep '-1' for normal queue.

#### Function

* Javascript code to supply dynamic data to SQS message.
* "MessageBody","MessageAttributes" and "payload" objects are available in this code, function can be used to set message body and attributes from payload before sending to SQS.

```
//Example 1

MessageBody = payload;
MessageAttributes = { "From":Thingsup" };
```

#### Connection ID

User need to provide a Connection ID of AWS connection.

![Add AWS SQS Send Action](/files/r7S3lshCdRfQn7nPMNtE)

Please note the following points:

{% hint style="info" %}

* "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* Data Response from AWS SQS will be available as Action Response.
  {% endhint %}


# Publish MQTT Message Action

Publish message to MQTT Broker completely serverless via Thingsup IoT Platform.

This provides a way to publish message to MQTT Broker. Before adding Publish MQTT Message Action, user has to define a [**MQTT Connection**](/connections/mqtt-connection). User need to provide following parameters to publish message to MQTT Broker.

#### PublishTopic

* &#x20;User need to provide MQTT Topic on which data will be published.

#### QoS

MQTT QoS value. Default is 1.

#### Function

* Javascript code to build mqtt message.
* "topic","message" and "payload" objects are available in this code, function can be used to set message body and topic from payload before sending to MQTT.
* Setting topic here overrides already defined PublishTopic.

```
//Example 1

message = payload;
topic = "somenewtopic";
```

#### Connection ID

User need to provide a Connection ID of MQTT connection.

![Add Publish MQTT Message Action](/files/BBDh5yktsSMBbKi38KKB)

Please note the following points:

{% hint style="info" %}

* "payload" object is supplied from Action Trigger like Rules, Action Command etc.
  {% endhint %}


# MQTT CommandResponse Action

Publish MQTT Message based on event completely serverless via Thingsup IoT Platform.

This provides a way to publish MQTT Message based on event. Before adding MQTT CommandResponse Action, user has to define a [**MQTT Connection**](/connections/mqtt-connection). User need to provide following parameters.

#### PublishTopic

* &#x20;User need to provide MQTT Topic on which data will be published.

#### SubscribeTopic

User need to provide MQTT Topic on which data will be received.

#### QoS

MQTT QoS value. Default is 1.

#### Function

* Javascript code to build mqtt message.
* "tx\_topic","rx\_topic","message" and "payload" objects are available in this code, function can be used to set message body and topic from payload before sending to MQTT.
* Setting tx\_topic and rx\_topic here overrides already defined PublishTopic and SubscribeTopic respectively.

```
//Example 1

message = payload;
tx_topic = "somenewtopic"; 
rx_topic = "someothertopic";
```

#### ResponseFunction

* Javascript code to validate received message.
* "tx\_topic","rx\_topic","rx\_message" and "tx\_message" objects are available in this code, keeping rx\_message non null will result in success response of action and assigning rx\_message to null will result in action failure.
* This function will execute for each message till success or timeout.

```
// Example 1

if(rx_message.id != tx_message.id ){
rx_message = null; 
}
```

#### Timeout

Maximum time expected in milliseconds for MQTT Response. Default value is 2000. Range is 1000 to 5000.

#### Connection ID

User need to provide a Connection ID of MQTT connection.

![Add MQTT CommandResponse Action](/files/Vf9icTmYA8tBFochpHx4)

Please note the following points:

{% hint style="info" %}

* "payload" object is supplied from Action Trigger like Rules, Action Command etc.
  {% endhint %}


# ProcessFunction Action

Process input data using Thingsup IoT Platform.

This provides a way to process input data. User need to provide following parameters.

#### Function

* Javascript code to process input data.
* "payload" and "response" object are available in this code.
* Write your custom processing logic or build your Mock APIs with predefined responses.

```
//Example 1

response = payload; 
//Reply with same payload 
or
if(payload.temperature > 40){ 
response["Status"] = "High";
}
else{ 
response["Status"] = "Low";
}
```

![Add ProcessFunction Action](/files/42QDpeFrpXBZybjZpDgI)

Please note the following points:

{% hint style="info" %}

* "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* Response object will be available as Action Response.
* Loops are not supported for Performance.
  {% endhint %}


# WebHook Action

Provide Webhook using Thingsup IoT Platform.

This provides a webhook. User need to provide following parameters.

#### URL

User need to provide HTTP(S) URL for HTTP Web Request

#### Function

* Javascript code to process input data.
* "headers","payload", "ContentType", "data" object are available in this code.
* These will be passed as your HTTP Request. ContentType set here will override ContentType field value.

```
//Example 1

data = { 
city: payload.city
};

headers["Authorization"] = "Bearer Test123";
ContentType = "application/x-www-form-urlencoded"; 
```

#### ContentType

User need to provide HTTP Request Data Content Type.

#### Method

User need to provide HTTP Request Method.

#### Data

&#x20;Request Data in JSONObject Format shown as below.\
{"Key": 12, "Key2":"Value"}

![Add Webhook Action](/files/rJdiVUzonVMGbXaN9JyN)

Please note the following points:

{% hint style="info" %}

* "payload" object is supplied from Action Trigger like Rules, Action Command etc
* Response object will be available as Action Response.
* Loops are not supported for Performance.
  {% endhint %}


# Push to Thingsup Track Action

Push data directly to Thingsup Track platform.

This provides a way to push data directly to Thingsup Track platform. User need to provide following parameters.

#### Function

* Javascript code to process input data.
* "payload" object is available in this code. This payload will be sent to Thingsup Track Servers.

```
//Example 1

payload.attributes["sender"] = "Thingsup";
payload.deviceId = "98889988889";
```

#### AuthKey

User need to provide Thingsup Track Auth Key.

#### Sample Payload

All the fields in sample payload are compulsory. Attributes can vary as per device but motion, ignition, odometer attributes are compulsory. Unavailability of compulsory fields will result in action failure.

```
{
   "id":0,
   "attributes":{
      "priority":0,
      "sat":7,
      "event":0,
      "ignition":false,
      "motion":true,
      "rssi":5,
      "io200":0,
      "gpsStatus":1,
      "pdop":1,
      "hdop":0.9,
      "power":0,
      "battery":3.857,
      "io68":0,
      "temp1":25,
      "operator":40490,
      "odometer":8124,
      "distance":7.32,
      "totalDistance":8318161.78
   },
   "deviceId":"TestDevice4",
   "type":null,
   "protocol":"thingsup",
   "serverTime":"2021-01-29T10:54:27.625+0000",
   "deviceTime":"2021-01-29T10:54:25.000+0000",
   "fixTime":"2021-01-29T10:54:25.000+0000",
   "outdated":false,
   "valid":true,
   "latitude":17.7066716,
   "longitude":73.7727833,
   "altitude":592,
   "speed":3.779699,
   "course":283,
   "address":null,
   "accuracy":0,
   "network":null
}
```

![Add Push to Thingsup Track Action](/files/NmVuW3RU1AyIqUZqt7Fe)

Please note the following points:

{% hint style="info" %}

* "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* Response object will be available as Action Response.
* Loops are not supported for Performance.
  {% endhint %}


# Send MSG91 SMS Action

Send SMS via MSG91 from Thingsup IoT Platform. Create and send customized bulk SMS with MQTT Rules or HTTP APIs to global phone numbers for IoT Solutions.

This provides a way to send SMS. Before adding MSG91 SMS Action, user has to define a [**MSG91 Connection**](/connections/msg91-connection). User need to provide following parameters to add Send MSG91 SMS Action.

#### Function

* Javascript code to create params this Action.
* "payload" object and "params" object is available in this code. params object should hold key-value data pairs of any below mentioned params in their respective data types.
* Any params passed through Function will override parameters passed through form.

```
//Example 1

params["Numbers"] = "992168XXXX,8945XXXXXX"
params["Message"] = "Your Order "+ payload.orderid + " is delivered"
```

#### Numbers

User can provide comma separated Phone Numbers.

#### Message

SMS content string. Long Message will result into sending multiple SMS automatically.

#### Sender ID

User need to provide MSG91 Approved Sender ID.

#### Country Code

Country Code without '+' Sign

#### Connection ID

User need to provide connection ID of MSG91 Connection.

![Add Send MSG91 SMS Action](/files/4JfSeVsmilhd1F2BbpWY)

Please note the following points:

{% hint style="info" %}

* "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* Response object will be available as Action Response.
* Loops are not supported for Performance.
  {% endhint %}


# MQTT Rules Engine

Best MQTT Rules engine built-in with Thingsup IoT Platform with MQTT Broker. Validate and Transform your IoT data on the fly with serverless service.

MQTT Rule is a Rule defined in Thingsup to Process MQTT Message. Before setting up MQTT Rule, user need [**Add Device**](/mqtt/add-mqtt-device) to his account. User need to provide following parameters.

#### Topic

User need to provide a topic on which data is incoming. For example, *Test.* Thingsup also support standard Wildcard subscriptions like Test/+ or Test/# or Test/+/LocationData

#### Data Validation/Transform

Here user can write a JavaScript code to validate or change data i.e "payload"  which is received as payload to given MQTT Topic.

The "payload" object here in this code, can get changed or transformed before passing to Thingsup Actions. Also user can assign "null" to payload if he want to avoid action trigger after data validation.

```
// This code checks if payload is JSON and contains Location data 
if(typeof payload === 'object') 
{
    if(payload.Location == undefined) 
    {
        payload = null;
    }
    else
    {
        payload["time"] = Date.now(); // Transform payload
    }
}
else
{
    payload = null;
}
```

#### Action ID

User need to provide an Action ID of Action to be triggered.

![Add MQTT Rule](/files/JUDNeZBQ1BcUiosq6TzA)

Please note the following points:

{% hint style="info" %}

* "null" payload results into Rule Failure which doesn't trigger Action
* Avoid using Rule Engine directly to trigger Send SMS /Email Action, bad configuration can result into High Credits Usage
  {% endhint %}


# HTTP API

Best HTTP Rules engine built-in with Thingsup IoT Platform to create HTTP APIs. Validate and Transform your IoT data on the fly with serverless service to build your IoT solutions.

HTTP Rule is a Rule defined in Thingsup to Process HTTP Request. User need to provide following parameters.

### URL

HTTP Rules can be executed by sending HTTP POST Request to below URL.

```
https://api.thingsup.io/data/{Your-AccountID}/{Rule-ID}
```

### Authorization - Auth key

It is an Authorization Key for incoming HTTP Request. This Key needs to be sent in Authorization header in HTTP POST Request with format Bearer{space}{Your-Auth-Key} to <https://api.thingsup.io/data/{Your-AccountID}/{Rule-ID}>

```
Bearer<space>{Your-Auth-Key}
```

{% hint style="info" %}
If user need to create HTTP request without Authentication key, then user can put 'none' or '-' in textfield.
{% endhint %}

### Data Validation/Transform

Here user can write a JavaScript code to validate or change data i.e "payload" which is received in body of HTTP Request.&#x20;

The "payload" object here in this code which can be changed or transformed before passing to Thingsup Actions. Also user can assign "null" to payload if he want to avoid action trigger after data validation.

```
// This code checks if payload is JSON and contains Location data
if(typeof payload === 'object') 
{
    if(payload.Location == undefined)
    {
        payload = null;
    }
    else
    {
        payload["time"] = Date.now(); // Transform payload
    }
}
else
{
    payload = null;
}
```

### Action ID

User need to provide an Action ID of Action to be triggered.

![Add HTTP Rule](/files/WHsgVvqa37lj8GDkqE5L)

Please note the following points:

{% hint style="info" %}

* "null" payload results into Rule Failure which doesn't trigger Action
* Avoid using Rule Engine directly to trigger Send SMS/Email Action, bad configuration can result into High Credits Usage
* Content Types of JSON, Form Data and x-www-form-urlencoded are supported
  {% endhint %}


# HTTP Command

Test your HTTP API Rules with Thingsup IoT Platform. Send and receive sample payloads from triggered actions.

By using HTTP Command you can send POST request to endpoint. You need to provide following three parameters:

* Request Endpoint ID
* Authentication Key
* Payload

In below example shown in image, the Endpoint ID '*HttpRule'* is the HTTP Rule created in dashboard, with Authentication key '1234'. You can send payload in JSON Object format.

![HTTP Command](/files/wWeATC3ono8OwKiwvEmz)

After sending the command, you can see the result of the command in given Result table.


# Action Command

Test your Actions with Thingsup IoT Platform. Send and receive sample payloads from triggered actions.

By using Action Command you can send payload to any action defined in your account.You need to provide the following parameters:

* Action ID
* Payload

![Test Action](/files/HCNoNtHTvirPL3SHL6P2)

The result of Action Command performed, is shown in given table.


# Basic Alert

Setup Alerts with multiple triggers from Rules Engine. Configure Actions which will be executed when alert is raised.

User has to configure actions which will be executed when alert is raised. And assign that action to ActionID field while Alert addition.

![Add Alert](/files/fm6gzKS6kd4Ui6MiQETB)


# Add Dashboard

Design your own dashboard via MQTT or Thingsup Action with the help of many available widgets using Thingsup Platform.

User can create custom dashboard using available mulitple widgets. Each widget is configurable providing options like choosing data source, event  etc.

#### Create New Dashboard

Go to **Dashboards** option from the left side menu and click on the **+ Add New Dashboard** button. It will show a popup to add a dashboard. User need to provide a name for it, also user can directly import a JSON file(Exported JSON File of Dashboard) to create a dashboard.

![Add Dashboard](/files/xdrzpPpilxMpfTNJUtbf)

#### Dashboard Options

After creating dashboard, user can perform following operations on it.

* Export JSON -  This option will export entire dashboard as JSON file, which user can directly use to create dashboard. &#x20;
* Delete Dashbaord - This option will delete the dashboard
* Clone Dashbaord - This option will make a duplicate copy of Dashboard in user's account.

![Dashboard Options](/files/Wo53ilIx7QpKM8xhFn0F)


# Dashboard Settings

#### Dashboard Settings

User can customize dashboard by changing dashboard title, title font size, title color. User can assign icon to the dashboard, change background color of dashboard and even user can add background image for the dashboard and handle its transparency from Dashboard Settings Option.

![Dashboard Settings](/files/ppcqR6xHIwoafPxsZcG3)

#### Add Widget to the Dashboard

User can add and customize widgets added in the dashboard. List of available widgets are shown in following images. Configuration details of each widget is provided in [**Widgets**](/widgets/button-widget) section.

![Add Widget](/files/NhHOShcyqz64OI52QuwD)

![Add Widget](/files/qZajJfINDPQIccWIAod9)


# Button Widget

#### General Setting

User can change following things in button widget:

* Widget Name - Name for widget which will be used data reference&#x20;

  For Example, if widget name is 'Button', then data of widget is referenced as Button.data as shown in below image.

<div align="center"><img src="/files/Bd2gnq4dL7Xr7jK3gu1y" alt="Configure Button Widget"></div>

* Show Title - User can show/hide widget title
* Title Color
* Background Color&#x20;

![Configure Button Widget ](/files/trCDVLfaskK3wDVoSJXX)

#### Widget Setting

In Widget Setting option, user can change following parameters:

* Value -  value for **Button.data** parameter in JSON object, that will be used for onClick Event.
* Button Color&#x20;
* Text Color
* Button Text

![Configure Button Widget ](/files/nKIjxQGs38IH4U4UXB1O)

#### Source

Button widget does not support Source settings.

#### Event Handling

Button onClick event is provided. User can choose MQTT or Action mode for onClick event.

**Using MQTT**

User needs to provide following parameters:

* event - Select **onClick** event from dropdown
* mode - Select mode as **MQTT**
* topic - Enter topic name directly. No need to provide accountID.
* Data parameters - Add new data parameter item. Each data parameter item represent a key-value pair. So select required parameter and give key name to it.

As shown in below images, for onClick event, MQTT mode is selected. It means when user clicks on the button, it will publish configured data parameters on given MQTT topic.

![Button Widget - Event handling using MQTT](/files/qxOJa7ZZqmmFTR2TThPr)

![Button Widget - Event handling using MQTT](/files/ey1GBLnYEp8FsAtwgPEv)

So, as per the configuration shown in above images, when user clicks the button, JSON object with **buttonKey-UserRole** as key-value pair gets published on **buttonData** topic. Please refer below image for final output.

![Button Widget - Event handling using MQTT](/files/Rdv9tnM5h11oK67vE2pK)

**Using Action**

User needs to provide following parameters:

* event - Select **onClick** event from dropdown
* mode - Select mode as **action**
* Action ID - Select required Action ID from dropdown

As shown in below images, for onClick event, **action** mode is selected. It means when user clicks on the button, it will trigger given Action with configured action parameters.

![Button Widget - Event handling using Actions Widget](/files/1reBQEbgT61WiLrri5rp)

![Button Widget - Event handling using Actions](/files/8TiFetFY4arGtyWOwtIA)

So, as per the example given in above images, when user clicks a button, **updateFirebaseCloud** action will trigger with JSON object of **buttonData-UserID** as key-value pair as input.


# Data Text Widget

**General Setting**

User can change following things in Data Text widget:

* Name for widget which will be used data reference. For Example, if widget name is 'Data Text', then data of widget is referenced as Data Text.data
* Show title - User can show/hide widget title
* Title Color
* Background Color

![Configure Data Text Widget](/files/oZaK1IxUjosdXqrcwYJx)

**Widget Setting**

In Widget Setting option, user can change following parameters:

* Key - key parameter of JSON Object which will used to get data.
* Data Color&#x20;
* Unit - Unit for Data
* Decimal units- Number of decimal units

![Configure Data Text Widget](/files/nZ1jKYO2qW5RGuVrRm3z)

#### Source <a href="#source" id="source"></a>

User can select a source mode as MQTT or Action.

**Using MQTT**

Here, to show data on Data Text widget user need to send data in given format on given MQTT topic. No need to provide \<account\_id> while providing the MQTT topic. The JSON object will be as below.

```
// Example 

{"dataKey":10.2}
OR
{"dataKey":"hi"}
OR
{"dataKey":"100"}

// 'dataKey' is declared in widget form.
```

![Configure Data Text Widget](/files/QEGMFak1fy8Zfs3kY8n0)

**Using Action**

Here, to show data on Data Text Widget, output of the action should contain key-value pair with 'dataKey' key. User can also update the widget either onLoad or periodically by providing refresh interval.

![Configure Data Text Widget](/files/G29jVzWW9RX0ftnUL8wE)

#### Event Handling

Data Text widget does not support any event.

#### Example

If we configure Data Text Widget as below:

1. key - dataKey
2. Unit - %
3. Decimal points - 2

and set source type for widget as MQTT and topic configured is 'data'. And if we publish following JSON Object over 'data' topic then Data Text Widget will look as shown in image.

```
// Data over configured MQTT Topic

{ 
    "dataKey":89.32
}
```

![](/files/9T2HoKIOZC841OOdskBB)


# Toggle Switch Widget

**General Setting**

User can change following things in Toggle Switch widget:

* Name for widget which will be used data reference&#x20;

  For Example, if widget name is 'Switch', then data of widget is referenced as Switch.data
* Show title - User can show/hide widget title
* Title Color
* Background Color

![Configure Toggle Switch Widget](/files/17SPKNGbraC02uRTUXgm)

#### Widget Setting <a href="#widget-setting" id="widget-setting"></a>

In Widget Setting option, user can change following parameters:

* Key - key parameter of JSON Object which will define state of switch.

User can manage state of switch using MQTT or Actions. To change state of switch, user need to send data in following format.

```
{"imageKey":true/false}   
OR
{"imageKey":1/0} 

// 'imageKey' is set as key in widget form.
```

![Configure Toggle Switch Widget](/files/7GMMkTDgO4RGNK9cSGee)

#### Source

User can select a source mode as MQTT or Action.

**Using MQTT**

Here, to change state of switch user can publish JSON object on given **imageData** MQTT topic. The JSON object will be as below. No need to provide \<account\_id> while providing the MQTT topic.

```
{"imageKey":true/false}   
OR
{"imageKey":1/0} 

// 'imageKey' is set as key in widget form.
```

![Configure Toggle Switch Widget](/files/tLlcNwk2DsKHYgVgi5oA)

**Using Action**

Here, to change state of switch, output of the action should contain key-value pair with 'imageKey' key. User can also update the widget either onLoad or periodically by providing refresh interval.

![Configure Toggle Switch Widget](/files/LsjeyJtDhSBRgxROkpmV)

#### Event Handling <a href="#event-handling" id="event-handling"></a>

Button onChange event is provided. User can choose MQTT or Action mode for onChange event.

**Using MQTT**&#x20;

User needs to provide following parameters:

* event - Select **onChange** event from dropdown
* mode - Select mode as **MQTT**
* topic - Enter topic name directly. No need to provide accountID.
* Data parameters - Add new data parameter item. Each data parameter item represent a key-value pair. So select required parameter and give key name to it.

As shown in below images, for onClick event, MQTT mode is selected. It means when state of switch changes, it will publish configured data parameters on given MQTT topic.

![Toggle Switch Widget - Event handling using MQTT](/files/8ItFnQEHyXRJTrGNJxug)

![Toggle Switch Widget - Event handling using MQTT](/files/Ay6TaWJqImDAEtTjgQP0)

So, as per the configuration shown in above images, when button state changes, JSON object with **imgKey-UserRole** as key-value pair gets published on **buttonData** topic. Please refer below image for final output.

![Toggle Switch Widget - Event handling using MQTT](/files/XSBohFka12hFriNPDRtj)

**Using Action**

User needs to provide following parameters:

* event - Select **onChange** event from dropdown
* mode - Select mode as **action**
* Action ID - Select required Action ID from dropdown

As shown in below images, for onChange event, **action** mode is selected. It means when switch state changes, it will trigger given Action with configured action parameters.​

![oggle Switch Widget - Event handling using Actions](/files/OOLuiIFNHDBeS8Kp0Gs4)

![Toggle Switch Widget - Event handling using Actions](/files/5CuIv4bAf8HLNYmP0zJA)

#### Example

If we configure Toggle Switch Widget as below:

1. key - toggleKey

and set source type for widget as MQTT and topic configured is 'data'. And if we publish following JSON Object over 'data' topic then Toggle Switch Widget will look as shown in image.

```
// Data over configured MQTT Topic

{ 
    "toggleKey":true/1 
}

OR

{ 
    "toggleKey":false/0
}
```

![Enabled Toggle Switch](/files/WOR7CXj4PldSpXHqTrPQ) ![Disabled Toggle S](/files/7A4sGOy2Ty4W98kYua7W)


# Image Switch Widget

**General Setting**

User can change following things in Image Switch widget:

* Name for widget which will be used data referenceFor Example, if widget name is 'Switch', then data of widget is referenced as Switch.data
* Show title - User can show/hide widget title
* Title Color
* Background Color

![Configure Image Switch Widget](/files/NPdp6pae4HJ0fdVS9YkC)

#### Widget Setting <a href="#widget-setting" id="widget-setting"></a>

In Widget Setting option, user can change following parameters:

* Key - key parameter of JSON Object which will define state of switch.
* Switch Style - Select one from available Switch styles

![Configure Image Switch Widget](/files/Bx4i6kCibPZNERpGBBP4)

User can manage state of switch using MQTT or Actions. To change state of switch, user need to send data in following format.

```
{"imageKey":true/false}   
OR
{"imageKey":1/0} 

// 'imageKey' is set as key in widget form.
```

#### Source <a href="#source" id="source"></a>

User can select a source mode as MQTT or Action.

**Using MQTT**

Here, to change state of Image Switch user can publish JSON object on given **imageData** MQTT topic. No need to provide \<account\_id> while providing the MQTT topic. The JSON object will be as below.

```
{"imageKey":true/false}   
OR
{"imageKey":1/0} 

// 'imageKey' is set as key in widget form.
```

![Configure Image Switch Widget](/files/mhgZP6BeJcWoETxBxMxm)

**Using Action**

Here, to change state of Image Switch, output of the action should contain key-value pair with 'imageKey' key. User can also update the widget either onLoad or periodically by providing refresh interval.

![Configure Image Switch Widget](/files/0tD6MpLMHsr4Fuj6c7Hf)

#### Event Handling <a href="#event-handling" id="event-handling"></a>

Button onClick event is provided. User can choose MQTT or Action mode for onClick event.

**Using MQTT**

User needs to provide following parameters:

* event - Select **OnClick** event from dropdown
* mode - Select mode as **MQTT**
* topic - Enter topic name directly. No need to provide accountID.
* Data parameters - Add new data parameter item. Each data parameter item represent a key-value pair. So select required parameter and give key name to it.

As shown in below images, for onClick event, MQTT mode is selected. It means when the user clicks the button, it will publish configured data parameters on given MQTT topic.​

![Image Switch Widget - Event Handling using MQTT](/files/cWj370ZhOnye7ORIad7Y)

![Image Switch Widget - Event Handling using MQTT](/files/88XXVIRIM43rhcK9lxMV)

So, as per the configuration shown in above images, when the user clicks the button, JSON object with **imgSwitch-UserRole** as key-value pair gets published on **buttonData** topic. Please refer below image for final output.

![Image Switch Widget - Event Handling using MQTT](/files/XK2tWtD4FdBoMUVr9JUd)

**Using Action**

User needs to provide following parameters:

* event - Select **onClick** event from dropdown
* mode - Select mode as **action**
* Action ID - Select required Action ID from dropdown

As shown in below images, for onClick event, **action** mode is selected. It means when user clicks on the button, it will trigger given Action with configured action parameters.

![Image Switch Widget - Event Handling using Action](/files/Z4HBUDDirhi0qB2eTvLX)

![Image Switch Widget - Event Handling using Action](/files/lHxCLBfZNN7YclVk9U9w)

#### Example

If we configure Image Switch Widget as below:

1. key - imgKey

and set source type for widget as MQTT and topic configured is 'data'. And if we publish following JSON Object over 'data' topic then Image Switch Widget will look as shown in image.

```
// Data over configured MQTT Topic

{ 
    "imgKey":true/1
}

OR

{ 
    "imgKey":false/0
}
```

![Enabled Image Switch Widget](/files/xEkogcnJG0nWOo8K9TD8) ![Disabled Image Switch Widget](/files/trfwhe5H8XBoKHKOJjfK)


# Dropdown Widget

**General Setting**

User can change following things in Dropdown widget:

* Name for widget which will be used data referenceFor Example, if widget name is 'Dropdown', then data of widget is referenced as Dropdown.data
* Show title - User can show/hide widget title
* Title Color
* Background Color

![Configure Dropdown Widget](/files/MTTIGBli1CBJSc3nce2z)

**Widget Setting**

In Widget Setting option, user can change following parameters:

* Label Key - Key parameter in key-value pair of input JSON Object which will get added to dropdown.
* Label Value - Value parameter in key-value pair of input JSON Object which will get added to dropdown.
* Fixed List - User can provide fixed list by enabling this option. Fixed list items either will be in \<value,label> or \<value> format.
* Multi Select - Enable this option of multi selection.

![Configure Dropdown Widget](/files/0WtXxB1Y7XOXWXAMYyfa)

#### Source <a href="#source" id="source"></a>

User can select a source mode as MQTT or Action.

**Using MQTT**

Here, to add option to dropdown list user need to send data in given format on given MQTT topic. No need to provide \<account\_id> while providing the MQTT topic. The JSON object will be as below.

```
[{"labelkey":"bike","labelvalue":50}]
[{"labelkey":"scooter","labelvalue":30}]

// 'labelkey' and 'labelvalue' is set as LabelKey and LabelValue in widget form.
```

![](/files/QEGMFak1fy8Zfs3kY8n0)

**Using Action**

Here, to add option to dropdown list, output of the action should contain key-value pair with 'labelKey' and 'labelValue' keys. User can also update the widget either onLoad or periodically by providing refresh interval.

![Configure Dropdown Widget](/files/G29jVzWW9RX0ftnUL8wE)

#### Event Handling

Dropdown widget does not support any event.

#### Example

If we configure Dropdown Widget as below:

1. Label Key - labelkey
2. Label Value - labelvalue
3. Fixed List - Disabled
4. Multiselect -Disabled

and set source type for widget as MQTT and topic configured is 'data'. And if we publish following JSON array over 'data' topic then Dropdown Widget will look as shown in image.

```
// Data over configured MQTT Topic

[
  {
    "labelkey": "wolf bike",
    "labelvalue": 50
  },
  {
    "labelkey": "Monster bike",
    "labelvalue": 60
  }
]
```

![Dropdown Widget Example](/files/DuVoWcRHcYrgVDSBCs8s)


# LED Widget

**General Setting**

User can change following things in LED widget:

* Name for widget which will be used data referenceFor Example, if widget name is 'LED', then data of widget is referenced as LED.data
* Show title - User can show/hide widget title
* Title Color
* Background Color

![Configure LED Widget](/files/Amy599tjyKGb8OTniFJ9)

**Widget Setting**

In Widget Setting option, user can change following parameters:

* Key - key parameter of JSON Object which will define state of LED.
* LED Style - Select one from available options of LED

![Configure LED Widget](/files/KaOtU7Gqtwm2ELnPLdKf)

User can manage state of LED using MQTT or Actions. To change state of LED, user need to send data in following format.

```
{"dataKey":true/false}   
OR
{"dataKey":1/0} 

// 'dataKey' is set as key in widget form.
```

#### Source <a href="#source" id="source"></a>

User can select a source mode as MQTT or Action.

**Using MQTT**

Here, to change state of LED user can publish JSON object on given **data** MQTT topic. No need to provide \<account\_id> while providing the MQTT topic. The JSON object will be as below.

```
{"dataKey":true/false}   
OR
{"dataKey":1/0} 

// 'dataKey' is set as key in widget form.
```

![Configure LED Widget](/files/QEGMFak1fy8Zfs3kY8n0)

**Using Action**

Here, to change state of LED, output of the action should contain key-value pair with 'dataKey' key. User can also update the widget either onLoad or periodically by providing refresh interval.

![Configure LED Widget](/files/G29jVzWW9RX0ftnUL8wE)

#### Event Handling

LED widget does not support any event.

#### Example

If we configure LED Widget as below:

1. key - testWidgetKey

and set source type for widget as MQTT and topic configured is 'data'. And if we publish following JSON Object over 'data' topic then LED Widget will look as shown in image.

```
// Data over configured MQTT Topic

{ 
    "ledKey":true/1 
}

OR 

{ 
    "ledKey":false/0
}
```

![Enabled LED Widget](/files/jqJ1cwDgOe2f6PL1FGen) ![Disabled LED Widget](/files/US1rEmWqsxhtcHGvGByq)


# Text Widget

**General Setting**

User can change following things in Text widget:

* Name for widget which will be used data referenceFor Example, if widget name is 'Text', then data of widget is referenced as Text.data
* Show title - User can show/hide widget title
* Title Color
* Background Color

![Configure Text Widget](/files/pA37wzjP0iyBhTXIaDAS)

**Widget Setting**

In Widget Setting option, user can change following parameters:

* Font Color&#x20;
* Font Size&#x20;
* Constant String - If this option is enabled, user can provide constant string value.
* Key - key parameter of JSON Object which will define data of Text Widget.

![Configure Text Widget](/files/Ax04ztUdBPBuillTcn7Z)

User can change value of Text Widget using MQTT or Actions. To change Text Widget, user need to send data in following format.

```
{"textKey":"Reports"}   

// 'textKey' is set as key in widget form.
```

#### Source <a href="#source" id="source"></a>

User can select a source mode as MQTT or Action.

**Using MQTT**

Here, to change value of Text Widget user can publish JSON object on given **data** MQTT topic. No need to provide \<account\_id> while providing the MQTT topic. The JSON object will be as below.

```
{"textKey":"Reports"}   

// 'textKey' is set as key in widget form.// 'dataKey' is set as key in widget form.
```

![Configure Text Widget](/files/nl6cAzuBp7YQTDI540qP)

**Using Action**

Here, to change value of Text Widget, output of the action should contain key-value pair with 'textKey' key. User can also update the widget either onLoad or periodically by providing refresh interval.

![Configure Text Widget](/files/G29jVzWW9RX0ftnUL8wE)

#### Event Handling

Text widget does not support any event.

#### Example

If we configure Text Widget as below:

1. constant string - disabled
2. key - testWidgetKey

and set source type for widget as MQTT and topic configured is 'data'. And if we publish following JSON Object over 'data' topic then Text Widget will look as shown in image.

```
// Data over configured MQTT Topic

{ 
    "testWidgetKey":"Reports"
}
```

![Test Widget Example](/files/dqqMRv54teDkZudvyyM9)


# Navigation Button Widget

**General Setting**

User can change following things in Navigation Button widget:

* Name for widget which will be used data referenceFor Example, if widget name is 'Navigation Button', then data of widget is referenced as Navigation Button.data
* Show title - User can show/hide widget title
* Title Color
* Background Color

![Configure Navigation Button Widget](/files/Tn6jN54a9Z93mq92nvRk)

**Widget Setting**

In Widget Setting option, user can change following parameters:

* Button Color&#x20;
* Text Color&#x20;
* Button Text&#x20;
* Button Action - Two Type of actions are given.
  * Open URL - This will open a given URL on button click event.
  * Navigate to Dashboard -  This will navigate to selected dashboard on button click event.

![Configure Navigation Button Widget](/files/ojWurOalt4vWhwBy82aw)

#### Source <a href="#source" id="source"></a>

Navigation Button does not support source settings.

#### **Event Handling**

Navigation Button does not support event handling.


# Form Widget

#### General Setting <a href="#general-setting" id="general-setting"></a>

User can change following things in Form widget:

* Widget Name - Name for widget which will be used data referenceFor Example, if widget name is 'Form', then data of widget is referenced as Form.formData.
* Show Title - User can show/hide widget title
* Title Color
* Background Color&#x20;

![Configure Form Widget](/files/qsFWfiRpxnqCTD0HoYr0)

#### Widget Setting

In Widget Setting option, user can change following parameters:

* Button Text&#x20;
* Button Text Color&#x20;
* Button Background Color
* Form Schema

  Here, user can define schema for form with required fields, properties etc. Please refer below example.

```
// Form Schema

{
  "title": "A registration form",
  "description": "A simple form example.",
  "type": "object",
  "required": [
    "firstName",
    "lastName"
  ],
  "properties": {
    "firstName": {
      "type": "string",
      "title": "First name",
      "default": "Chuck"
    },
    "lastName": {
      "type": "string",
      "title": "Last name"
    },
    "telephone": {
      "type": "string",
      "title": "Telephone",
      "minLength": 10
    }
  }
}
```

* UI Schema

  Here, user can customize each field of form. Different properties like autoFocus, autoComplete etc are available.

```
// UI Schema

{
  "firstName": {
    "ui:autofocus": true,
    "ui:emptyValue": "",
    "ui:autocomplete": "family-name"
  },
  "lastName": {
    "ui:emptyValue": "",
    "ui:autocomplete": "given-name"
  },
  "age": {
    "ui:widget": "updown",
    "ui:title": "Age of person",
    "ui:description": "(earthian year)"
  },
  "bio": {
    "ui:widget": "textarea"
  },
  "password": {
    "ui:widget": "password",
    "ui:help": "Hint: Make it strong!"
  },
  "date": {
    "ui:widget": "alt-datetime"
  },
  "telephone": {
    "ui:options": {
      "inputType": "tel"
    }
  }
}
```

![Configure Form Widget](/files/ZvxtVePPxbpuOtBN2nt7)

If user define Form Schema and UI schema as above given example, the Form will be shown as below image.

![Form Widget](/files/V2nr7YqcwL82Ref33qih)

{% hint style="info" %}
Notes:

* For more details, please refer [Form-Schema](https://rjsf-team.github.io/react-jsonschema-form/)
  {% endhint %}

#### Source

Button widget does not support Source settings.

#### Event Handling

Form onSubmit event is provided. User can choose MQTT or Action mode for onSubmit event.

**Using MQTT**

User needs to provide following parameters:

* event - Select **onSubmit** event from dropdown
* mode - Select mode as **MQTT**
* topic - Enter topic name directly. No need to provide accountID.
* Data parameters - Add new data parameter item. Each data parameter item represent a key-value pair. So select required parameter and give key name to it.

As shown in below images, for onSubmit event, MQTT mode is selected. It means when user clicks on the submit button, it will publish configured data parameters on given MQTT topic.

![Form Widget - Event handling using MQTT](/files/mwx5B8uSooX0RYeXoTFE)

![Form Widget - Event handling using MQTT](/files/i0tKTJigf8mRwgfnIamu)

So, as per the configuration shown in above images, when user clicks the button, JSON object with **formKey-UserRole** as key-value pair gets published on **data** topic. Please refer below image for final output.

![Form Widget - Event handling using MQTT](/files/2U0NC818oYYq4GVPc96Q)

**Using Action**

User needs to provide following parameters:

* event - Select **onSubmit** event from dropdown
* mode - Select mode as **action**
* Action ID - Select required Action ID from dropdown

As shown in below images, for onClick event, **action** mode is selected. It means when user clicks on the button, it will trigger given Action with configured action parameters.

![Form Widget - Event handling using Actions Widget](/files/cGQEtyTw3iG2tDvcEPv7)

![Form Widget - Event handling using Actions](/files/p8xKGUkAhAArjEtTVy6Z)

So, as per the example given in above images, when user clicks a button, **updateFirebaseCloud** action will trigger with JSON object of **formDetails** as **key** and JSON Object of **Form** as **Value**.


# Date Picker Widget

**General Setting**

User can change following things in Date Picker widget:

* Name for widget which will be used data reference. For Example, if widget name is 'Date Picker', then data of widget is referenced as Data Picker.date
* Show title - User can show/hide widget title
* Title Color
* Background Color

![Configure Date Picker Widget](/files/jRTlf0fdNfZjR8tArH1o)

#### Source

Date Picker widget does not support Source settings.

#### Event Handling

Date Picker widget does not support Event handling.

**Examples:**

TestCase 1:

If user want to fetch data using Action which requires startTime as parameter and show it to Table Widget.  So following are the steps to perform this operation and are as follows.

1. Add Table Widget to dashboard and change its color, background color, file name as per requirement.
2. Now go to **Source** tab of Table Widget and select mode as Action, and select a required ActionID from dropdown.
3. Now, in Action Parameter, select parameter as **Date Picker.date** and set Key as **startTime,** and enable **Reload On Change operation.**
4. It will send JSON object with 'startTime:\<selected\_date>' as key-value pair to given ActionID as shown in below block. And received response of action will get shown in table.

```
// JSON Object 
// here, Date Format - dd/MM/yyyy is fixed

{
    "startTime":<selected_date>  
}
```

![Configure Date Picker Widget](/files/N8JvmHCwBsh9ptevI2aI)

![Configure Date Picker Widget](/files/Yb4Pa50FZtIyVhf2kO1F)


# Date Time Range Widget

In Date Time Range widget, user has two options of Range Type.

1. Absolute - Here, user can select specific start date and end date using calender.
2. Relative - Here, user can provide interval like days, months, weeks etc. This can be used to check history data. For example, data of last 3 weeks starting from current time.

**General Setting**

User can change following things in Date Time Range widget:

* Name for widget which will be used data reference. For Example, if widget name is 'Date Time Range', then data of widget is referenced as Data Time Range.startDate and Data Time Range.endDate
* Show title - User can show/hide widget title
* Title Color
* Background Color

![Configure Date Time Range Widget](/files/BvMs8AVuJwGZWRS4LSda)

#### Source <a href="#source" id="source"></a>

Date Time Range widget does not support Source settings.

#### Widget Setting

In Widget Setting option, user can change following parameters:

* Date Format - User can define any Date Format here. For example, dd/MM/yyyy HH:mm:ss.

![Configure Date Time Range Widget](/files/cVcADb1KoQhSrA6Db6yh)

#### Event Handling

Date Time Range widget does not support Event handling.

#### Example

Test Case 1:

If user want to fetch data using Action which requires startTime and endTime as parameter and show it to Table Widget. So following are the steps to perform this operation and are as follows.

1. Add Table Widget to dashboard and change its color, background color, file name as per requirement.
2. Now go to **Source** tab of Table Widget, and select mode as Action, and select a required ActionID from dropdown.
3. Now, in Action Parameter, select parameter as **Date Time Range.startDate** and set Key as **startTime,** and enable **Reload On Change operation.**
4. Similarly,  select parameter as **Date Time Range.endDate** and set Key as end**Time,** and enable **Reload On Change operation.**
5. It will send JSON object to given ActionID as shown in below block. And received response of action will get shown in table.

```
// JSON Object

// Date Format will be as per user input
// If not given by user, default Date Format will be 'dd/mm/yyyy'

{
    "startTime":<selected_startDate>,  
    endTime":<selected_endDate>
}
```

![Configure Date Time Range Widget](/files/wwvpV30wa8ZTc7rTvXX9)

![Configure Date Time Range Widget](/files/zjmItqAmLHPZto1NH4Le)


# Slider Widget

**General Setting**

User can change following things in Slider widget:

* Name for widget which will be used data referenceFor Example, if widget name is 'Slider', then data of widget is referenced as Slider.data
* Show title - User can show/hide widget title
* Title Color
* Background Color

![Configure Slider Widget](/files/5vg3CBUJGsbdHenOise9)

#### Widget Setting <a href="#widget-setting" id="widget-setting"></a>

In Widget Setting option, user can change following parameters:

* Key - key parameter of JSON Object which will define value of Slider.
* Min -  Minimum value for Slider widget
* Max - Maximum value for Slider widget
* Step Size - Size of each step of Slider widget. For example, if step size is 2, slider value will  increment by 2 with each step.&#x20;

![Configure Slider Widget](/files/umHvjTQEToicXs0MSAL5)

#### Source <a href="#source" id="source"></a>

User can select a source mode as MQTT or Action.

**Using MQTT**

Here, to change value of Slider widget user can publish JSON object on given **sliderData** MQTT topic. No need to provide \<account\_id> while providing the MQTT topic. The JSON object will be as below.

```
//Example 

{
    "sliderKey":60
}   

// 'sliderKey' is set as key in widget form.
```

![Configure Slider Widget](/files/EmfQiHcuzpkzLGMXQxCG)

**Using Action**

Here, to change value of Slider widget, output of the action should contain key-value pair with 'sliderKey' key. User can also update the widget either onLoad or periodically by providing refresh interval.

![Configure Slider Widget](/files/vhqhHFoO0hQm87SfeVma)

#### Event Handling <a href="#event-handling" id="event-handling"></a>

Button onClick event is provided. User can choose MQTT or Action mode for onClick event.

**Using MQTT**

User needs to provide following parameters:

* event - Select **OnChangeSubmitted** event from dropdown
* mode - Select mode as **MQTT**
* topic - Enter topic name directly. No need to provide accountID.
* Data parameters - Add new data parameter item. Each data parameter item represent a key-value pair. So select required parameter and give key name to it.

As shown in below images, for onChangeSubmitted event, MQTT mode is selected. It means when the slider value gets changed, it will publish configured data parameters on given MQTT topic.​

![Slider Widget - Event Handling using MQTT](/files/BAcjNEg7WIZSjZESk9gA)

![Slider Widget - Event Handling using MQTT](/files/fVekQVgMoJiTfFJXkb0B)

So, as per the configuration shown in above images, when the slider value changes, JSON object with **speed-Slider.data** as key-value pair gets published on **data** topic.

**Using Action**

User needs to provide following parameters:

* event - Select **onChangeSubmitted** event from dropdown
* mode - Select mode as **action**
* Action ID - Select required Action ID from dropdown

As shown in below images, for onChangeSubmitted event, **action** mode is selected. It means when user slider value is changed, it will trigger given Action with configured action parameters.

![Slider Widget - Event Handling using Action](/files/wZG1aFZYNgLQUWf6h5x8)

![Slider Widget - Event Handling using Action](/files/Xuq95Cvokex6kEfeLkbf)

#### Example

If we configure Slider Widget as below:

1. key - sliderKey
2. Min - 0
3. Max -100
4. Step Size - 1

and set source type for widget as MQTT and topic configured is 'data'. And if we publish following JSON Object over 'data' topic then Slider Widget will look as shown in image.

```
// Data over configured MQTT Topic

{ 
    "sliderKey":55
}
```

![Slider Widget Example](/files/Fl5dYeTiJXvbzBU7i1sH)


# Table Widget

**General Setting**

User can change following things in Table widget:

* Name for widget which will be used data referenceFor Example, if widget name is 'Table', then data of widget is referenced as Table.data
* Show title - User can show/hide widget title
* Title Color
* Background Color

![Configure Table Widget](/files/gGM7Fi11G5NXWLSm1plF)

**Widget Setting**

In Widget Setting option, user can change following parameters:

* Filename - User can change name of Exported file. Default file type is .xlsx and default file name is 'thingsup.xlsx'.

![Configure Table Widget](/files/dmKNoTa07DDPg7AhwAGc)

#### Source <a href="#source" id="source"></a>

User can select a source mode as MQTT or Action.

**Using MQTT**

Here, to change value of Text Widget user can publish JSON array on given **testData** MQTT topic. No need to provide \<account\_id> while providing the MQTT topic. The JSON array will be as below.

```
//Example 

[{ 
  "ID":1,
  "Name":"John"
},
{ 
  "ID":2,
  "Name": "Andrew"
},
{ 
  "ID":3,
  "Name":"Peter"
}]


// Here, ID and Name will be the Table Headers. And each Json object of the given
array is consided as unique row in table.
```

![Configure Table Widget](/files/SlLJo0D2xqz8BiEIxFmD)

**Using Action**

Here, to update the table widget, output of the action should contain JSON array as given format in above example. User can also update the widget either onLoad or periodically by providing refresh interval.

![Configure Table Widget](/files/tV3c57XKozW1N4Kp77s4)

#### Event Handling

Table widget does not support any event.

#### Example

If we configure Table widget with source type for widget as MQTT and topic configured is 'data'. And if we publish following JSON array over 'data' topic then Table Widget will look as shown in image.

```
[
  {
    "ID": "121",
    "Name": "John"
  },
  {
    "ID": "S122",
    "Name": "Andrew"
  },
  {
    "ID": "S123",
    "Name": "Peter"
  }
]

// Here, ID and Name will be the Table Headers. And each Json object of the given
array is consided as unique row in table.
```

![Table Widget Example](/files/sXf57YvwfoewgRqEtLvS)


# Google Map Widget

**General Setting**

User can change following things in Google Map widget:

* Name for widget which will be used data reference. For Example, if widget name is 'Map', then data of widget is referenced as Map.data
* Show title - User can show/hide widget title
* Title Color
* Background Color

![Configure Google Map Widget](/files/kBLZXGJq3RQhNk6a6dGJ)

**Widget Setting**

In Widget Setting option, user can change following parameters:

* Key - key parameter of JSON Object which will define location details for Google Map widget.
* Marker Color&#x20;
* Marker Type - Following marker types are available to show location on Map.
  1. CIRCLE
  2. BACKWARD CLOSED ARROW
  3. FORWARD CLOSED ARROW
  4. BACKWARD OPEN ARROW
  5. FORWARD OPEN ARROW

![Configure Google Map Widget](/files/dfNRd8hmQT2uDWmXxJQD)

#### Source <a href="#source" id="source"></a>

User can select a source mode as MQTT or Action.

**Using MQTT**

Here, to update location on Google Map user can publish JSON object on given **testData** MQTT topic. No need to provide \<account\_id> while providing the MQTT topic. The JSON object will be as below.

```
//Example 

{
"locationKey": {"lat": 15.78, "lng": 78.12}
}

// Here, 'locationKey' is key defined for Google Map widget.
```

![Configure Google Map Widget](/files/1348ihj88nqG3OuM2xhB)

**Using Action**

Here, to update the Google Map widget, output of the action should contain JSON object as given in above example. User can also update the widget either onLoad or periodically by providing refresh interval.

![Configure Google Map Widget](/files/F2s6WXOIgVnjUnUo4ahh)

#### Event Handling

Google Map widget does not support any event.

#### Example <a href="#example" id="example"></a>

If we configure Google map Widget as below:

1. key - mapKey
2. Marker type - circle
3. Marker color - red

and set source type for widget as MQTT and topic configured is 'data'. And if we publish following JSON Object over 'data' topic then Google Map Widget will look as shown in image.

```
// Data over configured MQTT Topic

{
    "mapKey": {"lat": 15.78, "lng": 78.12}
}
```

![Google Map Widget Example](/files/y72VlB9C6TnDMJZMPUYm)


# Data Tile Widget

**General Setting**

User can change following things in Data Tile widget:

* Name for widget which will be used data reference. For Example, if widget name is 'Data Tile', then data of widget is referenced as Data Tile.data
* Show title - User can show/hide widget title
* Title Color
* Background Color

![Configure Data Tile Widget](/files/Mt0ldUJnYVCweej1WzhH)

**Widget Setting**

In Widget Setting option, user can change following parameters:

* Key - key parameter of JSON Object which will define data of Data Tile Widget.
* Data Color&#x20;
* Unit Color&#x20;
* Unit - If any unit need to be given. For example, '%' for battery data.
* Decimal units - Number of decimal points in required in data

![Configure Data Tile Widget](/files/vWF5xYXbXkQ0wJhOpFT1)

#### Source <a href="#source" id="source"></a>

User can select a source mode as MQTT or Action.

**Using MQTT**

Here, to update data on Data Tile Widget user can publish JSON object on given **testData** MQTT topic. No need to provide \<account\_id> while providing the MQTT topic. The JSON object will be as below.

```
{"testKey":10.2}

// Here, 'testKey' is key defined for Data Tile widget.
```

![Configure Data Tile Widget](/files/1348ihj88nqG3OuM2xhB)

**Using Action**

Here, to update the data on Data Tile widget, output of the action should contain JSON object as given in above example. User can also update the widget either onLoad or periodically by providing refresh interval.

![Configure Data Tile Widget](/files/3KuDPdrgSkycSO7z158U)

#### Event Handling

Data Tile widget does not support any event.

#### Example

If we configure Data Tile Widget as below:

1. key - testKey
2. Unit - %
3. Decimal points - 2

and set source type for widget as MQTT and topic configured is 'data'. And if we publish following JSON Object over 'data' topic then Data Tile Widget will look as shown in image.

```
// Data over configured MQTT Topic

{ 
    "testKey":89.98
}
```

![Data Tile Widget Example](/files/ZQcaWb5ntGdm5dU7WstD)


# HTML Tile Widget

**General Setting**

User can change following things in HTML Tile widget:

* Name for widget which will be used data reference. For Example, if widget name is 'HTML Tile', then data of widget is referenced as HTML Tile.data
* Show title - User can show/hide widget title
* Title Color
* Background Color

![Configure HTML Tile Widget](/files/afyDnrFlYMdLyf9JZDKU)

**Widget Setting**

In Widget Setting option, user can change following parameters:

* Key - key parameter of JSON Object which will define data of HTML Tile Widget. User can provide multiple comma seprated keys.
* CSS - User can provide CSS styling&#x20;
* HTML -  User can write HTMl code here using keys also.

![Configure HTML Tile Widget](/files/8AA7WLpXQX6vdVn4xC56)

![Configure HTML Tile Widget](/files/mwaQ3pZL6I06WQWQA6po)

#### Source <a href="#source" id="source"></a>

User can select a source mode as MQTT or Action.

**Using MQTT**

Here, to update data on HTML Tile Widget user can publish JSON object on given **testData** MQTT topic. No need to provide \<account\_id> while providing the MQTT topic. The JSON object will be as below.

```
// Example 

{
    "key1":"Hello World !!!",
    "key2":"My name is John"
}

// Here, 'key1' and 'key2' are the keys defined for HTML Tile widget.
```

![Configure HTML Tile Widget](/files/jpI6WOsuXBT6ElhGBuUM)

**Using Action**

Here, to update the data on HTML Tile widget, output of the action should contain JSON object as given in above example. User can also update the widget either onLoad or periodically by providing refresh interval.

![Configure HTML Tile Widget](/files/3KuDPdrgSkycSO7z158U)

#### Event Handling

HTML Tile widget does not support any event.

#### Example

If we write CSS code for widget as:

```
.tile{ background-color: red; color: white;}
.tile2{ background-color: blue; color: white;}
```

and write HTML Code for widget as:

```
<div class="tile">{key1}</div>
<div class="tile2">{key2}</div>
```

and set source type for widget as MQTT and topic configured is 'data'. And if we publish following JSON Object over 'data' topic then HTML Widget will look as shown in image.

```
// Data over configured MQTT Topic

{ 
    "key1":"Hello World !!!", 
    "key2":"My name is John"
}
```

![HTML Tile Widget Example](/files/EG3f8ZX1sQcu2D2jOuig)


# Line Chart Widget

**General Setting**

User can change following things in Line Chart widget:

* Name for widget which will be used data reference. For Example, if widget name is 'Line Chart', then data of widget is referenced as Line Chart.data
* Show title - User can show/hide widget title
* Title Color
* Background Color

![Configure Line Chart Widget](/files/dAD8Y136fgyHWtLWhMzM)

**Widget Setting**

In Widget Setting option, user can change following parameters:

* Show Grid - Enable to show grid inside the chart
* Show Legend -  Enable to show chart legends
* X Legend - String value as a Legend for the X Axis&#x20;
* Y Legend - String value as a Legend for the Y Axis &#x20;
* Visible Points - Integer value to show maximum visible points on Chart
* Type - Two types of Line Chart are available
  * XY Chart -  It will take values from X Key and Y Keys configured below.
  * Timeseries Chart - It will plot Y Keys configured against the timestamp data.
* Time Format -  Two time format are supported. This are only considred in case of Timeseries chart.
  * HH:mm:ss
  * DD-MM-YYYY
* X Key - key parameter of JSON Object which will define X-Axis Data for Line Chart Widget.
* Y Keys - Key parameter of JSON Object which will define Y-Axis Data for Line Chart Widget.
* Show Grid X - Enable to show X Axis Grid Lines
* Show Grid Y - Enable to show Y Axis Grid Lines

![Configure Line Chart Widget](/files/JQZ8PcQIe4lovSVBXAvC)

![Configure Line Chart Widget](/files/cjxlVoXWTNUsayuCb5b0)

#### Source <a href="#source" id="source"></a>

User can select a source mode as MQTT or Action.

**Using MQTT**

Here, to update data on Line Chart user can publish JSON object/array on given **data** MQTT topic. No need to provide \<account\_id> while providing the MQTT topic. The JSON object will be as below.

```
// Example 1
// XY Line Chart is selected

[
  {
    "xData": "Div A",
    "yData": 116,
    "zData": 60
  },
  {
    "xData": "Div B",
    "yData": 86,
    "zData": 40
  },
  {
    "xData": "Div C",
    "yData": 20,
    "zData": 30
  }
]

// here 'xData' is set as XKey and 'yData' and 'zData' are set as yKeys.
```

```
// Example 
// Timeseries Line Chart is selected

{
    "yData":116,
    "zData":60
}

// here 'yData' and 'zData' are set as yKeys. 
```

![Configure Line Chart Widget](/files/eocaX1EidhGF9LbCT0H5)

**Using Action**

Here, to update the Line Chart widget, output of the action should contain JSON object/array as given in above example. User can also update the widget either onLoad or periodically by providing refresh interval.

![Configure Line Chart Widget](/files/F2s6WXOIgVnjUnUo4ahh)

#### Event Handling

Line Chart widget does not support any event.

#### Examples <a href="#examples" id="examples"></a>

Here, data in below format published on configured topic, will appear as shown in image.

#### 1. XY Line Chart <a href="#undefined" id="undefined"></a>

```
// XY Line Chart is selected

[
  {
    "xData": "Div A",
    "yData": 116,
    "zData": 60
  },
  {
    "xData": "Div B",
    "yData": 86,
    "zData": 40
  },
  {
    "xData": "Div C",
    "yData": 20,
    "zData": 30
  }
]

// here 'xData' is set as XKey and 'yData' and 'zData' are set as yKeys.
```

![XY Line Chart Example](/files/OuEGmimfEdFnfTP4O5tA)

#### 2. Timeseries Line Chart <a href="#id-2.-stacked-bar-chart" id="id-2.-stacked-bar-chart"></a>

Here, point on chart will get plot at the time it is received from configured source.

```
// Timeseries Line Chart is selected

{
    "yData":116,
    "zData":60
}

// here 'yData' and 'zData' are set as yKeys. 
```

![Timeseries Line Chart Example](/files/EMjg8iJi4cN7HvgXsmhG)


# Bar Chart Widget

**General Setting**

User can change following things in Bar Chart widget:

* Name for widget which will be used data reference. For Example, if widget name is 'Bar Chart', then data of widget is referenced as Bar Chart.data
* Show title - User can show/hide widget title
* Title Color
* Background Color

![Configure Bar Chart Widget](/files/I6q1YAOJxFNxux1XYwbn)

**Widget Setting**

In Widget Setting option, user can change following parameters:

* Index By - Parameter of JSON Object which will define X-Axis Data for Line Chart Widget.
* Keys -  Key parameter of JSON Object which will define Y-Axis Data for Line Chart Widget.
* Y Legend - string value as Y axis legend
* Show Legend -Enable to show legends
* Grouped  -Enable to show bars as grouped. Default bar chart will be stacked bar chart.
* Show grid X -  Enable to show X axis grid lines
* Show grid Y - Enable to show Y axis grid lines
* Horizontal - Enable to show bars horizontally

![Configure Bar Chart Widget](/files/s2zV2IUwCnhI7e251uLE)

![Configure Bar Chart Widget](/files/QursFCIOYO4lYiRbMyW6)

#### Source <a href="#source" id="source"></a>

User can select a source mode as MQTT or Action.

**Using MQTT**

Here, to update data on Bar Chart user can publish JSON array on given **data** MQTT topic. No need to provide \<account\_id> while providing the MQTT topic. The JSON object will be as below.

```
// Example 1
// Grouped/Stacked Bar Chart

[
  {
    "country": "India",
    "first": 94,
    "second": 114,
    "third": 14
  },
  {
    "country": "Australia",
    "first": 22,
    "second": 65,
    "third": 16
  },
  {
    "country": "US",
    "first": 21,
    "second": 85,
    "third": 12
  }
]

// here 'country' is set as IndexBy key and 'first', 'second' and 'third' are set as yKeys.
```

```
// Example 
// Simple Bar Chart

[
  {
    "country": "India",
    "first": 94
  },
  {
    "country": "Australia",
    "first": 22
  },
  {
    "country": "US",
    "first": 21
  }
]

// here 'country' is set as IndexBy key and 'first' is set as yKey.
```

![Configure Bar Chart Widget](/files/eocaX1EidhGF9LbCT0H5)

**Using Action**

Here, to update the Bar Chart widget, output of the action should contain JSON array as given in above example. User can also update the widget either onLoad or periodically by providing refresh interval.

![Configure Bar Chart Widget](/files/F2s6WXOIgVnjUnUo4ahh)

#### Event Handling

Bar Chart widget does not support any event.

#### Examples

Here, data in below format published on configured topic, will appear as shown in image.

#### 1. Simple Bar Chart

```
// Simple Bar Chart

[
  {
    "country": "India",
    "first": 94
  },
  {
    "country": "Australia",
    "first": 22
  },
  {
    "country": "US",
    "first": 21
  }
]

// here 'country' is set as IndexBy key and 'first' is set as yKey.
```

![Simple Bar Chart](/files/y7jSBc2wlGeLgoNdYXB3)

#### 2. Stacked Bar Chart

```
// Grouped/Stacked Bar Chart

[
  {
    "country": "India",
    "first": 94,
    "second": 114,
    "third": 14
  },
  {
    "country": "Australia",
    "first": 22,
    "second": 65,
    "third": 16
  },
  {
    "country": "US",
    "first": 21,
    "second": 85,
    "third": 12
  }
]

// here 'country' is set as IndexBy key and 'first', 'second' and 'third' are set as yKeys.
```

![Stacked Bar Chart Example](/files/oMsRWVLHW7PejalHZkRF)


# Pie Chart Widget

**General Setting**

User can change following things in Pie Chart widget:

* Name for widget which will be used data reference. For Example, if widget name is 'Pie Chart', then data of widget is referenced as Pie Chart.data
* Show title - User can show/hide widget title
* Title Color
* Background Color

![Configure Pie Chart Widget](/files/vnavDtPhGv5hzRAe6g7y)

**Widget Setting**

In Widget Setting option, user can change following parameters:

* Inner Radius - Integer value for radius of inner circle of pie chart
* Show Legend - Enable to show legends

![Configure Pie Chart Widget](/files/hNKxYyWwl9XUokweWlCI)

#### Source <a href="#source" id="source"></a>

User can select a source mode as MQTT or Action.

**Using MQTT**

Here, to update data on Pie Chart user can publish JSON object on given **data** MQTT topic. No need to provide \<account\_id> while providing the MQTT topic. The JSON obejct will be as below.

```
// Example 

{ "Andrew": 100 ,"John":160 ,"Sam":120}
```

![Configure Pie Chart Widget](/files/eocaX1EidhGF9LbCT0H5)

**Using Action**

Here, to update the Pie Chart widget, output of the action should contain JSON Object as given in above example. User can also update the widget either onLoad or periodically by providing refresh interval.

![Configure Pie Chart Widget](/files/F2s6WXOIgVnjUnUo4ahh)

#### Event Handling

Pie Chart widget does not support any event.

#### Example

Here, data in below format published on configured topic, will appear as shown in image.

```
// Example

{ "Andrew": 100 ,"John":160 ,"Sam":120}
```

![MQTT Data for Pie Chart](/files/Yomn3IYtoJcUN3Cn6IgI)

![Pie Chart Example](/files/AM6Btcv0NmWLXzo1laRT)


# Scatter Chart Widget

**General Setting**

User can change following things in Scatter Chart widget:

* Name for widget which will be used data reference. For Example, if widget name is 'Scatter Chart', then data of widget is referenced as Scatter Chart.data
* Show title - User can show/hide widget title
* Title Color
* Background Color

![Configure Scatter Chart Widget](/files/8m4OIIC9eHu5J2nESjVc)

**Widget Setting**

In Widget Setting option, user can change following parameters:

* Dot Size - Integer value for dot size
* X Key - key parameter of JSON Object which will define X-Axis value.
* Show Legend - Enable to show legends
* Y Keys - key parameter of JSON Object which will define Y-Axis values.
* X Legend - String value as a Legend for the X Axis&#x20;
* Y Legend - String value as a Legend for the Y Axis&#x20;

![Configure Scatter Chart Widget](/files/74Nl8IP7Yqp4hEae5KOc)

![Configure Scatter Chart Widget](/files/GIbc3Lku5O5vRcNCAOM3)

#### Source <a href="#source" id="source"></a>

User can select a source mode as MQTT or Action.

**Using MQTT**

Here, to update data on Scatter Chart user can publish JSON array on given **data** MQTT topic. No need to provide \<account\_id> while providing the MQTT topic. The JSON array will be as below.

```
// Example

[
  {
    "x": 42,
    "y": 116,
    "z": 60
  },
  {
    "x": 22,
    "y": 86,
    "z": 30
  }
]

// here, 'x' is set as X Key and 'y' and 'z' are set as Y keys with 'groupA' and
 'groupB' as labels respectively.
```

![Configure Scatter Chart Widget](/files/eocaX1EidhGF9LbCT0H5)

**Using Action**

Here, to update the Scatter Chart widget, output of the action should contain JSON array as given in above example. User can also update the widget either onLoad or periodically by providing refresh interval.

![Configure Scatter Chart Widget](/files/2p8GE9hpImVGMbwEgZpk)

#### Event Handling

Scatter Chart widget does not support any event.

#### Example

Here, data in below format published on configured topic, will appear as shown in image.

```
// Example

[
  {
    "x": 42,
    "y": 116,
    "z": 60
  },
  {
    "x": 22,
    "y": 86,
    "z": 30
  }
]

// here, 'x' is set as X Key and 'y' and 'z' are set as Y keys with 'groupA' and 'groupB' as labels respectively.

```

![MQTT Data for Scatter Chart](/files/sk3Uz38QGW0QEQHuZuWB)

![Scatter Chart Example](/files/QOLdLFg4q3bLyIHGwnqy)


# Radar Chart Widget

**General Setting**

User can change following things in Radar Chart widget:

* Name for widget which will be used data reference. For Example, if widget name is 'Radar Chart', then data of widget is referenced as Radar Chart.data
* Show title - User can show/hide widget title
* Title Color
* Background Color

![Configure Radar Chart Widget](/files/6f4uHFX13xrdSjSsS3iq)

**Widget Setting**

In Widget Setting option, user can change following parameters:

* Index By - key parameter of JSON Object which will used as Index for Radar Chart.
* Keys - key parameter of JSON Object which will define parameters for Radar Chart. Here, user can provide label and color for each key.
* Show Legend - Enable to show legends

![Configure Radar Chart Widget](/files/u7v9T7HjLDJ7zKHbBoh5)

#### Source <a href="#source" id="source"></a>

User can select a source mode as MQTT or Action.

**Using MQTT**

Here, to update data on Radar Chart user can publish JSON array on given **data** MQTT topic. No need to provide \<account\_id> while providing the MQTT topic. The JSON array will be as below.

```
// Example

[
  {
    "taste": "fruity",
    "a": 94,
    "b": 114,
    "c": 31
  },
  {
    "taste": "bitter",
    "a": 22,
    "b": 65,
    "c": 88
  },
  {
    "taste": "heavy",
    "a": 108,
    "b": 47,
    "c": 119
  },
  {
    "taste": "strong",
    "a": 30,
    "b": 84,
    "c": 94
  },
  {
    "taste": "sunny",
    "a": 74,
    "b": 114,
    "c": 60
  }
]

// here, 'taste' is set as Index By value and 'a','b' and 'c' are set as keys with 
respective labels and colors.
```

![Configure Radar Chart Widget](/files/eocaX1EidhGF9LbCT0H5)

**Using Action**

Here, to update the Radar Chart widget, output of the action should contain JSON array as given in above example. User can also update the widget either onLoad or periodically by providing refresh interval.

![Configure Radar Chart Widget](/files/2p8GE9hpImVGMbwEgZpk)

#### Event Handling

Radar Chart widget does not support any event.

#### Example

Here, data in below format published on configured topic, will appear as shown in image.

```
// Example

[
  {
    "taste": "fruity",
    "a": 94,
    "b": 114,
    "c": 31
  },
  {
    "taste": "bitter",
    "a": 22,
    "b": 65,
    "c": 88
  },
  {
    "taste": "heavy",
    "a": 108,
    "b": 47,
    "c": 119
  },
  {
    "taste": "strong",
    "a": 30,
    "b": 84,
    "c": 94
  },
  {
    "taste": "sunny",
    "a": 74,
    "b": 114,
    "c": 60
  }
]

// here, 'taste' is set as 'Index By' value and 'a','b' and 'c' are set as keys with respective labels and colors.
```

![MQTT Data for Radar Chart](/files/ry6KDZJ2dS7GFIy6awNe)

![Radar Chart Example](/files/f6EH4BrnqySetd8U6l0I)


# Radial Gauge

**General Setting**

User can change following things in Radial Gauge widget:

* Name for widget which will be used data reference. For Example, if widget name is 'Radial Gauge', then data of widget is referenced as Radial Gauge.data
* Show title - User can show/hide widget title
* Title Color
* Background Color

![Configure Radial Gauge Widget](/files/a6ZyDlblJOxUYl4yTp3v)

**Widget Setting**

In Widget Setting option, user can change following parameters:

* Key - key parameter of JSON Object which will define data of Radial Gauge Widget.
* Title - Title for Widget
* Unit -  Unit of data showing using Widget
* Minimum value - Minimum value of range for widget
* Maximum value - Maximum value of range for widget
* Show border - Enable to show border in widget
* Border Shadow Width -Width for border shadow of widget
* Needle Shape -  Two options of Needle Shape are given- 1. Arrow 2. Line
* Meter tick values - Comma seperated values to generate Meter ticks
* Minor ticks - Number of minor ticks required
* Highlights - Multiple Highlights can be created by providing From, To  values and Color for it.
* Highlight Width
* Ticks Angle
* Start Angle
* Enable Gauge Animation&#x20;
* Animation duration - duration for Gauge Animation in milliseconds
* Animation rule - multiple options for animation are given. For example, linear, quad etc.
* Animate value
* Colors - Plate color, Major ticks color, Minor ticks color, Title color, Unit color, Numbers color, Needle start color, Needle end color, Value text color can be changed
* Needle Configuration -&#x20;
  * Needle Start, Needle End, its width, Needle Circle Size can be changed
  * Also user can show/hide needle inner and outer circle.
* Value Box Configuration -&#x20;
  * Integer precision - Integer which defines how many numeric positions should be used to display integer part of the value number.
  * Decimal precision - Integer which defines how many positions should be used to display decimal part of the value number.
* Font Size - Font size for Numbers, title, units and value can be changed here.

#### Source <a href="#source" id="source"></a>

User can select a source mode as MQTT or Action.

**Using MQTT**

Here, to update data on Radial Gauge user can publish JSON object on given **data** MQTT topic. No need to provide \<account\_id> while providing the MQTT topic. The JSON object will be as below.

```
// Example

{
    "RGKey":120
}

Here, "RGKey" is set as key in widget configuration.
```

![Configure Radial Gauge Widget](/files/eocaX1EidhGF9LbCT0H5)

**Using Action**

Here, to update the Radial Gauge widget, output of the action should contain JSON object as given in above example. User can also update the widget either onLoad or periodically by providing refresh interval.

![Configure Radial Gauge Widget](/files/2p8GE9hpImVGMbwEgZpk)

#### Event Handling

Radial Gauge widget does not support any event.

#### Example

Here, data in below format published on configured topic, will appear as shown in image.

```
// Example

{
    "RGKey":120
}

Here, "RGKey" is set as key in widget configuration.
```

![MQTT Data for Radial Gauge](/files/bGD5WATG4n8HIlylrvie)

![Radial Gauge Example](/files/yBcFjlwOot9nM8BrTaG3)


# Linear Gauge

**General Setting**

User can change following things in Linear Gauge widget:

* Name for widget which will be used data reference. For Example, if widget name is 'Linear Gauge', then data of widget is referenced as Linear Gauge.data
* Show title - User can show/hide widget title
* Title Color
* Background Color

![Configure Linear Gauge Widget](/files/sEOhryfznYNyJVHo96Rv)

**Widget Setting**

In Widget Setting option, user can change following parameters:

* Key - key parameter of JSON Object which will define data of Linear Gauge Widget.
* Title - Title for Widget
* Unit -  Unit of data showing using Widget
* Minimum value - Minimum value of range for widget
* Maximum value - Maximum value of range for widget
* Show border - Enable to show border in widget
* Border Shadow Width -Width for border shadow of widget
* Needle Shape -  Two options of Needle Shape are given- 1. Arrow 2. Line
* Meter tick values - Comma seperated values to generate Meter ticks
* Minor ticks - Number of minor ticks required
* Ticks Width&#x20;
* Minor Ticks Width
* Highlights - Multiple Highlights can be created by providing From, To  values and Color for it.
* Highlight Width
* Bar Configuration
  * Bar length, Bar width, bar Stroke Length, Tick side, Number side, Needle side can be changed
* Enable Gauge Animation&#x20;
* Animation duration - duration for Gauge Animation in milliseconds
* Animation rule - multiple options for animation are given. For example, linear, quad etc.
* Animate value
* Colors - Plate color, Bar Color, Bar progress color, Bar stroke color, Major ticks color, Minor ticks color, Title color, Unit color, Numbers color, Needle start color, Needle end color, Value text color can be changed
* Needle Configuration -&#x20;
  * Needle Start, Needle End, its width can be changed
* Value Box Configuration -&#x20;
  * Integer precision - Integer which defines how many numeric positions should be used to display integer part of the value number.
  * Decimal precision - Integer which defines how many positions should be used to display decimal part of the value number.
* Font Size - Font size for Numbers, title, units and value can be changed here.

#### Source <a href="#source" id="source"></a>

User can select a source mode as MQTT or Action.

**Using MQTT**

Here, to update data on Linear Gauge user can publish JSON object on given **data** MQTT topic. No need to provide \<account\_id> while providing the MQTT topic. The JSON object will be as below.

```
// Example

{
    "LGKey":100
}

Here, "LGKey" is set as key in widget configuration.
```

![Configure Linear Gauge Widget](/files/eocaX1EidhGF9LbCT0H5)

**Using Action**

Here, to update the Linear Gauge widget, output of the action should contain JSON object as given in above example. User can also update the widget either onLoad or periodically by providing refresh interval.

![Configure Linear Gauge Widget](/files/2p8GE9hpImVGMbwEgZpk)

#### Event Handling

Linear Gauge widget does not support any event.

#### Example

Here, data in below format published on configured topic, will appear as shown in image.

```
// Example

{
    "LGKey":100
}

Here, "LGKey" is set as key in widget configuration.
```

![MQTT Data for Linear Gauge](/files/TlP6noBMYFB71ywKMRns)

![Linear Gauge Example](/files/g9yMr57X5LPr9oIDKk4J)


