Light RGB colour as a template in automation condition

Hi all, I’m wondering whether it’s possible for an automation of mine to trigger only when the lights in question are “white”.

I’ve got a condition set up as follows:

condition:
  - condition: template
    value_template: "{{ states.light.bedroom.attributes.rgb_color = [255,255,255] }}"

But this doesn’t seem to work. Does anybody have tips on how this should be formulated?

Thanks!!

Copy and paste your template in Dev Tools/Templates and you will see what you get.
It should return True.

You need another equal sign:

{{ states.light.bedroom.attributes.rgb_color == [255,255,255] }}

But I would recommend writing it this way:

{{ is_state_attr('light.bedroom', 'rgb_color', [255,255,255]) }}