Climate set-point sync Automation

Today I am trying to synchronize the setpoint of two AC units when a separating wall is taken out. I was using automation to get this working.
I can’t seem to get it to work…
My code so far:

- id: 'Zalensetlink'
  alias: 'Zalen set Link'`
  trigger:
    platform: state
    entity_id: climate.z2
  condition:
    - condition: state
      entity_id: binary_sensor.z1_schuif
      state: 'on'
  action:
    - service: climate.set_temperature
      data:
        entity_id: climate.z1
        temperature: {{ states.climate.z2.attributes.temperature }}

I get the following error:

Error loading /config/configuration.yaml: invalid key: "OrderedDict([('states.climate.z2.attributes.temperature | float', None)])"

in “/config/automations.yaml”

I have no idea what I’m doing wrong.
Can somebody help me?

The ‘data:’ key needs to read ‘data_template:’ because you’re using a template in the ‘temperature’ value. So

  action:
    - service: climate.set_temperature
      data_template:
        entity_id: climate.z1
        temperature: {{ states.climate.z2.attributes.temperature }}

Thanks Steve, adjusted it. Unfortunately still get the same error…

Oh damn I found the second mistake forgot the: " "…

Thanks Steve!

Ah…I always use the “>” syntax, so I never use the quotes:

  action:
    - service: climate.set_temperature
      data_template:
        entity_id: climate.z1
        temperature: >
          {{ states.climate.z2.attributes.temperature }}