I have somehere an error in this code
Invalid config for [sensor.template]: invalid template (TemplateSyntaxError: unexpected 'end of print statement') for dictionary value @ data['sensors']['virtual_target']['value_template']. Got "{% set masterbedroom_td = (states('sensor.target_temperature_br') - states('sensor.ble_temperature_clim_master_bedroom') | float) %} {% set kidsbedroom_td = (states('sensor.target_temperature_kidsbr') - states('sensor.ble_temperature_clim_kids_bedroom') | float) %} {% set livingroom_td = (states('sensor.target_temperature_lr') - states('sensor.ble_temperature_clim_living') | float) %} {% set kitchen_td = (states('sensor.target_temperature_kit') - states('sensor.ble_temperature_clim_kitchen')...
invalid template (TemplateSyntaxError: unexpected 'end of print statement') for dictionary value @ data['sensors']['virtual_temperature']['value_template']. Got "{% set masterbedroom_td = (states('sensor.target_temperature_br') - states('sensor.ble_temperature_clim_master_bedroom') | float) %} {% set kidsbedroom_td = (states('sensor.target_temperature_kidsbr') - states('sensor.ble_temperature_clim_kids_bedroom') | float) %} {% set livingroom_td = (states('sensor.target_temperature_lr') - states('sensor.ble_temperature_clim_living') | float) %} {% set kitchen_td = (states('sensor.target_temperature_kit') - states('sensor.ble_temperature_clim_kitchen').... (See ?, line ?).
sensors:
virtual_temperature:
friendly_name: "Virtual Temperature"
unit_of_measurement: "°C"
value_template: >
{% set masterbedroom_td = (states('sensor.target_temperature_br') - states('sensor.ble_temperature_clim_master_bedroom') | float) %}
{% set kidsbedroom_td = (states('sensor.target_temperature_kidsbr') - states('sensor.ble_temperature_clim_kids_bedroom') | float) %}
{% set livingroom_td = (states('sensor.target_temperature_lr') - states('sensor.ble_temperature_clim_living') | float) %}
{% set kitchen_td = (states('sensor.target_temperature_kit') - states('sensor.ble_temperature_clim_kitchen') | float) %}
{% set bathroom_td = (states('sensor.target_temperature_bathr') - states('sensor.ble_temperature_clim_bathroom') | float) %}
{% set max_td = ([masterbedroom_td,kidsbedroom_td,kitchen_td,bathroom_td,livingroom_td] | max) %}
{% set list_room_td = [masterbedroom_td,kidsbedroom_td,kitchen_td,bathroom_td,livingroom_td] %}
{% set index_td = list_room_td.index(max_td) %}
{% if index_td == 1 %}
{{ (states('sensor.ble_temperature_clim_master_bedroom') | float) % }}
{% elif index_td == 2 %}
{{ (states('sensor.ble_temperature_clim_kids_bedroom') | float) % }}
{% elif index_td == 3 %}
{{ (states('sensor.ble_temperature_clim_kitchen') | float) % }}
{% elif index_td == 4 %}
{{ (states('sensor.ble_temperature_clim_bathroom') | float) % }}
{% else %}
{{ (states('sensor.ble_temperature_clim_living') | float) % }}
{% endif %}
virtual_target:
friendly_name: "Virtual Target"
unit_of_measurement: "°C"
value_template: >
{% set masterbedroom_td = (states('sensor.target_temperature_br') - states('sensor.ble_temperature_clim_master_bedroom') | float) %}
{% set kidsbedroom_td = (states('sensor.target_temperature_kidsbr') - states('sensor.ble_temperature_clim_kids_bedroom') | float) %}
{% set livingroom_td = (states('sensor.target_temperature_lr') - states('sensor.ble_temperature_clim_living') | float) %}
{% set kitchen_td = (states('sensor.target_temperature_kit') - states('sensor.ble_temperature_clim_kitchen') | float) %}
{% set bathroom_td = (states('sensor.target_temperature_bathr') - states('sensor.ble_temperature_clim_bathroom') | float) %}
{% set max_td = ([masterbedroom_td,kidsbedroom_td,kitchen_td,bathroom_td,livingroom_td] | max) %}
{% set list_room_td = [masterbedroom_td,kidsbedroom_td,kitchen_td,bathroom_td,livingroom_td] %}
{% set index_td = list_room_td.index(max_td) %}
{% if index_td == 1 %}
{{ (states('sensor.target_temperature_br') | float) % }}
{% elif index_td == 2 %}
{{ (states('sensor.target_temperature_kidsbr') | float) % }}
{% elif index_td == 3 %}
{{ (states('sensor.target_temperature_kit') | float) % }}
{% elif index_td == 4 %}
{{ (states('sensor.target_temperature_bathr') | float) % }}
{% else %}
{{ (states('sensor.target_temperature_lr') | float) % }}
{% endif %}