if (msg.topic === "tempf") { context.set('tempf',msg.payload); } else if (msg.topic === "humidity") { context.set('humidity',msg.payload); } var tempf = context.get('tempf'); var humidity = context.get('humidity'); // Quelle: https://www.chemie-schule.de/KnowHow/Taupunkt // Gültigkeitsbereich Taupunkt: -30°C <= tmp <= 70°C var tp = ((241.2 * Math.log(humidity/100)) + ((4222.03716 * tempf) / (241.2 + tempf))) / (17.5043 - Math.log(humidity/100) - ((17.5043*tempf)/(241.2+tempf))); tp = Math.round( tp * 100 ) / 100; flow.set("flowtp",tp); msg.payload = tp; msg.topic = "Taupunkt"; return msg;