Function | Description |
productId() | Returns the ID of the product from which the message comes |
deviceName() | Returns the name of the device from which the message comes |
timestamp() | Returns the current Unix system timestamp in seconds |
topic() | Returns the original topic from which the message comes |
topic(n) | Returns the segment n separated by / in the original topic from which the message comes |
payloadLen() | Returns the length of the payload in bytes |
bin_to_dec() | Converts the binary data to a decimal integer |
to_hex () | Converts the entered original message to a hexadecimal string |
randint(min,max) | Returns a random integer between min and max |
upper(string) | Returns an uppercase string (the entered message should be in JSON format, and the function object is the corresponding key value. For example, if the entered message is "tencent":"iot", then upper(tencent)=IOT) |
lower(string) | Returns a lowercase string (the entered message should be in JSON format, and the function object is the corresponding key value) |
crypto(field,String) | Encrypts the value of field, where the second parameter String is an algorithm string. Valid values: MD5, SHA1, SHA256, SHA384, SHA512. (The entered message should be in JSON format, and the function object is the corresponding key value) |
concat(string1, string2) | Concatenates strings, such as concat(deviceid,'a') or concat(field1,field2) |
requestId() | Returns the ID of the message generated by IoT Hub |
newuuid() | Returns a random UUID string |
replace(source, substring, replacement) | Replaces substring in source with replacement |
substring(source, start, end) | Returns the string between start (inclusive) and end (not inclusive) |
dev00 sends the following messages to the cloud:{"room1":{"temperature":31,"humidity":"63%"},"room2":{"temperature":26,"humidity":"63%"}}
dev00, dev01, and dev02 under the temperature and humidity monitor product monitor the temperature and humidity in six rooms room1, room2, room3...room6 respectively, and only when the temperature in room room1 is above 30°C, the data needs to be transferred to the MySQL database for processing. In this example, the settings of the rule engine are as follows:


Feedback