A method and device for masking noise from a dialysis machine (100), as an example of a medical device, includes tubing (238) or a fluid container (234), or both, being connectable to a patient (301) for flowing fluid to or from the patient, and one or more sensors (140) configured to detect one or more patient parameters. The dialysis machine further includes a controller (105) configured to determine a sleep state of the patient based on the one or more patient parameters detected by the plurality of sensors, and adjust a masking sound in response to the sleep state of the patient. The masking sound is activatable in response to noise generated during operation of the dialysis machine.