Color depending on time

I use a configuration to change brightness depending on the time of day.
Now i want to add a color to it at the same way, but it gives me errors.
Who can see what’s wrong wit this?

I get this error:
Invalid service data for light.turn_on: None for dictionary value @ data[‘rgb_color’]. Got ‘255,209,0’

- alias: "Testlamp kleur"
  trigger:
    - platform: state
      entity_id: input_boolean.test_knop    
      from: 'off'
      to: 'on'          
  action:
    - service: light.turn_on
      data_template:
        entity_id: light.staande_lamp
        brightness: >
          {%- if now().strftime('%H')| int >= 21 %}
            100
          {%- elif now().strftime('%H')| int < 7 %}
            100
          {%- elif now().strftime('%H')| int >= 7 %}
            250
          {%- endif %}
        rgb_color: >
          {%- if now().strftime('%H')| int >= 21 %}
            [255,0,0]
          {%- elif now().strftime('%H')| int < 7 %}
            [255,0,0]
          {%- elif now().strftime('%H')| int >= 7 %}
            [255,209,0]
          {%- endif %}

At a quick glance, I’d move the entity_id line, so it looks like this:

  action:
    - service: light.turn_on
      entity_id: light.staande_lamp
      data_template:
        brightness: >

Any better?

It looks like your template worked and was evaluated, but the service call itself didn’t work. Perhaps try getting rbg_color to work without the template first, just to see if your syntax regarding spacing or quotes or whatever is right?

This part is working with color, so i think color works

  action:
    - service: light.turn_on
      data_template:
        entity_id: light.staande_lamp
        brightness: >
          {%- if now().strftime('%H')| int >= 21 %}
            100
          {%- elif now().strftime('%H')| int < 7 %}
            100
          {%- elif now().strftime('%H')| int >= 7 %}
            250
          {%- endif %}
       rgb_color: [255,209,73]

i hope some one have a solution.
i still didnt found one!