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!