Programming tasks for multiple tanks from 1 card?

We are trying to set up controls to operate two tanks from the same card, alternating between the two programs. The goal is to fill tank 1, then alternating to fill tank 2 when tank 1 is full, and repeating. However, the automation cards only have an input for one tank at a time. Since these tanks are filled from the same inlet pipe, we’d like to alternate between them. Once the tanks are full, we want to run a specific program for each tank that directs where the flows go - we can use the irrigation and drain settings for each tank to do this.

I have a few fixes that I think will work, but I want to run them by you first.
We can have the inlet valves (fill valves for each tank) alternating, so one is always open while the other is always closed. I think this can be done with a connection to the relay that operates this way. However, I then need to program into the automation cards the following steps to follow when the tank is full. I am not sure that if I have two automation cards, one for each tank, that if I set the valve to fill as the first step of the program if it will wait for the other valve to close before opening this fill valve. I know on other controllers they operate this way, with the tasks queueing until its allowed to open the fill valve, but usually this is with programs on the same automation card rather than on two different cards.
Another fix is if there are any cards that I can program what tank to fill, irrigate, and drain. It looks like I can only set up one tank for each automation, rather than multiple tanks.

Any help would be appreciated. Thank you in advance.

Hi Gregory,

The Fertigation control card may be your solution. It was designed to manage fertigation for multiple tanks, switching valves for common sources (city water) and common destinations (drain) for multiple tanks.

Give this a try: Add a Fertigation control card, set up the multiple tanks, and configure the fill/drain valves and pumps.

Once that’s configured you should be able to run individual tasks - fill a tank, drain a tank, etc. You can customize parameters so the tasks look like “Fill tank 1 to 75%” and “Fill tank 2 to 75%”.

Once you’re confident you can manually kick off these tasks (valves and pumps switching as necessary), add a fertigation automation card to do it for you. Something like - between 7am and 4pm run the “Fill tank 1 to 75%”, followed by “Fill tank 2 to 75%”, followed by “Pause for a period - 5 minutes”. Set to repeat and Bob’s Uruncle.

The pause is there so the system doesn’t loop through hundreds of these a minute when both tanks are already filled.

Hi Loren,

I don’t think the fertigation control card will work, as it only has settings to add the valve to the tank and the valve from the tank, but no irrigation valve. We require a fill, drain, and irrigation valve to run our program.
Fill is from the sludge tank, drain is back to the cistern, and irrigation is into the reactor.
The ideal setup is to fill, pause, irrigate, pause, drain, restart for Tank 1.
When tank 1 is filled (step 1), open tank 2 to fill, pause, irrigate, pause, drain, restart.
I’d like the program to start on the opposite tank as soon as the fill step is achieved (ie. the fill valve closes), leaving time for the pause/irrigate/pause/drain while the other tank is filling.
Is this possible given the current card setup? or do we have to program some connections in the background, say having 1 fill valve always open?

It sounds like the fill,pause,irrigate,pause,drain,pause(repeat) can be set up independently for each tank using the Tank control and the Irrigation automation cards.

The challenge is in synchronizing these two automation cards so the cycle for one tank begins upon completion of the fill task of the other tank (both ways?).

The simplest solution would be to offset the tasks in time. If there are only a handful of cycles throughout the day (say 10 or less), you could set them up to start at specific time offsets, with no repeating. This would require no special programming.

If, however, you require the completion of one task to start another task (or sequence of tasks), the only mechanism (without custom programming) is to use the connected cards functionality.

This is where named tasks come in handy. Let’s say you named your first pause task (on Tank 1 card) “Pause after Filling”, and that consists of a Pause for a Period of 20 minutes.

Then on Tank 1, you could set up a connected card that says "When my current task equals Pause after Filling, send the Start Task message to the Tank 2 card of “Fill Tank”.

Since tasks queue, you could continue with another connection triggered by “Pause after Filling” to tell Tank 2 to do the next step (pause after filling), and the next (irrigate), and the next(drain).

The result is as soon as Tank 1 “Pause After Filling” task begins, all of the tasks for Tank 2 are queued up.

That’s an example of using the Connected Cards for custom automation. If none of these built-in mechanisms work, there’s always the ability to use JavaScript with the built-in Node-RED service, or your favorite programming language using the external API.

Thanks, that is interesting.
I have the programming set up on two separate cards that alternate between each other on a repeating schedule. They should run with one filling for the first hour, decanting for the 2nd. While decanting, the next controller should fill for an hour, then decant for an hour.
However, in practice we find that one can fill anywhere from 45 -75 minutes, which offsets the remaining programming. Sometimes this causes the steps to fall in sync, which increases the amount of time to run through the program as some pipes are shared - one step of the program can interfere with the identical step on the other program.
How can we use the connected cards function to unite these programs? Both programs are on the same controller. I have only used the connected cards function to mirror one card on another controller so both controllers have access to a specific relay, for example.
Thank you,
G

If I understand correctly, you have one task that starts with one card, and when that task is complete, it should trigger a task on another card.

Since you have them both set up as timers, a simple solution could be to kick off the “Fill Tank” task with a limit of 55 minutes, so at the top of the second hour it’ll be sure to be done when the decant process begins.

If these tasks are truly sequential, then my advise is to set up a link between the cards such that when tank filling is complete, it kicks off the decant task on another card.

An example of that is above, where it says "When my current task equals Pause after Filling, send the Start Task message to the Tank 2 card to “Fill Tank”.

Yes, one card runs a task that should take 2 hours, but filling for the first hour and decanting for the 2nd hour. The offset for the other card is 1 hour, so it should start to fill as the first card finishes filling.
If I connect cards using the same method as previous, does it give me an option to start the program at a certain step? I can only find it can be triggered by current recipe key or current recipe activation number but I’m not sure how to get unite the programs between the two cards.

Maybe: If I have the fill program start for one card (at a specific time), then have the decant program trigger the fill program on the other card? If I can set it up that way, perhaps it will work.
To do this, would I set it as:
When decant from (other card) is open, start (current recipe key) and vice versa? The decant trigger could be via a connection to the relay.
Would I have to remove the program repeat cycle, as it will trigger the cycle when the trigger is met - in this case, that a specific valve is opened? Do I need to maintain one of the start cycles via time, and the other via trigger? If one starts with time, but is also triggered by something else, will it queue up the tasks? I might have to test this.

Easy to test. Create two simulator cards of the same type, change timeframes so you’re not waiting an hour between tests. Then test, debug, repeat. Experiment with terminating mid-flow.

No way of starting a task mid-stream. You can stop mid-stream, but starting is always from the beginning.

I am not sure to start a program using a connection. The programs all have times on them, and they start based on the time entered, rather than at the direction of a connection.
One option I have is to set current recipe - but does that mean I enter the task title to start that task? (doesn’t work) What happens with the time limit and repeating the tasks?
What is the difference between Current Recipe Key and Current Recipe Activation Number?
If I can trigger the set of tasks based on the position of one relay, I can alternate the tasks based on the final relay being activated by the program. But I can’t seem to get that to work, as the two cards to control the two simultaneous-but-offset programs are triggered by time instead of connections.

You can’t start a program (in an automation card) with connections, but you can start tasks (in a control card) using connections.

See if this can be done using tasks in the tank cards. You can even get creative, like naming a task “Fill Complete” from a simple “Pause for a Period” task (pausing 1 second or something). Then you can place that task at the end of an automation card recipe. In the control card you can build a connection such as when the current task is set to “Fill Complete”, set the current task in tank 2 to “Fill Tank”.

Unfortunately there is no way to manually start an automation recipe. Those can only be kicked off by the automation card based on the time of day.