Hi Guys,
I build an magnetic stirring unit for my base, acid and the fertilizer.
For this I glued two magnets on each fan. A housing was printed on the outside. The fan is mounted in the housing. The container with the respective liquid is then placed on the housing. There is also a magnet in each of the liquids. As soon as the fans start up, the magnets in the liquids are carried along by the magnetic force, causing the liquid to be stirred.
The hardware is ready and each fan is connected to a relay.
I tried to create a conditional function. However, I cannot get this to work. None of the outputs are acting.
Does anyone happen to see the mistake I made?
Or can anybody give me advice to create a function the right way if creating a function by a conditional function is the worng way?
# Example code for learning how to use a Conditional. See the manual for more information.
self.logger.info("This INFO log entry will appear in the Daemon Log")
self.loop_count += 1 # Counts how many times the run code has been executed
########################################################################################
#Declaration
measurement_ph = self.condition("9995db5f") # Replace ID with correct Conditional ID
measurement_ec = self.condition("c5942d7c") # Replace ID with correct Conditional ID
self.logger.info(f"pH measurement value is {measurement_ph}")
self.logger.info(f"EC measurement value is {measurement_ec}")
setpoint_ph = 8
hysteresis_ph = 0.35
setpoint_ec = 900
hysteresis_ec = 100
t_stirr = 20
########################################################################################
#Regulation pH
if measurement_ph is not None: # If a measurement exists
self.message += "This message appears in email alerts and notes.\n"
#pH too low
if measurement_ph < (setpoint_ph-hysteresis_ph):
self.message += f"pH measurement is too Low! Measurement is {measurement_ph}\n"
self.run_action(message=self.message) # Run all actions sequentially
self.run_action("08174ef9") #Stirring
self.run_action("82ab9093") #Pause
self.run_action("d3350900") #Dispense pH Upper
#pH too high
elif measurement_ph > (setpoint_ph+hysteresis_ph):
self.message += f"pH measurement is too High! Measurement is {measurement_ph}\n"
self.run_action(message=self.message) # Run a single specific Action
self.run_action("98680d9e") #Stirring
self.run_action("82ab9093") #Pause
self.run_action("f237d75e") #Dispense pH Downer
#########################################################################################
#Regulation EC
if measurement_ph is not None: # If a measurement exists
self.message += "No EC measurement available.\n"
#EC too Low --> add fertilizer
if measurement_ec < (setpoint_ec-hysteresis_ec):
self.message += f"EC measurement is too Low! Measurement is {measurement_ec}\n"
self.run_action(message=self.message) # Run all actions sequentially
self.run_action("d5b06b69", message=self.message) #Stirrer Fertilizer
self.run_action("82ab9093") #Pause
self.run_action("683361df") #Dispense Fertilizer
elif measurement_ec > (setpoint_ec+2*hysteresis_ec):
self.message += f"EC measurement is too High! Measurement is {measurement_ph}\n"
# Replace "qwer5678" with an Action ID
Regards
Edit: not sure if you can see the pictures