A method in accordance with the invention includes prompting a user to align a mobile device with a geometric feature (e.g., a window sill, corner, etc.) of a window. The method further determines a position and orientation of the window using sensors of the mobile device. Based on the position and orientation of the window, the method determines a position of the sun over time relative to the window. The method automatically adjusts a window covering of the window to take into account the position of the sun over time. For example, the method may automatically tilt slats of a window blind or open or close a window covering to take into account the position of the sun over time. A corresponding system is also disclosed herein.