Need help with an Apex command

WhatCouldGoWrong71

Well-Known Member
View Badges
Joined
May 19, 2023
Messages
894
Reaction score
462
Location
Memphis
Rating - 100%
3   0   0
I want a DOS head to engage the program I have it on when PH is greater than x.xx.

I want to bounce between Sodium Hydroxide and Sodium BiCarb. It’s easy on the Hydroxide pump (If PH > x.xx then off), that works well. But if I do the opposite for the other pump (if PH > x.xx then on) it turns the pump on nonstop, it doesn’t allow the pump to follow the programming. Does anyone have any ideas?
 

Pistondog

5000 Club Member
View Badges
Joined
Jun 28, 2020
Messages
5,326
Reaction score
9,456
Rating - 0%
0   0   0
I want a DOS head to engage the program I have it on when PH is greater than x.xx.

I want to bounce between Sodium Hydroxide and Sodium BiCarb. It’s easy on the Hydroxide pump (If PH > x.xx then off), that works well. But if I do the opposite for the other pump (if PH > x.xx then on) it turns the pump on nonstop, it doesn’t allow the pump to follow the programming. Does anyone have any ideas?
Please post exact code in order.
 
OP
OP
W

WhatCouldGoWrong71

Well-Known Member
View Badges
Joined
May 19, 2023
Messages
894
Reaction score
462
Location
Memphis
Rating - 100%
3   0   0
DOS_1 is Sodium Hydroxide
Code:
IF PH > 5.67 THEN OFF

DOS_2 is Sodium BiCarb
IF PH > 5.67 THEN ON

I want both pumps to have the following program turn on or off depending on PH levels:

DOS_1 is fine. DOS_2 with that command only turns the pump on permanently, it doesn’t revert to the program listed below.
 

Attachments

  • IMG_2044.png
    IMG_2044.png
    109.5 KB · Views: 25
OP
OP
W

WhatCouldGoWrong71

Well-Known Member
View Badges
Joined
May 19, 2023
Messages
894
Reaction score
462
Location
Memphis
Rating - 100%
3   0   0
You need a SET off/on to define the state opposite your conditional.
I’ve done for DOS_2 is Sodium BiCarb
1) Set ON
2) IF PH > 5.67 THEN ON

1) Set OFF
2) IF PH > 5.67 THEN ON

Neither are working. Sorry, I am not code writing friendly, so I may need granular instructions.
 

Pistondog

5000 Club Member
View Badges
Joined
Jun 28, 2020
Messages
5,326
Reaction score
9,456
Rating - 0%
0   0   0
Dos 2 should be set off.
Just noticed you are trying these with profiles.
Not sure how they play together, sorry
 

Lbrdsoxfan

5000 Club Member
View Badges
Joined
Jun 13, 2021
Messages
5,078
Reaction score
8,051
Location
Long Beach, CA
Rating - 0%
0   0   0
I'm betting part of your issue is the PH state isn't changing quick enough for the sodium bicarb. I'd prolly run it off of a measured dump instead of relying on the ph probe to change state. Meaning every 'x' amount of hours add 'x' ml's of sodium bicarb.
 

Jason_MrFrags

Well-Known Member
View Badges
Joined
Jun 8, 2017
Messages
789
Reaction score
336
Location
Grand Rapids, Michigan
Rating - 100%
17   0   0
Try

DOS_1 is Sodium Hydroxide

IF PH < 5.67 THEN ON
IF PH > 5.67 THEN OFF

DOS_2 is Sodium BiCarb

IF PH > 5.67 THEN ON
IF PH < 5.67 THEN OFF



After giving it more thought I believe you need to setup/use a profile for the DOS in place of the ON though
 

Reef-_-Noob

Active Member
View Badges
Joined
Jun 23, 2022
Messages
259
Reaction score
98
Location
Miami
Rating - 0%
0   0   0
Try

DOS_1 is Sodium Hydroxide

IF PH < 5.67 THEN ON
IF PH > 5.67 THEN OFF

DOS_2 is Sodium BiCarb

IF PH > 5.67 THEN ON
IF PH < 5.67 THEN OFF



After giving it more thought I believe you need to setup/use a profile for the DOS in place of the ON though
This will not work the apex will crash with error code 403 forbidden. Needs to be different values for the on off variable. The off variable should be higher than the on variable. It may never turn on though unless you are dosing a solution outside of the aquarium
 

Reef-_-Noob

Active Member
View Badges
Joined
Jun 23, 2022
Messages
259
Reaction score
98
Location
Miami
Rating - 0%
0   0   0
This will not work the apex will crash with error code 403 forbidden. Needs to be different values for the on off variable. The off variable should be higher than the on variable. It may never turn on though unless you are dosing a solution outside of the aquarium
That's an http protocol error never coded with apex but the logic should be correct
 

Jason_MrFrags

Well-Known Member
View Badges
Joined
Jun 8, 2017
Messages
789
Reaction score
336
Location
Grand Rapids, Michigan
Rating - 100%
17   0   0
This will not work the apex will crash with error code 403 forbidden. Needs to be different values for the on off variable. The off variable should be higher than the on variable. It may never turn on though unless you are dosing a solution outside of the aquarium
Just did it on one of my unused outlets to test and loaded successfully.
only issue I see is if you get a ph of exactly 5.67
 

Gtinnel

10K Club member
View Badges
Joined
Mar 20, 2020
Messages
21,397
Reaction score
29,910
Location
Charleston, WV
Rating - 0%
0   0   0
I’m no expert at programming but if the off statement works then why don’t you just set both so that there is a condition that turns them off and not on.

DOS_1 is Sodium Hydroxide
Code:
IF PH > 5.67 THEN OFF

DOS_2 is Sodium BiCarb
IF PH < 5.67 THEN OFF
 
Last edited:
OP
OP
W

WhatCouldGoWrong71

Well-Known Member
View Badges
Joined
May 19, 2023
Messages
894
Reaction score
462
Location
Memphis
Rating - 100%
3   0   0
I’m no expert at programming but if the off statement works then why don’t you just set both so that there is a condition that turns them off and not on.

DOS_1 is Sodium Hydroxide
Code:
IF PH > 5.67 THEN OFF

DOS_2 is Sodium BiCarb
IF PH < 5.67 THEN OFF
I tried this one and it worked. @Jason_MrFrags I will try yours tomorrow. I think I am OK missing a dose when it splitting the uprights. This tank went from around 40ML a day of 2 part to over 300 a day in 2 weeks once I started getting after the PH. Nuts...
 

Reef-_-Noob

Active Member
View Badges
Joined
Jun 23, 2022
Messages
259
Reaction score
98
Location
Miami
Rating - 0%
0   0   0
You should be able to use >= or <= depending which one you want. This means greater than or equal to

Edit : only use it on off or on variable not both
 

Reef-_-Noob

Active Member
View Badges
Joined
Jun 23, 2022
Messages
259
Reaction score
98
Location
Miami
Rating - 0%
0   0   0
There is also != not equal to but don't use that it will never turn off or on depending
 

Keeping it clean: Have you used a filter roller?

  • I currently use a filter roller.

    Votes: 21 27.3%
  • I don’t currently use a filter roller, but I have in the past.

    Votes: 3 3.9%
  • I have never used a filter roller, but I plan to in the future.

    Votes: 20 26.0%
  • I have never used a filter roller and have no plans to in the future.

    Votes: 29 37.7%
  • Other.

    Votes: 4 5.2%
Back
Top