Reference sensor in another yaml

Hi, I’m new to esphome/HA. I’ve got a atc_mithermometer temperature sensor defined in one yaml, and I’d like to use it to control a switch attached to a fan heater defined in another yaml. I’m using the Thermostat Climate Controller, but I can’t figure out what to fill in for the “sensor” to reference the temperature sensor.

ESP32 with bluetooth extender to read temperature

esphome:
  name: bluetoothextender
  platform: ESP32
  board: nodemcu-32s
wifi:
  networks:
    - ssid: "main_iot"
      password: !secret wifi_main_iot_pass 
  manual_ip:
    static_ip: 192.168.1.143
    gateway: 192.168.1.1
    subnet: 255.255.255.0
captive_portal:
logger:
api:
ota:

esp32_ble_tracker:

sensor:
  - platform: atc_mithermometer
    mac_address: "A4:C1:38:13:95:9E"
    temperature:
      name: "Art Room Temperature"
    humidity:
      name: "Art Room Humidity"
    battery_level:
      name: "Art Room Battery-Level"
    battery_voltage:
      name: "Art Room Battery-Voltage"
# there are several more here, but I removed them for brevity

Fan Heater yaml

esphome:
  name: heater_switch
  platform: ESP8266
  board: esp01_1m

wifi:
  networks:
    - ssid: "main_iot"
      password: !secret wifi_main_iot_pass
    
captive_portal:
logger:
api:


climate:
  - platform: thermostat
    name: "Thermostat Climate Controller"
    sensor: what do I put here??????????????????????????????????????????????
    default_target_temperature_low: 25 °C
    min_heating_off_time: 30s
    min_heating_run_time: 30s
    min_idle_time: 30s
    heat_action:
      - switch.turn_on: relay
    idle_action:
      - switch.turn_off: relay

binary_sensor:
- platform: gpio
  pin:
    number: GPIO0
    mode: INPUT_PULLUP
    inverted: True
  name: "Heater Switch Button"
  on_press:
    - switch.toggle: relay
- platform: status
  name: "Heater Switch Status"


switch:
- platform: gpio
  name: "Heater Switch Relay"
  pin: GPIO12
  id: relay

Since the two ESPHome devices are connected through Home Assistant, it would easiest to use an automation in Home Assistant to control the relay rather than try to do it this way. If you still want to do it, you can use a Home Assistant Sensor or Text Sensor to get the data from HA into the ESP8266.

I used your second suggestion because I wanted to specifically use the “Thermostat Climate Controller” in esphome.

thanks!