I have a Tunze Osmolator plugged into plug 8 on my EB, and in the ATO water supply, there is an optical sensor plugged into my FMM directly.

I would like to have the ATO turn off for 1 of 2 reasons. Either the water level in the freshwater tank is low (sensed via optical sensor) or the pH in the aquarium gets higher than 8.2 (sensed via pH probe). I would like it to notify me if the ATO shuts off for either reason.

Does this code work for that?

Screen Shot 2017-05-22 at 9.11.33 AM.jpg

I also have it shut off Osmolator for feeding, to keep alarm from going off because my water level rises in sump during feeding.

In this code: "ATOsen" is the switch for the optical sensor. (Open is not covered, is low water)
"Output ATO" I think is the virtual switch I created that looks like this:

Screen Shot 2017-05-22 at 10.25.15 AM.png

Is this the way to do it? Is there a cleaner/easier way?

And how do I set up the alarm on this switch?

Thanks in advance for your input!