This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I get signalk data into node red
#11
(2016-12-17, 04:17 PM)Tocher Wrote: Can anyone help me with the correct function to change this value to celcius (sustract 273.15). Is this done in Node-RED or earlier in openplotter/signalK

Import this function "Convert" for: m/s to kn, rad to deg, K to C

Code:
[{"id":"6798b965.b393e8","type":"function","z":"ad773e6c.c040d","name":"convert","func":"var numInput = Number(msg.payload);\n//convert m/s to kn\n//msg.payload = Math.round(numInput*19.43844492)/10;\n//convert rad to deg\n//msg.payload = Math.round(numInput*572.95779513)/10;\n//convert K to C\nmsg.payload = numInput-273.15;\nreturn msg;","outputs":1,"noerr":0,"x":192.49998474121094,"y":651.3999938964844,"wires":[[]]}]
Reply
#12
(2016-12-17, 05:24 PM)e-sailing Wrote: Thanks a lot! Works like a charm

Import this function "Convert" for: m/s to kn, rad to deg, K to C

Code:
[{"id":"6798b965.b393e8","type":"function","z":"ad773e6c.c040d","name":"convert","func":"var numInput = Number(msg.payload);\n//convert m/s to kn\n//msg.payload = Math.round(numInput*19.43844492)/10;\n//convert rad to deg\n//msg.payload = Math.round(numInput*572.95779513)/10;\n//convert K to C\nmsg.payload = numInput-273.15;\nreturn msg;","outputs":1,"noerr":0,"x":192.49998474121094,"y":651.3999938964844,"wires":[[]]}]
Reply
#13
(2016-12-18, 02:11 AM)Tocher Wrote:
(2016-12-17, 05:24 PM)e-sailing Wrote: Thanks a lot! Works like a charm

Import this function "Convert" for: m/s to kn, rad to deg, K to C

Code:
[{"id":"6798b965.b393e8","type":"function","z":"ad773e6c.c040d","name":"convert","func":"var numInput = Number(msg.payload);\n//convert m/s to kn\n//msg.payload = Math.round(numInput*19.43844492)/10;\n//convert rad to deg\n//msg.payload = Math.round(numInput*572.95779513)/10;\n//convert K to C\nmsg.payload = numInput-273.15;\nreturn msg;","outputs":1,"noerr":0,"x":192.49998474121094,"y":651.3999938964844,"wires":[[]]}]

I already got it !!!
I can see the data of my DB sensors in the graphs.
I want to switch from Kelvin to Celsius, but I do not know where to write the code.
Where do I write the code?

Saludos,
Reply
#14
On node-red webside
right corner three stripes (menu)
import -> clipboard
A window "Import nodes" will open
paste the code

You will get a function block "convert"
Reply
#15
(2016-12-20, 06:29 PM)¿e-sailing Wrote: On node-red webside
right corner three stripes (menu)
import -> clipboard
A window "Import nodes" will open
paste the code

You will get a function block "convert"

Thanks a lot. 
It is running in Celsius.

Saludos,
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)