How to debug ESPhome

I created an input text entity in HA ( input_text.other_text) where I can write text, however I can’t figure out how to get the content visible on the ESP display. I tried different references id(displaytext).value .state etc. but it don’t work, see code below.

text_sensor:
  - platform: homeassistant
    name: "displaytext"
    entity_id: input_text.other_text
    id: displaytext

display:
  - platform: ssd1306_i2c
    model: "SSD1306 128x64"
    address: 0x3C
    rotation: 0
    lambda: |-
        it.print(64, 54, id(arial), TextAlign::BASELINE_CENTER, id(displaytext));

The compiler crashes reported earlier were all related to limited memory on the machine, see https://community.home-assistant.io/t/esphome-killing-home-assistant/325939/15