{"displayName":"Example Definition","parser":"function parsePayload(payloadStr, payloadRaw) {\n    // when data is posted to Docksters a pre-parser determines the device\n    // name in order to match the posted data to a device definition\n    //\n    // the pre-parser also determines what payloadStr will be set to.\n    // typically this will either be some hex data as a string or\n    // a JSON object converted to a string but it depends on what type of\n    // device/gateway you are using\n    \n    // you can use payloadRaw if you prefer to work with the entire unparsed payload\n    // payloadRaw is a string\n    \n    // this parsePayload() function needs to interpret payloadStr to get the\n    // sensor data\n\n    // use this to store the sensor data\n    var sensorData = {};\n\n    // in this example payloadStr is a JSON object converted to a string\n    // lets turn it back into JSON\n    var decoded = JSON.parse(payloadStr);\n\n    // see if there is any humidity data\n    if (decoded.Humidity !== undefined)\n    {\n        // we have some, so set the sensor data using the sensor name (not the display name)\n        // in our example we would need a sensor called \"Humidity\" (case is important)\n\n        sensorData[\"Humidity\"] = parseInt(decoded.Humidity);\n    }\n\n    // see if there is any temperature data\n    if (decoded.Temperature !== undefined)\n    {\n        // we have some, so set the sensor data using the sensor name (not the display name)\n        // in our example we would need a sensor called \"Temperature\" (case is important)\n\n        sensorData[\"Temperature\"] = parseInt(decoded.Temperature);\n    }\n\n    // some notes:\n    // - you don't have to have data for every sensor\n    // - Docksters will try to convert sensor data to the data type the sensor is set to\n    // - payloadStr is guaranteed to be a string\n\n    return sensorData;\n}","version":"1.0","updatedUTC":"2021-11-24T12:18:35.489Z","manufacturer":"Docksters","sensors":[{"name":"Humidity","thresholds":[{"name":"Less","warning":"","information":"","type":"lessthan","error":"40","critical":"30"},{"name":"Greater","warning":"","information":"","type":"greaterthan","error":"60","critical":"70"}],"type":"relativeHumidity","displayName":"Humidity"},{"name":"Temperature","thresholds":[],"type":"tempC","displayName":"Temperature"}],"createdUTC":"2021-08-31T07:44:54.312Z","organizationId":"4f9a573b-6cc6-47eb-863c-e1a5142018bd","definitionName":"example_definition","supportsVirtualDevices":false,"deviceIcon":"fas fa-sensor-on","definitionIsPublic":false}