A simple DIY status display with an 8x32 RGB LED

Does it work now? I have this board and it works for me

Processing ehmtx32 (board: mhetesp32minikit; framework: arduino; platform: platformio/espressif32 @ 3.3.2)
--------------------------------------------------------------------------------------------------------------------------------HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash

The release off the version 1.0 is coming :-). With the help of @jd1 the code and features grew to a exciting level. I will wait to next week how the display works day to day. If there are no features or bug it will be “official” released.

Thanx for your feedback.

1 Like

The release off the version 1.0 is still coming :slight_smile:
I am waiting for this pull request https://github.com/esphome/esphome/pull/3229 .
With this merged you can store more icons in the flash.

You can try it with this https://github.com/lubeda/EsphoMaTrix/blob/31d883e7863bed1e67387cad010f3699c35f35b9/RGB565.md informations

1 Like

great project! can you share your icons library??

1 Like

Thanx, but sorry i can’t share my icons.

But you could take a look a this powershell script.

This script downloads the first 100 (parameter page_size in $request) popular icons from the lametric icon database. The icons are downloaded to the current directory and named like this: Stork Delievers Baby-365.gif

I am not shure about the copyrights and the license of these icons. I think they are free but i don’t realy know.

So use at your own risk

Another way to get icons is from blueforcers icon database.
Here you can click on the desired icon and save it as gif or png. These icons are 240x240 pixel but they are scaled automagically. By the way blueforcer sells some nice hardware kits you can buy on his website.

$request = "https://developer.lametric.com/api/v2/icons?page_size=100&fields=id,type,title,url,category&order=popular"

$data = Invoke-WebRequest $request

$array = $data.Content | ConvertFrom-Json
$text = $array.data | foreach-object {
    $file = $_
    
    if ($file.type -eq "movie") {
        $fn = "$($file.title)-$($file.id).gif"}
     else{
        $fn = "$($file.title)-$($file.id).png"}
    write-host $fn
    Invoke-WebRequest -Uri $file.url -OutFile $fn
} 
1 Like

hello and congratulations on your work, I’m trying it and the time and date work perfectly, but what if I wanted to add more information in the loop? I can create sensors but not insert them in the loop, can you show me an example of how I could do it?

Hi maverik80,
i put a sample here

In your case it is easier to add the screen to the loop from home assistant. But i will test if it works the way you intended it.

it also works locally, but why i think it is more flexible to automate this on server

sensor:
  - platform: homeassistant
    id: istantaneo_w
    entity_id: sensor.energia_assorbita
    internal: true
    on_value:
      then:
      - ehmtx.add.screen:
          id: rgb8x32
          text: !lambda return std::to_string(x);
          icon_name: power
          duration: 7
          alarm: false

Greetings

1 Like

really thank you very much it works perfectly, but if I can I would like to ask you another question, how can I not refreshare continuously for the duration? that is, he prints me the value but if it varies continuously print the new value … would it be possible to print the value taken the first time for 7 seconds and then continue with the loop?

i’ m not shure what you want to achieve. On each state change of your sensor the new value will be displayed, that is by design. If you don’t want to see each change you can do a time_pattern trigger like this:

alias: send states to ehmtx by time
trigger:
    - platform: time_pattern
      # You can also match on interval. This will match every 5 minutes
      minutes: "/5"
condition: []
action:
  - service: esphome.ehmtx8266_screen_t            # must correspond to your device name
    data:
      icon_name: 'power'                                      # again your icon
      duration: 1                          # in minutes
      text: >-
        {{ states.sensor.energia_assorbita.state}} {{states.sensor.energia_assorbita.state.attributes.unit_of_measurement}}

This will read the sensor every five minutes and display its value for one minute.

Greetings

thank you very much you really help me a lot, another question, I’m inserting the icons as you did, but I didn’t understand how to make them animate? the file is a * .gif but on the screen it is reproduced static, I would like to understand if I’m wrong? keep in mind that I get the icons from Lametric. Thanks in advance

I have a question. I own a flexible RGB 8x32 panel. What is the best way to fasten it to a solid board so that it does not deform? What do you use? Is it enough to fasten it with double-sided adhesive tape? Will the temperature not matter during this installation? Thank you.

At full brightness the the panel may get hot. I use a 3d printed housing from thingiverse use the search term “awtrix”.

Here is a german [forum[(https://github.com/o0shojo0o/PixelIt/discussions/48) where user from a nother firmware show their devices.

Normaly all gifs are automagically animated on the display.
If you download this gif https://developer.lametric.com/content/apps/icon_thumbs/72.gif
and use this yaml (with your ids)

ehmtx:
  id: rgb8x32
  show_clock: 4
  show_screen: 6
  display8x32: ehmtx_display
  time: ehmtx_time
  duration: 7
  font_id: ehmtx_font
  icons: 
    - file: 72.gif
      id: rain

and this service call


your display should look like this: youtube

If not i think you have a probleme with your pillow library, a part of the esphome installation.

I tested this with hassos and esphome in docker on windows.

please check if your compiled code (e.g. /config/esphome/.esphome\build\ehmtx8266\src\main.cpp)
has a line like this:

rain = new display::Animation(uint8_t_3, 8, 8, 5, display::IMAGE_TYPE_RGB24);

the five means this animation has 5 frames.

Downloaded gif 240x240 does not work after compilation.
On PC win10 animation works, but after compiling esp has only one image
test = new display::Animation(uint8_t_6, 8, 8, 1, display::IMAGE_TYPE_RGB24);
I used your 8x8 and it works well on RPI4 8Gb after compilation
rain = new display::Animation(uint8_t_4, 8, 8, 5, display::IMAGE_TYPE_RGB24);
Can gif be scaled down to 8x8 on PC so it doesn’t lose animation?

Crazy,

all major image manipulation software is able to scale gifs without loosing the animation, like gimp.
I tried paint on my windows 10 PC, with this tool you lose the animation as in your test. So, use gimp.

I have one more question: the bottom row of LEDs shows the days of the week. Our first day of the week is Monday, but the indicator shows Sunday. Is it possible to modify it so that the first three LEDs on the left are activated as the first day of the week, Monday?
Thanks for the great component, it works perfectly

There is a new parameter for this, which defaults to monday as first day of week, since i’m from germany where this is the default.

week_start_monday (optional, bool): default monday is first day of week, false => sunday

1 Like

Thank you very much, it works perfectly.

Here you can edit the images online
https://resizeimage.net/

I wanted to use automatic brightness control with the BH1750 sensor, but an error occurs during compilation. The sensor works well on its own. Where am I making mistake?

sensor:
  - platform: bh1750
    name: "Jas led 8x32"
    address: 0x23
    update_interval: 5s
    on_value:
      then:
         lambda: |-  
            if (x > 200) then
            {
               id(rgb8x32)->set_brightness(50);
            } else {
               id(rgb8x32)->set_brightness(250);
            }
Compiling /data/led-8x32/.pioenvs/led-8x32/src/main.cpp.o
/config/esphome/led-8x32.yaml: In lambda function:
/config/esphome/led-8x32.yaml:261:20: error: 'then' was not declared in this scope
  261 |             if (x > 200) then
      |                    ^~~~
*** [/data/led-8x32/.pioenvs/led-8x32/src/main.cpp.o] Error 1

I figured it out and it works very well.

sensor:
  - platform: bh1750
    name: "Jas led 8x32"
    address: 0x23
    on_value:
      then:
        lambda: |-  
          if (x > 150)
          {
            id(rgb8x32)->set_brightness(100);
          } else {
            id(rgb8x32)->set_brightness(80);
          }
1 Like