Quantcast
Channel: ESPHome - Home Assistant Community
Viewing all articles
Browse latest Browse all 1486

Couldn't find ID 'font' error when using SSD1306 OLED Display

$
0
0

@cond wrote:

Hi, Can anyone spot what could be wrong here? I keep getting errors like this…

Failed config

display.ssd1306_i2c:
  platform: ssd1306_i2c
  model: SSD1306_128X64
  address: 0x3C

  Couldn't find ID 'font'. Please check you have defined an ID with that name in your configuration. These IDs look similar: "my_font".
  lambda: !lambda |-
    it.print(0, 0, id(font), "Hello World!");
  brightness: 1.0
  update_interval: 1s

Here’s my code so far…

esphome:
  name: esp_poe
  platform: ESP32
  board: esp32-poe-iso
  
ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO17_OUT
  phy_addr: 0
  power_pin: GPIO12
  manual_ip:
    static_ip: 10.0.0.246
    gateway: 10.0.0.139
    subnet: 255.0.0.0

i2c:
  sda: 13
  scl: 16
  scan: True
  id: bus_a
  
font:
  - file: "Comic Sans MS.ttf"
    id: my_font
    size: 20

display:
  - platform: ssd1306_i2c
    model: "SSD1306 128x64"
    #reset_pin: D0
    address: 0x3C
    lambda: |-
      it.print(0, 0, id(font), "Hello World!"); 
  
sensor:
  - platform: bme280
    temperature:
      name: "BME280 Temperature"
      oversampling: 16x
    pressure:
      name: "BME280 Pressure"
    humidity:
      name: "BME280 Humidity"
    address: 0x76
    update_interval: 10s  
    
web_server:
  port: 80
   
  
logger:
  level: VERBOSE 
  #baud_rate: 19200

It’s doing my head in :slight_smile:

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 1486