Changes for page ThingsBoard
Last modified by Dilisi S on 2025/04/02 02:09
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -209,26 +209,9 @@ 209 209 210 210 Click on the **TBEL** button if it has not been selected by default. 211 211 212 - Modify the default TBEL functionto match with your device asdescribedbelow:212 +The default TBEL function is shown below. 213 213 214 214 215 -~1. Uncomment line 11: 216 - 217 -var data = decodeToJson(payload) 218 - 219 -[[image:Screenshot 2025-03-26 at 18.15.08.png||height="219" width="500"]] 220 - 221 - 222 -3. Modify the telemetry section to allow parsed data to be assigned to the fields. 223 - 224 -telemetry: { 225 - temperature: data.temperature, 226 - humidity: data.humidity, 227 - rawData: payloadStr 228 - } 229 - 230 - 231 - 232 232 {{code language="JavaScript"}} 233 233 // Decode an uplink message from a buffer 234 234 // payload - array of bytes ... ... @@ -240,9 +240,9 @@ 240 240 var payloadStr = decodeToString(payload); 241 241 242 242 // decode payload to JSON 243 -var data = decodeToJson(payload); 226 +// var data = decodeToJson(payload); 244 244 245 -var deviceName = 'Device B';228 +var deviceName = 'Device A'; 246 246 var deviceType = 'thermostat'; 247 247 var customerName = 'Customer C'; 248 248 var groupName = 'thermostat devices'; ... ... @@ -268,8 +268,8 @@ 268 268 manufacturer: manufacturer 269 269 }, 270 270 telemetry: { 271 - temperature: data.temperature,272 - humidity: data.humidity,254 + temperature: 42, 255 + humidity: 80, 273 273 rawData: payloadStr 274 274 } 275 275 };