How to pass a parameter to a Conditional Controller?

I would like to start a Conditional Controller from a Trigger Sunrise Controller, and passing a parameter which will be calculated from measurements in the last.

How can I do that?

1 Like

I’m not sure I understand what you’re asking. What exactly do you have with the Trigger Function that you want to pass to the Conditional Function?

The Trigger Sunrise Controller will measure hygrometry, get meteo data and will calculate the number of tanks to water or the number of liters. Then it will start the Conditional Controller in charge of watering with this parameter.

At present time, I have a parameter hard-coded in the Conditional Controller and I need to edit the code to change it.

I still don’t understand. The Sunrise/Sunset Trigger Function merely executes Actions at sunrise or sunset. There are no parameters that it has to pass.

Let’s try another way, more globaly: is there a way to pass a value or a variable from one controller to another one?

I’ve been trying to figure out if it’s possible, and I’ve concluded there’s currently no method to send anything to a Conditional Function.

The only way I can think of to actually get data to it would be to create a dummy Input and save a measurement value to it, which the Conditional Function can then read. For instance, save value 1 to Dummy Input to initialize stage 1 in the Conditional Controller. Several minutes later, save a value of 2 to Dummy Input. There currently isn’t an Action to save a value to an Input or a Python Code Action to execute arbitrary Python code (which could be used to save a value to the measurement database).

I’ve wanted to add a Python Code Action for a while, since it can be pretty useful. This is the first time a user has demonstrated a real need for it.

1 Like

Isn’t it here: [Action] Execute: Bash/Shell Command ?
It misses “only” a parameter and a + to add another one. Parameters would be able to be choosed from any available date: measurement, calculated measurement, output state, etc.