Ph and EC Function Code Adjustment

I love the mycodo function that controls PH and EC. Currently there are 4 pumps that can be configured to use as dosing pumps to control the EC. Am I able to add additional code to add more pumps? Example would adding the lines "action_id_pump_4_nutrient_b = “PUMP_4_ID”,"action_id_pump_5_nutrient_c = “PUMP_5_ID”, "action_id_pump_6_nutrient_d = “PUMP_6_ID” etc etc. Would that work or is there additional items that need be adjusted?

No need to reinvent the wheel. A simple fix is all ready in place and it’s called and Output Trigger.

If not mistaken, all I need to do is configure and Output Triger to triger as many pumps as I see fit. Or am I way in left field?

Nope got a little fuzzy on the logic. I was under the impression that there was a built in Output Triger option within the regulate_ph_ec.py function . Back to the drawing board. I just want to make sure that I’m on the right track. If I wanted to add more EC pumps to the requlate_ph_ec.py file all I need to do is add the additional lines “example every where I see a reference to the list of EC pumps in the file I add additional entries for each pump” throughout the entire file? Save with new name and it would appear within the functions options within Mycodo?

upgrade to latest mycodo version 8.15.6 in which you can control upto 4 EC pumps and you dont even have to write any code. Everything is built in.


Please check the reference image and I hope this is what you want to do

yes, I have the 4 EC dosing pumps configured. There is a particular nutrient line that has 10 spots. I’ve looked through the code and it looks as if there’s about three maybe four sections that need be adjusted. Thanks for reaching out and sharing your time.

There are two ways to approach solving your issue, and both involve Python programming. You can either duplicate the current Regulation Function and modify it to use more pumps, or use the Conditional Function and modify the code to use more pumps. There isn’t currently a Variable Pump Regulation Function, but I see there’s a definite need for one that can accommodate any number of pumps without having to learn Python or involve convoluted ways of triggering Outputs based on when other outputs are actuated from the Function.

1 Like