ESPHome display not showing connected sensor value

Folks, it must be something rather simple I am missing. LilyGO T-QT ESP32-S3 display with ADS1115 and pressure sensor connected.

ESP read the values and passes to HA. Display is working and showing time. But not the pressure value which is successfully passed to HA. Any suggestions where I made a mistake?


spi:
  clk_pin: GPIO3
  mosi_pin: GPIO2

i2c:
  - id: bus_a
    sda: GPIO38
    scl: GPIO39
    scan: true

ads1115:
  - address: 0x48
sensor:
  - platform: ads1115
    multiplexer: 'A0_GND'
    gain: 6.144
    name: "Water Filter Pressure 1"
    unit_of_measurement: "PSI"
    device_class: "pressure"
    accuracy_decimals: 1
    id: pressure_ch1
    filters:
      - calibrate_linear:
         method: least_squares
         datapoints:
          # V           PSI
          - 0.4 ->   0
          - 0.8 ->  13
          - 1.7 ->  50
          - 4.5 ->  99  # assumed
      - clamp:
          min_value: -1
          max_value: 151
 
font:
  - file: "fonts/OCRAEXT.ttf"
    id: fontocra
    size: 42
  - file: "gfonts://Roboto"
    id: roboto
    size: 20

switch:
  - platform: gpio
    pin:
      number: GPIO10
      mode:
        output: True
    name: "Display Backlight"
    id: backlight
    entity_category: diagnostic

time:
  - platform: homeassistant
    id: home_time
    timezone: Australia/Perth

display:
  - platform: st7789v
    model: Custom
    width: 128
    height: 128
    offset_width: 0
    offset_height: 0
    cs_pin: GPIO5
    dc_pin: GPIO6
    reset_pin: GPIO1
    id: disp
    rotation: 180
    lambda: |-
      it.strftime(0, 0, id(fontocra), TextAlign::TOP_LEFT, "%H:%M", id(home_time).now());
      it.line(0, 50, 128, 50);
      it.printf(0, 90, id(roboto), "P1: %1", id(pressure_ch1).state);



Thank you in advance.

%1 is not a valid placeholder for printing a value. See this for formtting data:

1 Like

I knew it must be something simple =). Thank you very much @Edwin_D. Simple f solved the problem.

1 Like