Question about Funcions. My head is melting

Hey All. I am finishing setting up the automation.
I’ve CO2 sensor and humidity sensor and I have humidifier and fan that are connected to Kaza power strip. All of it is connected and working and sending data into Mycodo.
I was following the long guide of Kyle until the moment where he describes the " Carbon Dioxide Regulation Function". Some of the things described in the guide I just don’t see in mycodo. Like the part where it says " . Set the Conditional Statement to:" and the there are a couple of lines of code, but within the “conditional controller” config ui there is no field called “conditional statement”. So I got stuck.
Basically here here is the logic I need:

  1. Kaza socket 1 with Humidifier plugged in is looking at humidity sensor data and turns the humidifier on when it is bellow 87% and ramps it to 90-92%. If it is above 95 it turns on the fan for 5 seconds which is plugged into socket 2.
  2. If Co2 is above 800ppm based on Co2 sensor, the same fan turns on.

Can I achieve it with regular PID configuration function?

There have been several code sctions added to the Conditional Function since that was written. It’s simply the main code section that’s executed, now called “Run Python Code”.

Thank you!!

Can I ask a follow up and I apologise if this is something straight forward that I missed. Here is your code for CO2:

> co2_limit = 700
> on_duration = 90
> run_interval = 1900
> import time
> measurement = self.condition("{b719d47a}")
> try:
>     print(self.last_on)
> except:
>     self.last_on = 0
>     self.stay_off_until = 0
>     self.turned_off = True
> if self.last_on + on_duration < time.time() and not self.turned_off:
>     self.run_action("{18a86305}")  # Turn off if has been on
>     self.turned_off = True
> if measurement is not None:
>     if time.time() > self.stay_off_until and measurement > co2_limit:
>         self.logger.info("CO2 > {}: {} ppm".format(co2_limit, measurement))
>         self.last_on = time.time()
>         self.stay_off_until = time.time() + run_interval
>         self.run_action("{9e6fac6d}")  # Fan on
>         self.run_action("{5fa75b9a}")  # Humidifier on
>         self.turned_off = False

You have different action IDs for fan on and off, but the Kasa Strip controller output has only 1 ID for all sockets. Where would I get the ID’s for on/off for specific action?

From Mushroom Cultivation Automation: From Foraging to Fruiting – Projects | Kyle Gabriel

Add a “Measurement (Single, Last)” Condition and set it to the Humidity measurement. Add an “Output (Duty Cycle)” Action, set it to the Fan PWM Output, and a Duty Cycle of “30” percent. Add a “Pause” Action and set it to “10” seconds. Add an “Output (Duty Cycle)” Action, set it to the Fan PWM Output, and a Duty Cycle of “0” percent. The order of the Actions is important, so make sure you add then in the order listed… Add an “Output (On/Off/Duration)” Action, set it to the Humidifier, the State to “On”, and the Duration to “90” seconds… Be sure to change the IDs to match those of your particular Conditions and Actions.

What you are hilighting on your screenshot is a UUID for an Output. It has nothing to do with Conditional Function Conditions and Actions.