# Predefined Message Types

List of the predefined Message Types is presented in the following table:

{% hint style="success" %}
Message Types are used to link rule chains together and to categorize the type of message that is processed in the rule node. (e.g. whether the message is measurement data or attributes or alarm information. )
{% endhint %}

| **Message Type**                    | **Display Name**                    | **Description**                                                                          | **Message metadata**                                                                                                                                                                                                                                                                             | **Message payload**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ----------------------------------- | ----------------------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| POST\_ATTRIBUTES\_REQUEST           | **Post attributes**                 | Request from device to publish client side attributes (see attributes api for reference) | <p><strong>deviceName</strong> - originator device name,<br><strong>deviceType</strong> - originator device type</p>                                                                                                                                                                             | <p>key/value json:<br><code>{</code><br>  <code>"currentState": "IDLE"</code><br><code>}</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| POST\_TELEMETRY\_REQUEST            | **Post telemetry**                  | Request from device to publish telemetry (see telemetry upload api for reference)        | <p><strong>deviceName</strong> - originator device name,<br><strong>deviceType</strong> - originator device type,<br><strong>ts</strong> - timestamp (milliseconds)</p>                                                                                                                          | <p>key/value json:<br><code>{</code><br>  <code>"temperature": 22.7</code><br><code>}</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| TO\_SERVER\_RPC\_REQUEST            | **RPC Request from Device**         | RPC request from device (see client side rpc for reference)                              | <p><strong>deviceName</strong> - originator device name,<br><strong>deviceType</strong> - originator device type,<br><strong>requestId</strong> - RPC request Id provided by client</p>                                                                                                          | <p>json containing <strong>method</strong> and <strong>params</strong>:<br><code>{</code><br>  <code>"method": "getTime",</code><br>  <code>"params": { "param1": "val1" }</code><br><code>}</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| RPC\_CALL\_FROM\_SERVER\_TO\_DEVICE | **RPC Request to Device**           | RPC request from server to device (see server side rpc api for reference)                | <p><strong>requestUUID</strong> - internal request id used by sustem to identify reply target,<br><strong>expirationTime</strong> - time when request will be expired,<br><strong>oneway</strong> - specifies request type: <em>true</em> - without response, <em>false</em> - with response</p> | <p>json containing <strong>method</strong> and <strong>params</strong>:<br><code>{</code><br>  <code>"method": "getGpioStatus",</code><br>  <code>"params": { "param1": "val1" }</code><br><code>}</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ACTIVITY\_EVENT                     | **Activity Event**                  | Event indicating that device becomes active                                              | <p><strong>deviceName</strong> - originator device name,<br><strong>deviceType</strong> - originator device type</p>                                                                                                                                                                             | <p>json containing device activity information:<br><code>{</code><br>  <code>"active": true,</code><br>  <code>"lastConnectTime": 1526979083267,</code><br>  <code>"lastActivityTime": 1526979083270,</code><br>  <code>"lastDisconnectTime": 1526978493963,</code><br>  <code>"lastInactivityAlarmTime": 1526978512339,</code><br>  <code>"inactivityTimeout": 10000</code><br><code>}</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| INACTIVITY\_EVENT                   | **Inactivity Event**                | Event indicating that device becomes inactive                                            | <p><strong>deviceName</strong> - originator device name,<br><strong>deviceType</strong> - originator device type</p>                                                                                                                                                                             | json containing device activity information, see **Activity Event** payload                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| CONNECT\_EVENT                      | **Connect Event**                   | Event produced when device is connected                                                  | <p><strong>deviceName</strong> - originator device name,<br><strong>deviceType</strong> - originator device type</p>                                                                                                                                                                             | json containing device activity information, see **Activity Event** payload                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| DISCONNECT\_EVENT                   | **Disconnect Event**                | Event produced when device is disconnected                                               | <p><strong>deviceName</strong> - originator device name,<br><strong>deviceType</strong> - originator device type</p>                                                                                                                                                                             | json containing device activity information, see **Activity Event** payload                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ENTITY\_CREATED                     | **Entity Created**                  | Event produced when new entity was created in system                                     | <p><strong>userName</strong> - name of the user who created the entity,<br><strong>userId</strong> - the user Id</p>                                                                                                                                                                             | <p>json containing created entity details:<br><code>{</code><br>  <code>"id": {</code><br>    <code>"entityType": "DEVICE",</code><br>    <code>"id": "efc4b9e0-5d0f-11e8-8559-37a7f8cdca74"</code><br>  <code>},</code><br>  <code>"createdTime": 1526918366334,</code><br>  <code>...</code><br>  <code>"name": "my-device",</code><br>  <code>"type": "temp-sensor"</code><br><code>}</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ENTITY\_UPDATED                     | **Entity Updated**                  | Event produced when existing entity was updated                                          | <p><strong>userName</strong> - name of the user who updated the entity,<br><strong>userId</strong> - the user Id</p>                                                                                                                                                                             | json containing updated entity details, see **Entity Created** payload                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ENTITY\_DELETED                     | **Entity Deleted**                  | Event produced when existing entity was deleted                                          | <p><strong>userName</strong> - name of the user who deleted the entity,<br><strong>userId</strong> - the user Id</p>                                                                                                                                                                             | json containing deleted entity details, see **Entity Created** payload                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ENTITY\_ASSIGNED                    | **Entity Assigned**                 | Event produced when existing entity was assigned to customer                             | <p><strong>userName</strong> - name of the user who performed assignment operation,<br><strong>userId</strong> - the user Id,<br><strong>assignedCustomerName</strong> - assigned customer name,<br><strong>assignedCustomerId</strong> - Id of assigned customer</p>                            | json containing assigned entity details, see **Entity Created** payload                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ENTITY\_UNASSIGNED                  | **Entity Unassigned**               | Event produced when existing entity was unassigned from customer                         | <p><strong>userName</strong> - name of the user who performed unassignment operation,<br><strong>userId</strong> - the user Id,<br><strong>unassignedCustomerName</strong> - unassigned customer name,<br><strong>unassignedCustomerId</strong> - Id of unassigned customer</p>                  | json containing unassigned entity details, see **Entity Created** payload                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ADDED\_TO\_ENTITY\_GROUP            | **Added to Group**                  | Event produced when entity was added to Entity Group.                                    | <p><strong>userName</strong> - name of the user who performed assignment operation,<br><strong>userId</strong> - the user Id,<br><strong>addedToEntityGroupName</strong> - entity group name,<br><strong>addedToEntityGroupId</strong> - Id of entity group</p>                                  | empty json payload                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| REMOVED\_FROM\_ENTITY\_GROUP        | **Removed from Group**              | Event produced when entity was removed from Entity Group.                                | <p><strong>userName</strong> - name of the user who performed unassignment operation,<br><strong>userId</strong> - the user Id,<br><strong>removedFromEntityGroupName</strong> - entity group name,<br><strong>removedFromEntityGroupId</strong> - Id of entity group</p>                        | empty json payload                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ATTRIBUTES\_UPDATED                 | **Attributes Updated**              | Event produced when entity attributes update was performed                               | <p><strong>userName</strong> - name of the user who performed attributes update,<br><strong>userId</strong> - the user Id,<br><strong>scope</strong> - updated attributes scope (can be either <strong>SERVER\_SCOPE</strong> or <strong>SHARED\_SCOPE</strong>)</p>                             | <p>key/value json with updated attributes:<br><code>{</code><br>  <code>"softwareVersion": "1.2.3"</code><br><code>}</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ATTRIBUTES\_DELETED                 | **Attributes Deleted**              | Event produced when some of entity attributes were deleted                               | <p><strong>userName</strong> - name of the user who deleted attributes,<br><strong>userId</strong> - the user Id,<br><strong>scope</strong> - deleted attributes scope (can be either <strong>SERVER\_SCOPE</strong> or <strong>SHARED\_SCOPE</strong>)</p>                                      | <p>json with <strong>attributes</strong> field containing list of deleted attributes keys:<br><code>{</code><br>  <code>"attributes": \["modelNumber", "serial"]</code><br><code>}</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ALARM                               | **Alarm event**                     | Event produced when an alarm was created, updated or deleted                             | <p>All fields from original Message Metadata<br><strong>isNewAlarm</strong> - true if a new alram was just created<br><strong>isExistingAlarm</strong> - true if an alarm is existing already<br><strong>isClearedAlarm</strong> - true if an alarm was cleared</p>                              | <p>json containing created alarm details:<br><code>{</code><br>  <code>"tenantId": {</code><br>     <code>...</code><br>  <code>},</code><br>  <code>"type": "High Temperature Alarm",</code><br>  <code>"originator": {</code><br>     <code>...</code><br>  <code>},</code><br>  <code>"severity": "CRITICAL",</code><br>  <code>"status": "CLEARED\_UNACK",</code><br>  <code>"startTs": 1526985698000,</code><br>  <code>"endTs": 1526985698000,</code><br>  <code>"ackTs": 0,</code><br>  <code>"clearTs": 1526985712000,</code><br>  <code>"details": {</code><br>    <code>"temperature": 70,</code><br>    <code>"ts": 1526985696000</code><br>  <code>},</code><br>  <code>"propagate": true,</code><br>  <code>"id": "33cd8999-5dac-11e8-bbab-ad47060c9431",</code><br>  <code>"createdTime": 1526985698000,</code><br>  <code>"name": "High Temperature Alarm"</code><br><code>}</code></p> |
| REST\_API\_REQUEST                  | **REST API Request to Rule Engine** | Event produced when user executes REST API call                                          | <p><strong>requestUUID</strong> - the unique request id,<br><strong>expirationTime</strong> - the expiration time of the request</p>                                                                                                                                                             | json with request payload                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
