First and foremost, thanks for all the effort you have put in here. What an amazing job you’ve done so far!
My question is regarding schedules over time. Is there a way to schedule different sets of parameters for the different stages of growth? IE raising the conductivity over each passing week, changing nutrient ratios, or changing to a different light schedule after so many weeks?
I’m trying to understand more before I start buying parts. I tried running raspberry OS on a HyperV VM to test it out. It fails with the InfluxDB install due to architecture differences.
So I figured I would just ask you and then buy the parts. Thanks in advance for your support!
My guess would be that the easiest way is to add the capability to the EC control function. You could probably create an array with a value for each week and have it use those as the setpoints.
I guess the way I would do it is add a variable called start which holds the timestamp for the beginning of the growth cycle. Python can convert this into a timestamp and you can check up against this to see if a week have passed. Something like this:
ECvalues = [[0,900],[1,1000],[2,1100],[3,2000]]
Where the first parameter is the week since start and the second is the desired EC value.
Anyhow, the short answer is yes, it can be done, but there is no build in function I think.
It would be nice with some sort of valuables per time function somewhere. So you could merely link to these valuables from all functions and it would hold all sorts of data like temperature, EC, pH etc.
Jacob, Thank you for your input here! I’m new to this whole thing but I learn pretty quick. I need to do some reading to understand more about how to apply what you’ve said but I’ll take it as a logical option is there and I will figure it out.
I understand the concept of what you’re getting at with the coding experience that I have. I just don’t know python yet. This is a good simple task for me to start with. Thanks.
What @jacobguldbergdk said is one way to do it, and relies on a bit of Python coding. There are a number of ways to accomplish what you’re describing. If using a PID controller, you can use Methods to change the setpoint over time, which can be developed in the UI. But for non-PID control, with something like a Conditional Controller, creating some sort of array with desired measurement at a particular time can accomplish the same effect.
In thinking about developing a Custom Functions, it just dawned on me that there should be a way for the UI to display feedback from the running controller, by periodically executing a status function in the controller, which can return information about it in the current moment, such as how far along in a cycle it is, certain variable values, etc. This can further be used by Custom Widgets to display information on the Dashboard or elsewhere. Currently the only way to get feedback from a running Function Controller is to have it print log lines to the Daemon Log, but this is not the best solution for casually viewing status information.
Mycodo has already been designed to run in Docker, so if you want to try it out without a Pi, this will allow you to install it on virtually any operating system.
There are several functions used by Mycodo that allow comparing the current time to user-set time. I will see if I can make these more accessible to Conditional Controllers and perhaps add it to the Docs and/or FAQs.
Try this. I pulled it from the PID controller and it should work in a Conditional Controller but I haven’t tested it. start_time is only used for Duration Methods, and would be preferable if you wanted to reuse time-based Methods and not have to go back and change all the dates in the Method, since it operates based on time since the start time. You would merely change the start time and it will calculate the setpoint from whatever that start time is.
Which merely returns a dictionary. The frontend will display the “string_status” above the options of the Function, allowing direct feedback about what’s going on with the Function. This one merely shows the current time and an internal counter, and updates on the UI every 60 seconds. I think the first actual implementation I’ll make is the PID controller showing the current P, I, and D values, among other variables. This will also allow custom Widgets to get information about Functions to display, so one could make custom Functions and Widgets that share information and interact in more complex ways.
Alright, last update before I commit these additions… The status from PID Controllers is working now. The style will be tweaked before release, but the important part is it’s working. This may even expand into a more universal and direct way for all Controllers to share information to other parts of Mycodo.
Thats pretty cool. I love to be able to see the value of variables and function status on the dashboard.
I have build other control systems in the pass (like a brew system controller) and its nice to also see the setpoints on charts, especially if they change over time.