Let's assume you overcome the issue of the RTC not working, by finding a better library. That the I2C scanner found the clock is good news. (My Arduino sketches are all on an old laptop that struggles to fire up, so I can't check to see what library I used for a DS3231 sketch I used a few years back- I'll see if it's in a good mood and fires up....)
So, assuming the clock works, what's your strategy (in words, not code) to have your system know when it's sunrise?
To paste code in tags is easy.
-
In the IDE, press control-T which formats the sketch with nice indents to make easy to read.
-
In the IDE, press control-shift-C to snag the code for the forum
-
Then just control-V that into the forum. Simples...