Getting ID globally

I am trying to read out a state from and DHT11 to a SSD1306 display.

The DHT11 I want to read from is on another ESP32 (ESP01) on the network with an ID of farm_temp and farm_hum for temperature and humidity.

If I use the ID of a BMP280 on the ESP32 with the screen on it (ESP02) it works but it doesn’t recognise the ID from ESP01.

Is there a dot syntax that I need to tell it the ID is from another ESP32?

display:
  - platform: ssd1306_i2c
    model: "SSD1306 128x64"
    address: 0x3C
    lambda: |-
      // %% - literal % sign
      it.printf(0, 10, id(roboto_10), "Temperature: %.1f°C", id(farm_temp).state);
      it.printf(0, 25, id(roboto_10), "Humidity: %.1f%%", id(farm_hum).state);

Found the solution now as follows:

text_sensor:
  - platform: homeassistant
    entity_id: sensor.farm_temp
    id: ft
  - platform: homeassistant
    entity_id: sensor.farm_hum
    id: fh
    
display:
  - platform: ssd1306_i2c
    model: "SSD1306 128x64"
    address: 0x3C
    lambda: |-
      // %% - literal % sign
      it.printf(0, 10, id(roboto_10), "Temperature: %.1f°C", id(ft).state);
      it.printf(0, 25, id(roboto_10), "Humidity: %.1f%%", id(fh).state);