Led Matrix Textbar ESPHome code

esphome:

name: matrix-display

platform: ESP8266

board: d1_mini


# Enable logging

logger:


# Enable Home Assistant API

api:


ota:

password: "b7617c64a5817ab5be8047cbf5568faa"


wifi:

ssid: "wifi"

password: "whatsthepassword"


# Enable fallback hotspot (captive portal) in case wifi connection fails

ap:

ssid: "Matrix-Display Fallback Hotspot"

password: "whatsthepassword"


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: 12

intensity: 1

scroll_speed: 75ms

update_interval: 100ms

lambda: |-

it.printf(0, 0, id(digit_font), TextAlign::TOP_LEFT, "%s", id(Matrix_txt).state.c_str());

it.intensity(atoi(id(Matrix_Brightness).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

- °


text_sensor:

- platform: wifi_info

ip_address:

name: "Matrix Display IP Address"

ssid:

name: "Matrix Display Connected SSID"

bssid:

name: "Matrix Display Connected BSSID"

- platform: homeassistant

name: "HA Txt"

id: Matrix_txt

entity_id: input_text.matrix_text

- platform: homeassistant

name: "HA Brightness"

id: Matrix_Brightness

entity_id: input_number.matrix_brightness

sensor:

- platform: wifi_signal

name: "Matrix Display WiFi Signal Sensor"

update_interval: 60s

- platform: uptime

name: "Matrix Display Uptime Sensor"





Add the Helper sensors in Home assistant.

Don't forget to add the 2 helpers in home assistant. One is for the text to show on the display. One is for the brightness setting of the display. (I have two matrix display that why you see them double in the screenshot. In the ESPhome code we refer to these helper sensors in Home assistant itself!

Info on the used Matrix MAX 7219 hardware on the ESPHome site, click here.