A controller for performing a peritoneal dialysis treatment, the controller being programmed to: connect a disposable unit to a source of sterile and pure water by a fluid conveyer and circuit switch , said disposable unit including at least a first container holding a sterile liquid concentrate containing an osmotic agent, a second container holding a sterile liquid concentrate containing electrolytes, an empty sterile mixing container , and a tubing set with a pre-attached peritoneal fill/drain line having distal and proximal pressure sensors , wherein the controller applies control signals to the fluid conveyer and circuit switch and the source of sterile and pure water and receives signals from the distal and proximal pressure sensors , 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 ; mix the contents of the mixing container ; further dilute or further add concentrated osmotic agent to the mixing container ; flow fluid from the mixing container 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 into the mixing container ; and after the mixing, detect the concentration of osmotic agent in the mixing container . connect a disposable unit to a source of sterile and pure water by a fluid conveyer and circuit switch , said disposable unit including at least a first container holding a sterile liquid concentrate containing an osmotic agent, a second container holding a sterile liquid concentrate containing electrolytes, an empty sterile mixing container , and a tubing set with a pre-attached peritoneal fill/drain line having distal and proximal pressure sensors , wherein the controller applies control signals to the fluid conveyer and circuit switch and the source of sterile and pure water and receives signals from the distal and proximal pressure sensors , 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 ; mix the contents of the mixing container ; further dilute or further add concentrated osmotic agent to the mixing container ; flow fluid from the mixing container 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 into the mixing container ; and after the mixing, detect the concentration of osmotic agent in the mixing container . 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 into the mixing container ; and after the mixing, detect the concentration of osmotic agent in the mixing container . <EOS>