A simple DIY status display with an 8x32 RGB LED

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

Sorry, you fixed it. My example was wrong.

Out of curiosity, any one tried to use more than one 8x32 led matrix, like two or maybe even three? :stuck_out_tongue:

Yes, kind of…

I have two displays always running. They all show the same content. Therefor i use this script:

description: Send a screen to all active ehmtx devices
fields:
  title:
    description: The title of the notification
    example: State change
  message:
    description: The message content
    example: The light is on!
sequence:
  - choose:
      - conditions:
          - condition: state
            entity_id: binary_sensor.awtrix_status
            state: 'on'
        sequence:
          - service: esphome.awtrix_screen
            data:
              icon_name: '{{ icon_name }}'
              text: '{{ text }}'
  - choose:
      - conditions:
          - condition: state
            entity_id: binary_sensor.ehmtx8266_status
            state: 'on'
        sequence:
          - service: esphome.ehmtx8266_screen
            data:
              icon_name: '{{ icon_name }}'
              text: '{{ text }}'
  - choose:
      - conditions:
          - condition: state
            entity_id: binary_sensor.ehmtx32_status
            state: 'on'
        sequence:
          - service: esphome.ehmtx32_screen
            data:
              icon_name: '{{ icon_name }}'
              text: '{{ text }}'
mode: single
alias: EHMTX screen to all
icon: mdi:arrange-bring-forward
1 Like

Each with it’s own esp? I was thinking hooking like two of this 8x32 matrixes on one esp in series to get for example a 16x32 or a 8x64 matrix display?

Each display has 256 pixels so not sure what the limit (probably memory) is for a esp82xx or a esp32 :thinking:

Yes,
but it should be possible.
But there are realy some limitiations in the hardware. E.G. the fontscrolling. Esphome has no method to limit the text to the needed parts so it uses a lot of memory for the text in RAM. Other parts like the icons will also consume a lot of memory 8x8 vs. 16x16 icons == 4 times RAM and flash…

Perhaps i will give it a try but only the 8x64 style…

1 Like

But…
The day indicator needs a rework, also the alarm and indicator on the right side. Also the calculation of the scrolling…

It is still possible but needs more work.

If you like to send screens to your display with notify calls use this EHMTX notify component.

Now you can use it in alert to send messages to your display in a more streamlined way.

1 Like

Since my pull requests to the esphome core are approved now, some important parts of my esphome-component will be officially available with the upcoming esphome release 2022.5! :slight_smile:

Then i am able to clean up a little bit and release the version 1.0 of my component. Then my rgb565-branch will become “main” which makes it much easier to use it.
thanx to @jesserockz

2 Likes