Light color and brightnes depending on time of day

I have 2 RGBCW zigbee lights that I group together to form my closet_light.
I want to be able to siwtch this light bright white during daytime but at night they need to go blueviolet at 50% bright. in order not to wake up people.
This is the automation that is generated from the visual editor:

> alias: closet light toggle
> description: depending on time
> trigger:
>   - device_id: 80de99edcf941efda13ffa6a1704e18c
>     domain: zha
>     platform: device
>     type: remote_button_short_press
>     subtype: button_2
> condition: []
> action:
>   - if:
>       - condition: time
>         after: "22:00:00"
>         before: "05:30:00"
>     then:
>       - service: light.toggle
>         metadata: {}
>         data:
>           transition: 20
>           color_name: blueviolet
>           brightness_pct: 50
>         target:
>           entity_id: light.closet_light
>     else:
>       - service: light.toggle
>         metadata: {}
>         data:
>           transition: 20
>           color_name: white
>           brightness_pct: 100
>         target:
>           entity_id: light.closet_light
> mode: single

Problem is now that independent on the time of day it switches always blueviolet.
What I am doing wrong?

Please see #11 here to make it easier to help you.
How to help us help you - or How to ask a good question - Configuration - Home Assistant Community (home-assistant.io)