• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
My Node-red
#1
From another post here, it was asking about showing the different flows in Node-Red, so here is mine.

I use OP as a info screen by the chart-table about the boat and here is my dashboard:
[Image: Skjermbilde_2017-03-31_kl._21.14.32.png]

Apologize that most of the text is in Norwegian, but I think you understand what the boxes are anyways.

My nodes are divided in 5 sections.
1. Seildata (Saildata) is NMEA data from OP. (My chart plotter and so on was not powered when I did the screenshot, so not showing any info. I will also put in wind-datas as soon as I go up in the mast and mount the vindvane.
2. DC System, this is collecting datas from my Victron Energy BMV702 batterymonitor who sends the info to a Raspberry pi with the VE CCGX software, who resend it to my OP via MQTT.
3. Solcelle (Solarpanel), this collects info via my VictronEnergy MPPT 75/15 solar controller and goes the same way as the BMV702.
Both of these also upload datas to VictronEnergys vrm portal.
4. AC System, I have now mounted a Z-wave plugin module on my charger and waterheater, I`m not finished with this yet so will also mount one bigger Z-wave switch for the shore power to see all the power consumption for the shore power and also be able to turn it on/off remotely. This is then connected wireless to a UZB1 dongle and controlled by Domoticz (home automation system). From Domoticz the info goes via MQTT to my OP.
5. Temperatures, these are wireless sensors around the boat connected to a rfxcom wich is also controlled by Domoticz.
Here I`m missing the water temp who I will get from the NMEA datas on the boat.. Just need to figure out how..

Screenshots from the flows:

This is the standard flow that comes with OP, I have added the dept-tranducer and also put in a function node to get rid of some decimals on the numbers.. the course over ground had about 10 decimals I think.
[Image: Skjermbilde_2017-03-31_kl._21.26.12.png]
This is the DC and solar panel flow:
[Image: Skjermbilde_2017-03-31_kl._21.28.23.png]

And finally the AC and Temp flow:
[Image: Skjermbilde_2017-03-31_kl._21.29.37.png]
On the switch for the charger (Lader) and waterheater (vbv) I get the result 1 (on) and 0 (off), so I added a switch and a change node to change 1 to ON and 0 to Off to present it in the dashboard.

This is my flows, feel free to ask and comment..
These flows I think will be of constant change Wink

I have a complete SeatalkNG setup in my boat, so if someone have info about getting the datas from SeatalkNG I`m eager to hear.

I will aslo add tank meters for waste, water and diesel in the future, this will be done via a Arduino and is working in my testrig at the office, so just need to get it install in my boat.
  Reply
#2
That looks awesome!
could you publish your flow export? it could be really useful to other users.
thanks for sharing.
  Reply
#3
@ dreuf: IMPRESSIV !

Please elaborate on your wireless sensors - which ones are you using and is there somewhere a description how to integrate them?

Other question is how do you calibrate the rol/pitch data ? I carry the raspi with op on different boats and it is then velcro-taped to the desk.
Have not been successful to implement a simple calibration for roll & pitch to set the levels to neutral - but I am still learning with node-red and I am no programmer Wink
  Reply
#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: http://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
#5
This is my node-red in progress i have 2 rpi3 1 running an older version of 0.09.0 with imu, bmp180, and 2 1w-sensors and one running pico-ups and a pi sense hat. this is the flow from the second.
[
Code:
{"id":"ad773e6c.c040d","type":"tab","label":"openplotter"},{"id":"83ebf205.9cf04","type":"tab","label":"system"},{"id":"72ac4338.c8385c","type":"websocket-listener","z":"ad773e6c.c040d","path":"ws://openplotter:3000/signalk/v1/stream","wholemsg":"false"},{"id":"d431fc05.6c8748","type":"ui_group","z":"","name":"Group 1","tab":"2228987b.a4ebd","order":1,"disp":true,"width":"8"},{"id":"ce804676.cbb9e","type":"ui_group","z":"","name":"Weather","tab":"4c2b5852.80dfe","order":1,"disp":true,"width":"16"},{"id":"96a306f6.b3486","type":"ui_group","z":"","name":"Group 2","tab":"2228987b.a4ebd","order":2,"disp":true,"width":"9"},{"id":"2228987b.a4ebd","type":"ui_tab","z":"","name":"Navigation","icon":"dashboard","order":2},{"id":"4c2b5852.80dfe","type":"ui_tab","z":"","name":"Weather","icon":"dashboard","order":1},{"id":"b3587257.a10b2","type":"ui_tab","z":"","name":"System","icon":"dashboard","order":3},{"id":"a09c8854.c07c9","type":"ui_group","z":"","name":"System","tab":"b3587257.a10b2","order":1,"disp":true,"width":"12"},{"id":"60d2bfd5.9b7738","type":"ui_base","theme":{"name":"theme-dark","lightTheme":{"default":"#0094CE","baseColor":"#0094CE","baseFont":"Helvetica Neue","edited":false},"darkTheme":{"default":"#097479","baseColor":"#097479","baseFont":"Helvetica Neue","edited":true,"reset":false},"customTheme":{"name":"Untitled Theme 1","default":"#4B7930","baseColor":"#4B7930","baseFont":"Helvetica Neue"},"themeState":{"base-color":{"default":"#0094CE","value":"#0094CE","edited":false},"page-titlebar-backgroundColor":{"value":"#097479","edited":false},"page-backgroundColor":{"value":"#111111","edited":false},"page-sidebar-backgroundColor":{"value":"#000000","edited":false},"group-textColor":{"value":"#10cfd8","edited":false},"group-borderColor":{"value":"#555555","edited":false},"group-backgroundColor":{"value":"#333333","edited":false},"widget-textColor":{"value":"#eeeeee","edited":false},"widget-backgroundColor":{"value":"#097479","edited":false},"widget-borderColor":{"value":"#333333","edited":false}}},"site":{"name":"Node-RED Dashboard","hideToolbar":"false","allowSwipe":"false","dateFormat":"DD/MM/YYYY","sizes":{"sx":48,"sy":48,"gx":6,"gy":6,"cx":6,"cy":6,"px":0,"py":0}}},{"id":"856cb5e9.dcebc8","type":"websocket in","z":"ad773e6c.c040d","name":"openplotter","server":"72ac4338.c8385c","client":"","x":90,"y":80,"wires":[["58ad6945.29ed58","3d44a77e.20399"]]},{"id":"58ad6945.29ed58","type":"json","z":"ad773e6c.c040d","name":"","x":64.16664123535156,"y":330,"wires":[["ac5c27ba.10caa8","6d23f4f0.c8b5ac","c3a23ac4.eff46","2df3e4fa.c305fc","e03cca87.cde858","38194dc5.0e010a","d4669c92.508d68","6963caf3.774b1c","7d4bf1cb.5abc2","fac9923d.10c41","fc84cccf.b90698","8a4def95.380fe8"]]},{"id":"fac9923d.10c41","type":"jsonpath","z":"ad773e6c.c040d","expression":"$.updates..values[?(@.path==\"navigation.courseOverGroundTrue\")]..value","split":true,"name":"navigation.courseOverGroundTrue","x":380,"y":180,"wires":[["1a793e91.8573a9"]]},{"id":"ac5c27ba.10caa8","type":"jsonpath","z":"ad773e6c.c040d","expression":"$.updates..values[?(@.path==\"navigation.speedOverGround\")]..value","split":true,"name":"navigation.speedOverGround","x":370,"y":260,"wires":[["964c8878.0db3a8"]]},{"id":"6d23f4f0.c8b5ac","type":"jsonpath","z":"ad773e6c.c040d","expression":"$.updates..values[?(@.path==\"navigation.position\")]..latitude","split":true,"name":"navigation.position.latitude","x":360,"y":300,"wires":[["5751d54e.580ac4","9c60395b.896448"]]},{"id":"7d4bf1cb.5abc2","type":"jsonpath","z":"ad773e6c.c040d","expression":"$.updates..values[?(@.path==\"navigation.position\")]..longitude","split":true,"name":"navigation.position.longitude","x":360,"y":340,"wires":[["aa5aa325.7675f","624288f4.5e9f48"]]},{"id":"c3a23ac4.eff46","type":"jsonpath","z":"ad773e6c.c040d","expression":"$.updates..values[?(@.path==\"environment.outside.pressure\")]..value","split":true,"name":"Environment Pressure","x":340,"y":400,"wires":[["4672ae78.0883f","db147abc.2f8718"]]},{"id":"2df3e4fa.c305fc","type":"jsonpath","z":"ad773e6c.c040d","expression":"$.updates..values[?(@.path==\"environment.inside.temperature\")]..value","split":true,"name":"temperature","x":310,"y":440,"wires":[["f991b1e7.ef9748","9c5b7428.6582e8"]]},{"id":"db147abc.2f8718","type":"function","z":"ad773e6c.c040d","name":"Pa2hPa","func":"msg.payload = Number((msg.payload / 100).toFixed(2));\nreturn msg;","outputs":"1","noerr":0,"x":520,"y":420,"wires":[["315e1cc1.968594","f90ec44.162e238","bea6c800.841d8"]]},{"id":"f991b1e7.ef9748","type":"function","z":"ad773e6c.c040d","name":"KelvintC2","func":"msg.payload=((msg.payload - 273.15).toFixed(1));\nreturn msg;","outputs":"1","noerr":0,"x":520,"y":580,"wires":[["d6c718f7.0949e","ff26732b.c64298"]]},{"id":"1a793e91.8573a9","type":"function","z":"ad773e6c.c040d","name":"RadtoDeg","func":"msg.payload=((msg.payload * 57.2957795).toFixed(1));\nreturn msg;","outputs":"1","noerr":0,"x":690,"y":180,"wires":[["5406500b.87d18","a84a2b20.2bac18"]]},{"id":"a03d5d52.229058","type":"debug","z":"ad773e6c.c040d","name":"","active":false,"console":"false","complete":"payload","x":830,"y":380,"wires":[]},{"id":"32c714cb.af6c94","type":"function","z":"ad773e6c.c040d","name":"RadtoDeg","func":"msg.payload=((msg.payload * 57.2957795).toFixed(1));\nreturn msg;","outputs":"1","noerr":0,"x":690,"y":100,"wires":[["409d93e7.e0e7ec","fe0e75cd.2e3708","c75f14ac.80d1f8"]]},{"id":"e03cca87.cde858","type":"jsonpath","z":"ad773e6c.c040d","expression":"$.updates..values[?(@.path==\"navigation.attitude.roll\")]..value","split":true,"name":"Roll","x":290,"y":100,"wires":[["32c714cb.af6c94"]]},{"id":"38194dc5.0e010a","type":"jsonpath","z":"ad773e6c.c040d","expression":"$.updates..values[?(@.path==\"navigation.attitude.pitch\")]..value","split":true,"name":"pitch","x":290,"y":140,"wires":[["5b015c35.d1c47c"]]},{"id":"5b015c35.d1c47c","type":"function","z":"ad773e6c.c040d","name":"RadtoDeg","func":"msg.payload=((msg.payload * 57.2957795).toFixed(1));\nreturn msg;","outputs":"1","noerr":0,"x":690,"y":140,"wires":[["a8565431.372598","ea003035.f49c8","c3049964.134088"]]},{"id":"d4669c92.508d68","type":"jsonpath","z":"ad773e6c.c040d","expression":"$.updates..values[?(@.path==\"navigation.headingMagnetic\")]..value","split":true,"name":"navigation.headingMagnetic","x":360,"y":220,"wires":[["5f19c749.5d02f"]]},{"id":"5f19c749.5d02f","type":"function","z":"ad773e6c.c040d","name":"RadtoDeg","func":"msg.payload=((msg.payload * 57.2957795).toFixed(1));\nreturn msg;","outputs":"1","noerr":0,"x":690,"y":220,"wires":[["4404eb90.8804ec","88997d54.254c7"]]},{"id":"6963caf3.774b1c","type":"jsonpath","z":"ad773e6c.c040d","expression":"$.updates..values[?(@.path==\"environment.inside.humidity\")]..value","split":true,"name":"InsideHumidity","x":320,"y":480,"wires":[["671b9af7.80fee4"]]},{"id":"671b9af7.80fee4","type":"function","z":"ad773e6c.c040d","name":"round","func":"msg.payload=((msg.payload).toFixed(1));\nreturn msg;","outputs":1,"noerr":0,"x":510,"y":640,"wires":[["f21fc4d3.b2ba58","3f8480c4.28e988"]]},{"id":"5751d54e.580ac4","type":"function","z":"ad773e6c.c040d","name":"roundx5","func":"msg.payload=((msg.payload).toFixed(5));\nreturn msg;","outputs":1,"noerr":0,"x":700,"y":300,"wires":[["979bfe6f.7a5ca","83e4abd5.c97ad8","9929e299.a35188"]]},{"id":"aa5aa325.7675f","type":"function","z":"ad773e6c.c040d","name":"roundx5","func":"msg.payload=((msg.payload).toFixed(5));\nreturn msg;","outputs":1,"noerr":0,"x":700,"y":340,"wires":[["9c0b4622.437fd8","9d46f1a1.425dc8","390f0dab.def10a"]]},{"id":"964c8878.0db3a8","type":"function","z":"ad773e6c.c040d","name":"mstoknts","func":"msg.payload=((msg.payload * 1.94384).toFixed(1));\nreturn msg;","outputs":1,"noerr":0,"x":700,"y":260,"wires":[["e62f8235.e3eba","62b13a88.b314dc","7c6352cb.99a96c"]]},{"id":"9c5b7428.6582e8","type":"debug","z":"ad773e6c.c040d","name":"","active":false,"console":"false","complete":"payload","x":650,"y":500,"wires":[]},{"id":"979bfe6f.7a5ca","type":"debug","z":"ad773e6c.c040d","name":"","active":false,"console":"false","complete":"payload","x":1030,"y":300,"wires":[]},{"id":"409d93e7.e0e7ec","type":"ui_text","z":"ad773e6c.c040d","group":"d431fc05.6c8748","order":1,"width":"4","height":"1","name":"","label":"Roll","format":"{{msg.payload}}","layout":"row-left","x":870,"y":100,"wires":[]},{"id":"a8565431.372598","type":"ui_text","z":"ad773e6c.c040d","group":"d431fc05.6c8748","order":2,"width":"4","height":"1","name":"","label":"Pitch","format":"{{msg.payload}}","layout":"row-left","x":870,"y":140,"wires":[]},{"id":"f21fc4d3.b2ba58","type":"ui_text","z":"ad773e6c.c040d","group":"ce804676.cbb9e","order":3,"width":"4","height":"1","name":"","label":"humdity","format":"{{msg.payload}} %","layout":"row-left","x":660,"y":640,"wires":[]},{"id":"d6c718f7.0949e","type":"ui_text","z":"ad773e6c.c040d","group":"ce804676.cbb9e","order":1,"width":"4","height":"1","name":"","label":"outSide Temperature","format":"{{msg.payload}}C","layout":"row-left","x":700,"y":600,"wires":[]},{"id":"e62f8235.e3eba","type":"ui_text","z":"ad773e6c.c040d","group":"d431fc05.6c8748","order":4,"width":0,"height":0,"name":"","label":"Speed","format":"{{msg.payload}}","layout":"row-left","x":870,"y":260,"wires":[]},{"id":"62b13a88.b314dc","type":"ui_gauge","z":"ad773e6c.c040d","name":"","group":"96a306f6.b3486","order":3,"width":"4","height":"4","gtype":"gage","title":"Speed","label":"Knt","format":"{{value}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"x":990,"y":260,"wires":[]},{"id":"fe0e75cd.2e3708","type":"ui_gauge","z":"ad773e6c.c040d","name":"","group":"d431fc05.6c8748","order":5,"width":"4","height":"4","gtype":"gage","title":"Roll","label":"Deg","format":"{{value}}","min":"-50","max":"50","colors":["#c03535","#00ad00","#ca3838"],"seg1":"-45","seg2":"45","x":990,"y":100,"wires":[]},{"id":"ea003035.f49c8","type":"ui_gauge","z":"ad773e6c.c040d","name":"","group":"d431fc05.6c8748","order":6,"width":"4","height":"4","gtype":"gage","title":"Pitch","label":"Deg","format":"{{value}}","min":"-50","max":"50","colors":["#c23636","#00af00","#ca3838"],"x":990,"y":140,"wires":[]},{"id":"4404eb90.8804ec","type":"ui_gauge","z":"ad773e6c.c040d","name":"","group":"96a306f6.b3486","order":5,"width":"4","height":"4","gtype":"compass","title":"Bering","label":"Deg","format":"{{value}}","min":0,"max":"360","colors":["#00b500","#e6e600","#ca3838"],"x":990,"y":220,"wires":[]},{"id":"5406500b.87d18","type":"ui_gauge","z":"ad773e6c.c040d","name":"","group":"96a306f6.b3486","order":4,"width":"4","height":"4","gtype":"compass","title":"Course","label":"Deg","format":"{{value}}","min":0,"max":"360","colors":["#00b500","#e6e600","#ca3838"],"x":990,"y":180,"wires":[]},{"id":"f90ec44.162e238","type":"ui_text","z":"ad773e6c.c040d","group":"ce804676.cbb9e","order":0,"width":"0","height":"0","name":"","label":"Pressure","format":"{{msg.payload}} kPa","layout":"col-center","x":700,"y":420,"wires":[]},{"id":"624288f4.5e9f48","type":"debug","z":"ad773e6c.c040d","name":"","active":false,"console":"false","complete":"true","x":540.6363525390625,"y":340.727294921875,"wires":[]},{"id":"9c0b4622.437fd8","type":"debug","z":"ad773e6c.c040d","name":"","active":false,"console":"false","complete":"payload","x":1030,"y":340,"wires":[]},{"id":"9c60395b.896448","type":"debug","z":"ad773e6c.c040d","name":"","active":false,"console":"false","complete":"payload","x":550,"y":300,"wires":[]},{"id":"83e4abd5.c97ad8","type":"ui_text","z":"ad773e6c.c040d","group":"96a306f6.b3486","order":0,"width":0,"height":0,"name":"","label":"lat","format":"{{msg.payload}}","layout":"row-spread","x":870,"y":300,"wires":[]},{"id":"9d46f1a1.425dc8","type":"ui_text","z":"ad773e6c.c040d","group":"96a306f6.b3486","order":0,"width":0,"height":0,"name":"","label":"long","format":"{{msg.payload}}","layout":"row-spread","x":870,"y":340,"wires":[]},{"id":"315e1cc1.968594","type":"ui_chart","z":"ad773e6c.c040d","name":"","group":"ce804676.cbb9e","order":0,"width":0,"height":0,"label":"","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"linear","nodata":"","ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"3600","removeOlderUnit":"86400","cutout":"","colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"x":690,"y":380,"wires":[[],["a03d5d52.229058"]]},{"id":"ff26732b.c64298","type":"freeboard","z":"ad773e6c.c040d","name":"inSidetemp","x":850,"y":600,"wires":[]},{"id":"bea6c800.841d8","type":"freeboard","z":"ad773e6c.c040d","name":"Pressure","x":940,"y":520,"wires":[]},{"id":"3f8480c4.28e988","type":"freeboard","z":"ad773e6c.c040d","name":"inSidehumid","x":830,"y":640,"wires":[]},{"id":"e9dae696.f2afa","type":"inject","z":"83ebf205.9cf04","name":"","topic":"","payload":"","payloadType":"date","repeat":"10","crontab":"","once":true,"x":70,"y":240,"wires":[["619efef6.aedf","154aaf32.710451","1847084f.d09f68","d90572ed.405ff8","df11089a.539ee","64d0c926.b6ee28"]]},{"id":"619efef6.aedf","type":"exec","z":"83ebf205.9cf04","command":"vcgencmd","addpay":false,"append":"measure_temp","useSpawn":"","timer":"","name":"getCPUtemp","x":250,"y":400,"wires":[["1754a07f.1a708","72be8f3.de330f","84eed03a.587f28"],[],[]]},{"id":"ecf5d4c5.fabef","type":"debug","z":"83ebf205.9cf04","name":"Debug showSK","active":false,"console":"false","complete":"payload","x":563,"y":168,"wires":[]},{"id":"1754a07f.1a708","type":"function","z":"83ebf205.9cf04","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":490,"y":320,"wires":[["c7ddb840.05bd","9a2e2662.de723"]]},{"id":"c7ddb840.05bd","type":"udp out","z":"83ebf205.9cf04","name":"sendSK","addr":"localhost","iface":"","port":"55559","ipv":"udp4","outport":"","base64":false,"multicast":"false","x":720,"y":340,"wires":[]},{"id":"72be8f3.de330f","type":"function","z":"83ebf205.9cf04","name":"systemp","func":"cpu_temp = parseFloat(msg.payload.replace(\"temp=\",\"\").replace(\"'C\\n\",\"\"));\nmsg.payload = ((cpu_temp).toFixed(0));\nreturn msg;","outputs":1,"noerr":0,"x":480,"y":360,"wires":[["d8a6eada.71b35","d434f304.a45e48","2f240695.e60b3a"]]},{"id":"2f240695.e60b3a","type":"ui_gauge","z":"83ebf205.9cf04","name":"","group":"a09c8854.c07c9","order":6,"width":"6","height":"6","gtype":"gage","title":"Temp","label":"Temp","format":"{{value}}","min":"22","max":"85","colors":["#171ce5","#e6e600","#ca3838"],"seg1":"","seg2":"","x":859.0908813476562,"y":349.0909118652344,"wires":[]},{"id":"154aaf32.710451","type":"exec","z":"83ebf205.9cf04","command":"vcgencmd","addpay":false,"append":"measure_clock arm","useSpawn":"","timer":"","name":"getCPUspeed","x":260,"y":460,"wires":[["406510ed.7526d"],[],[]]},{"id":"406510ed.7526d","type":"function","z":"83ebf205.9cf04","name":"sysspeed","func":"cpu_speed = parseFloat(msg.payload.replace(\"frequency(45)=\",\"\").replace(\"'C\\n\",\"\"));\nmsg.payload = cpu_speed / 1000000000;\nreturn msg;","outputs":1,"noerr":0,"x":460,"y":440,"wires":[["e6800311.b8fa88","3c1ca983.06af8e"]]},{"id":"9a2e2662.de723","type":"debug","z":"83ebf205.9cf04","name":"Debug showSK","active":false,"console":"false","complete":"payload","x":820,"y":300,"wires":[]},{"id":"3c1ca983.06af8e","type":"ui_gauge","z":"83ebf205.9cf04","name":"","group":"a09c8854.c07c9","order":7,"width":"6","height":"6","gtype":"gage","title":"CPU Speed","label":"GHz","format":"{{value}}","min":".4","max":"1.2","colors":["#171ce5","#e6e600","#ca3838"],"x":770,"y":420,"wires":[]},{"id":"9929e299.a35188","type":"freeboard","z":"ad773e6c.c040d","name":"latitude","x":1188.75,"y":302.5,"wires":[]},{"id":"a84a2b20.2bac18","type":"freeboard","z":"ad773e6c.c040d","name":"courseoverground","x":1170,"y":180,"wires":[]},{"id":"c3049964.134088","type":"freeboard","z":"ad773e6c.c040d","name":"pitch","x":1130,"y":140,"wires":[]},{"id":"88997d54.254c7","type":"freeboard","z":"ad773e6c.c040d","name":"headingmag","x":1150,"y":220,"wires":[]},{"id":"7c6352cb.99a96c","type":"freeboard","z":"ad773e6c.c040d","name":"speedoverground","x":1150,"y":260,"wires":[]},{"id":"390f0dab.def10a","type":"freeboard","z":"ad773e6c.c040d","name":"longitude","x":1192.5,"y":340,"wires":[]},{"id":"c75f14ac.80d1f8","type":"freeboard","z":"ad773e6c.c040d","name":"roll","x":1130,"y":100,"wires":[]},{"id":"e6800311.b8fa88","type":"ui_chart","z":"83ebf205.9cf04","name":"CPUSpeed","group":"a09c8854.c07c9","order":12,"width":"6","height":"3","label":"CPUspeed","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"linear","nodata":"","ymin":"","ymax":"","removeOlder":"4","removeOlderPoints":"500","removeOlderUnit":"3600","cutout":"","colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"x":710,"y":460,"wires":[[],[]]},{"id":"d434f304.a45e48","type":"ui_chart","z":"83ebf205.9cf04","name":"Systemp","group":"a09c8854.c07c9","order":8,"width":"6","height":"4","label":"Systemp","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"basis","nodata":"","ymin":"","ymax":"","removeOlder":"4","removeOlderPoints":"500","removeOlderUnit":"3600","cutout":"","colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"x":895.4545288085938,"y":393.6363525390625,"wires":[[],[]]},{"id":"1847084f.d09f68","type":"exec","z":"83ebf205.9cf04","command":"i2cget -y 1 0x69 0x0a w","addpay":false,"append":"","useSpawn":"","timer":"","name":"getCPUmv","x":250,"y":340,"wires":[["29cca1e8.b55c86"],[],[]]},{"id":"29cca1e8.b55c86","type":"function","z":"83ebf205.9cf04","name":"sysv","func":"cpu_v = parseFloat(msg.payload.replace(\"0x\",\"\").replace(\"'C\\n\",\"\"));\nmsg.payload = cpu_v /100;\nreturn msg;","outputs":1,"noerr":0,"x":470,"y":280,"wires":[["2f50fa6d.ef1e4e","7930fbbe.11dfcc"]]},{"id":"7930fbbe.11dfcc","type":"ui_gauge","z":"83ebf205.9cf04","name":"","group":"a09c8854.c07c9","order":3,"width":"6","height":"6","gtype":"gage","title":"CPU volts","label":"V","format":"{{value}}","min":"4.9","max":"5.3","colors":["#171ce5","#e6e600","#ca3838"],"x":750,"y":260,"wires":[]},{"id":"5a5b9941.8baac","type":"ui_gauge","z":"83ebf205.9cf04","name":"","group":"a09c8854.c07c9","order":4,"width":"6","height":"6","gtype":"donut","title":"Bat volts","label":"batVolts","format":"{{value}}","min":"3.4","max":"4.15","colors":["#c43636","#2700ff","#38ca38"],"x":744,"y":224,"wires":[]},{"id":"d6da5a95.4c3aa8","type":"function","z":"83ebf205.9cf04","name":"sysv","func":"cpu_v = parseFloat(msg.payload.replace(\"0x\",\"\").replace(\"'C\\n\",\"\"));\nmsg.payload = cpu_v /100;\nreturn msg;","outputs":1,"noerr":0,"x":470,"y":240,"wires":[["5a5b9941.8baac","28f7c81f.48d368"]]},{"id":"d90572ed.405ff8","type":"exec","z":"83ebf205.9cf04","command":"i2cget -y 1 0x69 0x08 w","addpay":false,"append":"","useSpawn":"","timer":"","name":"getbatmv","x":240,"y":280,"wires":[["d6da5a95.4c3aa8","d8ec996b.ce6068"],[],[]]},{"id":"28f7c81f.48d368","type":"ui_chart","z":"83ebf205.9cf04","name":"Systembatv","group":"a09c8854.c07c9","order":9,"width":"6","height":"4","label":"Bat Volts","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"linear","nodata":"","ymin":"","ymax":"","removeOlder":"4","removeOlderPoints":"500","removeOlderUnit":"3600","cutout":"","colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"x":750,"y":200,"wires":[[],[]]},{"id":"2f50fa6d.ef1e4e","type":"ui_chart","z":"83ebf205.9cf04","name":"Sysv","group":"a09c8854.c07c9","order":11,"width":"6","height":"4","label":"sysv","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"linear","nodata":"","ymin":"","ymax":"","removeOlder":"4","removeOlderPoints":"","removeOlderUnit":"3600","cutout":"","colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"x":741,"y":289,"wires":[[],[]]},{"id":"df11089a.539ee","type":"exec","z":"83ebf205.9cf04","command":"i2cget -y 1 0x69 0x00 b","addpay":false,"append":"","useSpawn":"","timer":"","name":"getPowersource","x":260,"y":226,"wires":[["908990bd.b10d6"],[],[]]},{"id":"d5096c77.724568","type":"debug","z":"83ebf205.9cf04","name":"DBG","active":false,"console":"false","complete":"payload","x":597.1111450195312,"y":131.11109161376953,"wires":[]},{"id":"908990bd.b10d6","type":"function","z":"83ebf205.9cf04","name":"power","func":"if (msg.payload == 0x01) {\n    msg.payload = \"Main\";\n  } else {\n        msg.payload = \"UPS\";\n        }\nreturn msg;","outputs":1,"noerr":0,"x":459,"y":205,"wires":[["df51a2c3.033d6"]]},{"id":"df51a2c3.033d6","type":"ui_text","z":"83ebf205.9cf04","group":"a09c8854.c07c9","order":2,"width":0,"height":0,"name":"","label":"Power Source: ","format":"{{msg.payload}}","layout":"row-left","x":757,"y":154,"wires":[]},{"id":"4672ae78.0883f","type":"debug","z":"ad773e6c.c040d","name":"","active":false,"console":"false","complete":"true","x":530,"y":380,"wires":[]},{"id":"64d0c926.b6ee28","type":"exec","z":"83ebf205.9cf04","command":"i2cget -y 1 0x69 0x0c w","addpay":false,"append":"","useSpawn":"","timer":"","name":"getBatTime","x":250,"y":171,"wires":[["2624fa55.7055f6","ecf5d4c5.fabef"],[],[]]},{"id":"19b961c7.5f06de","type":"debug","z":"83ebf205.9cf04","name":"Debug showSK","active":false,"console":"false","complete":"payload","x":820,"y":560,"wires":[]},{"id":"c939fe0.61bbd","type":"ui_chart","z":"83ebf205.9cf04","name":"Systembatv","group":"a09c8854.c07c9","order":10,"width":"6","height":"4","label":"Bat Main Volts","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"linear","nodata":"","ymin":"11.7","ymax":"12.7","removeOlder":"4","removeOlderPoints":"500","removeOlderUnit":"3600","cutout":"","colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"x":839,"y":48,"wires":[[],[]]},{"id":"3f35e3ae.0f01b4","type":"ui_gauge","z":"83ebf205.9cf04","name":"","group":"a09c8854.c07c9","order":5,"width":"6","height":"6","gtype":"donut","title":"Bat Main volts","label":"batMainVolts","format":"{{value}}","min":"11.5","max":"12.5","colors":["#171ce5","#e6e600","#ca3838"],"x":730,"y":82,"wires":[]},{"id":"2624fa55.7055f6","type":"function","z":"83ebf205.9cf04","name":"extv","func":"ext_v = parseFloat(msg.payload.replace(\"0x\",\"\").replace(\"'C\\n\",\"\"));\nmsg.topic = \"raw\"\nmsg.payload = (ext_v / 100);\nif (ext_v > 0){\nvar extstat = {payload:\"Battery On\"};\n    }else{ \nvar extstat ={payload:\"Battery Off\"};\n    }\n\nreturn [[msg],[extstat]];","outputs":"2","noerr":0,"x":335,"y":108,"wires":[["d5096c77.724568","c939fe0.61bbd","fdc7cc60.441358","3f35e3ae.0f01b4"],["2ac5f068.a0a9e8","d5096c77.724568"]]},{"id":"2ac5f068.a0a9e8","type":"ui_text","z":"83ebf205.9cf04","group":"a09c8854.c07c9","order":1,"width":0,"height":0,"name":"","label":"Ext Power","format":"{{msg.payload}}","layout":"row-left","x":734.5,"y":119,"wires":[]},{"id":"a2e959ff.576ac","type":"debug","z":"83ebf205.9cf04","name":"Debug","active":false,"console":"false","complete":"true","x":664,"y":20,"wires":[]},{"id":"84eed03a.587f28","type":"debug","z":"83ebf205.9cf04","name":"Debug showSK","active":false,"console":"false","complete":"payload","x":469,"y":407,"wires":[]},{"id":"fdc7cc60.441358","type":"function","z":"83ebf205.9cf04","name":"settopic","func":"msg.topic = \"smoth\"\nreturn [msg];","outputs":"1","noerr":0,"x":532,"y":25,"wires":[["c939fe0.61bbd","a2e959ff.576ac"]]},{"id":"3d44a77e.20399","type":"debug","z":"ad773e6c.c040d","name":"","active":false,"console":"false","complete":"payload","x":450,"y":20,"wires":[]},{"id":"d8a6eada.71b35","type":"debug","z":"83ebf205.9cf04","name":"Debug showSK","active":false,"console":"false","complete":"payload","x":980,"y":260,"wires":[]},{"id":"d8ec996b.ce6068","type":"debug","z":"83ebf205.9cf04","name":"Debug showSK","active":false,"console":"false","complete":"payload","x":588,"y":256,"wires":[]},{"id":"8a4def95.380fe8","type":"jsonpath","z":"ad773e6c.c040d","expression":"$.updates..values[?(@.path==\"environment.inside.mainCabin.temperature\")]..value","split":true,"name":"mainCabin","x":250,"y":640,"wires":[["5c3cbf45.ceb45","a87a3d5c.df8078"]]},{"id":"a376206b.c68cd","type":"ui_text","z":"ad773e6c.c040d","group":"ce804676.cbb9e","order":3,"width":"4","height":"1","name":"","label":"MainCabin","format":"{{msg.payload}} C","layout":"row-left","x":837,"y":820,"wires":[]},{"id":"fc84cccf.b90698","type":"jsonpath","z":"ad773e6c.c040d","expression":"$.updates..values[?(@.path==\"environment.water.temperature\")]..value","split":true,"name":"watertemp","x":350,"y":580,"wires":[["7d3d63e4.1727d4"]]},{"id":"88d7a85b.bfec8","type":"ui_text","z":"ad773e6c.c040d","group":"ce804676.cbb9e","order":3,"width":"4","height":"1","name":"","label":"Watertemp","format":"{{msg.payload}} C","layout":"row-left","x":1010,"y":680,"wires":[]},{"id":"5c3cbf45.ceb45","type":"function","z":"ad773e6c.c040d","name":"KelvintC2","func":"msg.payload=((msg.payload - 273.15).toFixed(1));\nreturn msg;","outputs":"1","noerr":0,"x":520,"y":720,"wires":[["a376206b.c68cd"]]},{"id":"7d3d63e4.1727d4","type":"function","z":"ad773e6c.c040d","name":"KelvintC2","func":"msg.payload=((msg.payload - 273.15).toFixed(1));\nreturn msg;","outputs":"1","noerr":0,"x":980,"y":600,"wires":[["88d7a85b.bfec8"]]},{"id":"a87a3d5c.df8078","type":"debug","z":"ad773e6c.c040d","name":"","active":false,"console":"false","complete":"false","x":340,"y":820,"wires":[]}]

this is the flow that transmits the 1w-Sensors from the first machine to the second.


Code:
[{"id":"2ba969d4.1f866e","type":"jsonpath","z":"bebccf83.6d5ac8","expression":"$.updates..values[?(@.path==\"environment.water.temperature\")]..value","split":true,"name":"outside temp","x":362.8333740234375,"y":702.9999694824219,"wires":[["7916d3f.4801fac","74bf2c48.ba9c14"]]},{"id":"7916d3f.4801fac","type":"function","z":"bebccf83.6d5ac8","name":"KelvintC2","func":"msg.payload=((msg.payload - 273.15).toFixed(1));\nreturn msg;","outputs":"1","noerr":0,"x":519.8333740234375,"y":703,"wires":[["16bcbee9.1f6769","a3bbb7d4.b91fc8","68659783.b99a4"]]},{"id":"74bf2c48.ba9c14","type":"function","z":"bebccf83.6d5ac8","name":"wtemp","func":"watertemp = msg.payload;\n// watertemp = watertemp + 273.15;\nmsg.payload = '{\\\"updates\\\": [{\\\"source\\\": {\\\"type\\\": \\\"waterTEMP\\\",\\\"src\\\" : \\\"OP2\\\"},\\\"values\\\":[{\\\"path\\\": \\\"environment.water.temperature\\\",\\\"value\\\":'+watertemp+'}]}]}\\n';\nreturn msg;","outputs":1,"noerr":0,"x":622.6832885742188,"y":685.2332458496094,"wires":[["7372829b.a2837c","19c692b0.e96395"]]},{"id":"19c692b0.e96395","type":"udp out","z":"bebccf83.6d5ac8","name":"sendSK","addr":"openplotter","iface":"","port":"55561","ipv":"udp4","outport":"","base64":false,"multicast":"false","x":707.6832885742188,"y":933.6332702636719,"wires":[]},{"id":"16bcbee9.1f6769","type":"ui_text","z":"bebccf83.6d5ac8","group":"9fd50d6c.20db1","order":2,"width":"4","height":"1","name":"","label":"outside temp","format":"{{msg.payload}} C","layout":"row-left","x":725.8333740234375,"y":720,"wires":[]},{"id":"a3bbb7d4.b91fc8","type":"freeboard","z":"bebccf83.6d5ac8","name":"outSidetemp","x":885.8333740234375,"y":720,"wires":[]},{"id":"1a47b706.59b899","type":"jsonpath","z":"bebccf83.6d5ac8","expression":"$.updates..values[?(@.path==\"environment.inside.mainCabin.temperature\")]..value","split":true,"name":"temperature","x":365.8333740234375,"y":766,"wires":[["aa31f4cc.25aaa","6a8fbbbe.8cfd64"]]},{"id":"6a8fbbbe.8cfd64","type":"function","z":"bebccf83.6d5ac8","name":"cabintemp","func":"cabintemp = msg.payload;\n// watertemp = watertemp + 273.15;\nmsg.payload = '{\\\"updates\\\": [{\\\"source\\\": {\\\"type\\\": \\\"cabinTEMP\\\",\\\"src\\\" : \\\"OP2\\\"},\\\"values\\\":[{\\\"path\\\": \\\"environment.inside.mainCabin.temperature\\\",\\\"value\\\":'+cabintemp+'}]}]}\\n';\nreturn msg;","outputs":1,"noerr":0,"x":318.3500061035156,"y":952.3832702636719,"wires":[["92594560.db685","1c0d7c5a.0748ac"]]},{"id":"1c0d7c5a.0748ac","type":"udp out","z":"bebccf83.6d5ac8","name":"sendSK","addr":"openplotter","iface":"","port":"55561","ipv":"udp4","outport":"","base64":false,"multicast":"false","x":497.3500061035156,"y":997.38330078125,"wires":[]},{"id":"aa31f4cc.25aaa","type":"function","z":"bebccf83.6d5ac8","name":"KelvintC2","func":"msg.payload=((msg.payload - 273.15).toFixed(1));\nreturn msg;","outputs":"1","noerr":0,"x":559.8333740234375,"y":767.9999694824219,"wires":[["b037edd2.4b8e2","4afe72f0.571e04","9877b154.2dcad"]]},{"id":"b037edd2.4b8e2","type":"ui_text","z":"bebccf83.6d5ac8","group":"9fd50d6c.20db1","order":1,"width":"4","height":"1","name":"","label":"inside temp","format":"{{msg.payload}} C","layout":"row-left","x":725.8333740234375,"y":760,"wires":[]},{"id":"9fd50d6c.20db1","type":"ui_group","z":"","name":"Weather","tab":"41035547.cead3c","order":1,"disp":true,"width":"16"},{"id":"41035547.cead3c","type":"ui_tab","z":"","name":"Weather","icon":"dashboard","order":1}]
  Reply
#6
Do you also have some screenshots from the flows?
And a tip:
When you post a reply, use the full editor and click on "code" at the right side of the menubar. Add the flow there, its easier to separate what is text and what is code Smile

Like this:
Code:
This is just a test of the code
  Reply
#7
(03-31-2017, 03:35 PM)dreuf Wrote: I also dont think I have a roll or pitch sensor... For what do you use them? (I´m also new in sailing..)
The main reason to have an IMU is to have a proper digital magnetic compass. The other measurements are a bonus. Smile
  Reply
#8
(04-11-2017, 11:30 AM)Saqqara Wrote:
(03-31-2017, 03:35 PM)dreuf Wrote: I also dont think I have a roll or pitch sensor... For what do you use them? (I´m also new in sailing..)
The main reason to have an IMU is to have a proper digital magnetic compass. The other measurements are a bonus. Smile

I am planning on doing some mapping so i want to be able to calculate heave.
https://www.google.ca/url?sa=t&rct=j&q=&...kjOzRTf5fg
  Reply
#9
here is a example of a nodemcu with 4 relays and a switch plus temperature,a steelseries gauge and turns on led 13 on arduino..

Code:
[{"id":"3304551a.2e55fa","type":"arduino out","z":"5145140c.93970c","name":"","pin":"13","state":"OUTPUT","arduino":"8787c49b.ad4d98","x":480,"y":120,"wires":[]},{"id":"bba99501.874b08","type":"inject","z":"5145140c.93970c","name":"OFF","topic":"B","payload":"0","payloadType":"str","repeat":"","crontab":"","once":false,"x":110,"y":140,"wires":[["96cbf7b7.a2f508"]]},{"id":"c070d488.bf62d8","type":"inject","z":"5145140c.93970c","name":"on","topic":"B","payload":"1","payloadType":"str","repeat":"","crontab":"","once":false,"x":110,"y":100,"wires":[["96cbf7b7.a2f508"]]},{"id":"2dd1384b.20ef18","type":"mqtt out","z":"5145140c.93970c","name":"","topic":"B","qos":"","retain":"","broker":"1e9c9256.67bcae","x":470,"y":40,"wires":[]},{"id":"96cbf7b7.a2f508","type":"ui_switch","z":"5145140c.93970c","name":"","label":"switch","group":"e3d20b81.e5e498","order":0,"width":"2","height":"1","passthru":true,"decouple":"false","topic":"B","style":"","onvalue":"1","onvalueType":"str","onicon":"","oncolor":"","offvalue":"0","offvalueType":"str","officon":"","offcolor":"","x":290,"y":80,"wires":[["2dd1384b.20ef18","3304551a.2e55fa"]]},{"id":"10dd3391.341a5c","type":"mqtt in","z":"5145140c.93970c","name":"","topic":"B","qos":"2","broker":"1e9c9256.67bcae","x":110,"y":40,"wires":[["96cbf7b7.a2f508"]]},{"id":"5706b9b6.dc01b8","type":"ui_template","z":"5145140c.93970c","group":"a17208f5.0eab18","name":"Temp","order":2,"width":"6","height":"6","format":"<script src=\"/myjs/tween-min.js\"></script>\n<script src=\"/myjs/steelseries-min.js\"></script>\n<script>\nvar radial4;\n    (function(scope){ \n        scope.$watch('msg', function(msg) {\n           if (typeof(msg.value) != \"undefined\") radial4.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    radial4 = new steelseries.Radial('canvasRadial4', {\n            gaugeType: steelseries.GaugeType.TYPE4,\n            size: 292,\n            section: sections,\n            area: areas,\n            titleString: \"Temperature\",\n            unitString: \"Degrees F\",\n            threshold: 80,\n            //thresholdRising: false,\n           // userLedVisible: true,\n           // useOdometer: true,\n          //  lcdVisible: true,\n           // trendVisible: true\n        });\n                        \n    radial4.setFrameDesign(steelseries.FrameDesign.BRASS);\n    radial4.setValueAnimated(0);\n    radial4.setPointerType(steelseries.PointerType.TYPE9);\n   // radial4.setThreshold(50);\n    //radial4.blinkUserLed(0);\n   // radial4.setOdoValue(0);\n\n\n</script>\n\n<canvas id=\"canvasRadial4\" width=\"201\" height=\"201\"></canvas>\n","storeOutMessages":true,"fwdInMessages":true,"x":370,"y":200,"wires":[["92922286.ea901"]]},{"id":"a1998d1c.b6477","type":"mqtt in","z":"5145140c.93970c","name":"","topic":"outTopictemp","qos":"2","broker":"1e9c9256.67bcae","x":110,"y":200,"wires":[["f33eff68.0f275"]]},{"id":"92922286.ea901","type":"debug","z":"5145140c.93970c","name":"","active":true,"console":"false","complete":"payload","x":570,"y":200,"wires":[]},{"id":"f33eff68.0f275","type":"function","z":"5145140c.93970c","name":"","func":"msg.value=msg.payload;\nreturn msg;","outputs":1,"noerr":0,"x":250,"y":200,"wires":[["5706b9b6.dc01b8"]]},{"id":"8787c49b.ad4d98","type":"arduino-board","z":"","device":"/dev/ttyACM0"},{"id":"1e9c9256.67bcae","type":"mqtt-broker","z":"","broker":"localhost","port":"1883","tls":"3fb1b783.f68d18","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""},{"id":"e3d20b81.e5e498","type":"ui_group","z":"","name":"compass","tab":"bdb776e4.17a1e8","order":1,"disp":true,"width":"6"},{"id":"a17208f5.0eab18","type":"ui_group","z":"","name":"horizon","tab":"bdb776e4.17a1e8","order":3,"disp":true,"width":"6"},{"id":"3fb1b783.f68d18","type":"tls-config","z":"","name":"","cert":"","key":"","ca":"","verifyservercert":true},{"id":"bdb776e4.17a1e8","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]


Code:
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include <OneWire.h>
#include <DallasTemperature.h>

// wifi and MQTT broker vars

const char* ssid = "OpenPlotter";              // your network ssid
const char* password = "*******";             // password
const char* mqtt_server = "10.10.10.1";    // your mqtt server
boolean pin1 = false;
boolean pin2 = false;
boolean pin3 = false;                          
boolean pin4 = false;
boolean pin5 = false;
//boolean pin6 = false;
const int   misc_sens_pin = 12;                // temp was after thought 12 was free,. change to pin you like
const int   mqtt_interval = 60000;



WiFiClient espClient;
PubSubClient client(espClient);
OneWire oneWire(misc_sens_pin);
DallasTemperature DS18B20(&oneWire);

long lastMsg = 0;
char msg[50];
int value = 0;

void setup_wifi() {

 delay(10);
 Serial.println();
 Serial.print("Connecting to ");
 Serial.println(ssid);

 WiFi.begin(ssid, password);

 while (WiFi.status() != WL_CONNECTED) {
   delay(500);
   Serial.print(".");
 }

 Serial.println("");
 Serial.println("WiFi connected");
 Serial.println("IP address: ");
 Serial.println(WiFi.localIP());
}

void callback(char* topic, byte* payload, unsigned int length) {
 if ( (char)topic[0] == 'A') {
   if ((char)payload[0] == '1') {
     digitalWrite(16, LOW);  // you will need to change pin # if done elswere, it is 16 now thats the onboard led for testing
   }
   if ((char)payload[0] == '0') {
     digitalWrite(16, HIGH);          // and here same as above and for any pin changes
   }
 }

 if ( (char)topic[0] == 'B') {
   if ((char)payload[0] == '1') {
     digitalWrite(4, LOW);   // Turn the LED on (Note that LOW is the voltage level
   }
   if ((char)payload[0] == '0') {
     digitalWrite(4, HIGH);   // Turn the LED on (Note that LOW is the voltage level
   }
 }

 if ( (char)topic[0] == 'C') {
   if ((char)payload[0] == '1') {
     digitalWrite(0, LOW);   // Turn the LED on (Note that LOW is the voltage level
   }
   if ((char)payload[0] == '0') {
     digitalWrite(0, HIGH);   // Turn the LED on (Note that LOW is the voltage level
   }
 }

 if ( (char)topic[0] == 'D') {
   if ((char)payload[0] == '1') {
     digitalWrite(2, LOW);   // Turn the LED on (Note that LOW is the voltage level
   }
   if ((char)payload[0] == '0') {
     digitalWrite(2, HIGH);   // Turn the LED on (Note that LOW is the voltage level
   }
 }
}

void reconnect() {
 // Loop until we're reconnected
 while (!client.connected()) {
   Serial.print("Attempting MQTT connection...");
   // Attempt to connect
   //if (client.connect("ESP8266Client5"))
   if (client.connect("esp82661","pi", "*******")){          //Your mqtt password in op*****
     Serial.println("connected");


     // ... and resubscribe
     client.subscribe("A");
     client.subscribe("B");
     client.subscribe("C");
     client.subscribe("D");

   } else {
     Serial.print("failed, rc=");
     Serial.print(client.state());
     Serial.println(" try again in 5 seconds");
     // Wait 5 seconds before retrying
     delay(5000);
   }
 }
}


void setup() {

 pinMode(16, OUTPUT);
 pinMode(4, OUTPUT);
 pinMode(0, OUTPUT);                    
 pinMode(2, OUTPUT);
 pinMode(14, OUTPUT);                    // if you changed temp pin then it needs to be input..
 pinMode(12, INPUT);                     //temp pin





Serial.begin(115200);
setup_wifi();
client.setServer(mqtt_server, 1883);
client.setCallback(callback);
}

void loop() {
 float temp;
 char tempStr[5];

 if (!client.connected()) {
   reconnect();
 }
 client.loop();
 long now = millis();
 if (now - lastMsg > mqtt_interval) {
   lastMsg = now;
   ++value;
   DS18B20.requestTemperatures();
   temp = DS18B20.getTempCByIndex(0);

   temp = (temp * 9.0) / 5.0 + 32.0;       // temp C to F

   String(temp).toCharArray(tempStr, 2);

   String(temp).toCharArray(tempStr, 5);
   client.publish("outTopictemp", tempStr);
   client.publish("outTopic", "Relay Board OK");
   
 }
}
  Reply
#10
simple clock steelseries.

Code:
[{"id":"82ee10c2.6fd3f","type":"ui_template","z":"9f550e95.3b889","group":"e3d20b81.e5e498","name":"clock","order":2,"width":0,"height":0,"format":"<script src=\"/myjs/tween-min.js\"></script>\n<script src=\"/myjs/steelseries-min.js\"></script>\n\n<script>\nvar clock\n    (function(scope){ \n        scope.$watch('msg', function(msg) {\n           if (typeof(msg.value) != \"undefined\")clock.setValueAnimated(msg.value);\n          \n        });\n    })(scope);\n    \n   \n    clock = new steelseries.Clock('clock', {\n        \n        gaugeType: steelseries.GaugeType.TYPE4, \n        size: 292,\n        lcdVisible:false,\n        \n      //rotateFace: true\n                            });\n    \n \n            \n        \n                        \n   clock.setFrameDesign(steelseries.FrameDesign.BRASS);\n   clock.setValueAnimated(0);\n   //wind.setForegroundType(steelseries.ForegroundType.TYPE4);\n   //wind.lcdVisible = false\n   //compass1.rotateFace: \n   //compass1. roseVisible:true\n   // test.setThreshold(50);\n   // test.blinkUserLed(0);\n   // test.setOdoValue(0);\n\n\n</script>\n\n<canvas id=\"clock\" width=\"201\" height=\"201\"></canvas>\n\n","storeOutMessages":true,"fwdInMessages":true,"x":410,"y":420,"wires":[[]]},{"id":"e68189b1.a47a08","type":"inject","z":"9f550e95.3b889","name":"","topic":"","payload":"","payloadType":"date","repeat":"1","crontab":"","once":false,"x":251,"y":424,"wires":[["82ee10c2.6fd3f"]]},{"id":"e3d20b81.e5e498","type":"ui_group","z":"","name":"compass","tab":"bdb776e4.17a1e8","order":1,"disp":true,"width":"6"},{"id":"bdb776e4.17a1e8","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)