You might be interested in this thread.
It shows how to use the Astro binding along with cron triggers to control lighting and other Items that change how they work based on the time of day.
You cannot really gray it out. The best you could do is have two versions of it, one that is a switch and is visible when the switch should be enabled and another that is a text item configured to use gray text that is visible when the switch should be disabled.
Switch item=TestLight visibility=[TestLightControl!=ON]
Text item=TestLight labelcolor=[TestLightControl==OFF="gray"] visibility=[Testlight==ON]