Average temperature of 2 Sensors

Hey im pretty new to HA and wanted some help. I want to make an automation for my air conditioning System based on the average temperature of 2 different thermostats. I have looked on the Internet but didnt find anything that helped me for my case.
Can somebody help me here?

This will do what you want:

EDIT: Though thinking about it a bit more it does not support attributes so you have to make template sensors to extract the two temperatures from the climate devices. So you might as well just make one template sensor.

Like this, in your configuration.yaml file:

template:
  - sensor:
      - name: "Average temperature"
        unit_of_measurement: "°C"
        state: >
          {% set bedroom = state_attr('climate.bedroom', 'temperature') | float(0) %}
          {% set kitchen = state_attr('climate.kitchen', 'temperature') | float(0) %}
          {{ ((bedroom + kitchen) / 2) | round(1, default=0) }}