Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Node Red flow for SignalK. Measuring temperature with DS18B20. Info at https://pysselilivet.blogspot.com/2018/07/signalk-measuring-temperature.html
[{"id":"9ae73cb2.1aa53","type":"tab","label":"Flow 1","disabled":true,"info":""},{"id":"b203a1de.b0e7b","type":"inject","z":"9ae73cb2.1aa53","name":"","topic":"","payload":"","payloadType":"date","repeat":"5","crontab":"","once":false,"onceDelay":"1","x":130,"y":60,"wires":[["b50bf0c3.5a39"]]},{"id":"b50bf0c3.5a39","type":"rpi-ds18b20","z":"9ae73cb2.1aa53","topic":"","array":true,"name":"","x":290,"y":60,"wires":[["5755463c.bc7758"]]},{"id":"5755463c.bc7758","type":"split","z":"9ae73cb2.1aa53","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":130,"y":140,"wires":[["7338dfbc.b0fb1"]]},{"id":"7338dfbc.b0fb1","type":"function","z":"9ae73cb2.1aa53","name":"Set values","func":"\ntempIn = msg.payload.temp + 273.15;\ntempDsId = msg.payload.file\n\nswitch(tempDsId) {\n \n case \"28-051693ea56ff\" :\n SkPath = \"propulsion.starboard.exhaustTemperature\"; \n break;\n \n case \"28-051693ec41ff\" :\n SkPath = \"propulsion.port.exhaustTemperature\"; \n break;\n \n case \"28-123493ec41ff\" :\n SkPath = \"environment.inside.engineRoom.temperature\"; \n break;\n \n default:\n return msg[null]; \n}\n\nmsg = {};\nmsg.payload = tempIn;\nmsg.topic = SkPath;\nmsg.DsId = tempDsId;\n\nreturn msg;","outputs":1,"noerr":0,"x":290,"y":140,"wires":[["b9d1c481.c106b8","63e6594d.907e98"]]},{"id":"63e6594d.907e98","type":"debug","z":"9ae73cb2.1aa53","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":610,"y":120,"wires":[]},{"id":"b9d1c481.c106b8","type":"signalk-send-pathvalue","z":"9ae73cb2.1aa53","name":"","source":"","x":570,"y":60,"wires":[]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.