unmarshalHomie(value, datatype) {
        if (value === null || value === undefined) {
            return null;
        }

        switch (datatype) {
            case DataType.ENUM:
                if (datatype !== this.dataType) {
                    return value;
                }

                if (this.format.split(",").indexOf(value) < 0) {
                    throw new Error("Value '" + value + "' is invalid for enum with format [" + this.format + "]!");
                }

                return value;
            case DataType.INTEGER:
                return parseInt(value, 10);
            case DataType.FLOAT:
                return parseFloat(value);
            case DataType.DATETIME:
                return new Date(value);
            case DataType.BOOLEAN:
                return value === "true";
            case DataType.DURATION:
                return iso8601.durationToNumber(value);
            default:
                return value;
        }
    }
Convert a Homie-compatible value to a JS value, based on the current data type

@protected
@param {string|null} value
@param {string} datatype
@return {*}