Data Types in MQTT Topic Configuration
- Last UpdatedJun 25, 2024
- 3 minute read
The available data types you can configure in MQTT topic are:
-
String
If the string value is assigned to the TextBox control, then the value is converted to string.
If there is any mismatch of format, the error is logged in Browser Console as:
Error occurred during String type conversion for the topic '<@topicname@>'.
-
Boolean
If the true value is assigned to the Boolean control, True is enabled.
If the false value is assigned to the Boolean control, False is enabled.
The supported Boolean values are:
-
True values:
- true (is not case sensitive and is a Boolean flag)
- 1 (can be numeric or in string format)
- yes (is not case sensitive and should be passed only in string format)
- y (is not case sensitive)
-
False values:
- false (is not case sensitive and is a Boolean flag)
- 0 (can be numeric or in string format)
- no (is not case sensitive and should be passed only in string format)
- n (is not case sensitive)
If the Boolean values are assigned to the TextBox control, the value is converted to string.
If the Boolean values are assigned to the Number control other than 1 and 0; and if there is any mismatch of format, the error is logged in the Browser Console as:
Error occurred during Boolean type conversion for the topic '<@topicname@>'.
-
-
Integer
If the integer value is assigned to the Number control, the value takes 15 digits as specified by the property's boundary limit.
It is recommended to have the precision set to the Number control as per the source.
If the integer value is assigned to the TextBox control, the value is converted to strings.
If there is any mismatch of format, the error is logged in Browser Console as:
Error occured during Number type conversion for the topic '<@topicname@>'.
-
Float
If the float value is assigned to the Number control, the value displayed is as specified by the property's boundary limit.
It is recommended to have the precision set to the Number control as per the source.
If the float value is assigned to the TextBox control, the value is converted to strings.
Only decimal separator is allowed to represent the decimal number.
If there is any mismatch of format, the error is logged in Browser Console as:
Error occurred during Number type conversion for the topic '<@topicname@>'.
-
Double
If the Double value is assigned to the Number control, the value displayed is as specified by the property's boundary limit.
It is recommended to have the precision set to the Number control as per the source.
If the Double value is assigned to the TextBox control, the value is converted to strings.
Only decimal separator is allowed to represent the decimal number.
If there is any mismatch of format, the error is logged in Browser Console as:
Error occurred during Number type conversion for the topic '<@topicname@>'.
Note: When the selected data type is Float/Double and the Linked control is a number (without decimal), then the extracted value is displayed with precision.
-
DateTime
If the DateTime value is assigned to the ‘DateTime’ control, the value displayed is as specified by the property's boundary limit and local browser specific culture.
If the DateTime value is assigned to the 'TextBox' control, the value displayed is string values. For example, Mon Mar 11 2019 19:23:35 GMT+0530 (India Standard Time).
The supported DateTime value is only in string format and should be in en-US format.
The supported DateTime formats are:
“MM/dd/yyyy hh:mm:ss.fff tt",
"MM/dd/yyyy hh:mm:ss tt”
If there is any mismatch of format, the error is logged in Browser Console as:
Error occurred during DateTime format conversion for the topic '<@topicname@>'.
-
ElapsedTime
If the ElapsedTime value is assigned to the TextBox control, the time is displayed as HH:mm:ss.fff (where HH represents 24 hour format, mm represents minutes, ss represents seconds, and fff represents milliseconds).
The ElapsedTime datatype should be the decimal number. For example, the decimal part is milli seconds(.fff) and the integer part is converted to HH:mm:ss.
If there is any mismatch of format, the error is logged in Browser Console as:
Error occurred during ElapsedTime format conversion for the topic '<@topicname@>'.