Lights turns on according to the position of the sun

Are you using the second method? ( It deals with various possible sun angles )

Also, you can put a debug print here

to see what you’re actually getting…

Also try resetting the orientation of your sun

and only change the Y.