Grow Room Automation with Home Assistant

pahval

Well-Known Member
As far as sensors that can do that (ir sensors) that could then send the data and incorporate for vpd calcs and stuff, I've personally only heard of one company or product that does that. It was mentioned in one of solventlessbakenvapes videos. He did a consult with a company dealing with this equipment.
afaik, ir sensors like mlx90614 arent reliable enough to get leaf temperature, they have 1 or 2 °C +/- offset, ive found some research paper using thermistor clamped to a leaf as a viable and more accurate alternative, but i havent done any testing as im waiting for my sensor to come from china...

edit:

you can see how it looks here:

about vpd calc:

you only need to calculate setpoint temp or rh, and should be enough for plants, lets say you have 1.2 vpd setpoint and 30°C of ambient air setpoint, you then only need proper RH setpoint to calc from VPD, i used this formula (having vpd setpoint, leaf temp and ambient temp):

double e = 2.7182818284590452353602875;

float rhSet = (((0.61121 * pow(e, ((18.678 - leafTemp / 234.5) * leafTemp) / (leafTemp + 257.14))) - vpdSet) / (0.61121 * pow(e, ((18.678 - airTemp / 234.5 ) * airTemp) / (airTemp + 257.14))) * 100);

edit: i should mention i used buck 1996 formula, i found it to be easy to implement in calculations with mcus like esp32 and even arduino, and precise enough to be accurate, for others you can check here:

 
Last edited:

dstroy

Well-Known Member
Figured I'd show you guys what I've been working on in my free time. Its a WIP but I'm happy with progress thus far. Previously I was able to remote control and monitor my lights, temperature, humidity and ventilation. It was kind of a pain though because I had to use different apps for each feature. Enter Home Assistant. Home Assistant (HASS/HASSio) is open source home automation software that is damn near infinitely customizable. It has official support for damn near every brand of smart device (and if it doesn't there is unofficial support). You can even flash your smart device with different firmware if you want/need to to make it work. It all runs on a Raspberry Pi 4. The learning curve is pretty steep and requires a little bit of what I would call programming-lite. You need to be comfortable using the command line and you'll need to familiarize yourself with something called YAML. I've always been great with computers but know fuck all about coding/programming. Its been a fun learning experience though!

Right now my main dashboard allows me to remotely switch humidity and lights but there is no need to do so because its all automated by the software. The humidifier and dehumidifier are both hooked up to smart plugs and turn on and off based on the readings from my Govee bluetooth/wifi thermometer and hygrometer from Amazon. The humidity and temp each have their own dashboard card which displays current conditions as well as a historical graph that changes colors based on a range I set on the backend. Using the readings from the Govee, I created a custom card that calculates VPD in real time. There are 2 gagues on the dashboard that I have set up to change color based on the ideal VPD range for the plant cycle (one for veg and one for flower). Red is bad, yellow is OK and green is perfect.

I've also set it up to send me notifications when VPD has been out of range for an extended period of time or if the lights have been on too long or out too long.

I've spent less than $100 on the whole set up including the Pi. I plan to eventually use this system to automate watering and add soil monitoring. The thermostat on my mini split does an excellent job of controlling temps with its built in thermostat but I will likely find a way to add control of it too, eventually.

View attachment 4803371
This is really cool! I really like that dashboard.

Mine just uses the pi as a lamp stack/mysql db/db connector. I wrote a db connector in python that takes these json the microcontrollers output, slice it up, and put it into the db.

1632921497613.png

I wish my ui was that nice, I haven't spent enough time on it. I use the visualizations a lot though, they go back for the whole grow, then I save a snapshot of them so I can use them in the future.

1632920820456.png

1632920960785.png
1632921116643.png
 

pahval

Well-Known Member
This is really cool! I really like that dashboard.

Mine just uses the pi as a lamp stack/mysql db/db connector. I wrote a db connector in python that takes these json the microcontrollers output, slice it up, and put it into the db.

View attachment 4997912

I wish my ui was that nice, I haven't spent enough time on it. I use the visualizations a lot though, they go back for the whole grow, then I save a snapshot of them so I can use them in the future.

View attachment 4997906

View attachment 4997907
View attachment 4997909
you shouldnt let this one be as it is, you made a proper setup, you should complete it with a nice ui... unfortunately i have no exp with HA so i cannot help, i use openHab, but there is this awesome list for HA (awesome webpage is a collection of all projects around some platform), found here:

 

Friendly_Grower

Well-Known Member
Extremely interesting thread.

How good is this software at simply providing data?
I would benefit from knowing more about conditions at this point. Automating might happen in time.

Friendly_Grower
 

pahval

Well-Known Member
Extremely interesting thread.

How good is this software at simply providing data?
I would benefit from knowing more about conditions at this point. Automating might happen in time.

Friendly_Grower
very good and reliable... it is used for smart home automation, so its also very powerful... as sf_frankie mentioned:

"The learning curve is pretty steep and requires a little bit of what I would call programming-lite."

there are easier ways to just show your data, but they all require a bit of tech skills... it depends on what equipment you have... sensors require to have arduino to read from them... you can put lcd screen to show data in growbox... if you want to see data remotely, on your pc or your phone, you will need a server hardware like raspberry pi... people use raspi to run home assistant program, but you can install something called mosquitto, its a mqtt server that just recieves data, and on your phone you can install subscriber app like this one:


which will show data to your phone... it is easier to setup, you basically copy and paste command lines, but it doesnt store any data... you can see how it looks down here... i accidentally posted 2 pics but they are same...

these are good tutorials:


 

Attachments

Last edited:

pahval

Well-Known Member
if you dont know where to even start, i reccomend this equipment (im a cheap bastard that orders everything via ebay from china, so thats all i know):

- raspberry pi 4 for mqtt server, which you can later on use for something like home assistant, and have database like influxdb to store your data

- esp32 or arduino mega with ethernet shield to collect data and send to your server

- sht-31 temperature and relative hunidity sensor

- scd-30 (i would reccomend scd-41 but it seems there is a temporary shortage of it in popular electronics shops) for co2 sensor (if you need one)

- ds18b20 temp sensor with stainless steel case for water temperature

- 5v relay board with octocoupler, has 1/2/4/6/8 relays (octocoupler is an important part) for eventual control

when you get raspberry, buy proper power adapter because its power hungry and may not work properly on your usual phone charger...
 

Friendly_Grower

Well-Known Member
Wow!

I'm working on my morning coffee but I will read what @pahval has shared.
There is a grow room design going on here. :weed:
New State with 4 seasons instead of two.
Thanks @pahval

Edit: Funny I actually have two Raspberry Pi monitors I bought years ago for a project I never finished. They are HDMI and they work just fine.
 

pahval

Well-Known Member
Wow!

I'm working on my morning coffee but I will read what @pahval has shared.
There is a grow room design going on here. :weed:
New State with 4 seasons instead of two.
Thanks @pahval

Edit: Funny I actually have two Raspberry Pi monitors I bought years ago for a project I never finished. They are HDMI and they work just fine.
nice, im always excited when new projects are in play... as i said, it all depends on what your equipment is... feel free to ask, and ill help as much as i can... peace...
 

MidnightSun72

Well-Known Member
if you dont know where to even start, i reccomend this equipment (im a cheap bastard that orders everything via ebay from china, so thats all i know):

- raspberry pi 4 for mqtt server, which you can later on use for something like home assistant, and have database like influxdb to store your data

- esp32 or arduino mega with ethernet shield to collect data and send to your server

- sht-31 temperature and relative hunidity sensor

- scd-30 (i would reccomend scd-41 but it seems there is a temporary shortage of it in popular electronics shops) for co2 sensor (if you need one)

- ds18b20 temp sensor with stainless steel case for water temperature

- 5v relay board with octocoupler, has 1/2/4/6/8 relays (octocoupler is an important part) for eventual control

when you get raspberry, buy proper power adapter because its power hungry and may not work properly on your usual phone charger...
If you get the scd41 can you skip the temp sensor and possibly the humidity? Or is it CO2 only? The data sheet makes it look like it can do temp as well.
 

pahval

Well-Known Member
If you get the scd41 can you skip the temp sensor and possibly the humidity? Or is it CO2 only? The data sheet makes it look like it can do temp as well.
youre right, it has t/rh sensor built in, im using multipoint sensor reading for my project so i use both, this missed my mind... if you get scd-41 and put it near your canopy, youre all set...
 

MidnightSun72

Well-Known Member
youre right, it has t/rh sensor built in, im using multipoint sensor reading for my project so i use both, this missed my mind... if you get scd-41 and put it near your canopy, youre all set...
Does that mean it has multiple leads to plug into different spots on the raspberry?

sorry I am completely ignorant to how these work. But would love the option to make my own controller.
 

pahval

Well-Known Member
Does that mean it has multiple leads to plug into different spots on the raspberry?

sorry I am completely ignorant to how these work. But would love the option to make my own controller.
nope, it uses i2c if im not misaken, sp only 2 wires for data plus 2 for power, and then your microcontroller basically sends give me temperature command, and sensor sends temperature, same for rh and for co2... so its not just a sensor, but there is a chip on board as well that handles communication...

there is a good tutorial here:


if you need something about a code, i can work on, it when i get home...
 

ComputerSaysNo

Well-Known Member
A pi is just a mini bare-bones computer, alot of people dont realize you can save even more money just running home assistant off your home computer.
In this scenario that means your home computer will have to be running 24/7, because data wants to be collected, and devices controlled. A Raspi will be a lot more power efficient than most home setups; if the PC draws 40 W and the Raspi draws 5 W, that really adds up in the long run (of course its negligible considering what most grow setups draw...).

I would not want having to use my regular PC to double as a grow room controller, unless it was running around the clock anyway; and there, I use a Linux based OS, which you can actually run for extended periods. That's not possible with Windows.

If there's already a server running permanently in the household, a Raspi would be redundant (but then there would have to be a microcontroller satellite system in the grow space to collect the data, and possibly run relays for switching power).
 

pahval

Well-Known Member
I was thinking about ducting.
The ability to change air flow in the ducting without doing it manually for each.
change in what way? like have intake and outake with one pipe? this should be achievable with changing of fan blow direction... tell us more about what you want to achieve and well see what we can figure out...
 

Friendly_Grower

Well-Known Member
change in what way? like have intake and outake with one pipe? this should be achievable with changing of fan blow direction... tell us more about what you want to achieve and well see what we can figure out...
Well they make electrically controlled Motorized Dampers.
That would allow air to be directed where a grower wants it. The same with inlet air. Get it from a "lung room" for example or from outside.
It's design ideas. Nothing firm on design so no need to invest more than casual conversation.
It's a good and interesting thread.
What I like is having access to the stats of things in the grow-room.

Friendly_Grower
 

pahval

Well-Known Member
Well they make electrically controlled Motorized Dampers.
That would allow air to be directed where a grower wants it. The same with inlet air. Get it from a "lung room" for example or from outside.
It's design ideas. Nothing firm on design so no need to invest more than casual conversation.
It's a good and interesting thread.
What I like is having access to the stats of things in the grow-room.

Friendly_Grower
i see... well, basically, anything that has electromotor can be controlled with micro controller... but im wondering, can the duct be achieved in a way you only have one flap (i think thats how this motorized part that opens and closes is called), in a Y splitter, just before v part, so when it goes to left, it lets air go trough left part of v and down to I, and when it goes right it does the opposite... and is there a commercial product like that allready been made?
 

Friendly_Grower

Well-Known Member
i see... well, basically, anything that has electromotor can be controlled with micro controller... but im wondering, can the duct be achieved in a way you only have one flap (i think thats how this motorized part that opens and closes is called), in a Y splitter, just before v part, so when it goes to left, it lets air go trough left part of v and down to I, and when it goes right it does the opposite... and is there a commercial product like that allready been made?
I'll look into to these things.
This is the dreaming about it part for me.
You got to work through the thoughts and ideas so when money is spent there are no regrets.
I can't remember how many times I bought before I was sure and ended up with parts on hand and no immediate use for them.

Friendly_Grower
 

pahval

Well-Known Member
of course, trust me, when i find a product i like, i search youtube about how it works, google for same, i google reviews, if its lets say amazon i look for worst reviews, etc etc, then if i like product, like some dehumidifier, i imagine how it works in my tent and what are problems i may run into, or at least what i might need to test, as in, the speed of removal of humidity, reliability of 24/7 running etc... just an analogy, but my point is, im same... =)
 
Top