A heat pump assembly comprising: a heat pump having a primary side inlet and a primary side outlet; a primary side inlet valve assembly comprising: a primary side inlet connection connected to the primary side inlet, a primary side inlet valve first conduit connection configured to be connected to a first conduit of a thermal energy grid, and a primary side inlet valve second conduit connection configured to be connected to a second conduit of the thermal energy grid; a first conduit temperature determining device configured to measure a local temperature, t 1, of heat transfer liquid of the first conduit; a second conduit temperature determining device configured to measure a local temperature, t 2, of heat transfer liquid of the second conduit; and a controller configured to: receive t 1 and t 2 from the first and second conduit temperature determining devices (105a; 105b), receive information pertaining to whether the heat pump is a heating mode heat pump or a cooling mode heat pump, upon the heat pump is the heating mode heat pump: upon t 1 > t 2, set the primary side inlet valve assembly to fluidly connect the primary side inlet valve first conduit connection and the primary side inlet connection, upon t 2 > t 1, set the primary side inlet valve assembly to fluidly connect the primary side inlet valve second conduit connection and the primary side inlet connection, upon the heat pump is the cooling mode heat pump: upon t 1 > t 2, set the primary side inlet valve assembly to fluidly connect the primary side inlet valve second conduit connection and the primary side inlet connection, upon t 2 > t 1, set the primary side inlet valve assembly to fluidly connect the primary side inlet valve first conduit connection and the primary side inlet connection. a heat pump having a primary side inlet and a primary side outlet; a primary side inlet valve assembly comprising: a primary side inlet connection connected to the primary side inlet, a primary side inlet valve first conduit connection configured to be connected to a first conduit of a thermal energy grid, and a primary side inlet valve second conduit connection configured to be connected to a second conduit of the thermal energy grid; a primary side inlet connection connected to the primary side inlet, a primary side inlet valve first conduit connection configured to be connected to a first conduit of a thermal energy grid, and a primary side inlet valve second conduit connection configured to be connected to a second conduit of the thermal energy grid; a first conduit temperature determining device configured to measure a local temperature, t 1, of heat transfer liquid of the first conduit; a second conduit temperature determining device configured to measure a local temperature, t 2, of heat transfer liquid of the second conduit; and a controller configured to: receive t 1 and t 2 from the first and second conduit temperature determining devices (105a; 105b), receive information pertaining to whether the heat pump is a heating mode heat pump or a cooling mode heat pump, upon the heat pump is the heating mode heat pump: upon t 1 > t 2, set the primary side inlet valve assembly to fluidly connect the primary side inlet valve first conduit connection and the primary side inlet connection, upon t 2 > t 1, set the primary side inlet valve assembly to fluidly connect the primary side inlet valve second conduit connection and the primary side inlet connection, upon the heat pump is the cooling mode heat pump: upon t 1 > t 2, set the primary side inlet valve assembly to fluidly connect the primary side inlet valve second conduit connection and the primary side inlet connection, upon t 2 > t 1, set the primary side inlet valve assembly to fluidly connect the primary side inlet valve first conduit connection and the primary side inlet connection. receive t 1 and t 2 from the first and second conduit temperature determining devices (105a; 105b), receive information pertaining to whether the heat pump is a heating mode heat pump or a cooling mode heat pump, upon the heat pump is the heating mode heat pump: upon t 1 > t 2, set the primary side inlet valve assembly to fluidly connect the primary side inlet valve first conduit connection and the primary side inlet connection, upon t 2 > t 1, set the primary side inlet valve assembly to fluidly connect the primary side inlet valve second conduit connection and the primary side inlet connection, upon t 1 > t 2, set the primary side inlet valve assembly to fluidly connect the primary side inlet valve first conduit connection and the primary side inlet connection, upon t 2 > t 1, set the primary side inlet valve assembly to fluidly connect the primary side inlet valve second conduit connection and the primary side inlet connection, upon the heat pump is the cooling mode heat pump: upon t 1 > t 2, set the primary side inlet valve assembly to fluidly connect the primary side inlet valve second conduit connection and the primary side inlet connection, upon t 2 > t 1, set the primary side inlet valve assembly to fluidly connect the primary side inlet valve first conduit connection and the primary side inlet connection. upon t 1 > t 2, set the primary side inlet valve assembly to fluidly connect the primary side inlet valve second conduit connection and the primary side inlet connection, upon t 2 > t 1, set the primary side inlet valve assembly to fluidly connect the primary side inlet valve first conduit connection and the primary side inlet connection.