Can i have an help to set a specific rgb color in my automation?

Hello,
I’ve this automation that work fine, the only problem is that the light color is white while i’d like a different color. Where i can insert the rgb color? If I put the code as in example below the light goes in on with right color but don’t turn off when close the door

```
data:
      brightness: 15
      rgb_color: [255, 196, 89]
    service: light.turn_on
```

This my automation

- alias: Accensione/Spegnimento luce con apertura porta
  trigger:
  - platform: state
    entity_id: binary_sensor.door_window_sensor_158d00023ea03f
    to: 'on'
  - platform: state
    entity_id: binary_sensor.door_window_sensor_158d00023ea03f
    to: 'off'
  action:
    service_template: '{% if trigger.to_state.state == "on" %} homeassistant.turn_on  
      {% elif trigger.to_state.state == "off" %} homeassistant.turn_off {% endif %}'  
    entity_id: light.gateway_light_7811dce210d1

my:

  • id: Kuchnia Wall Right Single LED Click
    alias: Kuchnia Wall Right Single LED Click
    trigger:
    platform: event
    event_type: xiaomi_aqara.click
    event_data:
    entity_id: binary_sensor.wall_switch_right_158d0001e066af
    click_type: single
    action:
    entity_id: light.kuchnia_led
    data:
    rgb_color:
    - 145
    - 79
    - 0
    brightness_pct: 60
    service: homeassistant.turn_on

I’d split up the automation and use light.turn_on/light.turn_off. Check the docs for details.

e.g.

- alias: Accensione luce con apertura porta
  trigger:
  - platform: state
    entity_id: binary_sensor.door_window_sensor_158d00023ea03f
    to: 'on'
  action:
    service: light.turn_on
    data:
      brightness: 150
      rgb_color: [255, 0, 0]
      entity_id:
        - light.gateway_light_7811dce210d1
- alias: Spegnimento luce con apertura porta
  trigger:
  - platform: state
    entity_id: binary_sensor.door_window_sensor_158d00023ea03f
    to: 'off'
  action:
    service: light.turn_off
    data:
      entity_id:
        - light.gateway_light_7811dce210d1