Well…I stare at the plants a lot. However, I’ve been …um…challenged to get the camera mount working right and my mind won’t let me take a picture of the plants until I have that figured out. I better figure this out soon! 🙂
This post discusses the python code located at this GitHub location.
The Question I’m Asking
I’m looking at data in the log file that goes from 3/4 4:26:60-3/7 12:54. While the use of the data will change over time to focus more on the health of the plants, the question I’m answering in this post is:
What is the average temperature,humidity, and CO2 when the LEDs are on and when they are off?
Knowledge Provided by the Answer
Knowing the average values of the environmental properties monitored by the Leaf Spa will give me a clear idea if these key values in the healthy growth of a plant are optimized and at expected values.
Here are the results for the log file in this spreadsheet (sheet is named 3022017_0426-0307_1254):
|LED ON||LED OFF|
The table is at the bottom of the sheet. It shows there were two runs. The first run only had values for when the LED was on. The second run had values for when the LED was on and off. I want to spend a little time analyzing the results. I’ll write up my thoughts in a future post.
In this post I will focus on the Python code I wrote that appended the average values to the bottom of the log file.
Once the log file was processed by the Python code, I imported into the Google Spreadsheet.
The Python Code
The Python code (located at this GitHub location) opens the CSV file created by the firmware of the Leaf Spa, reads through it, calculates the average values as shown in the table above, then appends these values to the end of the CSV. I called the project: Avg Temp, Humidity, and CO2. As I discussed in a previous post, my knowledge of python requires me to wear floaties:
I run the code within the Eclipse IDE. I show an image In this post on how to enter arguments. In this project the argument entered is:
-i <path to csv logfile>
In my case, the dialog box looks like this:
I’m thinking you can understand what is going on within the Python code without me explaining.
Nifty Atom Editor Feature
Since I think of myself as an advanced beginner with respect to Python coding, I am excited to share an interactive environment that I use as a sandbox to test stuff out – the Atom editor with the script package installed. This Quora link has answers on how to install the script package. Using Atom with script means Python scripts can run within Atom. This makes trying stuff out much easier than using Terminal! Yippee!!!
There it is:
- (beginner level) Python code to get to the average values of the temperature, humidity, and CO2 when the LED lights are on and when they are off.
- a new-to-me way to play around with Python using Atom + script package.