A controller (610, 907) for performing a peritoneal dialysis treatment, the controller being programmed to: connect a disposable unit (641, 700, 800) to a source of sterile and pure water (216, 620, 790) by a fluid conveyer and circuit switch, said disposable unit (641, 700, 800) including at least a first container (204, 602, 760, 912) holding a sterile liquid concentrate containing an osmotic agent, a second container (206, 604, 762, 910) holding a sterile liquid concentrate containing electrolytes, an empty sterile mixing container (202, 606, 764, 850, 908), and a tubing set with a pre-attached peritoneal fill/drain line (234, 306, 650, 716, 945) having distal and proximal pressure sensors (613, 614), wherein the controller (610, 907) applies control signals to the fluid conveyer and circuit switch and the source of sterile and pure water (216, 620, 790) and receives signals from the distal and proximal pressure sensors (613, 614), respectively; receive a prescription command, indicating at least the fill volume and desired final concentration of the osmotic agent to be used for a current fill cycle under said treatment; pump a quantity of the concentrated osmotic agent that is at least sufficient to achieve the desired final concentration into the mixing container (202, 606, 764, 850, 908); mix the contents of the mixing container (202, 606, 764, 850, 908); further dilute or further add concentrated osmotic agent to the mixing container (202, 606, 764, 850, 908); flow fluid from the mixing container (202, 606, 764, 850, 908) to a patient; wherein the controller is further programmed to: prior to the pumping a quantity of the concentrated osmotic agent and responsively to the prescription command, pump a volume of water from the source of sterile and pure water (216, 620, 790) into the mixing container (202, 606, 764, 850, 908); and after the mixing, detect the concentration of osmotic agent in the mixing container (202, 606, 764, 850, 908). connect a disposable unit (641, 700, 800) to a source of sterile and pure water (216, 620, 790) by a fluid conveyer and circuit switch, said disposable unit (641, 700, 800) including at least a first container (204, 602, 760, 912) holding a sterile liquid concentrate containing an osmotic agent, a second container (206, 604, 762, 910) holding a sterile liquid concentrate containing electrolytes, an empty sterile mixing container (202, 606, 764, 850, 908), and a tubing set with a pre-attached peritoneal fill/drain line (234, 306, 650, 716, 945) having distal and proximal pressure sensors (613, 614), wherein the controller (610, 907) applies control signals to the fluid conveyer and circuit switch and the source of sterile and pure water (216, 620, 790) and receives signals from the distal and proximal pressure sensors (613, 614), respectively; receive a prescription command, indicating at least the fill volume and desired final concentration of the osmotic agent to be used for a current fill cycle under said treatment; pump a quantity of the concentrated osmotic agent that is at least sufficient to achieve the desired final concentration into the mixing container (202, 606, 764, 850, 908); mix the contents of the mixing container (202, 606, 764, 850, 908); further dilute or further add concentrated osmotic agent to the mixing container (202, 606, 764, 850, 908); flow fluid from the mixing container (202, 606, 764, 850, 908) to a patient; wherein the controller is further programmed to: prior to the pumping a quantity of the concentrated osmotic agent and responsively to the prescription command, pump a volume of water from the source of sterile and pure water (216, 620, 790) into the mixing container (202, 606, 764, 850, 908); and after the mixing, detect the concentration of osmotic agent in the mixing container (202, 606, 764, 850, 908). prior to the pumping a quantity of the concentrated osmotic agent and responsively to the prescription command, pump a volume of water from the source of sterile and pure water (216, 620, 790) into the mixing container (202, 606, 764, 850, 908); and after the mixing, detect the concentration of osmotic agent in the mixing container (202, 606, 764, 850, 908).