python – Bar disappearing when value gets below 1 in node-red
On node red I have a bars chart representing values of my pressure sensors which are managed by a Raspberry Pi. On the terminal, everything is fine when pressure goes under 1 bar, but on node red, if sensor 1 goes under 1, its bar disappear.
I think it might be because of the code I use to adapt the values to put them in the chart :
const Press = msg.payload.trim().slice(1,-1).split(" ");
i=0;
y=1;
for (const element of Press) {
msg.topic = "P"+y;
msg.payload=Press[i]/1e5;
node.send(msg);
i++;
y++;
}
return;
I don’t really know as I’m not an expert on node
Read more here: Source link
