Automation data template not work

Hello
I try to create template to turn on lamp with different color based on current time, but it not work.
I got this error

Invalid config for [automation]: expected dict for dictionary value @ data['action'][0]['data_template']. Got None.

here is automation config

alias: 'Спальня: Прикроватная лампа 1 - включить желтый'
description: дневной режим
trigger:
  - platform: device
    domain: mqtt
    device_id: 06d5134816c011eb9e85418fe651e574
    type: action
    subtype: single
    discovery_id: 0x00158d0003fb860a action_single
condition:
  - condition: and
    conditions:
      - condition: device
        type: is_off
        device_id: bb3aa3e503eb11eb872e5f799648b6fc
        entity_id: light.rgb_01
        domain: light
      - condition: time
        before: '22:00'
        after: '6:30'
action:
  - service: light.turn_on
    target:
      device_id: bb3aa3e503eb11eb872e5f799648b6fc
    data_template:
      {% if "06:30" < now().strftime("%H:%M") < "12:29" %}
      brightness: 255
      color_temp: 500
      white_value: 255
      {% else %}
      color_name: blue
      brightness: 255
      {% endif %}
mode: single

If i test template in HA, it work and display correct value, but in automation it not work

what’s wrong with automation?

You can not template the key and the value, only the value. You can use choose for different action depending on some condition.

Thanks! Now i can combine all actions (turn on/off and day/night mode) in one automation.