Automation to turn off lights and set bulb color/brightness

I’m trying to create an automation that will turn off some lights and set my rope lights to a specific color and brightness

This throws a “Message malformed: extra keys not allowed @ data[‘action’][8][‘type’]” error

alias: Good Night
description: ''
trigger: []
condition: []
action:
  - domain: light
    entity_id: light.living_room_right
    device_id: 9fd25548f5fad307266d7b83bc0b1f8a
    type: turn_off
  - domain: light
    entity_id: light.living_room_left
    device_id: 6c2ad9f37c0b777bd39e5ad47cc01b4e
    type: turn_off
  - type: turn_off
    device_id: 114dcb74e2478f4483d0ce0b0f14bed1
    entity_id: light.family_room_left
    domain: light
  - type: turn_off
    device_id: 590beba5ec0e512480b9434b741a1ee9
    entity_id: light.family_room_right
    domain: light
  - type: turn_off
    device_id: 91537ab2ab9b71abe613e12aa66fe7b8
    entity_id: switch.family_room_accent
    domain: switch
  - type: turn_off
    device_id: be4cb33e8e4b68be0e6f3e837fac8bcd
    entity_id: switch.yard_lights
    domain: switch
  - type: turn_off
    device_id: 14942d97c33f5bb63d6f9086e3e99fb1
    entity_id: light.office_accent
    domain: light
  - type: turn_off
    device_id: d06cebaa3b135fa07e393037e3bd0236
    entity_id: switch.office
    domain: switch
  - type: turn_on
    entity_id: light.rope_lights
    domain: light
  - data:  
    rgb_color:
      - 127
      - 0
      - 255
    brightness: 30
mode: single

Try:

  - type: turn_on
    entity_id: light.rope_lights
    domain: light
    data:  
      rgb_color: [127,0,255]
      brightness: 30

Thanks Browet.
Same error
“Message malformed: extra keys not allowed @ data[‘action’][8][‘type’]”

  - type: turn_off
    device_id: d06cebaa3b135fa07e393037e3bd0236
    entity_id: switch.office
    domain: switch
  - type: turn_on
    entity_id: light.rope_lights
    domain: light
    data:  
      rgb_color: [127,0,255]
      brightness: 30
mode: single

Got it working.

alias: Good Night
description: ''
trigger: []
condition: []
action:
  - service: light.turn_on
    data:
      brightness: 150
      rgb_color:
        - 127
        - 0
        - 255
      entity_id:
        - light.rope_lights
  - type: turn_off
    device_id: 6c2ad9f37c0b777bd39e5ad47cc01b4e
    entity_id: light.living_room_left
    domain: light
  - type: turn_off
    device_id: 9fd25548f5fad307266d7b83bc0b1f8a
    entity_id: light.living_room_right
    domain: light
  - type: turn_off
    device_id: 114dcb74e2478f4483d0ce0b0f14bed1
    entity_id: light.family_room_left
    domain: light
  - type: turn_off
    device_id: 590beba5ec0e512480b9434b741a1ee9
    entity_id: light.family_room_right
    domain: light
  - type: turn_off
    device_id: be4cb33e8e4b68be0e6f3e837fac8bcd
    entity_id: switch.yard_lights
    domain: switch
  - type: turn_off
    device_id: 91537ab2ab9b71abe613e12aa66fe7b8
    entity_id: switch.family_room_accent
    domain: switch
mode: single
1 Like