Need help not quite even sure with what

i hope this is a better explanations of what i want
i have a philips dial i want each button to change the lights colors temps and brightness that part is working
now i want one of the buttons to check if the scene its coupled to is active if not net make that scene active it the corresponding scene is active turn the lights off

alias: On/Off
description: ""
trigger:
  - device_id: 3264eba18c8d3bfbbdb5298a62256068
    domain: hue
    platform: device
    type: initial_press
    subtype: 4
    unique_id: 74c0ec97-9878-4195-9efa-5472bc236f57
  - device_id: a0eaff7cbc8e2cd3539799c3b9161058
    domain: hue
    platform: device
    type: initial_press
    subtype: 4
    unique_id: d089dc3e-dc04-4881-91fc-3efd3f0aeddc
  - device_id: 25e32fa81076633bb1d454349da4f789
    domain: hue
    platform: device
    type: initial_press
    subtype: 1
    unique_id: ab8e66e2-5000-4b44-856a-5df0ea641637
  - device_id: 9dbabd5997c0413fc8c73b8977ac53c1
    domain: hue
    platform: device
    type: initial_press
    subtype: 1
    unique_id: 3a4ad953-3d27-4bef-8e05-88275369ec39
condition: []
action:
  - if:
      - condition: device
        type: is_on
        device_id: 4667a900642e0a67d71db1872da19df8
        entity_id: c515b08dc469e0e17fb4f8ce1dfcd364
        domain: light
      - condition: and
        conditions:
          - condition: state
            entity_id: light.a
            attribute: rgb_color
            state: 106, 6, 103
    then:
      - service: light.turn_on
        metadata: {}
        data:
          kelvin: 2650
          brightness_pct: 40
        target:
          entity_id: light.all_2
    else:
      - service: light.turn_off
        metadata: {}
        data: {}
mode: single

https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

okay yea i was afraid somone would say somthing about that i tried using Preformatted text but it dident do anything

also, what does this mean? What’s not working?

but without that information the only thing that jumps out is your condition syntax is weird/wrong.

I think it should be:

  - if:
      - condition: device
        type: is_on
        device_id: 4667a900642e0a67d71db1872da19df8
        entity_id: c515b08dc469e0e17fb4f8ce1dfcd364
        domain: light
      - condition: state
        entity_id: light.a
        attribute: rgb_color
        state: '106, 6, 103' # <---add quotes here
    then:

you don’t need the ‘and’ because conditions are ‘and’ by default. and you had the ‘and’ in the wrong spot anyway.

alias: On/Off
description: ""
trigger:
  - device_id: 3264eba18c8d3bfbbdb5298a62256068
    domain: hue
    platform: device
    type: initial_press
    subtype: 4
    unique_id: 74c0ec97-9878-4195-9efa-5472bc236f57
  - device_id: a0eaff7cbc8e2cd3539799c3b9161058
    domain: hue
    platform: device
    type: initial_press
    subtype: 4
    unique_id: d089dc3e-dc04-4881-91fc-3efd3f0aeddc
  - device_id: 25e32fa81076633bb1d454349da4f789
    domain: hue
    platform: device
    type: initial_press
    subtype: 1
    unique_id: ab8e66e2-5000-4b44-856a-5df0ea641637
  - device_id: 9dbabd5997c0413fc8c73b8977ac53c1
    domain: hue
    platform: device
    type: initial_press
    subtype: 1
    unique_id: 3a4ad953-3d27-4bef-8e05-88275369ec39
condition: []
action:
  - if:
      - condition: device
        type: is_on
        device_id: 4667a900642e0a67d71db1872da19df8
        entity_id: c515b08dc469e0e17fb4f8ce1dfcd364
        domain: light
      - condition: template
        value_template: |
          {{ is_state_attr('light.a', 'rgb_color', (106, 6, 103)) }}
    then:
      - service: light.turn_on
        data:
          kelvin: 2650
          brightness_pct: 40
        target:
          entity_id: light.all_2
    else:
      - service: light.turn_off
        target:
          entity_id: light.all_2
mode: single