DIY Grow Room Automation w/ Node-Red

Home Assistant automation projects, questions, etc. go here.
jaysal
LED Enthusiast
LED Enthusiast
Reactions:
Posts: 75
Joined: Sat May 30, 2020 7:49 am

Hey gvbz,
How often do you get data from your ruvviTAG? The reason I ask is because I have been testing a Zibee Aqara Temp/Humidity sensor and it appears to be accurate however there are times that I do not get data for like 30 minutes plus. From what I understand it will only send data when the temp changes .5 degrees or when the humidity changes by 6% I like to get more continues stream of data so this sensor is not going to make the cut for my grow environment.
User avatar
gvbz
LED Enthusiast
LED Enthusiast
Reactions:
Posts: 37
Joined: Thu Apr 02, 2020 3:30 pm

jaysal wrote:
Thu Jul 09, 2020 4:39 am
Hey gvbz,
How often do you get data from your ruvviTAG? The reason I ask is because I have been testing a Zibee Aqara Temp/Humidity sensor and it appears to be accurate however there are times that I do not get data for like 30 minutes plus. From what I understand it will only send data when the temp changes .5 degrees or when the humidity changes by 6% I like to get more continues stream of data so this sensor is not going to make the cut for my grow environment.
Hey Jaysal, broadcast time on the RuuviTag is dependent on the firmware mode you are using and it can also be adjusted via config:

The firmware has 3 modes:
-RAWv2-fast (broadcast every 1285ms, green LED blinks, theoretical battery life 4 years)
-RAWv2-slow (broadcast every 6425ms, green LED blinks, theoretical battery life 6 years)
-RAWv1-fast (broadcast every 1285ms, red LED blinks, theoretical battery life 4 years)

I use RAWv2-fast and typically set the BLE scan time on the node to 5s.

Some further resources on firmware and scan time: https://lab.ruuvi.com/dfu/
480W Bridgelux EB Gen3 Parallel Build: https://bit.ly/2NfoVyE
Grow Room Automation w/ Node Red: https://bit.ly/3hOm5yK
Github: https://github.com/gvbz/gardenbro
Instagram: @loudfarms_ca
jaysal
LED Enthusiast
LED Enthusiast
Reactions:
Posts: 75
Joined: Sat May 30, 2020 7:49 am

This is looking like a pretty impressive sensor, continuous data stream and long battery life! Thanks for specs bringing it to our attention.
User avatar
gvbz
LED Enthusiast
LED Enthusiast
Reactions:
Posts: 37
Joined: Thu Apr 02, 2020 3:30 pm

Just a quick update on this project, everything is being moved over to Node-Red within Home Assistant. Rather trying to learn how to develop a custom front end for the NR code using some sort of stack, Home Assistant will be used to provide all the same benefits without giving up automation programming in NR. Huge shout out to @LEDG for the recent videos and help with getting up and running! Big updates incoming.
480W Bridgelux EB Gen3 Parallel Build: https://bit.ly/2NfoVyE
Grow Room Automation w/ Node Red: https://bit.ly/3hOm5yK
Github: https://github.com/gvbz/gardenbro
Instagram: @loudfarms_ca
jaysal
LED Enthusiast
LED Enthusiast
Reactions:
Posts: 75
Joined: Sat May 30, 2020 7:49 am

Same here, all of my automations are in Node-Red not one in HA, I did try to build a front end in Node-Red using the dashboard nodes however I didn't like how it was coming out so I just left it alone. I really don't need to change anything that often anyways so wasn't a big deal after all. I use Grafana for a quick view only mode to check if all is good and its been working pretty well. Looking forward to your updates!
GrowDash.png
dtsmith213
LED-Curious
LED-Curious
Reactions:
Posts: 3
Joined: Tue Sep 08, 2020 4:33 pm

i noticed you were looking to implement mysql and NR, here is how i am currently doing it


Code: Select all

[{"id":"949de64c.d7a968","type":"mysql","z":"5d6d1ecf.81f6f8","mydb":"130c01b6.7c62de","name":"","x":510,"y":40,"wires":[[]]},{"id":"130c01b6.7c62de","type":"MySQLdatabase","z":"","name":"aaa","host":"core-mariadb","port":"3306","db":"hassio","tz":"America\\Chicago"}]
anyhow great looking project, thank for sharing with us
warmachine
LED-Curious
LED-Curious
Reactions:
Posts: 18
Joined: Wed Sep 02, 2020 3:48 am

Here's my fertigation automation. Very close to LEDgardener 's but, I use hours after lights on rather than a time. That way if I change the lights on time it changes the watering schedule. The flow takes an input number changes it to ms, then switch node changes payload to delay which uses the delay node as a variable time. Seconds can be changes to minutes for flood type setups. I also have one for a repeat cycle timer I use for my aeroponic setup if anyone is interested I can upload it.

Code: Select all

[{"id":"62ea646a.c3e7dc","type":"api-current-state","z":"f52ddd40.ccfcd","name":"Water Duration","server":"e1baff13.0f49d","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_number.water_dur","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":380,"y":480,"wires":[["238eb7d0.63e558"]]},{"id":"238eb7d0.63e558","type":"function","z":"f52ddd40.ccfcd","name":"Sec to ms","func":"msg.payload= msg.payload*1000\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":540,"y":480,"wires":[["c1383100.f84c"]]},{"id":"c1383100.f84c","type":"change","z":"f52ddd40.ccfcd","name":"msg.delay","rules":[{"t":"set","p":"delay","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":480,"wires":[["aa902090.a31e4"]]},{"id":"aa902090.a31e4","type":"delay","z":"f52ddd40.ccfcd","name":"","pauseType":"delayv","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":840,"y":480,"wires":[["82d2ec8.01e821"]],"inputLabels":["miliseconds"],"outputLabels":["seconds"]},{"id":"82d2ec8.01e821","type":"api-call-service","z":"f52ddd40.ccfcd","name":"Pump/Zone/script?","server":"e1baff13.0f49d","version":1,"debugenabled":false,"service_domain":"homeassistant","service":"turn_off","entityId":"switch.pump","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1010,"y":480,"wires":[[]]},{"id":"79d5a5b7.581fcc","type":"server-state-changed","z":"f52ddd40.ccfcd","name":"Flower On","server":"e1baff13.0f49d","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.Lights_on","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":80,"y":120,"wires":[["13c05c02.3d5254","c47f68ab.b68f08","d717b471.2ed1a8","46d51334.fa6ddc","a940242d.63ce48","75b5f834.21ac88"],[]]},{"id":"ef92c318.95b71","type":"delay","z":"f52ddd40.ccfcd","name":"","pauseType":"delayv","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":840,"y":420,"wires":[["3b48b737.b1d7b8"]],"inputLabels":["miliseconds"],"outputLabels":["hours"]},{"id":"3b48b737.b1d7b8","type":"api-call-service","z":"f52ddd40.ccfcd","name":"Pump/Zone/script?","server":"e1baff13.0f49d","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1010,"y":420,"wires":[["62ea646a.c3e7dc"]]},{"id":"5f3a6f18.61a84","type":"delay","z":"f52ddd40.ccfcd","name":"","pauseType":"delayv","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":840,"y":360,"wires":[["d2bdc56d.cba0f8"]],"inputLabels":["miliseconds"],"outputLabels":["seconds"]},{"id":"d2bdc56d.cba0f8","type":"api-call-service","z":"f52ddd40.ccfcd","name":"Pump/Zone/script?","server":"e1baff13.0f49d","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1010,"y":360,"wires":[["62ea646a.c3e7dc"]]},{"id":"2112695a.09f936","type":"api-call-service","z":"f52ddd40.ccfcd","name":"Pump/Zone/script?","server":"e1baff13.0f49d","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1010,"y":300,"wires":[["62ea646a.c3e7dc"]]},{"id":"abc5c8b1.2874e8","type":"delay","z":"f52ddd40.ccfcd","name":"","pauseType":"delayv","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":840,"y":300,"wires":[["2112695a.09f936"]],"inputLabels":["miliseconds"],"outputLabels":["seconds"]},{"id":"dd7af0e.f2bf91","type":"delay","z":"f52ddd40.ccfcd","name":"","pauseType":"delayv","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":840,"y":240,"wires":[["e555fa86.aa4668"]],"inputLabels":["miliseconds"],"outputLabels":["seconds"]},{"id":"e555fa86.aa4668","type":"api-call-service","z":"f52ddd40.ccfcd","name":"Pump/Zone/script?","server":"e1baff13.0f49d","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1010,"y":240,"wires":[[]]},{"id":"6bba2707.0453b8","type":"api-call-service","z":"f52ddd40.ccfcd","name":"Pump/Zone/script?","server":"e1baff13.0f49d","version":1,"debugenabled":false,"service_domain":"","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1010,"y":180,"wires":[["62ea646a.c3e7dc"]]},{"id":"51ac6dbf.364234","type":"delay","z":"f52ddd40.ccfcd","name":"","pauseType":"delayv","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":840,"y":180,"wires":[["6bba2707.0453b8"]],"inputLabels":["miliseconds"],"outputLabels":["seconds"]},{"id":"16304259.35fbae","type":"delay","z":"f52ddd40.ccfcd","name":"","pauseType":"delayv","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":840,"y":120,"wires":[["8ad02d9b.0d733"]],"inputLabels":["miliseconds"],"outputLabels":["seconds"]},{"id":"8ad02d9b.0d733","type":"api-call-service","z":"f52ddd40.ccfcd","name":"Pump/Zone/script?","server":"e1baff13.0f49d","version":1,"debugenabled":false,"service_domain":"homeassistant","service":"turn_on","entityId":"switch.pump","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1010,"y":120,"wires":[["62ea646a.c3e7dc"]]},{"id":"a775f477.8435c8","type":"change","z":"f52ddd40.ccfcd","name":"msg.delay","rules":[{"t":"set","p":"delay","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":120,"wires":[["16304259.35fbae"]]},{"id":"18f1406b.902db","type":"change","z":"f52ddd40.ccfcd","name":"msg.delay","rules":[{"t":"set","p":"delay","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":160,"wires":[["51ac6dbf.364234"]]},{"id":"21176f3e.05f25","type":"change","z":"f52ddd40.ccfcd","name":"msg.delay","rules":[{"t":"set","p":"delay","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":200,"wires":[["dd7af0e.f2bf91"]]},{"id":"4a783ee7.f1a25","type":"change","z":"f52ddd40.ccfcd","name":"msg.delay","rules":[{"t":"set","p":"delay","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":240,"wires":[["abc5c8b1.2874e8"]]},{"id":"8be275c1.8e40f8","type":"change","z":"f52ddd40.ccfcd","name":"msg.delay","rules":[{"t":"set","p":"delay","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":280,"wires":[["5f3a6f18.61a84"]]},{"id":"3ae78bf7.c058e4","type":"change","z":"f52ddd40.ccfcd","name":"msg.delay","rules":[{"t":"set","p":"delay","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":320,"wires":[["ef92c318.95b71"]]},{"id":"e25ac8a6.dc8168","type":"function","z":"f52ddd40.ccfcd","name":"Hrs to ms","func":"msg.payload= msg.payload*3600*1000\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":540,"y":320,"wires":[["3ae78bf7.c058e4"]]},{"id":"1060b592.aad48a","type":"function","z":"f52ddd40.ccfcd","name":"Hrs to ms","func":"msg.payload= msg.payload*3600*1000\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":540,"y":280,"wires":[["8be275c1.8e40f8"]]},{"id":"22b16da1.f421a2","type":"function","z":"f52ddd40.ccfcd","name":"Hrs to ms","func":"msg.payload= msg.payload*3600*1000\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":540,"y":240,"wires":[["4a783ee7.f1a25"]]},{"id":"c8e9cbf4.a72b78","type":"function","z":"f52ddd40.ccfcd","name":"Hrs to ms","func":"msg.payload= msg.payload*3600*1000\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":540,"y":200,"wires":[["21176f3e.05f25"]]},{"id":"3eb5bd4.6325d42","type":"function","z":"f52ddd40.ccfcd","name":"Hrs to ms","func":"msg.payload= msg.payload*3600*1000\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":540,"y":160,"wires":[["18f1406b.902db"]]},{"id":"69feb546.8e830c","type":"function","z":"f52ddd40.ccfcd","name":"Hrs to ms","func":"msg.payload= msg.payload*3600*1000\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":540,"y":120,"wires":[["a775f477.8435c8"]]},{"id":"16da4d7.ef90fb3","type":"api-current-state","z":"f52ddd40.ccfcd","name":"w1","server":"e1baff13.0f49d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.w1","state_type":"str","state_location":"","override_payload":"none","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":390,"y":120,"wires":[["69feb546.8e830c"],[]]},{"id":"496ad844.aa9058","type":"api-current-state","z":"f52ddd40.ccfcd","name":"w2","server":"e1baff13.0f49d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.w2","state_type":"str","state_location":"","override_payload":"none","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":390,"y":160,"wires":[["3eb5bd4.6325d42"],[]]},{"id":"741b2078.c4d6d","type":"api-current-state","z":"f52ddd40.ccfcd","name":"tw3","server":"e1baff13.0f49d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.r1tw3","state_type":"str","state_location":"","override_payload":"none","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":390,"y":200,"wires":[["c8e9cbf4.a72b78"],[]]},{"id":"c3207c.64ca9f88","type":"api-current-state","z":"f52ddd40.ccfcd","name":"w4","server":"e1baff13.0f49d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.w4","state_type":"str","state_location":"","override_payload":"none","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":390,"y":240,"wires":[["22b16da1.f421a2"],[]]},{"id":"a60d7ba6.047618","type":"api-current-state","z":"f52ddd40.ccfcd","name":"w5","server":"e1baff13.0f49d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.w5","state_type":"str","state_location":"","override_payload":"none","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":390,"y":280,"wires":[["1060b592.aad48a"],[]]},{"id":"ca7304d9.afa588","type":"api-current-state","z":"f52ddd40.ccfcd","name":"w6","server":"e1baff13.0f49d","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.w6","state_type":"str","state_location":"","override_payload":"none","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":390,"y":320,"wires":[["e25ac8a6.dc8168"],[]]},{"id":"75b5f834.21ac88","type":"api-current-state","z":"f52ddd40.ccfcd","name":"Water6","server":"e1baff13.0f49d","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_number.water_6","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":220,"y":320,"wires":[["ca7304d9.afa588"]]},{"id":"a940242d.63ce48","type":"api-current-state","z":"f52ddd40.ccfcd","name":"Water5","server":"e1baff13.0f49d","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_number.water_5","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":220,"y":280,"wires":[["a60d7ba6.047618"]]},{"id":"46d51334.fa6ddc","type":"api-current-state","z":"f52ddd40.ccfcd","name":"Water4","server":"e1baff13.0f49d","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_number.rwater_4","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":220,"y":240,"wires":[["c3207c.64ca9f88"]]},{"id":"d717b471.2ed1a8","type":"api-current-state","z":"f52ddd40.ccfcd","name":"Water3","server":"e1baff13.0f49d","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_number.water_3","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":220,"y":200,"wires":[["741b2078.c4d6d"]]},{"id":"c47f68ab.b68f08","type":"api-current-state","z":"f52ddd40.ccfcd","name":"Water2","server":"e1baff13.0f49d","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_number.water_2","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":220,"y":160,"wires":[["496ad844.aa9058"]]},{"id":"13c05c02.3d5254","type":"api-current-state","z":"f52ddd40.ccfcd","name":"Water1","server":"e1baff13.0f49d","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_number.water_1","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":220,"y":120,"wires":[["16da4d7.ef90fb3"]]},{"id":"e1baff13.0f49d","type":"server","z":"","name":"Home Assistant","addon":true}]
Attachments
fertigation flow pic.jpg
fertigation flow.jpg
User avatar
LEDG
Site Admin
Reactions:
Posts: 1599
Joined: Sun Jun 04, 2017 8:15 pm

Beauty.
Want to Support the Site?

Use this Amazon referral link and any purchase you make within 24 hrs will earn LEDgardener a commission at no cost to you!
shmoove
LED-Curious
LED-Curious
Reactions:
Posts: 2
Joined: Thu Nov 19, 2020 11:26 am

jaysal wrote:
Tue Jun 23, 2020 12:08 am
Yes, I am using an ESP32 to connect my temperature sensors and the L298N Motor Drive Controller. The ESP32 connects via Wi-Fi to Home Assistant and Node-Red which is currently running on a RP4.

I have the L298N connected to a 12V 150CFM fan (computer fan) for testing, I have not yet purchased an EC style inline fans (I would like three; air intake, air exhaust and humidity exhaust) that would go inside my grow environment. I am 30 days out from harvest so I don't want to make any drastic changes at the moment.

What model EC fan do you have? Most likely you can use the L298N.

What is the best way to share the code? ESP code will fit here but probably not the best for Node-RED code. I will zip the json and attach for now.

fan pwm.zip
Hey Jaysal,

I am struggling with my PWM setup for L298N and a DC motor peristaltic pump. Do you mind sharing your ESP code? Thanks mate!
dtsmith213
LED-Curious
LED-Curious
Reactions:
Posts: 3
Joined: Tue Sep 08, 2020 4:33 pm

How did you program the device that reads the data sent by the Atlas scientific sensor and likewise how did you program the devices that control the pumps?
Post Reply