Automation UI, Sun and Time

Please edit your post and format the pasted code correctly. See point 11 here: Help us help you