Solar tracker (need help)

Hello i need help with making automatic solar tracker
i have esp32 with 2 relays, qmc5883l sensor, and 2 switches for solar tracker for 2 endpoints of rotation. i dont know how to automate it. i have working code for qmc readings and relays control. i want it to start tracking sun from sunrise and rotate solar panels every hour to point at sun, and when ist sunset go back to home position. the 2 relays control VFD left and right.

Anything in here of use, there seems to be a lot