Change colour temperature at sunrise /sunset


1) Give a description of the problem
I am trying to change the colour temperature on my lights depending on if its day or night. Sometimes it works on all the lights and sometimes it only does some lights. but there is always a big delay.

2) What is the expected behaviour?
When its sunset I want my bulbs to change colour temperature to 2700k, but only if it’s on.
and at sunrise change them to 5000k.
I am also thinking on doing the same when the light is turned on via a switch

3) What is happening/not happening?

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full