Light - color_name template

Hi, my automation logs error but working fine:

  alias: Bramy otwarte - gateway
  trigger:
  - entity_id:
    - binary_sensor.brama_garazowa
    - binary_sensor.brama_wjazdowa_contact
    platform: state
  condition:
  - condition: or
    conditions:
    - condition: state
      entity_id: binary_sensor.brama_garazowa
      state: 'on'
    - condition: state
      entity_id: binary_sensor.brama_wjazdowa_contact
      state: 'on'
  action:
  - service: light.turn_on
    data_template:
      entity_id: light.gateway_light_7xxxxx
      color_name: >-
        {% if is_state('binary_sensor.brama_garazowa', 'on') and is_state('binary_sensor.brama_wjazdowa_contact', 'off') %}
          blue
        {% elif is_state('binary_sensor.brama_garazowa', 'off') and is_state('binary_sensor.brama_wjazdowa_contact', 'on') %}
          green
        {% elif is_state('binary_sensor.brama_garazowa', 'on') and is_state('binary_sensor.brama_wjazdowa_contact', 'on') %}
          yellow
        {% else %} 
          white
        {% endif %}
      brightness: 50
  mode: single

I get error:

Error executing script. Invalid data for call_service at pos 1: extra keys not allowed @ data['color_name']
Bramy otwarte - gateway: Already running

Are you certain that it’s this automation that’s causing the error? Looks fine to me.

(the second error that mentions it may be unrelated to the first one)

Yes. I get this error:

Logger: homeassistant.components.automation.bramy_otwarte_gateway
Source: helpers/script.py:1056
Integration: Automation (documentation, issues)
First occurred: September 21, 2020, 11:01:56 PM (25 occurrences)
Last logged: 9:29:42 PM

Bramy otwarte - gateway: Error executing script. Invalid data for call_service at pos 1: extra keys not allowed @ data['color_name']
Bramy otwarte - gateway: Already running

Just a guess but…

I think it’s generating a false error in addition to the correct one that your automation is being re-triggered whilst it’s already running (especially given that when it is running you’re saying it’s working properly, so clearly the syntax is correct)

I would suggest a bug report.