2018-06-09, 06:53 PM
(2018-06-09, 04:59 PM)wkmhv Wrote: Hi jim321,
I know Your "It works" sample really works fine.
I have done it already with an action send mail. It works without any settings in op's MQTT tab.
But i like to send this message to node red, which unfortunatelly still not work.
This should put all signalk messages into node red global variables, then use an inject node to use them.
Code:
[{"id":"a89980ea.5e66c","type":"function","z":"749e8283.293f4c","name":"Create global variable","func":"// \n\n if (typeof msg.payload.updates !== 'undefined') {\n \n obj=msg.payload.updates[0].values[0].path;\n value=msg.payload.updates[0].values[0].value;\n global.set(obj, value);\n msg.payload = value;\n msg.topic = obj;\n \n \n \n return [ null, msg ];\n } \n","outputs":"2","noerr":0,"x":420,"y":80,"wires":[[],["fe0ec8cb.b88868"]]},{"id":"20af45d9.7fe30a","type":"json","z":"749e8283.293f4c","name":"","pretty":false,"x":230,"y":80,"wires":[["8b385a5c.b0c248","a89980ea.5e66c"]]},{"id":"fe0ec8cb.b88868","type":"debug","z":"749e8283.293f4c","name":"","active":false,"console":"false","complete":"true","x":530,"y":180,"wires":[]},{"id":"67b79641.1fad68","type":"websocket in","z":"749e8283.293f4c","name":"SignalK input","server":"fc1b2b62.0b63a8","client":"","x":90,"y":80,"wires":[["20af45d9.7fe30a","5235ae78.9cab4"]]},{"id":"8b385a5c.b0c248","type":"link out","z":"749e8283.293f4c","name":"To database","links":["1297a3e2.92bf2c","3e1e107d.03f6f"],"x":355,"y":120,"wires":[]},{"id":"5235ae78.9cab4","type":"debug","z":"749e8283.293f4c","name":"","active":false,"console":false,"complete":"true","x":130,"y":160,"wires":[]},{"id":"fc1b2b62.0b63a8","type":"websocket-listener","z":"","path":"ws://localhost:3000/signalk/v1/stream","wholemsg":"false"}]