Syntax error with template

Hello everyone,

I created a climate entity for a thermostat card.

The data comes in via mqtt, unfortunately I get a syntax error with my temperature command template.

As you can see, there was previously a temperature command template that was deactivated with #, so the whole thing worked without any problems.

Now, however, I wanted to ensure that, depending on which hvac mode is currently activated, the new temperature, if it is adjusted via the thermostat card, is written to a different topic… unfortunately that doesn’t quite work, it would be great if I could because someone could help.

- name: "Fußbodenheizung EG HK1"
  unique_id: bsb_lan_climate_fbh
  availability_topic: "BSB/status"
  payload_on: 1
  payload_off: 0
  modes:
    - auto
    - heat
    - cool
    - "off"
  mode_state_topic: "BSB/700!1"
  mode_state_template: >-
    {% set values = { '0 - Schutzbetrieb':'off', '1 - Automatik':'auto', '2 - Reduziert':'cool', '3 - Komfort':'heat'} %}
    {{ values[value] if value in values.keys() else 'off' }}
  mode_command_topic: "BSB"
  mode_command_template: >-
    {% set values = { 'off':'S700=0!1', 'auto':'S700=1!1', 'cool':'S700=2!1', 'heat':'S700=3!1'} %}
    {{ values[value] if value in values.keys() else '0' }}
  current_temperature_topic: "BSB/716!1"
  current_temperature_template: >-
    {% if value == '---' %}
        {{ 'None' }}
    {% else %}
        {{ value }}
    {% endif %}
  min_temp: 5
  max_temp: 30
  temp_step: 0.1
  temperature_state_topic: "BSB/8741!1"
  temperature_command_topic: "BSB"
  #temperature_command_template: "{{'S710!1='+ (value| string)}}"
  temperature_command_template: >-
    {% set values = { 'off':'"{{'S714!1='+ (value| string)}}"', 'cool':'"{{'S712!1='+ (value| string)}}"', 'heat':'"{{'S710!1='+ (value| string)}}"'} %}
    {{ values[value] if value in values.keys() else 'none' }}

Many greetings Pierre

Okay, I just tried around a bit again, so I don’t get any syntax errors, but the values ​​still aren’t sent :frowning:

  temperature_command_template: >-
    {% set values = { 'off':'S714!1=(value| string)', 'cool':'S712!1=(value| string)', 'heat':'S710!1=(value| string)'} %}
    {{ values[value] if value in values.keys() else '0' }}