MAX7219 Digit Display ESPhome

Hey, I m trying to connect my Nodemcu V3 to Home Assistant.
The plan is that my Nodemcu + MAX7219 communicate with my home assistant.

I tried to use ESPHome

But I can’t figure out which codes I have to create and export to my Nodemcu

esphome:
  name: haled
  platform: ESP8266
  board: nodemcuv2
  includes:
      - max7219grid/max7219grid.hpp

wifi:
  ssid: "my_ssid"
  password: "my_pw"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "my_ssid"
    password: "my_pw"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: "api_pw"

ota:
  password: "ota_pw"

# ...
spi:
  clk_pin: D1
  mosi_pin: D2
  id: _spi

custom_component:
- lambda: |-
    using Disp = esphome::display::MAX7219GridComponent;
    auto grid = new Disp(id(_spi), new esphome::GPIOPin(D3, OUTPUT), 100);
    grid->set_num_chips(4);
    auto writer = [](Disp& it){
      static uint16_t offset=0;
      ++offset;
      for(uint16_t l=0; l< it.width(); ++l){
        it.fill_vertical_line(l, 0x1 << ((l + offset) % it.height()));
      }
    };
    grid->set_writer(writer);
    return {grid};

IS there someone that could explain how I could connect my Nodemcu to Home assistant to show some dates and the time to my MAX7219

esphome:
  name: led_matrix
  platform: ESP8266
  board: nodemcuv2

wifi:
  ssid: "my_ssid"
  password: "my_pw"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Led Matrix Fallback Hotspot"
    password: "my_pw"



# Enable logging
logger:

# Enable Home Assistant API
api:
  password: "my_pw"

ota:
  password: "my_pw"

mqtt:
  broker: pi_ip
  username: ha_user
  password: my_pw



web_server:
  port: 80

captive_portal:


time:
  - platform: homeassistant
    id: homeassistant_time

spi:
  clk_pin: D5  # D5 is connected to CLK of MAX7219
  mosi_pin: D7 # D7 is connected to MOSI of MAX7219

display:
  - platform: max7219digit
    cs_pin: D8 # D8 is connected to CS of MAX7219
    num_chips: 8
    intensity: 3
    scroll_speed: 100ms
    update_interval: 100ms
    lambda: |-
      it.printf(0, 0, id(digit_font), TextAlign::TOP_LEFT, "%s", id(hatxt).state.c_str());
      it.intensity(atoi(id(habri).state.c_str()));
      it.scroll_left();
font:
  - file: "pixelmix.ttf"
    id: digit_font
    size: 8
    glyphs:
    - ' '
    - '@'
    - '*'
    - '!'
    - '"'
    - '%'
    - (
    - )
    - +
    - ','
    - '-'
    - .
    - '0'
    - '1'
    - '2'
    - '3'
    - '4'
    - '5'
    - '6'
    - '7'
    - '8'
    - '9'
    - ':'
    - A
    - B
    - C
    - D
    - E
    - F
    - G
    - H
    - I
    - J
    - K
    - L
    - M
    - N
    - O
    - P
    - Q
    - R
    - S
    - T
    - U
    - V
    - W
    - X
    - Y
    - Z
    - _
    - a
    - b
    - c
    - d
    - e
    - f
    - g
    - h
    - i
    - j
    - k
    - l
    - m
    - n
    - o
    - p
    - q
    - r
    - s
    - t
    - u
    - v
    - w
    - x
    - y
    - z
    - °

now getting this back:

INFO Reading configuration /config/esphome/led_matrix.yaml...
INFO Detected timezone 'CET' with UTC offset 1 and daylight savings time from 28 March 02:00:00 to 31 October 03:00:00
Failed config

display.max7219digit: 
  platform: max7219digit
  cs_pin: 
    number: 15
    mode: OUTPUT
    inverted: False
  num_chips: 8
  intensity: 3
  scroll_speed: 100ms
  update_interval: 100ms
  
  Couldn't find ID 'hatxt'. Please check you have defined an ID with that name in your configuration.
  lambda: !lambda |-
    it.printf(0, 0, id(digit_font), TextAlign::TOP_LEFT, "%s", id(hatxt).state.c_str());
    it.intensity(atoi(id(habri).state.c_str()));
    it.scroll_left();
  rotate_chip: 0
  scroll_mode: CONTINUOUS
  scroll_enable: True
  scroll_delay: 1000ms
  scroll_dwell: 1000ms```

Do you have the helper variables defined on HA?
and reference the input text as ‘hatxt’ like so:

text_sensor:
  - platform: homeassistant
    name: "HA Txt"
    id: hatxt
    entity_id: input_text.venner_text

see example code from here: