EspHoMaTriX version 2: An improved clock/status display

Hi,
on_boot” starts before the component is ready, so it is possible that nothing will work.
This may show more. I changed to the 2023.9.1 branch, added a font offset and moved the sample code to another lambda.

Please also check your matrix_pin!

substitutions:
  devicename: pixeldisplay
  friendly_name: "PixelDisplay"
  board: d1_mini_lite
  matrix_pin: GPIO4 
  
external_components:
- source:
    type: git
    ref: 2023.9.1
    url: https://github.com/lubeda/EspHoMaTriXv2 

animation:
  - id: animation_black
    file: pixeldisplay/1pixel.gif

image:
  - id: image_black
    file: pixeldisplay/1pixel.gif

esphome:
  comment: "EHMTXv2 TEXT from LuBeDa 8266"
  name: $devicename 
  

esp8266:
  board: $board

font:
  - file: pixeldisplay/mateine.ttf
    size: 16
    id: default_font
    glyphs:  |
      !?"%()+*=,-_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnÖÄÜöäüopqrstuvwxyz@<>ß§€/
  
binary_sensor:
  - platform: status
    name: "$devicename Status"

logger:

api:

ota:
  password: !secret ota

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

light:
  - platform: neopixelbus
    id: ehmtx_light
    type: GRB
    internal: true
    variant: WS2812
    pin: $matrix_pin
    num_leds: 256
    color_correct: [30%, 30%, 30%]
    gamma_correct: 2.0
    name: "$devicename Light"
    restore_mode: ALWAYS_OFF
 
time:
  - platform: homeassistant
    id: ehmtx_time

display:
  - platform: addressable_light
    id: ehmtx_display
    addressable_light_id: ehmtx_light
    width: 32
    height: 8
    pixel_mapper: |-
      if (x % 2 == 0) {
        return (x * 8) + y;
      }
      return (x * 8) + (7 - y);
    rotation: 0°
    update_interval: 16ms
    auto_clear_enabled: true
    lambda: |-
      id(rgb8x32)->tick();
      id(rgb8x32)->draw();
      
ehmtxv2:
  id: rgb8x32
  icons2html: true
  matrix_component: ehmtx_display
  time_component: ehmtx_time
  time_format: "%H:%M"
  date_format: "%d.%m."
  scroll_small_text: true
  default_clock_font: true
  allow_empty_screen: true
  blend_steps: 16
  default_font_id: default_font
  special_font_id: default_font 
  default_font_yoffset: 7
  special_font_yoffset: 8
  icons: 
    - id: error
      lameid: 40530
  on_start_running:
    lambda: |-
      id(rgb8x32)->show_rindicator(255,100,50,2);
      id(rgb8x32)->hide_rindicator();
      id(rgb8x32)->show_lindicator(255,100,250,2);
      id(rgb8x32)->hide_lindicator();
      id(rgb8x32)->show_alarm(255,0,150,3);
      id(rgb8x32)->hide_alarm();
      id(rgb8x32)->icon_screen("error","Hallo Text",false,237,20,100,200,150);
      id(rgb8x32)->force_screen("error");
      id(rgb8x32)->del_screen("error");
      id(rgb8x32)->del_screen("error",5);
      id(rgb8x32)->rainbow_icon_screen("error","Hallo Text",true,237,20);
      id(rgb8x32)->get_status();
      id(rgb8x32)->set_display_on();
      id(rgb8x32)->rainbow_text_screen("ÜÖÄüöä°C°F€--℉-℃-₿-₩-Ξ",30);
      id(rgb8x32)->set_display_off();
      id(rgb8x32)->hold_screen();
      id(rgb8x32)->show_gauge(100,0,200);
      id(rgb8x32)->hide_gauge();
      id(rgb8x32)->set_today_color(200,100,50);
      id(rgb8x32)->set_weekday_color(200,100,50);
      id(rgb8x32)->full_screen("scale");
      id(rgb8x32)->rainbow_icon_screen("error","Oh ein Text");
      id(rgb8x32)->text_screen("text",30);
      id(rgb8x32)->rainbow_text_screen("text",30);
      id(rgb8x32)->clock_screen(30,5);
      id(rgb8x32)->rainbow_clock_screen(30,5);
      id(rgb8x32)->date_screen(30,5);
      id(rgb8x32)->rainbow_date_screen(30,5);
      id(rgb8x32)->blank_screen(30,5);
      id(rgb8x32)->set_brightness(20);
  

Received my Ulanzi Pixelclock recently. Today, I tried to flash the esphomatrix firmware, but it fails to compile. Not sure if I’m missing some dependencies or not.

Some help would be appriciated :slight_smile:

Dependency Graph
|-- AsyncTCP-esphome @ 2.0.1
|-- WiFi @ 2.0.0
|-- FS @ 2.0.0
|-- Update @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 3.1.0
|-- ESPmDNS @ 2.0.0
|-- Wire @ 2.0.0
|-- ArduinoJson @ 6.18.5
|-- NeoPixelBus @ 2.7.3
Compiling .pioenvs/ulanzi/src/esphome/components/ehmtxv2/EHMTX.cpp.o
Compiling .pioenvs/ulanzi/src/esphome/components/ehmtxv2/EHMTX_icons.cpp.o
Compiling .pioenvs/ulanzi/src/esphome/components/ehmtxv2/EHMTX_queue.cpp.o
Compiling .pioenvs/ulanzi/src/esphome/components/esp32/core.cpp.o
In file included from src/esphome.h:25,
                 from src/esphome/components/ehmtxv2/EHMTX_icons.cpp:1:
src/esphome/components/ehmtxv2/EHMTX.h:6:10: fatal error: esphome/components/animation/animation.h: No such file or directory
 #include "esphome/components/animation/animation.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/esphome.h:25,
                 from src/esphome/components/ehmtxv2/EHMTX_queue.cpp:1:
src/esphome/components/ehmtxv2/EHMTX.h:6:10: fatal error: esphome/components/animation/animation.h: No such file or directory
 #include "esphome/components/animation/animation.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
compilation terminated.
*** [.pioenvs/ulanzi/src/esphome/components/ehmtxv2/EHMTX_queue.cpp.o] Error 1
*** [.pioenvs/ulanzi/src/esphome/components/ehmtxv2/EHMTX_icons.cpp.o] Error 1
In file included from src/esphome.h:25,
                 from src/esphome/components/ehmtxv2/EHMTX.cpp:1:
src/esphome/components/ehmtxv2/EHMTX.h:6:10: fatal error: esphome/components/animation/animation.h: No such file or directory
 #include "esphome/components/animation/animation.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pioenvs/ulanzi/src/esphome/components/ehmtxv2/EHMTX.cpp.o] Error 1
========================== [FAILED] Took 1.89 seconds ==========================

see here: GitHub - lubeda/EspHoMaTriXv2: A simple DIY status display with a 8x32 RGB LED matrix, implemented with esphome.io and Home Assistant.

1 Like

Wow. Thanks.

Usually, I am telling others to RTFM :joy:

1 Like

I’ve followed the directions from the README file on GitHub, including adding the 1pixel.gif lines to the YAML, but I’m still having issues flashing ESPHome onto my Ulanzi TC001. It is connected to my computer via USB-C, and when I click “Install” or “Update” in ESPHome (using the “connected via USB” option), the device reboots several times and a dialog in ESPHome reads “Connecting”, but eventually I’m given this error message:

Failed to initialize. Try resetting your device or holding the BOOT button while selecting your serial port until it starts preparing the installation.

What’s going wrong, or how can I diagnose this so I can properly install ESPHome on the device?

Edit: I tried validating the YAML without installing and noticed I didn’t have a secret defined for ota_password. Oops. Is this necessary?

Edit 2: Well, even with the validated YAML, it’s still giving me the same error. I’ve reset the device using the reset button and tried to hold the boot button (in this device’s case, two buttons together). Still nothing…


As a side note, I have a couple questions about the README on Github.

First, this is the current code block at the top (the fix for ESPHome 2023.7.0):

image:
   - file: 1pixel.gif
     id: breaking20237

animation:
  - file: 1pixel.gif
    id: breaking202371

The indentation on those is not consistent. Should the indentation below image: be decreased by 1 space?

Second, the “How to Use” section refers a couple times to ulanzi-simple.yaml, but no such file exists in the repository. Should that say ulanzi-easy.yaml?

Errors in the yaml leeds to not compiling the code. As i understand, you can upload, but then the error occurs.

I assume a hardware problem, does your hardware work with e.g. AWTRIX-Light?

Can you post your full yaml and a bit more logs?

Excellent work, @lubeda. I finally got around to upgrading to v2 and it’s really nice. The new fonts are fantastic, and I like the way you reorganized alarms and UI elements. And now I can show the Bitcoin price in rainbow. :rainbow_flag::rainbow_flag::rainbow_flag::rainbow_flag:

1 Like

Thanks for the help, @lubeda. It took a while, but I finally pinpointed the issue and resolved it.

For whatever reason, flashing via my desktop computer wasn’t working: I couldn’t flash ESPHome, Tasmota, or Awtrix Light from it. Even using a new TC001 device wasn’t helping.

I connected the TC001 via USB to the server running ESPHome, rather than my desktop, and tried to install via my ESPHome dashboard. That worked. I now have a TC001 flashed with EspHoMaTriX, ready for tinkering!

Hi, I like your Projekt very much. I come from the old Awtrix and I am using an D1 mini. Where can I find the latest yaml code for that hardware? Currently I am using ehtmxv2-special.yaml
Currently I am trying to make it work to my wishes. I am getting there very slowly.
But do you have a better version?
Dankeschön.

Is there a page/manual describing how the boot logo is made?
I’d like to change the bars (no color changes, etc …), but right now I only see a bunch of numbers and have no idea how they resemble.
Thanks!

Hello, I cannot see the esphome.ulanzi_add_screen ?
I see _display_version or _del_screen, but not _add_screen… ???

I am using ulanzi-easy.yaml + breaking20237 fix
Home Assistant core-2024.11.3
Operating system version 6.6.31-haos-raspi
ESPHome Device Compiler (2024.11.1)
EspHoMaTrix V2 2023.7.1

regards,
Benoit.

I’ve been using this for a couple years now and I finally had to throw in the towel due to all the breaking changes (whether it’s due to ESPHome or otherwise). I only use it to show the time and pop up notifications from HA. I was able to switch to AWTRIX3 and it does everything I was doing with EspHoMaTriX, plus its controlled over MQTT so I shouldn’t need to flash the firmware ever again or involve ESPHome.

Sorry to be that guy since this is a discussion about EspHoMaTriX, but just trying to help as many people as possible.

1 Like

Hi,
I can entirely understand your decision. Esphome is not the best platform for a solution like EsphomeMatrix. And there are too many compile time parameters you can modify, which makes it fragile.
My productive Matrix would work with an esphome version that is two years old. The only reason to compile it, is when I need new icons. All the rest is done in home-assistant.

Did you check PixeIT? After my baby (EsphomeMatrix) it is for me the second-best solution.

Awtrix is pushed by plenty of influencers, which is not always a sign for quality.

But at last you have to define your requirements and choose the best solution for you.

Addenum:
I checked the newest Awtrix-documentation, if you need something like the effects you will never get this with esphomematrix!! So farewell!

I appreciate the reply. I do perform regular updates on my ESPHome devices and this would get updated as well (maybe I should rethink this and only update when necessary in a similar way I treated Tasmota just to avoid breaking changes). So I would find a breaking change, do the new workaround, and get it going again. This latest one I couldn’t fix so I just ran out of energy to tinker on it. I have to imagine people using this software for the first time cannot lock their ESPHome to a version that’s 2 years old and avoid compiling the firmware!

Anyway, I appreciate the effort you put into this and it did serve me well for a long while. Your software is the reason I bought a ulanzi in the first place! AWTRIX does check all the boxes for me and I can now leave it alone (just change graphics via web interface if needed, but can also send images via MQTT as well). PixelIT looks very similar as well so I’ll keep that in my bookmarks if needed.

Good luck and thanks for all the effort over the years on this!

1 Like

Hello @lubeda

I think i am late sorry, is your Homatrix still under development? I order in a mistake a 8x32 rgb matrix and so i want to realize it with an esp32dev_V4 and since the cangings in esphome there are snipets of the code not actually i seem. dirt you have a code to run them for (an newbeenoob)

I only want to use ist to show 4 to 5 data from our PV so that my elderly can look on:) thank you for help and greetings from austria

I am trying to use this and I have gotten it to work but for some reason when mine boots it spends a very long time showing what looks like an ethernet port icon and the word false like this:

Eventually, it displays the date and time but it takes a really long time. I have an RTC hooked up and I’m using it’s id:

esphome:
  on_boot:
    then:
      # read the RTC time once when the system boots
      ds1307.read_time:
      
time:
  - platform: ds1307
    # repeated synchronization is not necessary unless the external RTC
    # is much more accurate than the internal clock
    update_interval: never
    id: ds1307_time
  - platform: homeassistant
    # instead try to synchronize via network repeatedly ...
    on_time_sync:
      then:
        # ... and update the RTC when the synchronization was successful
        ds1307.write_time:

ehmtxv2:
  id: rgb8x32
  icons2html: true
  matrix_component: led_matrix_32x8_display
  time_component: ds1307_time
  time_format: "%I:%M%p"
  date_format: "%d.%m."
  show_seconds: false
  advanced_clock: false
...

Is there something special I need to do to get it to boot up with the RTC time right away?

I also noticed that when I use the %I:%M%p format the time doesn’t fit on the 32x8 screen. Is there some way to adjust it so it scrolls or fits better?

Hi greg,

there is no build in icon like this. The easiest way is to look at the logs. so activate debugging with

logger:
  level: DEBUG

When you send commands to the display the display should show something else.

For your date-format… There is no room for magic. Use a small 3x5 pixel font or shorten the content of the date format.

This is a good starting point for documentation: ESPHome Pixel Clock aka TRAM by Andrew J.Swan