Good idea but it will need a bit more in order to ensure the light is set to the correct state after a restart (restart trigger, conditions to check in which time range the current time falls, etc).
The requirement to survive a restart always makes the automation a bit more complex.