An automatic water supply device for a refrigerator, wherein the device comprises a water vessel, a bracket for placing the water vessel, a detection means, and a water supply mechanism for supplying water to the water vessel, the water vessel comprising a water filling port; the detection means comprises an inductive element and a first sensor disposed on the bracket, the inductive element is disposed in the water vessel and capable of rising or falling along with the liquid level, and the first sensor outputs a first detection signal upon detecting that the inductive element is located at a first height; the water supply mechanism comprises a water supply pipe and a water valve provided on the water supply pipe, and an outlet of the water supply pipe corresponds to the water filling port of the water vessel; the automatic water supply device further comprises a controller controlling the water valve to open upon receiving the first detection signal; the detection means further comprises a detection element capable of outputting a second detection signal characterizing the liquid level in the water vessel, and the controller controls the water valve to close upon receiving the second detection signal; a float box is provided in the water vessel, the inductive element is fixedly disposed in the float box, and the float box rises and falls as the liquid level changes; wherein a side wall of the water vessel is provided with a rail extending in a height direction, the float box is located in the rail, and the rail is provided with a water hole, characterized in that the rail includes a housing protruding into the interior of the water vessel and an internal channel surrounded by the housing, the water hole communicated with the internal channel is provided in the lengthwise direction of the side wall of the housing, the top of the housing is provided with an opening and a seal for sealing the opening. the detection means comprises an inductive element and a first sensor disposed on the bracket, the inductive element is disposed in the water vessel and capable of rising or falling along with the liquid level, and the first sensor outputs a first detection signal upon detecting that the inductive element is located at a first height; the water supply mechanism comprises a water supply pipe and a water valve provided on the water supply pipe, and an outlet of the water supply pipe corresponds to the water filling port of the water vessel; the automatic water supply device further comprises a controller controlling the water valve to open upon receiving the first detection signal; the detection means further comprises a detection element capable of outputting a second detection signal characterizing the liquid level in the water vessel, and the controller controls the water valve to close upon receiving the second detection signal; a float box is provided in the water vessel, the inductive element is fixedly disposed in the float box, and the float box rises and falls as the liquid level changes; wherein a side wall of the water vessel is provided with a rail extending in a height direction, the float box is located in the rail, and the rail is provided with a water hole, characterized in that the rail includes a housing protruding into the interior of the water vessel and an internal channel surrounded by the housing, the water hole communicated with the internal channel is provided in the lengthwise direction of the side wall of the housing, the top of the housing is provided with an opening and a seal for sealing the opening.