New User Help for a Chemistry Flow

Hello,

My name is Bryce and I have recently found that a fellow staff member was using Node-RED to code and control a system we have in our workplace, the hard thing is he has since left the company and this project has been handed to me to oversee, and nobody codes or knows what he set up, and I'm only a materials engineer.

Where is the best place to start learning Node-RED and understand how it works?

The flow he set up uses a Raspberry Pi 3 B+ to constantly read a water flow meter which is connected to chemistry soxhlets so that if the water flow stops then the heating mantles are also turned off via smart plugs, a text is sent out, and also Slack, which is our work messaging app also gets a notification so that all workers could see what the issue is.

I think this is how it would look from a simple point of view.

RPi ---> FlowMeter ---> IFTTT ---> TP-Link ---> Text ---> Slack

Any help would be much appreciated, is there a way I can send the flow to someone to look over or see if there is a more simple flow to create?

Kind regards,
Bryce

Is it working at the moment? If so, you really just want to back things up so that you can safely go back to what is working if you start tinkering.
There are are tons of resources on the web. nodered.org is the first, there are videos, documents and example flows to help guide you..... and of course this forum.

There are usually many different ways to do the same thing with Node-RED, your ex-staff member just did it the way that made sense to him for his skill level.
If you take the time to rewrite it, it will still do the exact same function, but in a way that you are comfortable with. Hard for someone else to decide for you which is the best way to do it.

Yes it does currently work (last I checked) so I will figure out how to back up the flow, is it just the same as saving a file somewhere?

Yes I see this website has a tonne of resources, I just don't come from a programming background of any sort.... so trying to understand new terms is a bit overwhelming. And trying to determine what each node actually does, and what's a payload and global etc.... so much too learn.

If there was a way to share the original flow, could the path of inputs/outputs be explained in simpler terms? Like there is a GPIO input that feeds into a frequency node to tell if the flow meter has water flow, is this the only way to detect if the water is running?

Sorry for all the questions, I find this interesting, just hard jumping into a complex flow (for me)

To share a flow, click on the hamburger menu in the top right and select export
exoppt1
then you will have your choice to export a single node, all the nodes/flows on the current tab or all the nodes/flows on all tabs.

On the Pi, you want to backup the entire .node-red folder - it is a hidden folder under the 'pi' user default folder. If you get into a terminal session you can issue a cd .node-red to get into the folder.

First thing to do, right off, is backup the SD card. If the Pi is setup in desktop mode, you canuse the SD card copier progran (in the Utilities section...I think...)

1 Like

All of the settings and configuration are in the userDir folder which is normally ~/.node-red. However, watch out for the node_modules sub-folder. This is typically very large indeed. You don't need to back that folder up as it only contains the packages being used and these are reinstalled very easily because they should all be listed in the ~/.node-red/package.json

Hi there,

Here is one of the flows, I wasn't sure which format is easier to export and read, so I did both,

[Files removed because they provided authentication tokens]

If someone could open this and explain some of the nodes and what their purpose is, It would give me some insight as why/how this all works.

I know PIN:11 is the DATA wire of the water flow meter, and when the water is flowing the Frequency node shows a certain Hz depending on how fast the flow is. I would like to know why there are three "Pin V10 - Write" nodes all attached to Pin 10

What do the Smooth, rbe, and switch nodes do? I know there are descriptions in the information window, but a lot of it goes beyond my understanding (which is zero coding experience)

How are the timestamp nodes triggered to send a text in this flow, as it looks like they are not connected?

What would be the easiest way to make a flow that monitors the water flow meter, and if it detects no water flow the smart plugs then turn off, while also sending a text and slack notification?
What node would be used to detect flow, either ON or OFF, or does it have to run as a "frequency" ?

Thanks for all your help, it's very appreciated !!! :smiley:

@Bryce First off I removed the files because they included the authentication tokens in the blynk and the slack nodes. Here is the flow with the tokens removed

[{"id":"d2f33115.9f8418","type":"tab","label":"Small Soxhlets","disabled":false,"info":""},{"id":"72af1a42.a7d05c","type":"http request","z":"d2f33115.9f8418","name":"Turn off Smart plug","method":"POST","ret":"txt","paytoqs":false,"url":"https://maker.ifttt.com/trigger/flowstopsmall/with/key/nvP1CC19t2theTRDJDwKMHkZnwirFK2cXqf9cR3wH-c","tls":"","persist":false,"proxy":"","authType":"","x":670,"y":300,"wires":[["8860ef32.4d3188"]]},{"id":"8860ef32.4d3188","type":"http request","z":"d2f33115.9f8418","name":"Slack Message","method":"POST","ret":"txt","paytoqs":false,"url":"","tls":"","persist":false,"proxy":"","authType":"","x":680,"y":360,"wires":[[]]},{"id":"29ea5929.a7224e","type":"inject","z":"d2f33115.9f8418","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":440,"wires":[["489fde11.025ed"]]},{"id":"2f357f4f.abb52","type":"inject","z":"d2f33115.9f8418","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":163.0713996887207,"y":476.99987030029297,"wires":[["8df87a33.604608"]]},{"id":"8df87a33.604608","type":"http request","z":"d2f33115.9f8418","name":"Turn off Smart plug","method":"POST","ret":"txt","paytoqs":false,"url":"https://maker.ifttt.com/trigger/flowstopsmall/with/key/nvP1CC19t2theTRDJDwKMHkZnwirFK2cXqf9cR3wH-c","tls":"","persist":false,"proxy":"","authType":"","x":423.07140731811523,"y":479.9998731613159,"wires":[[]]},{"id":"833ebaa4.b4cf38","type":"rpi-gpio in","z":"d2f33115.9f8418","name":"","pin":"11","intype":"tri","debounce":"25","read":false,"x":90,"y":100,"wires":[["904a38e.76b9348"]]},{"id":"36708a63.143b66","type":"ui_gauge","z":"d2f33115.9f8418","name":"","group":"984197a8.113a28","order":0,"width":0,"height":0,"gtype":"gage","title":"Small Soxhlets Flow Frequency","label":"Hz","format":"{{value}}","min":0,"max":"50","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":650,"y":120,"wires":[]},{"id":"489fde11.025ed","type":"change","z":"d2f33115.9f8418","name":"Message content ","rules":[{"t":"set","p":"payload","pt":"msg","to":"Small Soxhlets Water turned off. ","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":420.7143249511719,"y":439.7142906188965,"wires":[["baca2879.d2834"]]},{"id":"c5068280.0356f","type":"debug","z":"d2f33115.9f8418","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":650,"y":260,"wires":[]},{"id":"7537b364.2c50dc","type":"switch","z":"d2f33115.9f8418","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":405.75000762939453,"y":303.211088180542,"wires":[["c5068280.0356f","72af1a42.a7d05c"]]},{"id":"8b5cbdce.41cea8","type":"rbe","z":"d2f33115.9f8418","name":"","func":"rbei","gap":"","start":"","inout":"out","property":"payload","x":275.757848739624,"y":301.93763160705566,"wires":[["7537b364.2c50dc"]]},{"id":"7ef718d8.0d695","type":"blynk-ws-out-write","z":"d2f33115.9f8418","name":"","pin":"10","pinmode":0,"client":"b3b67795.76391","x":560,"y":80,"wires":[]},{"id":"61b9426b.d5f454","type":"blynk-ws-out-write","z":"d2f33115.9f8418","name":"","pin":"10","pinmode":0,"client":"b3b67795.76391","x":560,"y":40,"wires":[]},{"id":"8b31ff52.3168c","type":"blynk-ws-out-write","z":"d2f33115.9f8418","name":"","pin":"10","pinmode":0,"client":"b3b67795.76391","x":560,"y":160,"wires":[]},{"id":"904a38e.76b9348","type":"frequency","z":"d2f33115.9f8418","name":"Flowmeter Frequency","interval":"1000","ntfyinterval":"1000","x":280,"y":100,"wires":[["36708a63.143b66","7ef718d8.0d695","61b9426b.d5f454","4c2f0a32.706454","8b31ff52.3168c"]]},{"id":"baca2879.d2834","type":"twilio out","z":"d2f33115.9f8418","twilio":"a9523da9.45e3b","twilioType":"sms","url":"","number":"+64276341846","name":"Text Bryce","x":725.357063293457,"y":438.714599609375,"wires":[]},{"id":"4c2f0a32.706454","type":"smooth","z":"d2f33115.9f8418","name":"","property":"payload","action":"max","count":"3","round":"","mult":"single","reduce":true,"x":137.74220275878906,"y":303.46113777160645,"wires":[["8b5cbdce.41cea8"]]},{"id":"984197a8.113a28","type":"ui_group","z":"","name":"Default","tab":"cfd63f2.851e44","order":1,"disp":false,"width":"6","collapse":false},{"id":"b3b67795.76391","type":"blynk-ws-client","z":"","name":"App","path":"ws://blynk-cloud.com/websockets","key":"","dbg_all":true,"dbg_read":false,"dbg_write":false,"dbg_notify":false,"dbg_mail":false,"dbg_prop":false,"dbg_sync":false,"dbg_bridge":false,"dbg_low":false,"dbg_pins":"","multi_cmd":false,"proxy_type":"no","proxy_url":"","enabled":true},{"id":"cfd63f2.851e44","type":"ui_tab","z":"","name":"Home","icon":"Dashboard","disabled":false,"hidden":false}]

Her is my take on some of the flow:
Screen Shot 2020-06-09 at 8.40.48 PM
The GPIOs-in node sendings msgs into the flow. The frequency node computes the number of msgs per second and sends out one msg per second. The msgs go to several nodes
Screen Shot 2020-06-09 at 8.41.53 PM

One node is a graph, three are 'Blynk' nodes - unfortunately, I can't help you with these since I've no experience with Blynk.


The smooth node looks at a batch of three msgs and sends out the maximum value seen. The rbe will only send a msg on if the value is different from the last value it received. The switch node tests the value to see if it is zero (0) and if so sends the msg on to a debug (which displays the msg in the debug sidebar) and to a set of nodes that causes a smart switch to shut off and a msg to be sent to a 'slack'

The other two flows


Look like there are their for testing since the inject nodes will not trigger until you press them.

Hope that helps and maybe someone else with experience with 'Blynk' can explain what that is doing.

2 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.