EspHoMaTriX: A simple clock/status display

Along with @jacamayo, I would love being able to show screens for less than a minute. If I understood correctly from code, the duration is set as an integer (0-65535), interpreted as minutes.

Still waiting for my TC001 to arrive before I try esphomatrix, but I’m starting to wonder if I can get notifications to be cycled along with clock, along with a screen duration (< a minute).

Imagine the following:

Clock (x seconds)
Notification 1 (y seconds)
Notification 2 (z seconds)
Clock (x seconds)
Notification 1 (y seconds)
Notification 2 (z seconds)
                          <-- HA stops Notification 1
Clock (x seconds)
Notification 2 (z seconds)
                          <-- HA stops Notification 2
Clock (forever until a new screen is added)

In my awtrix (which I mean to replace by esphomatrix), I have notifications which are being displayed in a cycle along with clock, until HA stops updating it. Is this something somehow doable in esphomatrix?

Not sure if I could explained myself properly in my question.

1 Like

I mean the compiled code that can be found in this route /config/esphome/.esphome\build\ehmtx8266\src\main.cpp

https://community.home-assistant.io/t/a-simple-diy-status-display-with-an-8x32-rgb-led/379051/33?u=jacamayo

Yes it’s there /config/esphome/.esphome/build/ehmtx8266/src/main.cpp
if we have everything the same, it is on line 1339.
Otherwise, use ctrl+f and type Animation in the search box.
Mine on this line
test = new display::Animation(uint8_t_5, 8, 8, 5, display::IMAGE_TYPE_RGB24);

The settings for how the display should behave are in the documentation.
The setting of individual times is set in the yaml code esp.

ehmtx:
  id: rgb8x32
  show_clock: 10
  show_screen: 15
  show_date: true
  display8x32: ehmtx_display
  time: ehmtx_time
  week_start_monday: true
  duration: 1
  scroll_intervall: 72
  anim_intervall: 256

Thank you very much

I will try to solve it following your instructions later and keep you up to date

Ok, I think I have found the problem following your indications

You have this in your main.ccp
test = new display::Animation(uint8_t_5, 8, 8, 5, display::IMAGE_TYPE_RGB24);

But I have this
computer_icon = new esphome::EHMTX_Icon(uint8_t_3, 8, 8, 1, display::IMAGE_TYPE_RGB565, "computer_icon", false, 500);

The 4th number, which sets the number of frames per animation, is 5 in your main.ccp and 1 in mine, and that is why mi animations don’t move as they “have only 1 frame instead of 5”

This is the same problem you were speaking about here

Were you able to solve it?

Yes, the solution is to resize the gif to 8x8px without losing the animation. I used the website to edit online but unfortunately the website is no longer working.
The Gimp editing program was recommended to me, but I haven’t tried it.

Yessssssssssssss! That made the trick!!
:raised_hands:

I followed your advices:
Gimp software
Image/scale image
8 x 8 px
Export as gif (it only lets me save as xcf file)

Thanks a lot @pepe59 @lubeda

1 Like

New release 2023.3.0 :tada:
Big thanks to the growing community!

New features:

  • action to disable the display
  • set the interval for the clock display

Also some fixes.

If you like it, sponsor my work or give me a github star⭐.

Have fun!

3 Likes

Guide on making it work with Ulanzi pixel clock and a link to a good pixel font resource

5 Likes

Great work! Thanks for sharing!

Hi, I have a couple of questions:

  1. which is the difference (and benefits) of defining services like this:
- service: set_brightness_rgb8x32

      variables:

        brightness: int

      then:

        lambda: |-

          id(rgb8x32)->set_brightness(brightness);

Or like this?

- service: set_brightness

      variables:

        brightness: int

      then:

        - ehmtx.set.brightness:

            brightness: !lambda return brightness;
  1. I must be missing something fundamental, but how can I implement a simple endless loop that shows clock/date for “x” seconds, then a screen during “y” seconds with icon “01” and text “test 01”, then a second screen during “z” seconds with icon “03” and text “03”, and then start again with clock/date?

Thanks!

For your second question you will need to create an automation to regularly push the screens you want, by default they expire after 5 minutes.
Here’s a link to my automations for inspiration, it pushes the screens I want every minute along with some other state changes, a force screen for an important state change, presence detection to turn the display on/off and finally handles the Ulanzi buttons.

1 Like

Thanks for sharing!
Will have a look.
Best regards

@lubeda Any advice on this? Thanks in advance for your help.

Hi,
from result they are the same.
ehmtx.set.brightness is esphome style and
id(rgb8x32)->set_brightness(brightness); is c++ style.

The c++ style is more complicated but way more flexible. So you have to decide.

Hi,

in my use case the display is mainly a clock, the state display is quite dynamic, because I don’t know when a new state is displayed. I’ve got ca. 20 automations that send data to the display. And 99,9999% percent of the day I don’t even look at the display, so I know that I miss most of the displayed informations.

For the operation:

There is a queue of states/screens that are displayed one after another. You can add screens like @codechimp showed in his sample. Each screen has a lifetime. How often and when it is displayed depends from the other states in the queue. So it’s very dynamic and configured by time settings, the live time duration per screen, the show_screen time per display slot.

I’m not good in english, even in my native language it is hard for me to describe in detail what’s the logic is.

Thanks for replying. Much appreciated. I believe I get your point.
Could you also please explain the differences in the two ways of defining services?

- service: set_brightness_rgb8x32

      variables:

        brightness: int

      then:

        lambda: |-

          id(rgb8x32)->set_brightness(brightness);

Versus

- service: set_brightness

      variables:

        brightness: int

      then:

        - ehmtx.set.brightness:

            brightness: !lambda return brightness;

See here, I think there is also a documantion on https://esphome.io

I see. Thanks for replying.

May also suggest something? Could you make the colon blinking every second in clock screen?