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
My Node-red
#4
Here are the flows:

First the NMEA flow. (This is standard from OP, I have only added that I remove some decimals, OBS: I dont know if this code only remove digits or round the numbers.. So test this before you use it).
I have also added the depth sensor.
Code:
[{"id":"ad773e6c.c040d","type":"tab","label":"NMEA"},{"id":"856cb5e9.dcebc8","type":"websocket in","z":"ad773e6c.c040d","name":"","server":"72ac4338.c8385c","client":"","x":218,"y":61,"wires":[["58ad6945.29ed58"]]},{"id":"58ad6945.29ed58","type":"json","z":"ad773e6c.c040d","name":"","x":95.5,"y":312,"wires":[["fac9923d.10c41","ac5c27ba.10caa8","6d23f4f0.c8b5ac","7d4bf1cb.5abc2","f86a32ab.39d82","63c505d1.d3d18c"]]},{"id":"31556d64.20f732","type":"ui_gauge","z":"ad773e6c.c040d","name":"courseOverGroundTrue","group":"a5d60f9b.e54c4","order":0,"width":"3","height":"3","gtype":"compass","title":"Sann Kurs","label":"rad","format":"{{value}}","min":0,"max":"360","colors":["#00b500","#e6e600","#ca3838"],"x":850,"y":220,"wires":[]},{"id":"fac9923d.10c41","type":"jsonpath","z":"ad773e6c.c040d","expression":"$.updates..values[?(@.path==\"navigation.courseOverGroundTrue\")]..value","split":true,"name":"navigation.courseOverGroundTrue","x":380,"y":220,"wires":[["e6ac0f18.dc51"]]},{"id":"ac5c27ba.10caa8","type":"jsonpath","z":"ad773e6c.c040d","expression":"$.updates..values[?(@.path==\"navigation.speedOverGround\")]..value","split":true,"name":"navigation.speedOverGround","x":370,"y":280,"wires":[["d7d23cf4.de2bc"]]},{"id":"d7d23cf4.de2bc","type":"ui_gauge","z":"ad773e6c.c040d","name":"speedOverGround","group":"a5d60f9b.e54c4","order":0,"width":"3","height":"3","gtype":"gage","title":"Speed Over Ground","label":"knop","format":"{{value}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"x":830,"y":280,"wires":[]},{"id":"6d23f4f0.c8b5ac","type":"jsonpath","z":"ad773e6c.c040d","expression":"$.updates..values[?(@.path==\"navigation.position\")]..latitude","split":true,"name":"navigation.position.latitude","x":360,"y":320,"wires":[["81c3d1ce.a1f68"]]},{"id":"7d4bf1cb.5abc2","type":"jsonpath","z":"ad773e6c.c040d","expression":"$.updates..values[?(@.path==\"navigation.position\")]..longitude","split":true,"name":"navigation.position.longitude","x":360,"y":360,"wires":[["5891f697.e2dab8"]]},{"id":"d808c595.698dd8","type":"ui_text","z":"ad773e6c.c040d","group":"a5d60f9b.e54c4","order":0,"width":0,"height":0,"name":"position.longitude","label":"Longitude","format":"{{msg.payload}}","layout":"col-center","x":830,"y":360,"wires":[]},{"id":"522ab899.91c268","type":"ui_text","z":"ad773e6c.c040d","group":"a5d60f9b.e54c4","order":0,"width":0,"height":0,"name":"position.latitude","label":"Latitude","format":"{{msg.payload}}","layout":"col-center","x":820,"y":320,"wires":[]},{"id":"e6ac0f18.dc51","type":"function","z":"ad773e6c.c040d","name":"","func":"msg.payload= msg.payload.toFixed(2);\nreturn msg;","outputs":1,"noerr":0,"x":650,"y":220,"wires":[["31556d64.20f732"]]},{"id":"f86a32ab.39d82","type":"jsonpath","z":"ad773e6c.c040d","expression":"$.updates..values[?(@.path==\"environment.depth.belowTransducer\")]..value","split":true,"name":"environment.depth.belowTransducer","x":390,"y":400,"wires":[["3731175a.097d68"]]},{"id":"3731175a.097d68","type":"ui_text","z":"ad773e6c.c040d","group":"a5d60f9b.e54c4","order":0,"width":0,"height":0,"name":"Dybde","label":"Dybde","format":"{{msg.payload}} M","layout":"col-center","x":790,"y":400,"wires":[]},{"id":"81c3d1ce.a1f68","type":"function","z":"ad773e6c.c040d","name":"","func":"msg.payload= msg.payload.toFixed(5);\nreturn msg;","outputs":1,"noerr":0,"x":650,"y":320,"wires":[["522ab899.91c268"]]},{"id":"5891f697.e2dab8","type":"function","z":"ad773e6c.c040d","name":"","func":"msg.payload= msg.payload.toFixed(5);\nreturn msg;","outputs":1,"noerr":0,"x":650,"y":360,"wires":[["d808c595.698dd8"]]},{"id":"63c505d1.d3d18c","type":"debug","z":"ad773e6c.c040d","name":"","active":true,"console":"false","complete":"false","x":150,"y":140,"wires":[]},{"id":"72ac4338.c8385c","type":"websocket-listener","z":"","path":"ws://localhost:3000/signalk/v1/stream","wholemsg":"false"},{"id":"a5d60f9b.e54c4","type":"ui_group","z":"","name":"Seildata","tab":"c35e6707.e7b658","order":1,"disp":true,"width":"3"},{"id":"c35e6707.e7b658","type":"ui_tab","z":"","name":"Samson","icon":"dashboard"}]

This is the Victronenergy flow: (I have a second R-pi running the VE software and who are connected to the solar regulator and batterymontior via a VEdirect USB cable).
More info about the VE Software: https://www.victronenergy.com/blog/2016/...-new-year/ Big Kudos for a company like VictronEnergy to support open source!!

Code:
[{"id":"e9109027.2778e8","type":"tab","label":"VictronEnergy"},{"id":"6e29f2c5.bca35c","type":"mqtt in","z":"e9109027.2778e8","name":"VEdirect","topic":"N/b827eb79e8ef/#","qos":"0","broker":"957e0f28.64d928","x":202,"y":49,"wires":[["bab5896a.2ea2d8"]]},{"id":"96cf9094.b3bf7","type":"mqtt out","z":"e9109027.2778e8","name":"Keepalive","topic":"","qos":"","retain":"","broker":"957e0f28.64d928","x":400,"y":180,"wires":[]},{"id":"d6c995b5.11415","type":"inject","z":"e9109027.2778e8","name":"Keepalive","topic":"R/b827eb79e8ef/system/0/Serial","payload":"","payloadType":"date","repeat":"50","crontab":"","once":false,"x":218,"y":181,"wires":[["96cf9094.b3bf7"]]},{"id":"a7c96a85.ff297","type":"switch","z":"e9109027.2778e8","name":"Splitter","property":"topic","propertyType":"msg","rules":[{"t":"cont","v":"/Dc/1/Voltage","vt":"str"},{"t":"cont","v":"/Dc/Battery/Voltage","vt":"str"},{"t":"cont","v":"/Dc/Battery/Soc","vt":"str"},{"t":"cont","v":"/Dc/Battery/Current","vt":"str"},{"t":"cont","v":"/Dc/Battery/Power","vt":"str"},{"t":"cont","v":"/solarcharger/288/Pv/I","vt":"str"},{"t":"cont","v":"/solarcharger/288/Yield/Power","vt":"str"},{"t":"cont","v":"/solarcharger/288/Pv/V","vt":"str"}],"checkall":"true","outputs":8,"x":463,"y":99,"wires":[["8ff51eec.36d908"],["7712ecae.c997b4"],["5268f5d5.8445ec"],["39590c27.bfea34"],[],["eedf0b84.97a328"],["bba3dfd3.05eb9"],["aa21caa5.785bf"]]},{"id":"8ff51eec.36d908","type":"function","z":"e9109027.2778e8","name":"","func":"msg.payload= msg.payload.value.toFixed(2);\nreturn msg;","outputs":1,"noerr":0,"x":684.7500076293945,"y":24.25000286102295,"wires":[["6a8278d7.b2e1b8"]]},{"id":"7712ecae.c997b4","type":"function","z":"e9109027.2778e8","name":"","func":"msg.payload= msg.payload.value.toFixed(2);\nreturn msg;","outputs":1,"noerr":0,"x":679.5000076293945,"y":61.50000286102295,"wires":[["30d7f89e.ec3f68"]]},{"id":"40c123d1.b8e6e4","type":"function","z":"e9109027.2778e8","name":"","func":"msg.payload= msg.payload.value.toFixed(2);\nreturn msg;","outputs":1,"noerr":0,"x":790,"y":260,"wires":[["b3915fd6.af232"]]},{"id":"bba3dfd3.05eb9","type":"function","z":"e9109027.2778e8","name":"","func":"msg.payload= msg.payload.value.toFixed(2);\nreturn msg;","outputs":1,"noerr":0,"x":790,"y":220,"wires":[["1ca21886.141ad7"]]},{"id":"aa21caa5.785bf","type":"delay","z":"e9109027.2778e8","name":"Delay 10sec","pauseType":"rate","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"10","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":650,"y":260,"wires":[["40c123d1.b8e6e4"]]},{"id":"6a8278d7.b2e1b8","type":"ui_text","z":"e9109027.2778e8","group":"cef7d7ff.0ba4a8","order":0,"width":0,"height":0,"name":"Volt startbatt","label":"Startbatteri","format":"{{msg.payload}} V","layout":"col-center","x":970,"y":20,"wires":[]},{"id":"30d7f89e.ec3f68","type":"ui_text","z":"e9109027.2778e8","group":"cef7d7ff.0ba4a8","order":0,"width":0,"height":0,"name":"Volt Forbruk","label":"Forbruksbatteri","format":"{{msg.payload}} V","layout":"col-center","x":970,"y":60,"wires":[]},{"id":"5268f5d5.8445ec","type":"ui_gauge","z":"e9109027.2778e8","name":"State of charge","group":"cef7d7ff.0ba4a8","order":0,"width":"3","height":"3","gtype":"gage","title":"State of charge","label":"%","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"x":980,"y":100,"wires":[]},{"id":"39590c27.bfea34","type":"ui_gauge","z":"e9109027.2778e8","name":"Ampere Forbruk","group":"cef7d7ff.0ba4a8","order":0,"width":"3","height":"3","gtype":"gage","title":"Ampere Forbruk","label":"A","format":"{{value}}","min":"-25","max":"+25","colors":["#00b500","#e6e600","#ca3838"],"x":990,"y":140,"wires":[]},{"id":"1ca21886.141ad7","type":"ui_text","z":"e9109027.2778e8","group":"4b4297a4.090188","order":0,"width":0,"height":0,"name":"Watt Solcelle","label":"Watt","format":"{{msg.payload}} W","layout":"row-spread","x":970,"y":220,"wires":[]},{"id":"b3915fd6.af232","type":"ui_text","z":"e9109027.2778e8","group":"4b4297a4.090188","order":0,"width":0,"height":0,"name":"Volt Solcelle","label":"Volt","format":"{{msg.payload}} V","layout":"row-spread","x":970,"y":260,"wires":[]},{"id":"bab5896a.2ea2d8","type":"json","z":"e9109027.2778e8","name":"","x":329,"y":84,"wires":[["a7c96a85.ff297"]]},{"id":"eedf0b84.97a328","type":"function","z":"e9109027.2778e8","name":"","func":"msg.payload= msg.payload.value.toFixed(2);\nreturn msg;","outputs":1,"noerr":0,"x":790,"y":180,"wires":[["94be9819.daeac8"]]},{"id":"94be9819.daeac8","type":"ui_text","z":"e9109027.2778e8","group":"4b4297a4.090188","order":0,"width":0,"height":0,"name":"Amp Solcelle","label":"Ampere","format":"{{msg.payload}} A","layout":"row-spread","x":970,"y":180,"wires":[]},{"id":"957e0f28.64d928","type":"mqtt-broker","z":"","broker":"192.168.1.32","port":"1883","clientid":"openplotter","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""},{"id":"cef7d7ff.0ba4a8","type":"ui_group","z":"","name":"DC System","tab":"c35e6707.e7b658","disp":true,"width":"3"},{"id":"4b4297a4.090188","type":"ui_group","z":"","name":"Solcelle","tab":"c35e6707.e7b658","order":5,"disp":true,"width":"3"},{"id":"c35e6707.e7b658","type":"ui_tab","z":"","name":"Samson","icon":"dashboard"}]

And last is the Domoticz flow:
Code:
[{"id":"6e606c8c.1d90f4","type":"tab","label":"Domoticz"},{"id":"b55a7800.03ec58","type":"mqtt in","z":"6e606c8c.1d90f4","name":"Domoticz","topic":"domoticz/out","qos":"0","broker":"c6baa5e3.413fd","x":195,"y":98.75,"wires":[["743ea0ed.d1dc38","1a510187.5598ae"]]},{"id":"743ea0ed.d1dc38","type":"json","z":"6e606c8c.1d90f4","name":"","x":190,"y":152.75,"wires":[["34646ff4.d650c8"]]},{"id":"34646ff4.d650c8","type":"switch","z":"6e606c8c.1d90f4","name":"","property":"payload.idx","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"2","vt":"str"},{"t":"eq","v":"3","vt":"str"},{"t":"eq","v":"7","vt":"str"},{"t":"eq","v":"11","vt":"str"},{"t":"eq","v":"25","vt":"str"},{"t":"eq","v":"26","vt":"str"},{"t":"eq","v":"28","vt":"str"}],"checkall":"true","outputs":8,"x":244,"y":242.75,"wires":[["76a9d3b7.ba4a3c"],["740eafe7.9872a"],["8cdb8569.1aeb48"],["5b129500.10f22c"],["ee846645.68cc58"],["5d86bdd2.ad1e44"],["a63c976d.72cd58"],["7ab9a9e3.01dfb8"]]},{"id":"bcede382.3bb43","type":"ui_text","z":"6e606c8c.1d90f4","group":"ce7c077a.141d78","order":0,"width":0,"height":0,"name":"Bryter Lader","label":"Lader","format":"{{msg.payload.nvalue}}","layout":"col-center","x":890,"y":80,"wires":[]},{"id":"b272bbb4.883b18","type":"ui_text","z":"6e606c8c.1d90f4","group":"ce7c077a.141d78","order":0,"width":0,"height":0,"name":"Bryter VBV","label":"Varmtvann","format":"{{msg.payload.nvalue}}","layout":"col-center","x":892,"y":160,"wires":[]},{"id":"8cdb8569.1aeb48","type":"ui_text","z":"6e606c8c.1d90f4","group":"ce7c077a.141d78","order":0,"width":0,"height":0,"name":"Forbruk Lader","label":"Lader","format":"{{msg.payload.svalue1}} W","layout":"col-center","x":900,"y":220,"wires":[]},{"id":"5b129500.10f22c","type":"ui_text","z":"6e606c8c.1d90f4","group":"ce7c077a.141d78","order":0,"width":0,"height":0,"name":"Forbruk VBV","label":"Varmtvann","format":"{{msg.payload.svalue1}} W","layout":"col-center","x":890,"y":260,"wires":[]},{"id":"ee846645.68cc58","type":"ui_text","z":"6e606c8c.1d90f4","group":"45a414e0.39911c","order":0,"width":0,"height":0,"name":"Temp forpigg","label":"Forpigg","format":"{{msg.payload.svalue1}} C {{msg.payload.svalue2}} %","layout":"col-center","x":890,"y":300,"wires":[]},{"id":"5d86bdd2.ad1e44","type":"ui_text","z":"6e606c8c.1d90f4","group":"45a414e0.39911c","order":0,"width":0,"height":0,"name":"Temp akterlugar","label":"Akterlugar","format":"{{msg.payload.svalue1}} C {{msg.payload.svalue2}} %","layout":"col-center","x":900,"y":340,"wires":[]},{"id":"a63c976d.72cd58","type":"ui_text","z":"6e606c8c.1d90f4","group":"45a414e0.39911c","order":0,"width":0,"height":0,"name":"Temp bysse","label":"Bysse","format":"{{msg.payload.svalue1}} C {{msg.payload.svalue2}} %","layout":"col-center","x":890,"y":380,"wires":[]},{"id":"7ab9a9e3.01dfb8","type":"ui_text","z":"6e606c8c.1d90f4","group":"45a414e0.39911c","order":0,"width":0,"height":0,"name":"Temp motorrom","label":"Motorrom","format":"{{msg.payload.svalue1}} C {{msg.payload.svalue2}} %","layout":"col-center","x":900,"y":420,"wires":[]},{"id":"76a9d3b7.ba4a3c","type":"switch","z":"6e606c8c.1d90f4","name":"","property":"payload.nvalue","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"1","vt":"str"}],"checkall":"true","outputs":2,"x":430,"y":80,"wires":[["4c92465d.5e5138"],["25a4ccd8.556bf4"]]},{"id":"4c92465d.5e5138","type":"change","z":"6e606c8c.1d90f4","name":"Change payload to off","rules":[{"t":"set","p":"payload.nvalue","pt":"msg","to":"Off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":60,"wires":[["bcede382.3bb43"]]},{"id":"25a4ccd8.556bf4","type":"change","z":"6e606c8c.1d90f4","name":"Change payload to on","rules":[{"t":"set","p":"payload.nvalue","pt":"msg","to":"On","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":100,"wires":[["bcede382.3bb43"]]},{"id":"740eafe7.9872a","type":"switch","z":"6e606c8c.1d90f4","name":"","property":"payload.nvalue","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"1","vt":"str"}],"checkall":"true","outputs":2,"x":430,"y":160,"wires":[["8da18589.99f4f8"],["e89635a6.27a108"]]},{"id":"8da18589.99f4f8","type":"change","z":"6e606c8c.1d90f4","name":"Change payload to off","rules":[{"t":"set","p":"payload.nvalue","pt":"msg","to":"Off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":140,"wires":[["b272bbb4.883b18"]]},{"id":"e89635a6.27a108","type":"change","z":"6e606c8c.1d90f4","name":"Change payload to on","rules":[{"t":"set","p":"payload.nvalue","pt":"msg","to":"On","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":180,"wires":[["b272bbb4.883b18"]]},{"id":"1a510187.5598ae","type":"debug","z":"6e606c8c.1d90f4","name":"","active":true,"console":"false","complete":"false","x":282.5,"y":21,"wires":[]},{"id":"c6baa5e3.413fd","type":"mqtt-broker","z":"","broker":"192.168.1.76","port":"1883","clientid":"openplotter","usetls":false,"compatmode":true,"keepalive":"15","cleansession":true,"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":""},{"id":"ce7c077a.141d78","type":"ui_group","z":"","name":"AC System","tab":"c35e6707.e7b658","disp":true,"width":"3"},{"id":"45a414e0.39911c","type":"ui_group","z":"","name":"Temperatur","tab":"c35e6707.e7b658","disp":true,"width":"3"},{"id":"c35e6707.e7b658","type":"ui_tab","z":"","name":"Samson","icon":"dashboard"}]

In these flows you will probably find some usernames, password and ipadresses to hack my system, please dont Smile

In the next post I will try to make some illustrations about the Domoticz.

Here is a little info about Domoticz and the wireless sensors.
I also recommend to look at their website: www.domoticz.com (I use this system to control my home automation also).

The first I did was to add my hardware:
All 433mhz sensors are talking to my rfxcom dongle. (http://www.rfxcom.com)
This is only 1-way communication so useful for sensor who only sends data to my server.
Both switches are via Z-wave, I use z-wave since it have 2-way communication (I tell the charger to turn on, the charger send back info to the server that it has turned on).
A lot of the z-wave switches have also built in power meters.
The third "hardware" i have added is a MQTT client who sends info from Domoticz to Node-red.

[Image: Skjermbilde_2017-04-02_kl._21.43.23.png]

The rfxcom is just to add in the system, tell the system to accept new sensors and they come automatically.
You need to look wich sensors who are yours, and wich is your neighbor..

[Image: Skjermbilde_2017-04-02_kl._21.50.26.png]

You see also that here is the UZB1 added, who is the controller for Z-wave. And there you also see the devices the Z-wave nodes add, its the switch it self, powermeter and total usage.
The temp and humidity sensors I use is from Clasohlson and cost 109NOK, about 10eur each:
http://www.clasohlson.com/no/Temperaturg...er/36-1797

Both rfxcom and z-wave are supported direct to node-red, but then you need to program much more.. And I`m not a programmer Smile

I also dont think I have a roll or pitch sensor... For what do you use them? (I´m also new in sailing..)
Reply


Messages In This Thread
My Node-red - by dreuf - 2017-03-31, 08:35 PM
RE: My Node-red - by Sailoog - 2017-04-01, 05:41 PM
RE: My Node-red - by Saqqara - 2017-04-11, 04:30 PM
RE: My Node-red - by ddelorme - 2017-04-13, 11:14 AM
RE: My Node-red - by SkipperEarly - 2017-04-02, 08:24 AM
RE: My Node-red - by dreuf - 2017-04-02, 08:40 PM
RE: My Node-red - by ddelorme - 2017-04-03, 12:43 AM
RE: My Node-red - by dreuf - 2017-04-03, 09:39 AM
RE: My Node-red - by jim321 - 2017-07-12, 10:04 AM
RE: My Node-red - by jim321 - 2017-07-12, 12:13 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)