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