FlytrapCare Carnivorous Plant Forums

Sponsored by FlytrapStore.com

Ask questions about terrariums, mini bogs, greenhouses and other growing environments

Moderator: Matt

Are you interested to learn how I automated my grow lights and exhaust fan ?

yes - it sounds interesting.
7
78%
no - we already know how, and this was documented exhaustively elsewhere.
2
22%
User avatar
By Supercazzola
Location: 
Posts:  1498
Joined:  Sun Nov 22, 2020 1:57 am
#370483
Screen Shot 2020-12-09 at 6.11.47 PM.png
Screen Shot 2020-12-09 at 6.11.47 PM.png (62.38 KiB) Viewed 17111 times
Before I put a lot of effort into writing up a guide, I thought I would poll and see if folks would be interested in one way to automate grow lights, exhaust fans, etc, for relatively cheap, using parts easily obtainable on Amazon, a free software called Home Assistant, and a bit of patience. If so, I will gladly write what I did. I am in no way an expert, and as of right now, I just have a very basic understanding. Just enough to get me what I wanted, albeit not in a pretty way yet.

What I have managed to be able to do:
  • load some firmware on, and program a cheap smart outlet to automatically turn on and off with the sunrise/sunset
  • load some firmware on, and program a cheap smart switch which has a relative humidity sensor and temp sensor probe to give me conditions in the grow tent. Decisions can me made based on either temperature limits, relative humidity level, or a combination of to turn on or off the exhaust fan
What I am still looking to do:
  • find a smart CO2 sensor and add it into the system and logic for the fan automation
  • make everything including the user dashboard look pretty
  • most importantly, get advice from forum members on what limits to use in the on / off criteria of the devices, to grow my drosera
Just seeing if folks are interested in how I did it. if so, I'll take the time to document it.
User avatar
By Matt
Location: 
Posts:  22522
Joined:  Mon Apr 21, 2008 11:28 pm
#370516
I think this is a great idea! I see another person voted and said that this information is already available elsewhere, and it might be (or maybe it is spread over multiple posts?) but I'm not aware of it. I think the more information out there, the better!
Apollyon liked this
User avatar
By Panman
Location: 
Posts:  6309
Joined:  Wed Mar 04, 2020 8:41 pm
#370518
I am nowhere near ready for this yet, but it would be great information to have. The other thing is that even if this has been dealt with elsewhere, unless it has been within the past year, there are likely technology changes that you are taking advantage of. New technology is released so quickly now, that any sort of documentation can be obsolete in 6 months.
By Benny
Location: 
Posts:  530
Joined:  Thu Jan 16, 2020 9:46 pm
#370536
Something I have always wanted to do, but I am not smart enough to figure it out on my own! :lol: It would be very interesting and helpful to hear, though.
User avatar
By Supercazzola
Location: 
Posts:  1498
Joined:  Sun Nov 22, 2020 1:57 am
#370543
I'll start with a list of what I had to buy:

  • Smart Plug. I use this to connect my LED Grow light to. I own this smart plug: https://www.amazon.com/gp/product/B07D9H9XCD but it seems to no longer be available. There are other similar models on Amazon.
  • A temperature and humidity sensor. I own this one https://www.amazon.com/gp/product/B075FSHKQ5 What I like about this Sonoff TH16 is that it also has the ability to act as a switch, although you will have to cut an extension cord in half to connect to it. I use this switch to actually turn on and off my exhaust fan
  • Speaking of extension cord, I used this one https://www.homedepot.com/p/Woods-8-ft- ... /204667701from a local Home Depot store, but Amazon has some too. The key is to buy one that the cable is flat (as opposed to being round). This is because the TH16 doesn't give you a lot of space for the wire.
  • A USB to serial adapter that breaks out Voltage, Ground, Send and Transmit. It is important that it outputs 3.3 volts DC. I chose this one https://www.amazon.com/gp/product/B07D7T3R77
  • I already had a soldering iron, solder, and some hookup cables. More on that later in my detailed description.


From a very high level, this is what has to happen. I will get into details of each step in subsequent posts:

  1. Update both the smart plug and temperature and humidity sensor with a firmware called Tasmota.
  2. Configure the Tasmota firmware to connect to my wireless network.
  3. Load software called Home Assistant and configure the devices.
  4. Create some rules for when to turn things on.
Sounds simple, right? It takes a bit of time, but I am happy with what I was able to get it to do. I'll follow with some more detailed posts during the next days.
User avatar
By Apollyon
Location: 
Posts:  1663
Joined:  Tue May 05, 2020 2:49 am
#370544
For sure, being able to get inspiration and info from one source is better than hunting for it in 20. I think it's a great idea. I'd like to synchronize my setup going forward, I do it manually. Thanks for the information!
User avatar
By Supercazzola
Location: 
Posts:  1498
Joined:  Sun Nov 22, 2020 1:57 am
#370584
The idea is simple. Many devices use the same chip or chipset to accomplish connecting to wireless network and monitoring / controlling devices through General Purpose Input Output (GPIO) pins. The folks at Tasmota https://tasmota.github.io/docs/ wrote some open source firmware for ESP8266 based devices. The process to flash it to different devices varies, depending on the device.

For the wireless smart outlet, I chose to do it Over the Air (OTA), meaning I used a raspberry pi, my laptop, and my smart phone. The steps I followed were pretty much what is documented on this page: https://github.com/ct-Open-Source/tuya-convert
  • Installed Tuyaconvert on my Raspberry Pi
  • Flashed the included Tasmota firmware file
  • Connected to the tasmota-xxxx access point (AP) using my cellphone, and went to newly flashed device's IP address using phone's web browser to enter my home's Wi-Fi credentials into the device.
  • The wireless smart outlet shows up on my home networks list of connected devices, and I go to it's IP address on my laptop to continue configuring the device.
Once the smart outlet is on my home network, I moved on to the next device, the Sonoff TH16. This one required a bit more work, and I wound up following instructions laid out in this excellent video https://youtu.be/JgHr5z33xlA
A couple of things to note about the Sonoff TH16:
  • Once you open it, you will see a spot for some standard .1 " header pins to be soldered. In my case, there were 5. You only use four. But I soldered in a 1x5 header. The 4 you use are TX, RX, VCC, and GND. a photo of which pin is which is nicely seen here:
    Image
  • As pointed out in my earlier post, you will need to make sure the USB to serial adapter you use is set for 3.3 volts out, otherwise you will damage the Sonoff TH16. On mine, there is a jumper to set the voltage of the VCC out and data levels.
  • Remember that the TX from your USB to serial adapter goes to the RX on the Sonoff TH16. The RX from the USB to serial adapter goes to the TX on the TH16
Once the firmware gets loaded on the TH16, you do a similar "dance" with the cell phone connecting to the device's wifi AP, setting your home wireless network's credentials, and connecting the device to your home network.

Next steps: installing Home Assistant, configuring it (and MQTT Broker), then configuring both the smart plug and the TH16 to connect to MQTT. More in upcoming post.
User avatar
By Supercazzola
Location: 
Posts:  1498
Joined:  Sun Nov 22, 2020 1:57 am
#370586
You can choose to install Home Assistant on a Raspberry Pi (I didn't have a spare when I started), or running in a virtual machine, on a Mac, PC, or linux computer. For me, I am running it on Virtual Box https://www.virtualbox.org/.

Instructions for loading it are all over youtube. The one I followed was this one https://youtu.be/sVqyDtEjudk. Warning, you should probably click the gear icon on youtube and have the playback speed be slower than 1.0. This guy talks fast.

In the video above, he also walks you through how to install it either on a raspberry pi or in a virtual machine. Regardless of what method you chose, the important thing is to get Home assistant installed.

Once home assistant is installed and running, we need to install and setup the Home Assistant Add-on, Mosquitto broker. He goes over this in the video above at about 9 minutes in. One thing to note, in the video above, the video references "Hass.io" on the screen. This has been renamed to Supervisor, as shown in my screenshot
Screen Shot 2020-12-11 at 8.44.10 AM.png
Screen Shot 2020-12-11 at 8.44.10 AM.png (15.37 KiB) Viewed 16939 times
Once you get the Mosquitto broker addon configured, the next step is to go back into the smart plug and TH16 and configure them with the IP address of your Smart Assistant, and the credentials of the user you created for Mosquitto broker. Using the console on the web interface for the smart device, you can issue the command
Code: Select all
SetOption19 1
and the device should be placed in self discovery mode. More on configuring the devices and automations in another post.
User avatar
By Bixtor36
Posts:  133
Joined:  Sun Aug 02, 2020 3:04 pm
#370591
This is great! This is actually the next project that I had on my list! I had done the research, and was planning to leverage some Tuya WiFi switches, Xiaomi plant sensors, and Home Assistant on a Raspberry Pi. I'm definitely going to have to check out that Sonoff switch. I would also be happy to contribute to the setup and guides if you are interested!
User avatar
By Supercazzola
Location: 
Posts:  1498
Joined:  Sun Nov 22, 2020 1:57 am
#370616
Bixtor36 wrote:This is great! This is actually the next project that I had on my list! I had done the research, and was planning to leverage some Tuya WiFi switches, Xiaomi plant sensors, and Home Assistant on a Raspberry Pi. I'm definitely going to have to check out that Sonoff switch. I would also be happy to contribute to the setup and guides if you are interested!
Thanks. I think I found a CO2 sensor and will add more info when I get it in, and have a chance to test it.

There are a few nuisances when you set Home Assistant up on the pi. Some of the add ons are not going to work on ARM platforms. Just ask if you have any issues getting it installed and setup.



Sent from my iPad using Tapatalk Pro
User avatar
By Supercazzola
Location: 
Posts:  1498
Joined:  Sun Nov 22, 2020 1:57 am
#372613
Thought I would update this post. I found a CO2 Sensor

US $19.50 | Infrared CARBON dioxide se ... ocialShare

And integrated it with a D1 Mini

US $2.12 7% Off | Wemos D1 Mini V3.0. ... ocialShare

The interconnect was easy, and I can document that in another post. So now I have three temperature sensors in my grow tank, two relative humidity sensors, and one CO2 sensor. I am finding it interesting to monitor how the values vary throughout the day. I run my exhaust fan for 30 mins throughout the day. Can you guess when ?
6C9D0F11-51D1-4731-85C7-C2297746B75A.jpeg
6C9D0F11-51D1-4731-85C7-C2297746B75A.jpeg (156.35 KiB) Viewed 15193 times


I’m still trying to understand the delta in the three temperature sensors, but the trends are consistent.
By sundewd
Posts:  189
Joined:  Sat Jan 16, 2021 8:53 am
#377956
I've attempted to use a more out of the box approach and it's been disappointing. I got two Switchbot hygrometers and am using IFTTT to trigger fans that are connected to Kasa smart plugs. But the update interval is quite long, maybe every 15 mins, and sometimes it doesn't make connection and then it seems to wait until the next update interval rather than trying until it gets it so the fan could be stuck on or off for unpredictable amounts of time. It seems like creating a schedule would be more reliable. I looked at home assistant but it seemed kind of complicated, but it might be the best solution in the end so I'll have to take another look soon.
Last bumped by Supercazzola on Thu Jan 05, 2023 4:45 am.
Supercazzola liked this
Hello!

Welcome

Chilly in LA…

I've got a friend in Harvey, but that looks like […]

Hey all, just got my order in today and figured I'[…]

1 year old cape!

My cape is being evil. It died back when I did I[…]

The Sphagnum Yacht

We all love cotton...blue jeans, t-shirts, underwe[…]

I counted 21 in this one. Both are flavas that I g[…]

A few weeks back most of my VFTs suddenly put out […]

Counting to infinity.

2476

Support the community - Shop at FlytrapStore.com!