Hi, i´m using the following function to send some values to my influxdb:
function sendIt(topic, address, roundTo) {
let m = {
topic: topic,
payload: parseFloat(msg.payload[address].toFixed(roundTo))
}
node.send(m);
}
sendIt("VLT", 40008, 1);
sendIt("RLT", 40012, 1);
sendIt("WWo", 40013, 1);
sendIt("WW", 40014, 1);
sendIt("KTe", 40015, 1);
sendIt("KTa", 40016, 1);
sendIt("Hz", 43136, 0);
sendIt("GM", 43005, 0);
sendIt("WT%", 43437, 0);
sendIt("KT%", 43439, 0);
sendIt("HG", 40018, 1);
sendIt("Vol", 40072, 1);
sendIt("Pth", 'Pth', 0);
sometimes I get incorrect values from: VLT, RLT, WWo.
for example: -78°C
I want to prevent that these speaks get into my database.
Is there a way to integrate this into the function?
if "WWo" is < 0°C => "WWo" = 0°C
greetings