TH | EN

Service Usage Calculation

Calculating usage volume of various services on the NEXIIOT Platform. You can view usage volume in each billing cycle from the Web Portal by clicking on your username in the upper right corner and selecting the "Billing" menu. For more details, please visit billing-page. The calculations are divided into the following main categories:

API Call

The total REST API usage volume on the NEXIIOT Platform is measured in Operations. The actions that will be counted as this type of usage are:

API Request

: Number of requests via REST APT based on the size of the Payload sent. Each Block is no larger than 4 kilobytes.

API Response

: Number of Responses via REST APT based on the size of the Payload that is responded to. Each Block is no larger than 4 kilobytes.

example

Reading data from Time Series Database via REST API 1 time, the data sent in the Request is 71 bytes and the Response data is 10 kilobytes, so the count this time is as follows:

Request sends Payload of size 71 bytes = 71 / 1024*4 = 1 Operation(Request) The remainder that does not divide 4KB exactly must be rounded up to another 1 Block.

Response Payload size 10KB = 10 / 4 = 3 Operations(Response) The remainder that does not divide 4KB must be rounded up to another 1 Block.

Total API Call Quota used = 1 + 3 = 4 Operations


Device Online

The total time that the device is connected to the NEXIIOT Platform is measured in seconds.

example

มี Device ที่ลงทะเบียนใช้งาน NEXIIOT Platform อยู่ 2 Devices Device เพื่อส่งข้อมูลสถานะการทำงานต่างๆ ของเครื่องจักรไปเก็บที่ Platform โดย Device1 เชื่อมต่อ Platform เวลา 08:00:03 ส่งข้อมูลเสร็จและตัดการเชื่อมต่อ Platform ที่เวลา 08:00:15 ส่วน Device2 เชื่อมต่อ Platform เวลา 08:00:05 ส่งข้อมูลเสร็จและตัดการเชื่อมต่อ Platform ที่เวลา 08:00:20 ดังนั้น เวลารวมในกรณีนี้จะเป็น

There are 2 devices registered to use the NEXIIOT Platform. Devices are used to send data on the operating status of the machines to be stored on the Platform. Device1 connects to the Platform at 08:00:03, completes sending data, and disconnects from the Platform at 08:00:15. Device2 connects to the Platform at 08:00:05, completes sending data, and disconnects from the Platform at 08:00:20. Therefore, the total time in this case will be

Device1 Online (08:00:03 - 08:00:15) = 12 seconds

Device2 Online (08:00:05 - 08:00:20) = 15 seconds

Total Connection Quota used = 12 + 15 = 27 seconds = 12 + 15 = 27 วินาที


Real Time Message

MQTT-related service usage is measured in messages, and the actions that are counted as this type of usage are:

MQTT Publish

: Number of Messages published based on the size of each Message Block, no larger than 4 kilobytes.

MQTT Subscribe

: Each subscription request counts as 1 message.

MQTT Deliver

: Number of messages sent to the devices that requested the subscription, based on the size of the message. Each block is no larger than 4 kilobytes.

MQTT Connect

: The number of times each connection request to the NEXIIOT Platform is counted as 1 message.

example

There are 5 Devices connected to the NEXIIOT Platform, with Device1 publishing a 6 kilobyte message to myDevice Topic, where Device2, Device3, Device4, and Device5 are subscribed to myDevice Topic, so the count this time is as follows:

5 Devices connected to NEXIIOT Platform = 5 x 1 = 5 Messages(MQTT Connect)

Device1 Publish Message size 6 KB = 6 / 4 = 2 Messages(MQTT Publish) The remainder that is not divisible by 4 must be rounded up to another 1 Block.

Device2-5 (4 Devices) Request Subscribe Topic = 4 x 1 = 4 Messages(MQTT Subscribe)

Device2-5 (4 Devices) received Message = 4 x 2 = 8 Messages(MQTT Deliver) from Subscription received Message that Device1 Publish size 6 KB.

Total Message Quota used = 5 + 2 + 4 + 8 = 19 Messages


Shadow Read/Write

Shadow service usage is measured in operations, and actions that are counted as this type of usage are:

Shadow Read

: Number of Shadow reads based on the size of the Shadow read. Each block is no larger than 1 kilobyte.

Shadow Write

: The number of Shadow writes is determined by the size of the Shadow sent to be written. Each Block is no larger than 1 kilobyte.

Shadow Expression

: The number of times Shadow runs an Expression is in the Data Transformation section.

example

When a device comes online, it will read all of its shadows (Shadow size 2 kilobytes) as the default for its working settings. After that, the device will send its current temperature value to update the shadow (data size sent 20 bytes). The value sent is in Fahrenheit, with an Expression defined to convert the units to Celsius. The Shadow Operation Quota used is calculated as follows:

2 Operations(Shadow Read) + 1 Operation(Shadow Write) + 1 Operation(Shadow Expression) = 4 Operations


Time Series Data Store

The amount of data (Time Series Data) and the period of time required to store the data are measured in Point-Day, meaning that the data sent stores 1 data point (data size not exceeding 1 kilobyte). The storage period (TTL) of 30 days is counted as 1 Point-Month or 30 Point-Day.

example

Device for measuring humidity and temperature (2 data points), measuring values and sending data to store every 1 hour (24 times/day), storing values for the past 30 days (TTL), service period of 31 days, calculating the amount of Quota used as follows:

2(data point) x 30(TTL) X 24(time/day) x 31(day) = 44,640 Point-Day or equal to

44,640 Point-Day / 30 = 1,488 Point-Month


Trigger & Action

The volume of service usage related to Trigger is counted as Operation. The actions that will be counted as this type of usage are:

Device Trigger

:Trigger caused by the Device changing the Platform connection status from Connected (Online) to Disconnected (Offline) or from Disconnected (Offline) to Connected (Online). Set the Trigger Event to DEVICE.STATUSCHANGED See more details Device Trigger and Event Hook. If this Trigger is set, every time the status changes will be counted as 1 Operation / 1 Trigger Event.

Shadow Trigger

: Triggers that are triggered by a Shadow have changed and have a condition set to detect the change. Set the Trigger Event to See Device Trigger and Event Hook SHADOW.UPDATED for more details Device Trigger and Event Hook. If this Trigger is set, every time the Shadow changes and the condition is true (Trigger Condition is True), it will be counted as 1 Operation / 1 Trigger Condition.

example

From the Trigger setting example below, there are 3 Triggers in total (Device Trigger 2 and Shadow Trigger 1). If there is 1 Device connected to the Platform and sends temperature (temp) values ​​3 times, each time about 1 minute apart, the values ​​sent are 1, 0, -1 respectively. The initial temperature in Shadow is 0. When all 3 times are sent, the Device will disconnect from the Platform. The amount of Triggers & Actions used can be calculated as follows:

Device Online performs action LINENOTIFY and myApp = 2 Operations

Send temperature (temp) 1st time, value is 1, perform action, checkTemp check condition and value is True = 1 Operations

Send temperature (temp) 2st time, value is 0, perform action, checkTemp check condition and value is False = 0 Operations

Send temperature (temp) 3st time, value is -1, perform action, checkTemp check condition and value is False = 0 Operations

Device Offline (DEVICE.STATECHANGED) does action LINENOTIFY and myApp = 2 Operations

Total Trigger & Action Quota used = 2 + 1 + 0 + 0 + 2 = 5 Operations

{
        "enabled": true,
        "trigger": [{
                "action": "LINENOTIFY",
                "event": "DEVICE.STATECHANGED",
                "msg": "My Device {{$NEW.statustext}}, statuscode: {{$NEW.status}}",
                "option": {
                        "url": "https://notify-api.line.me/api/notify",
                        "linetoken": "HBfiJA309FWFouCPzK5WhGUvJT1RvN3xb6hGxnIqAAA"
                }
        },
        {
                "action": "myApp",
                "event": "DEVICE.STATECHANGED",
                "msg": "{{$NEW.statustext}}",
                "option": {
                        "deviceid": "155941ce-1f4a-4e57-1864-1759af4f872c"
                }
        },
        {
                "action": "checkTemp",
                "event": "SHADOW.UPDATED",
                "condition": "$NEW.bedroom.temp > 0",
                "msg": "My temperature was change from {{$PREV.bedroom.temp}} to {{$NEW.bedroom.temp}}",
                "option": {
                        "url": "https://mywebhook/devicetemp"
                }
        }]
}

Datasource

The cumulative amount of data (in Bytes) resulting from data download from Time-series data storage, or Data Transfer. Data retrieval from external systems or internal dashboards will be subject to this quota.

example

Temperature and humidity data are stored in Time-series data storage. A Web Application has been developed to retrieve data from Time-series data storage to display in graphs. The frequency of retrieving data to update the graph is every 5 minutes (Auto Refresh). The size of the data retrieved to display each time is 2.5 KB. Therefore, if the Web Application is opened to display the graph for 1 hour, the amount of Datasource used can be calculated as follows:

Datasource = 60(minutes) / 5(minutes) x 2.5(KB) = 30 KB

Transfer units to Byte = 30 * 1024 = 30,720 B