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
Signal K MQTT Node Red
#11
Code:
[{"id":"1c59823a.00a2ae","type":"debug","z":"134ba20d.9b210e","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":550,"y":220,"wires":[]},{"id":"844fc22d.71486","type":"websocket in","z":"134ba20d.9b210e","name":"","server":"f75668d3.33a0c8","client":"","x":220,"y":220,"wires":[["1c59823a.00a2ae"]]},{"id":"f75668d3.33a0c8","type":"websocket-listener","z":"","path":"ws://localhost:3000/signalk/v1/stream","wholemsg":"false"}]

finally with this simple flow I get all Signal K keys:

10/06/2018, 18:54:19node: 1c59823a.00a2ae
msg.payload : string[622]
"{"updates":[{"source":{"sentence":"GGA","talker":"GP","type":"NMEA0183","label":"OPkplex"},"timestamp":"2018-06-10T18:54:19.000Z","values":[{"path":"navigation.position","value":{"longitude":7.149719666666667,"latitude":51.37150533333333}},{"path":"navigation.gnss.methodQuality","value":"GNSS Fix"},{"path":"navigation.gnss.satellites","value":10},{"path":"navigation.gnss.antennaAltitude","value":105},{"path":"navigation.gnss.horizontalDilution","value":0},{"path":"navigation.gnss.differentialAge","value":0},{"path":"navigation.gnss.differentialReference","value":0}]}],"context":"vessels.urn:mrn:imo:mmsi:123456789"}"

The flow from jim231 shows nothing in debug.

Now need help to learn how to filter e.g. "navigation.gnss.sattellites" and show it e.g. in a gauge.
Thanks for Your help.
Reply
#12
(2018-06-10, 08:06 PM)wkmhv Wrote: Now need help to learn how to filter e.g. "navigation.gnss.sattellites" and show it e.g. in a gauge.
Thanks for Your help.

Try the code in post 9 - should put all signalk into global variables. but don't have more than 1 webserver node listening to signalk,  then to get at the data - 

Code:
[{"id":"5bc00bac.426b34","type":"debug","z":"3f30ea31.da3756","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":480,"y":1600,"wires":[]},{"id":"93fd866d.b853b8","type":"inject","z":"3f30ea31.da3756","name":"","topic":"","payload":"navigation.gnss.sattellites","payloadType":"global","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":310,"y":1600,"wires":[["5bc00bac.426b34"]]}]
Reply
#13
Thanks to all, works perfect. The flow from jim231 also works. Sorry do not know what I have made wrong. Maybe really two webserver.
Reply
#14
Have add a gauge to dashboard. It shows the number of satellites.
But it not be automatically updated.

Code:
[{"id":"97745b0c.a0fb78","type":"function","z":"134ba20d.9b210e","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":300,"wires":[[],["9d107bdf.8fa438"]]},{"id":"46d9e442.a985dc","type":"json","z":"134ba20d.9b210e","name":"","property":"payload","action":"","pretty":false,"x":230,"y":300,"wires":[["97745b0c.a0fb78","81aff82.2034b08"]]},{"id":"9d107bdf.8fa438","type":"debug","z":"134ba20d.9b210e","name":"","active":false,"console":"false","complete":"true","x":630,"y":280,"wires":[]},{"id":"68e6dde2.9e8074","type":"websocket in","z":"134ba20d.9b210e","name":"SignalK input","server":"ed5f58f5.7d8488","client":"","x":90,"y":300,"wires":[["46d9e442.a985dc"]]},{"id":"81aff82.2034b08","type":"link out","z":"134ba20d.9b210e","name":"To database","links":[],"x":355,"y":340,"wires":[]},{"id":"f87e4c6.823d4b","type":"debug","z":"134ba20d.9b210e","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":350,"y":440,"wires":[]},{"id":"e8dc1ab6.cc1b18","type":"inject","z":"134ba20d.9b210e","name":"","topic":"","payload":"navigation.gnss.satellites","payloadType":"global","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":440,"wires":[["f87e4c6.823d4b","9a578fbe.d9724"]]},{"id":"9a578fbe.d9724","type":"ui_gauge","z":"134ba20d.9b210e","name":"","group":"10dc1020.ca684","order":0,"width":0,"height":0,"gtype":"gage","title":"Satellites","label":"","format":"{{value}}","min":0,"max":"12","colors":["#b50031","#3ae600","#0c5528"],"seg1":"3","seg2":"9","x":350,"y":500,"wires":[]},{"id":"97b386ed.756ab8","type":"inject","z":"134ba20d.9b210e","name":"","topic":"","payload":"navigation.speedOverGround","payloadType":"global","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":560,"wires":[["1dc3efa2.d0f31","74d015dc.688c7c"]]},{"id":"1dc3efa2.d0f31","type":"ui_gauge","z":"134ba20d.9b210e","name":"","group":"10dc1020.ca684","order":0,"width":0,"height":0,"gtype":"gage","title":"SOG","label":"knots","format":"{{value | number:2}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":350,"y":560,"wires":[]},{"id":"74d015dc.688c7c","type":"debug","z":"134ba20d.9b210e","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":360,"y":620,"wires":[]},{"id":"ed5f58f5.7d8488","type":"websocket-listener","z":"","path":"ws://localhost:3000/signalk/v1/stream","wholemsg":"false"},{"id":"10dc1020.ca684","type":"ui_group","z":"","name":"GPS","tab":"9c0ac6d3.738ab8","disp":true,"width":"6","collapse":false},{"id":"9c0ac6d3.738ab8","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]
Reply
#15
Code:
[{"id":"16a7b7c1.80c478","type":"ui_gauge","z":"8bd58c9a.71407","name":"","group":"61c12cf6.6a9484","order":0,"width":0,"height":0,"gtype":"gage","title":"Satellites","label":"","format":"{{value}}","min":0,"max":"12","colors":["#b50031","#3ae600","#0c5528"],"seg1":"3","seg2":"9","x":660,"y":160,"wires":[]},{"id":"20f64da9.658b22","type":"function","z":"8bd58c9a.71407","name":"roll","func":"var signalk_key=\"navigation.gnss.satellites\";\n\nif(msg.payload.hasOwnProperty(signalk_key)){\n    msg.payload=msg.payload[signalk_key];\n    return msg;\n    \n\n}","outputs":"1","noerr":0,"x":530,"y":180,"wires":[["16a7b7c1.80c478","28459c2.c326c64"]]},{"id":"23fd1689.8fe8ba","type":"jsonpath","z":"8bd58c9a.71407","expression":"$.updates..values","split":false,"name":"Signal K delta values","x":220,"y":180,"wires":[["2bf82467.4f994c"]]},{"id":"2bf82467.4f994c","type":"function","z":"8bd58c9a.71407","name":"merge values","func":"var paths={};\nvar arrayLength = msg.payload.length;\nfor (var i = 0; i < arrayLength; i++) {\n    paths[msg.payload[i].path]=msg.payload[i].value;\n}\nmsg.payload = paths;\nreturn msg;","outputs":1,"noerr":0,"x":400,"y":180,"wires":[["20f64da9.658b22"]]},{"id":"28459c2.c326c64","type":"ui_text","z":"8bd58c9a.71407","group":"61c12cf6.6a9484","order":0,"width":0,"height":0,"name":"","label":"text","format":"{{msg.payload}}","layout":"row-spread","x":650,"y":200,"wires":[]},{"id":"f8c05660.efc838","type":"websocket in","z":"8bd58c9a.71407","name":"ws","server":"f3d9cf91.f4f67","client":"","x":70,"y":180,"wires":[["23fd1689.8fe8ba"]]},{"id":"61c12cf6.6a9484","type":"ui_group","z":"","name":"NAV 1","tab":"47ff93a8.26e4bc","order":1,"disp":false,"width":"4"},{"id":"f3d9cf91.f4f67","type":"websocket-listener","z":"","path":"ws://localhost:3000/signalk/v1/stream","wholemsg":"false"},{"id":"47ff93a8.26e4bc","type":"ui_tab","z":"","name":"Engine","icon":"dashboard","order":1}]

it wont update from a inject node it needs the data stream

here is my complete flow and dash you wont have all the nodes or the steel series gauges but you can get an idea how i do it
still a work in progress
   
   
   
   

Code:
[{"id":"6ff08a3d.cda624","type":"inject","z":"46d7f9c0.e081c8","name":"","topic":"","payload":"","payloadType":"date","repeat":"30","crontab":"","once":true,"onceDelay":"","x":117.99993133544922,"y":62,"wires":[["c5a70556.1205c8"]]},{"id":"c5a70556.1205c8","type":"exec","z":"46d7f9c0.e081c8","command":"vcgencmd","addpay":false,"append":"measure_temp","useSpawn":"","timer":"","oldrc":false,"name":"getCPUtemp","x":277.9999313354492,"y":62,"wires":[["9c5988c.1be7778"],[],[]]},{"id":"165d077c.c77189","type":"debug","z":"46d7f9c0.e081c8","name":"","active":false,"console":"false","complete":"payload","x":437.9999313354492,"y":182,"wires":[]},{"id":"9c5988c.1be7778","type":"function","z":"46d7f9c0.e081c8","name":"msg.payload","func":"cpu_temp = parseFloat(msg.payload.replace(\"temp=\",\"\").replace(\"'C\\n\",\"\"));\ncpu_temp = cpu_temp + 273.15\nmsg.payload = '{\\\"updates\\\": [{\\\"source\\\": {\\\"type\\\": \\\"ARMTEMP\\\",\\\"src\\\" : \\\"RPIMCU\\\"},\\\"values\\\":[{\\\"path\\\": \\\"environment.inside.heating.temperature\\\",\\\"value\\\":'+cpu_temp+'}]}]}\\n';\nreturn msg;","outputs":1,"noerr":0,"x":437.9999313354492,"y":62,"wires":[["970b9f3f.4a1b9"]]},{"id":"970b9f3f.4a1b9","type":"udp out","z":"46d7f9c0.e081c8","name":"sendSK","addr":"localhost","iface":"","port":"55559","ipv":"udp4","outport":"","base64":false,"multicast":"false","x":587.9999313354492,"y":62,"wires":[]},{"id":"f3e31b1d.3bdc28","type":"websocket in","z":"46d7f9c0.e081c8","name":"ws","server":"f3d9cf91.f4f67","client":"","x":77.99993133544922,"y":362,"wires":[["1278d7ad.437e18","8fb83f8d.ced28","3484d22.786472e","23d6c3a1.83b8dc","2f7240ee.ee0e4"]]},{"id":"1278d7ad.437e18","type":"jsonpath","z":"46d7f9c0.e081c8","expression":"$.updates..values[*]","split":false,"name":"Signal K delta values","x":250.99993133544922,"y":362.9999952316284,"wires":[["5bb08d81.fbd8c4"]]},{"id":"5bb08d81.fbd8c4","type":"function","z":"46d7f9c0.e081c8","name":"merge values","func":"var paths={};\nvar arrayLength = msg.payload.length;\nfor (var i = 0; i < arrayLength; i++) {\n    paths[msg.payload[i].path]=msg.payload[i].value;\n}\nmsg.payload = paths;\nreturn msg;","outputs":1,"noerr":0,"x":447.9999313354492,"y":362,"wires":[["394ab41d.6db7cc","14a044d7.7dea3b","1911072f.cce719","4637a9e5.1a52f8","17c4bf1a.221091","c6f4d0d4.df808","2956926b.bd87fe","acbf1bf3.e85cf8","e3a16944.fe77d8","67a9dcf2.741f54","376214ad.6545dc","b0be41df.32aa","59e2dd68.8d8044"]]},{"id":"394ab41d.6db7cc","type":"function","z":"46d7f9c0.e081c8","name":"navigation.speedOverGround","func":"var signalk_key=\"navigation.speedOverGround\";\n\nif(msg.payload.hasOwnProperty(signalk_key)){\n    msg.payload=msg.payload[signalk_key];\n    return msg;\n}","outputs":1,"noerr":0,"x":677.9999313354492,"y":302,"wires":[["be401f30.fc89f"]]},{"id":"be401f30.fc89f","type":"function","z":"46d7f9c0.e081c8","name":"m/s to knots","func":"msg.payload = Number(msg.payload)*1.94384\nreturn msg;","outputs":1,"noerr":0,"x":907.9999313354492,"y":302,"wires":[["5d362f9a.6164c"]]},{"id":"14a044d7.7dea3b","type":"function","z":"46d7f9c0.e081c8","name":"navigation.position.latitude","func":"var signalk_key=\"navigation.position\";\n\nif(msg.payload.hasOwnProperty(signalk_key)){\n    msg.payload=msg.payload[signalk_key][\"latitude\"];\n    return msg;\n}","outputs":1,"noerr":0,"x":176.99996948242188,"y":442.0000114440918,"wires":[["2076f42.93c3d0c"]]},{"id":"4637a9e5.1a52f8","type":"function","z":"46d7f9c0.e081c8","name":"navigation.position.longitude","func":"var signalk_key=\"navigation.position\";\n\nif(msg.payload.hasOwnProperty(signalk_key)){\n    msg.payload=msg.payload[signalk_key][\"longitude\"];\n    return msg;\n}","outputs":1,"noerr":0,"x":176.99996948242188,"y":482.0000114440918,"wires":[["54034f22.b4ef"]]},{"id":"1911072f.cce719","type":"function","z":"46d7f9c0.e081c8","name":"navigation.courseOverGroundTrue","func":"var signalk_key=\"navigation.courseOverGroundTrue\";\n\nif(msg.payload.hasOwnProperty(signalk_key)){\n    msg.payload=msg.payload[signalk_key];\n    return msg;\n}","outputs":1,"noerr":0,"x":697.9999313354492,"y":342,"wires":[["5fe80d14.b42c84"]]},{"id":"2076f42.93c3d0c","type":"mqtt out","z":"46d7f9c0.e081c8","name":"lat","topic":"lat","qos":"0","retain":"","broker":"dcdf2343.034d1","x":376.9999694824219,"y":442.0000114440918,"wires":[]},{"id":"54034f22.b4ef","type":"mqtt out","z":"46d7f9c0.e081c8","name":"","topic":"lon","qos":"0","retain":"","broker":"dcdf2343.034d1","x":376.9999694824219,"y":482.0000114440918,"wires":[]},{"id":"3ce68dd5.2a0142","type":"ui_template","z":"46d7f9c0.e081c8","group":"61c12cf6.6a9484","name":"Cog","order":2,"width":"4","height":"4","format":"<script src=\"/myjs/tween-min.js\"></script>\n<script src=\"/myjs/steelseries-min.js\"></script>\n<script>\nvar cog;\n    (function(scope){ \n        scope.$watch('msg', function(msg) {\n           if (typeof(msg.value) != \"undefined\")cog.setValueAnimated(msg.value);\n          \n        });\n    })(scope);\n\n    \n\n    cog = new steelseries.Compass('cog', {\n            gaugeType: steelseries.GaugeType.TYPE4,\n            \n            size: 190,\n           \n            //titleString: \"Charge\",\n            //unitString: \"AMPS\",\n           // threshold: 11.9,\n           // minValue: 0,\n           // maxValue:  10,\n           // thresholdRising: false,\n            //lcdVisible: true,\n           \n        });\n//cog.steelseries.BackgroundColor.(steelseries.BackgroundColor.WHITE); \n   cog.setFrameDesign(steelseries.FrameDesign.BRASS);\n   cog.setValueAnimated(0);                   \n   \n   //cog.setPointerType(steelseries.PointerType.TYPE9);\n    \n\n\n</script>\n\n<canvas id=\"cog\" width=\"190\" height=\"190\"></canvas>\n","storeOutMessages":true,"fwdInMessages":true,"x":1197.9999313354492,"y":342,"wires":[[]]},{"id":"5fe80d14.b42c84","type":"function","z":"46d7f9c0.e081c8","name":"","func":"msg.value=msg.payload;\nreturn msg;","outputs":1,"noerr":0,"x":917.9999313354492,"y":342,"wires":[["3ce68dd5.2a0142"]]},{"id":"a7dcc4f0.58df48","type":"function","z":"46d7f9c0.e081c8","name":"math","func":"\nvar vout = 0.0;\nvar vin = 0.0;\nvar R1 = 30000.0;\nvar R2 = 7500.0; \nvar value= msg.payload;\n\n\n vout = (value * 5.0) / 1024.0; \n vin = vout / (R2/(R1+R2)); \n \n//vin.toFixed(1);\n\nmsg.payload=vin;\n\nreturn msg;","outputs":1,"noerr":0,"x":820.0000171661377,"y":474.00002098083496,"wires":[["6bc25f4f.d75e4"]]},{"id":"acf2611f.0aba1","type":"ui_template","z":"46d7f9c0.e081c8","group":"3e12df92.e8ced","name":"house","order":2,"width":"4","height":"4","format":"<script src=\"/myjs/tween-min.js\"></script>\n<script src=\"/myjs/steelseries-min.js\"></script>\n<script>\nvar house;\n    (function(scope){ \n        scope.$watch('msg', function(msg) {\n           if (typeof(msg.value) != \"undefined\")house.setValueAnimated(msg.value);\n          \n        });\n    })(scope);\n\n    \n\n    house = new steelseries.Radial('house', {\n            gaugeType: steelseries.GaugeType.TYPE2,\n            size: 190,\n           \n            titleString: \"HOUSE\",\n            unitString: \"VOLTS\",\n            threshold: 11.9,\n            minValue: 0,\n            maxValue:  15,\n            thresholdRising: false,\n            //lcdVisible: true,\n           \n        });\n      \n    house.setValueAnimated(0);                   \n    house.setFrameDesign(steelseries.FrameDesign.BRASS);\n    house.setPointerType(steelseries.PointerType.TYPE9);\n    \n\n\n</script>\n\n<canvas id=\"house\" width=\"190\" height=\"190\"></canvas>\n","storeOutMessages":true,"fwdInMessages":true,"x":1199.0000038146973,"y":474.00002098083496,"wires":[[]]},{"id":"6bc25f4f.d75e4","type":"function","z":"46d7f9c0.e081c8","name":"","func":"msg.value=msg.payload;\nreturn msg;","outputs":1,"noerr":0,"x":940.0000171661377,"y":474.00002098083496,"wires":[["f3d27861.d621a8"]]},{"id":"8f023220.4d53e","type":"mqtt in","z":"46d7f9c0.e081c8","name":"","topic":"/ESP03/watertemp/Temperature","qos":"0","broker":"cf4d901f.78107","x":137.99993133544922,"y":922,"wires":[["62ecfd4.b8d7f04","468dce85.5db9e"]]},{"id":"c1a2913d.efe5","type":"function","z":"46d7f9c0.e081c8","name":"","func":"msg.value=msg.payload;\nreturn msg;","outputs":1,"noerr":0,"x":502.00024795532227,"y":919.0001249313354,"wires":[["218c4083.ea80a"]]},{"id":"a412871e.786508","type":"switch","z":"46d7f9c0.e081c8","name":"Is it nav data?","property":"msg.payload.updates.source.sentence","propertyType":"jsonata","rules":[{"t":"cont","v":"GLL","vt":"str"}],"checkall":"false","repair":false,"outputs":1,"x":387.9999313354492,"y":302,"wires":[["cd276694.c71e68"]]},{"id":"cd276694.c71e68","type":"change","z":"46d7f9c0.e081c8","name":"create msg.lat etc","rules":[{"t":"set","p":"LAT","pt":"msg","to":"payload.updates.values.value.latitude","tot":"jsonata"},{"t":"set","p":"LONG","pt":"msg","to":"payload.updates.values.value.longitude","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":647.9999313354492,"y":262,"wires":[["144cb673.49ecda"]]},{"id":"144cb673.49ecda","type":"function","z":"46d7f9c0.e081c8","name":"Make JSON","func":"var mymsg = {\"name\":\"MyPlace\",\"lat\":msg.LAT,\"lon\":msg.LONG, icon:\"ship\",\niconColor:\"red\"};\n\nmsg.payload=mymsg;\nreturn msg;","outputs":1,"noerr":0,"x":837.9999313354492,"y":262,"wires":[["2835f45d.923c4c","c272669b.7d2858"]]},{"id":"8fb83f8d.ced28","type":"json","z":"46d7f9c0.e081c8","name":"","property":"payload","action":"","pretty":true,"x":197.99993133544922,"y":302,"wires":[["a412871e.786508"]]},{"id":"b232e795.30af58","type":"ui_template","z":"46d7f9c0.e081c8","group":"61c12cf6.6a9484","name":"Compass","order":1,"width":"4","height":"4","format":"<script src=\"/myjs/tween-min.js\"></script>\n<script src=\"/myjs/steelseries-min.js\"></script>\n<script>\nvar compass;\n    (function(scope){ \n        scope.$watch('msg', function(msg) {\n           if (typeof(msg.value) != \"undefined\")compass.setValueAnimated(msg.value);\n          \n        });\n    })(scope);\n\n    \n\n    compass = new steelseries.Compass('compass', {\n            gaugeType: steelseries.GaugeType.TYPE4,\n            \n            size: 190,\n            \n            rotateFace:  true,\n            //\n            //titleString: \"Charge\",\n            //unitString: \"AMPS\",\n           // threshold: 11.9,\n           // minValue: 0,\n           // maxValue:  10,\n           // thresholdRising: false,\n            //lcdVisible: true,\n           \n        });\n//cog.steelseries.BackgroundColor.(steelseries.BackgroundColor.WHITE); \n   compass.setFrameDesign(steelseries.FrameDesign.BRASS);\n   compass.setValueAnimated(0);                   \n   \n   //cog.setPointerType(steelseries.PointerType.TYPE9);\n    \n\n\n</script>\n\n<canvas id=\"compass\" width=\"190\" height=\"190\"></canvas>\n","storeOutMessages":true,"fwdInMessages":true,"x":1208.0002479553223,"y":392.0000534057617,"wires":[[]]},{"id":"c5e68976.d0f768","type":"ui_template","z":"46d7f9c0.e081c8","group":"f4b055f4.028fd8","name":"speed","order":1,"width":"4","height":"4","format":"<script src=\"/myjs/tween-min.js\"></script>\n<script src=\"/myjs/steelseries-min.js\"></script>\n<script>\nvar speed;\n    (function(scope){ \n        scope.$watch('msg', function(msg) {\n           if (typeof(msg.value) != \"undefined\")speed.setValueAnimated(msg.value);\n          \n        });\n    })(scope);\n\n    \n\n    speed = new steelseries.Radial('speed', {\n            gaugeType: steelseries.GaugeType.TYPE2,\n            size: 190,\n           \n            titleString: \"SPEED\",\n            unitString: \"KNOTS\",\n            //threshold: 11.9,\n            minValue: 0,\n            maxValue:  10,\n            //thresholdRising: false,\n            //lcdVisible: true,\n           \n        });\n      \n    speed.setValueAnimated(0);                   \n    speed.setFrameDesign(steelseries.FrameDesign.BRASS);\n    speed.setPointerType(steelseries.PointerType.TYPE9);\n    \n\n\n</script>\n\n<canvas id=\"speed\" width=\"190\" height=\"190\"></canvas>\n","storeOutMessages":true,"fwdInMessages":true,"x":1199.0000038146973,"y":302.0000057220459,"wires":[[]]},{"id":"5d362f9a.6164c","type":"function","z":"46d7f9c0.e081c8","name":"","func":"msg.value=msg.payload;\nreturn msg;","outputs":1,"noerr":0,"x":1057.9999961853027,"y":302.0000066757202,"wires":[["c5e68976.d0f768"]]},{"id":"fb7a3abf.8051a8","type":"ui_template","z":"46d7f9c0.e081c8","group":"f4b055f4.028fd8","name":"Horizon","order":2,"width":"4","height":"4","format":"<script src=\"/myjs/tween-min.js\"></script>\n<script src=\"/myjs/steelseries-min.js\"></script>\n<script>\nvar horizon;\n    (function(scope){ \n        scope.$watch('msg', function(msg) {\n            if (typeof(msg.value) != \"undefined\")horizon.setValueAnimated(msg.value);\n           //if (typeof(msg.hor) != \"undefined\")horizon.setHorAnimated(msg.hor);\n           //if (typeof(msg.value) != \"undefined\")horizon.setValueAnimated(value);\n                                                                        // (msg.value);\n           //if (typeof(msg.roll) != \"undefined\")horizon.setRollAnimated(roll);\n          \n          \n        });\n    })(scope);\n\n    \n\n    horizon = new steelseries.Level('horizon', {\n            gaugeType: steelseries.GaugeType.TYPE4,\n            size: 190,\n           //textOrientationFixed: true,\n           //decimalsVisible:true,\n           //pointerColor:  ORANGE.\n           //foregroundType:\n           //backgroundVisible:false,\n           //foregroundVisible:false,\n           \n        });\n    horizon.setFrameDesign(steelseries.FrameDesign.BRASS);  \n    horizon.setValueAnimated(0);                   \n    \n    //level.setPointerType(steelseries.PointerType.TYPE9);\n    \n\n\n</script>\n\n<canvas id=\"horizon\" width=\"190\" height=\"190\"></canvas>\n","storeOutMessages":true,"fwdInMessages":true,"x":1204.0001678466797,"y":434.000057220459,"wires":[[]]},{"id":"5e3f8874.04ef28","type":"ui_template","z":"46d7f9c0.e081c8","group":"3e12df92.e8ced","name":"wind","order":3,"width":"4","height":"4","format":"<script src=\"/myjs/tween-min.js\"></script>\n<script src=\"/myjs/steelseries-min.js\"></script>\n<script>\nvar wind;\n    (function(scope){ \n        scope.$watch('msg', function(msg) {\n           if (typeof(msg.value) != \"undefined\")wind.setValueAnimated(msg.value);\n           if (typeof(msg.ave) != 'undefined')wind.setValueAnimatedAverage(msg.ave);\n        });\n    })(scope);\n\n    \n\n    wind = new steelseries.WindDirection('wind', {\n            gaugeType: steelseries.GaugeType.TYPE4,\n            size: 190,\n           lcdVisible: true,\n           titleString: \"Wind Direction\",\n           degreeScaleHalf: true,\n           pointSymbolsVisible: false,\n           lcdTitleStrings: ['DIRECTION', 'Speed'],\n           windspeed: true,\n        });\n      \n                      \n    wind.setFrameDesign(steelseries.FrameDesign.BRASS);\n    wind.setPointerTypeAverage(steelseries.PointerType.TYPE17);\n    wind.setPointerType(steelseries.PointerType.TYPE1);\n\n\n</script>\n\n<canvas id=\"wind\" width=\"190\" height=\"190\"></canvas>\n","storeOutMessages":true,"fwdInMessages":true,"x":1199.0003280639648,"y":516.0001573562622,"wires":[[]]},{"id":"775ba013.89d45","type":"function","z":"46d7f9c0.e081c8","name":"heel","func":"msg.value=msg.payload;\n\nreturn msg;","outputs":"1","noerr":0,"x":1034.0000171661377,"y":434.00002098083496,"wires":[["fb7a3abf.8051a8"]]},{"id":"8eafd2d9.98a92","type":"ui_template","z":"46d7f9c0.e081c8","group":"21de4402.d9d01c","name":"Tempwater","order":4,"width":"3","height":"6","format":"<script src=\"/myjs/tween-min.js\"></script>\n<script src=\"/myjs/steelseries-min.js\"></script>\n<script>\nvar tempwater;\n    (function(scope){ \n        scope.$watch('msg', function(msg) {\n           if (typeof(msg.value) != \"undefined\") tempwater.setValueAnimated(msg.value);\n           //if (typeof(msg.threshold) != \"undefined\") radial4.setThreshold(msg.threshold);\n          // if (typeof(msg.odo) != \"undefined\")radial4.setOdoValue(msg.odo);  \n           //if (typeof(msg.userLed) != \"undefined\") radial4.setUserLedOnOff(msg.userLed);  \n          // if (typeof(msg.trend) != \"undefined\")\n            {\n               // if (msg.trend==1)     radial4.setTrend(steelseries.TrendState.UP);\n                //if (msg.trend==0)     radial4.setTrend(steelseries.TrendState.STEADY);\n               // if (msg.trend==-1)    radial4.setTrend(steelseries.TrendState.DOWN);\n               // if (msg.trend==-2)    radial4.setTrend(steelseries.TrendState.OFF);\n            }\n        });\n    })(scope);\n\n    var sections = [steelseries.Section(0, 25, 'rgba(0, 0, 220, 0.3)'),\n                        steelseries.Section(25, 50, 'rgba(0, 220, 0, 0.3)'),\n                        steelseries.Section(50, 75, 'rgba(220, 220, 0, 0.3)') ],\n\n            // Define one area\n    areas = [steelseries.Section(75, 100, 'rgba(220, 0, 0, 0.3)')],\n\n    tempwater = new steelseries.Linear('tempwater', {\n            gaugeType: steelseries.GaugeType.TYPE2,\n            width: 140,\n            height: 300,\n            //size: 292,\n            section: sections,\n            area: areas,\n            titleString: \"Water\",\n            unitString: \"Degrees F\",\n            threshold: 80,\n            lcdVisible: true,\n           \n            //thresholdRising: false,\n           // userLedVisible: true,\n           // useOdometer: true,\n          //  lcdVisible: true,\n           // trendVisible: true\n        });\n                        \n    tempwater.setFrameDesign(steelseries.FrameDesign.BRASS);\n    tempwater.setValueAnimated(0);\n    tempwater.setPointerType(steelseries.PointerType.TYPE9);\n   // radial4.setThreshold(50);\n    //radial4.blinkUserLed(0);\n   // radial4.setOdoValue(0);\n\n\n</script>\n\n<canvas id=\"tempwater\" width=\"140\" height=\"300\"></canvas>\n","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":777.9999313354492,"y":902,"wires":[[]]},{"id":"155e9a6b.287ed6","type":"ui_template","z":"46d7f9c0.e081c8","group":"21de4402.d9d01c","name":"Tempin","order":3,"width":"3","height":"6","format":"<script src=\"/myjs/tween-min.js\"></script>\n<script src=\"/myjs/steelseries-min.js\"></script>\n<script>\nvar tempout;\n    (function(scope){ \n        scope.$watch('msg', function(msg) {\n           if (typeof(msg.value) != \"undefined\") tempout.setValueAnimated(msg.value);\n           //if (typeof(msg.threshold) != \"undefined\") radial4.setThreshold(msg.threshold);\n          // if (typeof(msg.odo) != \"undefined\")radial4.setOdoValue(msg.odo);  \n           //if (typeof(msg.userLed) != \"undefined\") radial4.setUserLedOnOff(msg.userLed);  \n          // if (typeof(msg.trend) != \"undefined\")\n            {\n               // if (msg.trend==1)     radial4.setTrend(steelseries.TrendState.UP);\n                //if (msg.trend==0)     radial4.setTrend(steelseries.TrendState.STEADY);\n               // if (msg.trend==-1)    radial4.setTrend(steelseries.TrendState.DOWN);\n               // if (msg.trend==-2)    radial4.setTrend(steelseries.TrendState.OFF);\n            }\n        });\n    })(scope);\n\n    var sections = [steelseries.Section(0, 25, 'rgba(0, 0, 220, 0.3)'),\n                        steelseries.Section(25, 50, 'rgba(0, 220, 0, 0.3)'),\n                        steelseries.Section(50, 75, 'rgba(220, 220, 0, 0.3)') ],\n\n            // Define one area\n    areas = [steelseries.Section(75, 100, 'rgba(220, 0, 0, 0.3)')],\n\n    tempout = new steelseries.Linear('tempout', {\n            gaugeType: steelseries.GaugeType.TYPE2,\n            width: 140,\n            height: 300,\n            //size: 292,\n            section: sections,\n            area: areas,\n            titleString: \"Inside\",\n            unitString: \"Degrees F\",\n            threshold: 80,\n            lcdVisible: true,\n           \n            //thresholdRising: false,\n           // userLedVisible: true,\n           // useOdometer: true,\n          //  lcdVisible: true,\n           // trendVisible: true\n        });\n                        \n    tempout.setFrameDesign(steelseries.FrameDesign.BRASS);\n    tempout.setValueAnimated(0);\n    tempout.setPointerType(steelseries.PointerType.TYPE9);\n   // radial4.setThreshold(50);\n    //radial4.blinkUserLed(0);\n   // radial4.setOdoValue(0);\n\n\n</script>\n\n<canvas id=\"tempout\" width=\"140\" height=\"300\"></canvas>\n","storeOutMessages":true,"fwdInMessages":true,"x":1206.0003280639648,"y":590.0000686645508,"wires":[[]]},{"id":"17c4bf1a.221091","type":"function","z":"46d7f9c0.e081c8","name":"electrical.batteries","func":"var signalk_key=\"electrical.batteries.house.voltage\";\n\nif(msg.payload.hasOwnProperty(signalk_key)){\n    msg.payload=msg.payload[signalk_key];\n    return msg;\n    \n\n}","outputs":1,"noerr":0,"x":657.0000553131104,"y":474.0000419616699,"wires":[["a7dcc4f0.58df48"]]},{"id":"f3d27861.d621a8","type":"delay","z":"46d7f9c0.e081c8","name":"del","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1063.0000171661377,"y":474.00002098083496,"wires":[["acf2611f.0aba1"]]},{"id":"c6f4d0d4.df808","type":"function","z":"46d7f9c0.e081c8","name":"roll","func":"var signalk_key=\"navigation.attitude.roll\";\n\nif(msg.payload.hasOwnProperty(signalk_key)){\n    msg.payload=msg.payload[signalk_key];\n    return msg;\n    \n\n}","outputs":"1","noerr":0,"x":614.0000514984131,"y":433.0000400543213,"wires":[["f523fc91.457e"]]},{"id":"2956926b.bd87fe","type":"function","z":"46d7f9c0.e081c8","name":"Cabin Temp","func":"var signalk_key=\"environment.inside.maincabin.temperature\" \n\nif(msg.payload.hasOwnProperty(signalk_key)){\n    msg.payload=msg.payload[signalk_key];\n    return msg;\n    \n\n}","outputs":1,"noerr":0,"x":638.0000553131104,"y":514.0000438690186,"wires":[["56d763a8.9189ac"]]},{"id":"56d763a8.9189ac","type":"function","z":"46d7f9c0.e081c8","name":"K to F","func":"var temp = msg.payload;\n\nvalue = (temp * 9.0) / 5.0 - 459.67; \nmsg.payload=value;\nreturn msg; ","outputs":1,"noerr":0,"x":793.9999313354492,"y":516.9999952316284,"wires":[["c03de4e8.215d18","fbdfa721.e02ef8"]]},{"id":"fbdfa721.e02ef8","type":"function","z":"46d7f9c0.e081c8","name":"","func":"msg.value=msg.payload; \nreturn msg;","outputs":1,"noerr":0,"x":947.000244140625,"y":517.0000448226929,"wires":[[]]},{"id":"acbf1bf3.e85cf8","type":"function","z":"46d7f9c0.e081c8","name":"compass","func":"var signalk_key=\"navigation.headingMagnetic\";\n\nif(msg.payload.hasOwnProperty(signalk_key)){\n    msg.payload=msg.payload[signalk_key];\n    return msg;\n    \n\n}","outputs":"1","noerr":0,"x":621.0000534057617,"y":394.000036239624,"wires":[["848bb78e.d2eae8"]]},{"id":"848bb78e.d2eae8","type":"function","z":"46d7f9c0.e081c8","name":"Rad to Deg","func":"var rad = msg.payload;\nvar deg = rad * 180/3.14;\nmsg.payload=deg;\nreturn msg ;","outputs":1,"noerr":0,"x":777.9999313354492,"y":382,"wires":[["b1dd8a3c.02a408"]]},{"id":"b1dd8a3c.02a408","type":"function","z":"46d7f9c0.e081c8","name":"","func":"msg.value=msg.payload;\nreturn msg;","outputs":1,"noerr":0,"x":936.0000686645508,"y":392.00003147125244,"wires":[["b232e795.30af58"]]},{"id":"f523fc91.457e","type":"function","z":"46d7f9c0.e081c8","name":"Rad to Deg","func":"var rad = msg.payload;\nvar deg = rad * 180/3.14;\nmsg.payload=deg;\nreturn msg ;","outputs":1,"noerr":0,"x":798.0000171661377,"y":433.00002098083496,"wires":[["775ba013.89d45"]]},{"id":"e3a16944.fe77d8","type":"function","z":"46d7f9c0.e081c8","name":"Water Temp","func":"var signalk_key=\"environment.water.temperature\";\n\nif(msg.payload.hasOwnProperty(signalk_key)){\n    msg.payload=msg.payload[signalk_key];\n    return msg;\n    \n\n}","outputs":1,"noerr":0,"x":646.9999313354492,"y":565.000002861023,"wires":[["905e3c76.54159"]]},{"id":"9836a520.e33028","type":"function","z":"46d7f9c0.e081c8","name":"","func":"msg.value=msg.payload;\nreturn msg;","outputs":1,"noerr":0,"x":983.9999885559082,"y":590.0000066757202,"wires":[["155e9a6b.287ed6"]]},{"id":"905e3c76.54159","type":"function","z":"46d7f9c0.e081c8","name":"K to F","func":"var temp = msg.payload;\n\nvalue = (temp * 9.0) / 5.0 - 459.67; \nmsg.payload=value;\nreturn msg; ","outputs":1,"noerr":0,"x":786.9999313354492,"y":565.000002861023,"wires":[[]]},{"id":"6555c8f2.e903b8","type":"ui_template","z":"46d7f9c0.e081c8","group":"13514fc5.25604","name":"world","order":3,"width":"6","height":"6","format":"<iframe width=\"300\" height=\"300\" src=\"http://192.168.1.123:1880/worldmap/\" frameborder=\"0\" allowfullscreen></iframe>0","storeOutMessages":false,"fwdInMessages":true,"templateScope":"local","x":1205.0002059936523,"y":264.00000953674316,"wires":[[]]},{"id":"38cf23a7.02e48c","type":"mqtt in","z":"46d7f9c0.e081c8","name":"","topic":"/esp_easy32/bmp280/Pressure","qos":"2","broker":"cf4d901f.78107","x":140.16663360595703,"y":621.3333616256714,"wires":[["7cf40ff3.fcccb"]]},{"id":"3b7cb94d.b9ffa6","type":"mqtt in","z":"46d7f9c0.e081c8","name":"","topic":"/esp_easy32/bmp280/Temperature","qos":"2","broker":"cf4d901f.78107","x":145,"y":687.0000734329224,"wires":[["aa7a5eb.da259a","31a0296e.f20376"]]},{"id":"468dce85.5db9e","type":"debug","z":"46d7f9c0.e081c8","name":"","active":false,"console":"false","complete":"false","x":517.9999313354492,"y":1022,"wires":[]},{"id":"a0ebceac.6179c","type":"function","z":"46d7f9c0.e081c8","name":"math","func":"\nvar vout = 0.0;\nvar vin = 0.0;\nvar R1 = 30000.0;\nvar R2 = 7500.0; \nvar value= msg.payload;\n\n\n vout = (value * 5.0) / 1024.0; \n vin = vout / (R2/(R1+R2)); \n \n//vin.toFixed(1);\n\nmsg.payload=vin;\n\nreturn msg;","outputs":1,"noerr":0,"x":317.9999313354492,"y":842,"wires":[["7a006931.be15a8"]]},{"id":"7a006931.be15a8","type":"function","z":"46d7f9c0.e081c8","name":"","func":"msg.value=msg.payload;\nreturn msg;","outputs":1,"noerr":0,"x":437.9999313354492,"y":842,"wires":[[]]},{"id":"31a0296e.f20376","type":"function","z":"46d7f9c0.e081c8","name":"C  to F","func":"\n\nvar temp = msg.payload;\n\nvalue = (temp * 9.0) / 5.0 + 32.0; \nmsg.payload=value;\nreturn msg; ","outputs":1,"noerr":0,"x":372.9999313354492,"y":738.0000257492065,"wires":[["b9c86007.9e8cd"]]},{"id":"b9c86007.9e8cd","type":"function","z":"46d7f9c0.e081c8","name":"","func":"msg.value=msg.payload;\nreturn msg;","outputs":1,"noerr":0,"x":506.9999313354492,"y":745.000002861023,"wires":[[]]},{"id":"993b6a22.f5d968","type":"mqtt in","z":"46d7f9c0.e081c8","name":"","topic":"/esp_easy32/volts/Analog","qos":"2","broker":"cf4d901f.78107","x":117.99993133544922,"y":842,"wires":[["a0ebceac.6179c"]]},{"id":"62ecfd4.b8d7f04","type":"function","z":"46d7f9c0.e081c8","name":"C  to F","func":"\n\nvar temp = msg.payload;\n\nvalue = (temp * 9.0) / 5.0 + 32.0; \nmsg.payload=value;\nreturn msg; ","outputs":1,"noerr":0,"x":366.0001754760742,"y":920.000096321106,"wires":[["c1a2913d.efe5","6953283a.7a5d88"]]},{"id":"6953283a.7a5d88","type":"mqtt out","z":"46d7f9c0.e081c8","name":"","topic":"watertemp","qos":"","retain":"","broker":"cf4d901f.78107","x":517.9999313354492,"y":962,"wires":[]},{"id":"7cf40ff3.fcccb","type":"mqtt out","z":"46d7f9c0.e081c8","name":"","topic":"pressure","qos":"","retain":"","broker":"dcdf2343.034d1","x":467.9999313354492,"y":622,"wires":[]},{"id":"aa7a5eb.da259a","type":"mqtt out","z":"46d7f9c0.e081c8","name":"","topic":"airtemp","qos":"","retain":"","broker":"dcdf2343.034d1","x":481,"y":685.0000352859497,"wires":[]},{"id":"a6df97ee.4aab18","type":"function","z":"46d7f9c0.e081c8","name":"","func":"    var sensor_volt;\n    var RS_gas; // Get value of RS in a GAS\n    var ratio; // Get ratio RS_GAS/RS_air\n    var sensorValue =msg.payload;\n    sensor_volt=sensorValue/1024*5.0;\n    RS_gas = (5.0-sensor_volt)/sensor_volt; // omit *RL\n\n          /*-Replace the name \"R0\" with the value of R0 in the demo of First Test -*/\n    ratio = RS_gas/108;  // ratio = RS/R0\n    msg.payload=ratio;\nreturn msg;","outputs":1,"noerr":0,"x":637.9999313354492,"y":822,"wires":[[]]},{"id":"b178b7e0.80aa48","type":"mqtt in","z":"46d7f9c0.e081c8","name":"","topic":"lat","qos":"2","broker":"cf4d901f.78107","x":81.16660690307617,"y":520.3333559036255,"wires":[[]]},{"id":"dcaedfb.a22072","type":"mqtt in","z":"46d7f9c0.e081c8","name":"","topic":"lon","qos":"2","broker":"cf4d901f.78107","x":83.16660690307617,"y":565.3333568572998,"wires":[[]]},{"id":"218c4083.ea80a","type":"ui_chart","z":"46d7f9c0.e081c8","name":"","group":"13514fc5.25604","order":1,"width":0,"height":0,"label":"tempwater","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"x":763.0003414154053,"y":972.0000982284546,"wires":[[],[]]},{"id":"4d84a32.f911e5c","type":"mqtt out","z":"46d7f9c0.e081c8","name":"gas","topic":"gas","qos":"","retain":"","broker":"cf4d901f.78107","x":797.9999313354492,"y":822,"wires":[]},{"id":"e633da5.4788a28","type":"rbe","z":"46d7f9c0.e081c8","name":"","func":"rbei","gap":"","start":"","inout":"out","property":"payload","x":637.9999313354492,"y":782,"wires":[["4d84a32.f911e5c","a8ec870c.2f2b78"]]},{"id":"660f1acc.275d04","type":"exec","z":"46d7f9c0.e081c8","command":"sudo reboot","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":295.1666564941406,"y":248.50000476837158,"wires":[[],[],[]]},{"id":"5c954e15.98908","type":"inject","z":"46d7f9c0.e081c8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":97.1666030883789,"y":248.3333387374878,"wires":[["660f1acc.275d04"]]},{"id":"c03de4e8.215d18","type":"debug","z":"46d7f9c0.e081c8","name":"","active":false,"console":"false","complete":"false","x":1046.9999313354492,"y":365.00000286102295,"wires":[]},{"id":"67a9dcf2.741f54","type":"function","z":"46d7f9c0.e081c8","name":"cabin pres","func":"var signalk_key=\"environment.outside.pressure\";\n\nif(msg.payload.hasOwnProperty(signalk_key)){\n    msg.payload=msg.payload[signalk_key];\n    return msg;\n    \n\n}","outputs":1,"noerr":0,"x":646.9999313354492,"y":605.000002861023,"wires":[["c1ccefc6.fd04d"]]},{"id":"c1ccefc6.fd04d","type":"ui_chart","z":"46d7f9c0.e081c8","name":"","group":"21de4402.d9d01c","order":2,"width":0,"height":0,"label":"cabin pres","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"604800","cutout":0,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"x":806.9999313354492,"y":605.000002861023,"wires":[[],[]]},{"id":"376214ad.6545dc","type":"function","z":"46d7f9c0.e081c8","name":"cabin temp","func":"var signalk_key=\"environment.inside.mainCabin.temperature\";\n\nif(msg.payload.hasOwnProperty(signalk_key)){\n    msg.payload=msg.payload[signalk_key];\n    return msg;\n    \n\n}","outputs":1,"noerr":0,"x":646.9999313354492,"y":645.000002861023,"wires":[["85cd8f78.09843"]]},{"id":"ade9666f.a616a8","type":"ui_chart","z":"46d7f9c0.e081c8","name":"cabin temp","group":"21de4402.d9d01c","order":1,"width":0,"height":0,"label":"cabin temp","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"x":1083.166618347168,"y":645.0000114440918,"wires":[[],[]]},{"id":"c272669b.7d2858","type":"debug","z":"46d7f9c0.e081c8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1037.9999313354492,"y":202,"wires":[]},{"id":"3484d22.786472e","type":"mqtt out","z":"46d7f9c0.e081c8","name":"","topic":"ws","qos":"","retain":"","broker":"dcdf2343.034d1","x":204.99993133544922,"y":398.3333387374878,"wires":[]},{"id":"85cd8f78.09843","type":"function","z":"46d7f9c0.e081c8","name":"K to F","func":"var temp = msg.payload;\n\nvalue = (temp * 9.0) / 5.0 - 459.67; \nmsg.payload=value;\nreturn msg; ","outputs":1,"noerr":0,"x":788.9999313354492,"y":645.3333387374878,"wires":[["ade9666f.a616a8","9836a520.e33028"]]},{"id":"4d95331.2da7ecc","type":"ui_text","z":"46d7f9c0.e081c8","group":"f4b055f4.028fd8","order":0,"width":0,"height":0,"name":"","label":" ALARM","format":"{{msg.payload}}","layout":"col-center","x":1007.9999313354492,"y":802,"wires":[]},{"id":"a8ec870c.2f2b78","type":"function","z":"46d7f9c0.e081c8","name":"","func":"var alarm= msg.payload;\nvar gas=\"GAS ALARM\";\nvar ok=\"OK\";\n//var water=\"HIGH WATER\"\nif (alarm===1)msg.payload=ok;\nif (alarm===0)msg.payload=gas;\n//if (alarm===2)msg.payload=water;\nreturn msg;","outputs":1,"noerr":0,"x":797.9999313354492,"y":782,"wires":[["4d95331.2da7ecc"]]},{"id":"b0be41df.32aa","type":"function","z":"46d7f9c0.e081c8","name":"float","func":"var signalk_key=\"sensors.floatswitch\";\n\nif(msg.payload.hasOwnProperty(signalk_key)){\n    msg.payload=msg.payload[signalk_key];\n    return msg;\n    \n\n}","outputs":1,"noerr":0,"x":637.9999313354492,"y":683,"wires":[["391a415e.d6a6ee"]]},{"id":"391a415e.d6a6ee","type":"function","z":"46d7f9c0.e081c8","name":"","func":"var water=msg.payload;\nvar alarm=\"BILDGE ALARM\"\nvar ok=\"OK\"\nif (water===1)msg.payload=alarm;\nif (water===0)msg.payload=ok;\nreturn msg;","outputs":1,"noerr":0,"x":792.166618347168,"y":701.3333387374878,"wires":[["4d95331.2da7ecc"]]},{"id":"59e2dd68.8d8044","type":"function","z":"46d7f9c0.e081c8","name":"pir","func":"var signalk_key=\"sensors.pir\";\n\nif(msg.payload.hasOwnProperty(signalk_key)){\n    msg.payload=msg.payload[signalk_key];\n    return msg;\n    \n\n}","outputs":1,"noerr":0,"x":629.9999313354492,"y":741.9999647140503,"wires":[["a337f796.bfadc8"]]},{"id":"a337f796.bfadc8","type":"function","z":"46d7f9c0.e081c8","name":"","func":"var pir=msg.payload;\nvar piralarm=\"INTRUDER ALARM\"\nvar ok=\"OK\"\nif (pir===1)msg.payload=piralarm;\nif (pir===0)msg.payload=ok;\nreturn msg;","outputs":1,"noerr":0,"x":797.9999313354492,"y":743.666651725769,"wires":[["4d95331.2da7ecc"]]},{"id":"2835f45d.923c4c","type":"worldmap","z":"46d7f9c0.e081c8","name":"","lat":"","lon":"","zoom":"","layer":"Nat Geo","cluster":"","maxage":"","usermenu":"hide","layers":"hide","panit":"true","x":1057.9999313354492,"y":262,"wires":[]},{"id":"a1fa1b4f.7be578","type":"function","z":"46d7f9c0.e081c8","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":287.9999313354492,"y":122,"wires":[[],[]]},{"id":"23d6c3a1.83b8dc","type":"json","z":"46d7f9c0.e081c8","name":"","property":"payload","action":"","pretty":false,"x":97.99993133544922,"y":122,"wires":[["a1fa1b4f.7be578"]]},{"id":"2f7240ee.ee0e4","type":"link out","z":"46d7f9c0.e081c8","name":"ws","links":["8fa9cee5.69582"],"x":102.99993133544922,"y":322,"wires":[]},{"id":"f3d9cf91.f4f67","type":"websocket-listener","z":"","path":"ws://localhost:3000/signalk/v1/stream","wholemsg":"false"},{"id":"dcdf2343.034d1","type":"mqtt-broker","z":"","name":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"61c12cf6.6a9484","type":"ui_group","z":"","name":"NAV 1","tab":"47ff93a8.26e4bc","order":1,"disp":false,"width":"4"},{"id":"3e12df92.e8ced","type":"ui_group","z":"","name":"Batterys","tab":"47ff93a8.26e4bc","order":3,"disp":false,"width":"4"},{"id":"cf4d901f.78107","type":"mqtt-broker","z":"","name":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"f4b055f4.028fd8","type":"ui_group","z":"","name":"NAV 2","tab":"47ff93a8.26e4bc","order":2,"disp":false,"width":"4"},{"id":"21de4402.d9d01c","type":"ui_group","z":"","name":"ENVIRONMENT","tab":"eab91d6c.e8134","order":1,"disp":true,"width":"6"},{"id":"13514fc5.25604","type":"ui_group","z":"","name":"SECURITY","tab":"eab91d6c.e8134","order":2,"disp":true,"width":"6"},{"id":"47ff93a8.26e4bc","type":"ui_tab","z":"","name":"Engine","icon":"dashboard","order":1},{"id":"eab91d6c.e8134","type":"ui_tab","z":"","name":"Tab 2","icon":"dashboard","order":2}]
Reply
#16
(2018-06-09, 06:05 PM)JeroenAdam Wrote: [quote='wkmhv' pid='5591' dateline='1528559975']


If you trigger a  command, it should work.
mosquitto_pub -h 10.10.10.1 -t /test/anytopic -u pi -P raspberry -m anymessage
But first: sudo apt-get install mosquitto-clients

i got it to work this way with watchdog on opencpn.
 
mosquitto_pub -u pi -P mypassword -t 'anchor' -m 'Anchor Alarm'


thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)