pointbre / node-red-contrib-rflink

A Node-red node to encode/decode the messages from/to the RFLink gateway.
MIT License
2 stars 5 forks source link

_parseTemperature #7

Open timoline opened 4 years ago

timoline commented 4 years ago

Here the function I use for temp, wintmp and winchl

/**
 * Parse temperature
 *
 * @param timestamp : 
 */
function _parseTemperature(temp) {

    var result = parseInt(temp, 16);
        if(result >= 32768){
            result = 32768 - result;
        }

        var parsedTemperature = (result / 10.0).toString();

    return parsedTemperature;
}