Reports have pointed out that nearly 50% of the global total energy demand for buildings is used for daily heating and cooling. Therefore, it is very important to develop various high-performance thermal management techniques with low energy consumption. In this work, we present an intelligent shape memory polymers (SMPs)-based device with programmable anisotropic thermal conductivity fabricated by a 4D printing technique to assist in thermal management with net zero energy. Highly thermal conductive BN nanosheets were textured in a poly (lactic acid) (PLA) matrix by 3D printing, and the printed composites lamina exhibited significant anisotropic thermal conductivity. The direction of heat flow in devices could be switched programmably, accompanying the light-activated deformation controlled by grayscale of composite, which was demonstrated by the “windows” arrays composed of in-plate thermal conductivity facets and SMPs-based hinge joints, achieving the programmable movement of opening and closing under different light conditions. Based on solar radiation-dependent SMPs coupled with the adjustment of heat flow along anisotropic thermal conductivity, the 4D printed device has been proved in concept for potential applications in thermal management in a building envelop for dynamic climate adaptation, taking place automatically based on the environment.