Pth (calculated):
{"topic":"Pth","payload":1707,"raw":{"register":"40072","factor":10,"size":"s16","mode":"R","titel":"BF1 EP14 Flow","info":"Current flow EP14|Current flow EP15","unit":"l/m","min":"0","max":"0","logset":true,"data":9.1,"raw_data":9.1,"timestamp":1622038201687},"_msgid":"f3a5f191.83dfc"}
operating mode (NibePi Input):
{"topic":"43086","payload":30,"raw":{"register":"43086","factor":1,"size":"u8","mode":"R","titel":"Prio","info":"Indicates what heating action (HW/heat/pool) currently prioritised 10=Off 20=Hot Water 30=Heat 40=Pool 41=Pool 2 50=Transfer 60=Cooling","unit":"","min":"0","max":"0","logset":false,"data":30,"raw_data":30,"timestamp":1622038236527},"_msgid":"ca52d597.17fda8"}

with else:
var Pth = msg.payload["Pth"];
var M = msg.payload[43086];
var Pth1;
var Pth2;
var Pth3;
var msg1 = {};
var msg2 = {};
var msg3 = {};
var msg4 = {};
if(M == 10) {
Pth1 = 0;
Pth2 = 0;
Pth3 = 0;
}
else if(M == 20) {
Pth1 = Pth;
Pth2 = 0;
Pth3 = 0;
}
else if(M == 30) {
Pth1 = 0;
Pth2 = Pth;
Pth3 = 0;
}
else if(M == 60) {
Pth1 = 0;
Pth2 = 0;
Pth3 = Pth * (-1);
}
msg1.payload = Pth1;
msg1.topic = "Pth_WW";
msg2.payload = Pth2;
msg2.topic = "Pth_H"
msg3.payload = Pth3;
msg3.topic = "Pth_PC";
msg4.payload = msg.payload["Pel"];
msg4.topic = "Pel";
return [msg1,msg2,msg3,msg4];