An active magnetic regenerator device comprising: - two or more regenerator beds, each regenerator bed comprising magnetocaloric material, a first flow passage allowing fluid to pass through the regenerator bed along a first flow direction, and a second flow passage allowing fluid to pass through the regenerator bed along a second flow direction, the second flow direction being substantially opposite to the first flow direction, - a magnet arrangement arranged at least partly circumferentially with respect to the regenerator beds, the magnet arrangement comprising at least two sections comprising permanent magnets, - a first heat exchanger arranged to exchange heat with fluid received from the first flow passages of the regenerator beds, and a second heat exchanger arranged to exchange heat with fluid received from the second flow passages of the regenerator beds, and - a valve arrangement arranged to control fluid flow through the regenerator beds, wherein the regenerator beds and the magnet arrangement are arranged to perform rotational movements relative to each other, and wherein the valve arrangement comprises: - a plurality of valve elements, each valve element being arranged to control a supply of fluid to at least one regenerator bed, via the first flow passage or the second flow passage, the plurality of valve elements being arranged substantially immovably with respect to the regenerator beds along a direction of relative rotational movement, and - at least one cam surface arranged substantially immovably with respect to the magnet arrangement along the direction of relative rotational movement, the cam surface(s) comprising a plurality of cam elements arranged along the cam surface, each cam element being adapted to cooperate with a valve element in order to movements of the regenerator beds and the magnet arrangement, the opening degree of each valve element thereby being controlled in accordance with a relative angular position of the regenerator beds and the magnet arrangement. - two or more regenerator beds, each regenerator bed comprising magnetocaloric material, a first flow passage allowing fluid to pass through the regenerator bed along a first flow direction, and a second flow passage allowing fluid to pass through the regenerator bed along a second flow direction, the second flow direction being substantially opposite to the first flow direction, allowing fluid to pass through the regenerator bed along a first flow direction, and a second flow passage allowing fluid to pass through the regenerator bed along a second flow direction, the second flow direction being substantially opposite to the first flow direction, - a magnet arrangement arranged at least partly circumferentially with respect to the regenerator beds, the magnet arrangement comprising at least two sections comprising permanent magnets, arranged at least partly circumferentially with respect to the regenerator beds, the magnet arrangement comprising at least two sections comprising permanent magnets, - a first heat exchanger arranged to exchange heat with fluid received from the first flow passages of the regenerator beds, and a second heat exchanger arranged to exchange heat with fluid received from the second flow passages of the regenerator beds, and arranged to exchange heat with fluid received from the first flow passages of the regenerator beds, and a second heat exchanger arranged to exchange heat with fluid received from the second flow passages of the regenerator beds, and - a valve arrangement arranged to control fluid flow through the regenerator beds, - a plurality of valve elements, each valve element being arranged to control a supply of fluid to at least one regenerator bed, via the first flow passage or the second flow passage, the plurality of valve elements being arranged substantially immovably with respect to the regenerator beds along a direction of relative rotational movement, and each valve element being arranged to control a supply of fluid to at least one regenerator bed, via the first flow passage or the second flow passage, the plurality of valve elements being arranged substantially immovably with respect to the regenerator beds along a direction of relative rotational movement, and - at least one cam surface arranged substantially immovably with respect to the magnet arrangement along the direction of relative rotational movement, the cam surface(s) comprising a plurality of cam elements arranged along the cam surface, each cam element being adapted to cooperate with a valve element in order to movements of the regenerator beds and the magnet arrangement, the opening degree of each valve element thereby being controlled in accordance with a relative angular position of the regenerator beds and the magnet arrangement.