OpenMarine

Full Version: Changing unit and rounding of e.g. temperature notifications
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi!

In notifications it would be great, if units could be changed (e.g. celsius) and rounded.

It looks strange in freeboard.
(2017-09-06, 08:21 AM)Alpenskipper Wrote: [ -> ]Hi!

In notifications it would be great, if units could be changed (e.g. celsius) and rounded.

It looks strange in freeboard.

You can add a function node to do that, I don't use freeboard so you'll probably need to change msg.topic to something else.  

var numInput = Number(msg.payload);
msg.topic = "Eng";
var T =  numInput-273.15;
msg.payload = T.toFixed(1);
return msg;
(2017-09-06, 08:21 AM)Alpenskipper Wrote: [ -> ]Hi!

In notifications it would be great, if units could be changed (e.g. celsius) and rounded.

It looks strange in freeboard.

Hello, I changed the units in freeborad in "value" or JS editor with this is comand:

datasources["node-red"][environment.inside.heating.temperature"].toFixed()-273

Saludos
Thanks for the hints. But, for I am a Linux/ JS noob, I have no idea, where to edit...
Could you explain it for dummies, please?

Martin
(2017-09-06, 10:04 PM)Alpenskipper Wrote: [ -> ]Thanks for the hints. But, for I am a Linux/ JS noob, I have no idea, where to edit...
Could you explain it for dummies, please?

Martin
if I remember correctly, it is modified where you have added the temperature, pressure, ... in freeboard.

you have to add the last part. 

.toFixed()-273
If you do not find it, tomorrow I'll send you a screenshot

Saludos
Great!
.toFixed(n)
worked perfect.

[Image: 77e90c5b2224c30356beed44da2ca354.png]