I think the problem is the you have “Sw2” and the name of the switch “Tankov” both in the code. Try
IF Tankov OPEN Then OFF
Also, this is just code to control a ATO solenoid right, and not controlling your ATO? I only ask because if this solenoid is the only thing that stops fresh water from entering your system I would be nervous about relying just on a float switched that if it failed would constantly put fresh water into my system. For instance if you were to somehow accidentally pull one of the wires from the break out box it would open this solenoid and constantly be adding fresh water.
Just something to consider, and if this solenoid is just a redundant backup then please ignore my last paragraph.