Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with ESPHome 2023.07 update #62

Closed
clfberlin opened this issue Jul 19, 2023 · 18 comments
Closed

Issues with ESPHome 2023.07 update #62

clfberlin opened this issue Jul 19, 2023 · 18 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@clfberlin
Copy link

Bug report

Describe the bug

Cannot update after ESPHome 2023.07. It seems that the new version brought changes that prevents updates (to Ulanzi). This seems to evolve around the font-handling.

Logs

In file included from src/esphome.h:25,
                 from src/esphome/components/ehmtxv2/EHMTX_icons.cpp:1:
src/esphome/components/ehmtxv2/EHMTX.h:95:14: error: 'Font' in namespace 'esphome::display' does not name a type
     display::Font *default_font;
              ^~~~
src/esphome/components/ehmtxv2/EHMTX.h:96:14: error: 'Font' in namespace 'esphome::display' does not name a type
     display::Font *special_font;
              ^~~~
src/esphome/components/ehmtxv2/EHMTX.h:150:36: error: 'esphome::display::Font' has not been declared
     void set_default_font(display::Font *font);
                                    ^~~~
src/esphome/components/ehmtxv2/EHMTX.h:151:36: error: 'esphome::display::Font' has not been declared
     void set_special_font(display::Font *font);
                                    ^~~~
src/esphome/components/ehmtxv2/EHMTX.h:267:3: error: expected class-name before '{' token
   {
   ^
src/esphome/components/ehmtxv2/EHMTX.h:272:107: error: 'esphome::display::ImageType' has not been declared
     EHMTX_Icon(const uint8_t *data_start, int width, int height, uint32_t animation_frame_count, display::ImageType type, std::string icon_name, bool revers, uint16_t frame_duration);
                                                                                                           ^~~~~~~~~
In file included from src/esphome.h:25,
                 from src/esphome/components/ehmtxv2/EHMTX.cpp:1:
src/esphome/components/ehmtxv2/EHMTX.h:95:14: error: 'Font' in namespace 'esphome::display' does not name a type
     display::Font *default_font;
              ^~~~
src/esphome/components/ehmtxv2/EHMTX.h:96:14: error: 'Font' in namespace 'esphome::display' does not name a type
     display::Font *special_font;
              ^~~~
src/esphome/components/ehmtxv2/EHMTX.h:150:36: error: 'esphome::display::Font' has not been declared
     void set_default_font(display::Font *font);
                                    ^~~~
src/esphome/components/ehmtxv2/EHMTX.h:151:36: error: 'esphome::display::Font' has not been declared
     void set_special_font(display::Font *font);
                                    ^~~~
src/esphome/components/ehmtxv2/EHMTX.h:267:3: error: expected class-name before '{' token
   {
   ^
src/esphome/components/ehmtxv2/EHMTX.h:272:107: error: 'esphome::display::ImageType' has not been declared
     EHMTX_Icon(const uint8_t *data_start, int width, int height, uint32_t animation_frame_count, display::ImageType type, std::string icon_name, bool revers, uint16_t frame_duration);
                                                                                                           ^~~~~~~~~
src/esphome/components/ehmtxv2/EHMTX_icons.cpp:6:117: error: 'esphome::display::ImageType' has not been declared
   EHMTX_Icon::EHMTX_Icon(const uint8_t *data_start, int width, int height, uint32_t animation_frame_count, display::ImageType type, std::string icon_name, bool revers, uint16_t frame_duration)
                                                                                                                     ^~~~~~~~~
src/esphome/components/ehmtxv2/EHMTX_icons.cpp: In constructor 'esphome::EHMTX_Icon::EHMTX_Icon(const uint8_t*, int, int, uint32_t, int, std::__cxx11::string, bool, uint16_t)':
src/esphome/components/ehmtxv2/EHMTX_icons.cpp:7:9: error: class 'esphome::EHMTX_Icon' does not have any field named 'Animation'
       : Animation(data_start, width, height, animation_frame_count, type)
         ^~~~~~~~~
src/esphome/components/ehmtxv2/EHMTX_icons.cpp: In member function 'void esphome::EHMTX_Icon::next_frame()':
src/esphome/components/ehmtxv2/EHMTX_icons.cpp:17:15: error: 'class esphome::EHMTX_Icon' has no member named 'get_animation_frame_count'
     if (this->get_animation_frame_count() > 1)
               ^~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/components/ehmtxv2/EHMTX_icons.cpp:21:37: error: 'class esphome::EHMTX_Icon' has no member named 'get_current_frame'
         if (this->reverse && (this->get_current_frame() == this->get_animation_frame_count() - 2))
                                     ^~~~~~~~~~~~~~~~~
src/esphome/components/ehmtxv2/EHMTX_icons.cpp:21:66: error: 'class esphome::EHMTX_Icon' has no member named 'get_animation_frame_count'
         if (this->reverse && (this->get_current_frame() == this->get_animation_frame_count() - 2))
                                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/components/ehmtxv2/EHMTX_icons.cpp:25:9: error: 'Animation' has not been declared
         Animation::next_frame();
         ^~~~~~~~~
src/esphome/components/ehmtxv2/EHMTX_icons.cpp:29:19: error: 'class esphome::EHMTX_Icon' has no member named 'get_current_frame'
         if (this->get_current_frame() == 1) // this->get_animation_frame_count())
                   ^~~~~~~~~~~~~~~~~
src/esphome/components/ehmtxv2/EHMTX_icons.cpp:33:9: error: 'Animation' has not been declared
         Animation::prev_frame();
         ^~~~~~~~~
src/esphome/components/ehmtxv2/EHMTX.cpp: In member function 'void esphome::EHMTX::tick()':
src/esphome/components/ehmtxv2/EHMTX.cpp:581:67: error: 'class esphome::EHMTX_Icon' has no member named 'set_frame'; did you mean 'next_frame'?
             this->icons[this->queue[this->screen_pointer]->icon]->set_frame(0);
                                                                   ^~~~~~~~~
                                                                   next_frame
src/esphome/components/ehmtxv2/EHMTX.cpp: At global scope:
src/esphome/components/ehmtxv2/EHMTX.cpp:677:41: error: variable or field 'set_default_font' declared void
   void EHMTX::set_default_font(display::Font *font)
                                         ^~~~
src/esphome/components/ehmtxv2/EHMTX.cpp:677:41: error: 'Font' is not a member of 'esphome::display'
src/esphome/components/ehmtxv2/EHMTX.cpp:677:41: note: suggested alternative:
In file included from src/esphome.h:28,
                 from src/esphome/components/ehmtxv2/EHMTX.cpp:1:
src/esphome/components/font/font.h:41:7: note:   'esphome::font::Font'
 class Font : public display::BaseFont {
       ^~~~
src/esphome/components/ehmtxv2/EHMTX.cpp:677:51: error: expected primary-expression before ')' token
   void EHMTX::set_default_font(display::Font *font)
                                                   ^
src/esphome/components/ehmtxv2/EHMTX.cpp:682:41: error: variable or field 'set_special_font' declared void
   void EHMTX::set_special_font(display::Font *font)
                                         ^~~~
src/esphome/components/ehmtxv2/EHMTX.cpp:682:41: error: 'Font' is not a member of 'esphome::display'
src/esphome/components/ehmtxv2/EHMTX.cpp:682:41: note: suggested alternative:
In file included from src/esphome.h:28,
                 from src/esphome/components/ehmtxv2/EHMTX.cpp:1:
src/esphome/components/font/font.h:41:7: note:   'esphome::font::Font'
 class Font : public display::BaseFont {
       ^~~~
src/esphome/components/ehmtxv2/EHMTX.cpp:682:51: error: expected primary-expression before ')' token
   void EHMTX::set_special_font(display::Font *font)
                                                   ^
*** [/data/ulanzi/.pioenvs/ulanzi/src/esphome/components/ehmtxv2/EHMTX_icons.cpp.o] Error 1
*** [/data/ulanzi/.pioenvs/ulanzi/src/esphome/components/ehmtxv2/EHMTX.cpp.o] Error 1

Thanks!

@clfberlin clfberlin added the bug Something isn't working label Jul 19, 2023
@paolo-rendano
Copy link

same issue here. In the 2023.7.0 esphome changelog there are breaking changes regarding Fonts

@lubeda
Copy link
Owner

lubeda commented Jul 19, 2023

Yes, there are even more breaking changes in esphome 2023.7.0 that are not mentioned. I have to investigate

@lubeda lubeda added the help wanted Extra attention is needed label Jul 19, 2023
@lubeda
Copy link
Owner

lubeda commented Jul 19, 2023

@idodov
Copy link

idodov commented Jul 19, 2023

Also having compilation problem

Compiling /data/ulanzi/.pioenvs/ulanzi/src/esphome/components/homeassistant/time/homeassistant_time.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:5:10: fatal error: esphome/components/animation/animation.h: No such file or directory
 #include "esphome/components/animation/animation.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
*** [/data/ulanzi/.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:5:10: fatal error: esphome/components/animation/animation.h: No such file or directory
 #include "esphome/components/animation/animation.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
*** [/data/ulanzi/.pioenvs/ulanzi/src/esphome/components/ehmtxv2/EHMTX.cpp.o] Error 1
In file included from src/esphome.h:25,
                 from src/esphome/components/ehmtxv2/EHMTX_queue.cpp:1:
src/esphome/components/ehmtxv2/EHMTX.h:5:10: fatal error: esphome/components/animation/animation.h: No such file or directory
 #include "esphome/components/animation/animation.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
*** [/data/ulanzi/.pioenvs/ulanzi/src/esphome/components/ehmtxv2/EHMTX_queue.cpp.o] Error 1
========================== [FAILED] 

@jfurtner
Copy link

Also having compilation problem

@idodov You can work around this by bringing in an animation (which itself requires image apparently):

animation:
  - id: animation_black
    file: "black.gif"

image:
  - id: image_black
    file: "black.gif"

black.gif is just an 1x1 black gif located in the esphome config folder (along side the esphome device yaml file). The graphic only consumes 1 byte of data + the object so I'd guess it's <250 bytes of flash that's consumed for this part (in addition to whatever size the animation & image code is).

This is a work around - it should be a dynamic dependency of the component instead but I don't see how to do that yet.

@idodov
Copy link

idodov commented Jul 20, 2023

@jfurtner , Where in the yaml file I need to add those lines? Under what section?

@candyman2903
Copy link

I had no black.gif in esphome folder. That's why I quickly made a 1x1 gif in black via the site: https://onlinegiftools.com/create-1x1-pixel-gif

I put the code part under the font block.

@jfurtner
Copy link

Yes you need to create the file yourself.

Anywhere in your device config works, they are top-level config entries (at the same level as font/display/ehmtxv2):

animation:
  - id: animation_black
    file: "black.gif"
display:
  ...
ehmtxv2:
  ...
font:
  ...
image:
  - id: image_black
    file: "black.gif"

@lubeda
Copy link
Owner

lubeda commented Jul 20, 2023

@jfurtner Thanks, that is what I just found out. Only components that are referenced in the yaml are included in the compile part. Since i use animation only internally, it isn't included and the compiler error is "correct".

I am searching for a way to tweak the code generation from the yaml.

@idodov
Copy link

idodov commented Jul 20, 2023

@jfurtner @candyman2903 Thank you very much! Problem sovled.

@lubeda
Copy link
Owner

lubeda commented Jul 20, 2023

@jfurtner @candyman2903 Thank you very much! Problem sovled.
You're right, we have to thank @jfurtner @candyman2903, but this is no solution, it's only a workaround!!!!

Issues in esphome around "my" problem:
esphome/issues#4726 and esphome/issues#4719

@lubeda
Copy link
Owner

lubeda commented Jul 21, 2023

There are some other projects that suffer from this breaking change, e.g. esphome/issues#4720

For now there is no solution but a workaround.

@TheGabeMan
Copy link

Fixed it for me!

@lubeda lubeda closed this as completed Aug 16, 2023
@Empty2k12
Copy link

wget https://upload.wikimedia.org/wikipedia/commons/e/ed/Pix.gif && mv Pix.gif black.gif

in your config folder

@RikMuilwijk
Copy link

@clfberlin ever found a solution to the font issue? Having the exact same issue, skipping ESPhome updates since 2023.6.5

@clfberlin
Copy link
Author

clfberlin commented Oct 31, 2023

Hi @RikMuilwijk - The workround mentioned above worked for me.
Generate a 1x1px black gif, place it in /config/esphome and add to the YAML file

animation:
  - id: animation_black
    file: "black.gif"
display:
  ...
ehmtxv2:
  ...
font:
  ...
image:
  - id: image_black
    file: "black.gif"

@RikMuilwijk
Copy link

Thanks, added the lines but sadly no luck :( My log and yaml;

INFO ESPHome 2023.10.5
INFO Reading configuration /config/esphome/ledclock.yaml...
INFO Updating https://github.com/RikMuilwijk/EsphoMaTrix@None
WARNING 
WARNING If you are upgrading EsphoMaTrix from a version before 2023.4.0,
WARNING you should read the section https://github.com/lubeda/EsphoMaTrix/#how-to-update for tipps.
WARNING 
WARNING GPIO15 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
INFO Detected timezone 'Europe/Amsterdam'
INFO Detected timezone 'Europe/Amsterdam'
INFO Generating C++ source...
INFO Compiling app...
Processing ulanzi (board: esp32dev; framework: arduino; platform: platformio/espressif32@5.4.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
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/ehmtx/EHMTX.cpp.o
Compiling .pioenvs/ulanzi/src/esphome/components/ehmtx/EHMTX_icons.cpp.o
Compiling .pioenvs/ulanzi/src/esphome/components/ehmtx/EHMTX_screen.cpp.o
Compiling .pioenvs/ulanzi/src/esphome/components/ehmtx/EHMTX_store.cpp.o
In file included from src/esphome.h:26,
                 from src/esphome/components/ehmtx/EHMTX.cpp:1:
src/esphome/components/ehmtx/EHMTX.h:62:14: error: 'Font' in namespace 'esphome::display' does not name a type
     display::Font *font;
              ^~~~
src/esphome/components/ehmtx/EHMTX.h:102:28: error: 'esphome::display::Font' has not been declared
     void set_font(display::Font *font);
                            ^~~~
src/esphome/components/ehmtx/EHMTX.h:552:3: error: expected class-name before '{' token
   {
   ^
src/esphome/components/ehmtx/EHMTX.h:557:107: error: 'esphome::display::ImageType' has not been declared
     EHMTX_Icon(const uint8_t *data_start, int width, int height, uint32_t animation_frame_count, display::ImageType type, std::string icon_name, bool revers, uint16_t frame_duration);
                                                                                                           ^~~~~~~~~
In file included from src/esphome.h:26,
                 from src/esphome/components/ehmtx/EHMTX_icons.cpp:1:
src/esphome/components/ehmtx/EHMTX.h:62:14: error: 'Font' in namespace 'esphome::display' does not name a type
     display::Font *font;
              ^~~~
src/esphome/components/ehmtx/EHMTX.h:102:28: error: 'esphome::display::Font' has not been declared
     void set_font(display::Font *font);
                            ^~~~
src/esphome/components/ehmtx/EHMTX.h:552:3: error: expected class-name before '{' token
   {
   ^
src/esphome/components/ehmtx/EHMTX.h:557:107: error: 'esphome::display::ImageType' has not been declared
     EHMTX_Icon(const uint8_t *data_start, int width, int height, uint32_t animation_frame_count, display::ImageType type, std::string icon_name, bool revers, uint16_t frame_duration);
                                                                                                           ^~~~~~~~~
In file included from src/esphome.h:26,
                 from src/esphome/components/ehmtx/EHMTX_store.cpp:1:
src/esphome/components/ehmtx/EHMTX.h:62:14: error: 'Font' in namespace 'esphome::display' does not name a type
     display::Font *font;
              ^~~~
src/esphome/components/ehmtx/EHMTX.h:102:28: error: 'esphome::display::Font' has not been declared
     void set_font(display::Font *font);
                            ^~~~
src/esphome/components/ehmtx/EHMTX.h:552:3: error: expected class-name before '{' token
   {
   ^
src/esphome/components/ehmtx/EHMTX.h:557:107: error: 'esphome::display::ImageType' has not been declared
     EHMTX_Icon(const uint8_t *data_start, int width, int height, uint32_t animation_frame_count, display::ImageType type, std::string icon_name, bool revers, uint16_t frame_duration);
                                                                                                           ^~~~~~~~~
In file included from src/esphome.h:26,
                 from src/esphome/components/ehmtx/EHMTX_screen.cpp:1:
src/esphome/components/ehmtx/EHMTX.h:62:14: error: 'Font' in namespace 'esphome::display' does not name a type
     display::Font *font;
              ^~~~
src/esphome/components/ehmtx/EHMTX.h:102:28: error: 'esphome::display::Font' has not been declared
     void set_font(display::Font *font);
                            ^~~~
src/esphome/components/ehmtx/EHMTX.h:552:3: error: expected class-name before '{' token
   {
   ^
src/esphome/components/ehmtx/EHMTX.h:557:107: error: 'esphome::display::ImageType' has not been declared
     EHMTX_Icon(const uint8_t *data_start, int width, int height, uint32_t animation_frame_count, display::ImageType type, std::string icon_name, bool revers, uint16_t frame_duration);
                                                                                                           ^~~~~~~~~
src/esphome/components/ehmtx/EHMTX.cpp: In member function 'void esphome::EHMTX::draw_clock()':
src/esphome/components/ehmtx/EHMTX.cpp:212:74: error: 'class esphome::EHMTX' has no member named 'font'
         this->display->strftime(this->xoffset + 15, this->yoffset, this->font, this->clock_color, display::TextAlign::BASELINE_CENTER, this->time_fmt.c_str(),
                                                                          ^~~~
src/esphome/components/ehmtx/EHMTX.cpp:221:74: error: 'class esphome::EHMTX' has no member named 'font'
         this->display->strftime(this->xoffset + 15, this->yoffset, this->font, this->clock_color, display::TextAlign::BASELINE_CENTER, this->date_fmt.c_str(),
                                                                          ^~~~
src/esphome/components/ehmtx/EHMTX.cpp:228:69: error: 'class esphome::EHMTX' has no member named 'font'
       this->display->print(this->xoffset + 15, this->yoffset, this->font, this->alarm_color, display::TextAlign::BASELINE_CENTER, "!t!");
                                                                     ^~~~
src/esphome/components/ehmtx/EHMTX.cpp: In member function 'void esphome::EHMTX::tick()':
src/esphome/components/ehmtx/EHMTX.cpp:293:84: error: 'class esphome::EHMTX' has no member named 'font'
           this->display->get_text_bounds(0, 0, this->icons[i]->name.c_str(), this->font, display::TextAlign::LEFT, &x, &y, &w, &h);
                                                                                    ^~~~
src/esphome/components/ehmtx/EHMTX.cpp: At global scope:
src/esphome/components/ehmtx/EHMTX.cpp:426:33: error: variable or field 'set_font' declared void
   void EHMTX::set_font(display::Font *font)
                                 ^~~~
src/esphome/components/ehmtx/EHMTX.cpp:426:33: error: 'Font' is not a member of 'esphome::display'
src/esphome/components/ehmtx/EHMTX.cpp:426:33: note: suggested alternative:
In file included from src/esphome.h:29,
                 from src/esphome/components/ehmtx/EHMTX.cpp:1:
src/esphome/components/font/font.h:41:7: note:   'esphome::font::Font'
 class Font : public display::BaseFont {
       ^~~~
src/esphome/components/ehmtx/EHMTX.cpp:426:43: error: expected primary-expression before ')' token
   void EHMTX::set_font(display::Font *font)
                                           ^
src/esphome/components/ehmtx/EHMTX.cpp: In member function 'void esphome::EHMTX::internal_add_screen(uint8_t, std::__cxx11::string, uint16_t, uint16_t, bool)':
src/esphome/components/ehmtx/EHMTX.cpp:485:62: error: 'class esphome::EHMTX' has no member named 'font'
     this->display->get_text_bounds(0, 0, text.c_str(), this->font, display::TextAlign::LEFT, &x, &y, &w, &h);
                                                              ^~~~
src/esphome/components/ehmtx/EHMTX_icons.cpp:6:117: error: 'esphome::display::ImageType' has not been declared
   EHMTX_Icon::EHMTX_Icon(const uint8_t *data_start, int width, int height, uint32_t animation_frame_count, display::ImageType type, std::string icon_name, bool revers, uint16_t frame_duration)
                                                                                                                     ^~~~~~~~~
src/esphome/components/ehmtx/EHMTX_icons.cpp: In constructor 'esphome::EHMTX_Icon::EHMTX_Icon(const uint8_t*, int, int, uint32_t, int, std::__cxx11::string, bool, uint16_t)':
src/esphome/components/ehmtx/EHMTX_icons.cpp:7:9: error: class 'esphome::EHMTX_Icon' does not have any field named 'Animation'
       : Animation(data_start, width, height, animation_frame_count, type)
         ^~~~~~~~~
src/esphome/components/ehmtx/EHMTX_icons.cpp: In member function 'void esphome::EHMTX_Icon::next_frame()':
src/esphome/components/ehmtx/EHMTX_icons.cpp:18:15: error: 'class esphome::EHMTX_Icon' has no member named 'get_animation_frame_count'
     if (this->get_animation_frame_count() > 1)
               ^~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/components/ehmtx/EHMTX_icons.cpp:22:37: error: 'class esphome::EHMTX_Icon' has no member named 'get_current_frame'
         if (this->reverse && (this->get_current_frame() == this->get_animation_frame_count() - 2))
                                     ^~~~~~~~~~~~~~~~~
src/esphome/components/ehmtx/EHMTX_icons.cpp:22:66: error: 'class esphome::EHMTX_Icon' has no member named 'get_animation_frame_count'
         if (this->reverse && (this->get_current_frame() == this->get_animation_frame_count() - 2))
                                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/components/ehmtx/EHMTX_icons.cpp:26:9: error: 'Animation' has not been declared
         Animation::next_frame();
         ^~~~~~~~~
src/esphome/components/ehmtx/EHMTX_icons.cpp:30:19: error: 'class esphome::EHMTX_Icon' has no member named 'get_current_frame'
         if (this->get_current_frame() == 1) // this->get_animation_frame_count())
                   ^~~~~~~~~~~~~~~~~
src/esphome/components/ehmtx/EHMTX_icons.cpp:34:9: error: 'Animation' has not been declared
         Animation::prev_frame();
         ^~~~~~~~~
src/esphome/components/ehmtx/EHMTX.cpp: In member function 'void esphome::EHMTX::show_all_icons()':
src/esphome/components/ehmtx/EHMTX.cpp:660:78: error: 'class esphome::EHMTX' has no member named 'font'
     this->display->get_text_bounds(0, 0, this->icons[0]->name.c_str(), this->font, display::TextAlign::LEFT, &x, &y, &w, &h);
                                                                              ^~~~
src/esphome/components/ehmtx/EHMTX_screen.cpp: In member function 'void esphome::EHMTX_screen::draw_()':
src/esphome/components/ehmtx/EHMTX_screen.cpp:81:167: error: 'class esphome::EHMTX' has no member named 'font'
         this->config_->display->print(this->centerx_ + TEXTSCROLLSTART - this->shiftx_ + extraoffset + this->config_->xoffset, this->config_->yoffset, this->config_->font, this->config_->alarm_color, esphome::display::TextAlign::BASELINE_LEFT,
                                                                                                                                                                       ^~~~
src/esphome/components/ehmtx/EHMTX_screen.cpp:86:167: error: 'class esphome::EHMTX' has no member named 'font'
         this->config_->display->print(this->centerx_ + TEXTSCROLLSTART - this->shiftx_ + extraoffset + this->config_->xoffset, this->config_->yoffset, this->config_->font, this->text_color, esphome::display::TextAlign::BASELINE_LEFT,
                                                                                                                                                                       ^~~~
src/esphome/components/ehmtx/EHMTX_screen.cpp:100:75: error: no matching function for call to 'esphome::addressable_light::AddressableLightDisplay::image(int, int, esphome::EHMTX_Icon*&)'
       this->config_->display->image(2, 0, this->config_->icons[this->icon]);
                                                                           ^
In file included from src/esphome/components/display/display_buffer.h:6,
                 from src/esphome/components/addressable_light/addressable_light_display.h:5,
                 from src/esphome.h:4,
                 from src/esphome/components/ehmtx/EHMTX_screen.cpp:1:
src/esphome/components/display/display.h:347:8: note: candidate: 'void esphome::display::Display::image(int, int, esphome::display::BaseImage*, esphome::Color, esphome::Color)'
   void image(int x, int y, BaseImage *image, Color color_on = COLOR_ON, Color color_off = COLOR_OFF);
        ^~~~~
src/esphome/components/display/display.h:347:8: note:   no known conversion for argument 3 from 'esphome::EHMTX_Icon*' to 'esphome::display::BaseImage*'
src/esphome/components/display/display.h:358:8: note: candidate: 'void esphome::display::Display::image(int, int, esphome::display::BaseImage*, esphome::display::ImageAlign, esphome::Color, esphome::Color)'
   void image(int x, int y, BaseImage *image, ImageAlign align, Color color_on = COLOR_ON, Color color_off = COLOR_OFF);
        ^~~~~
src/esphome/components/display/display.h:358:8: note:   candidate expects 6 arguments, 3 provided
src/esphome/components/ehmtx/EHMTX_screen.cpp:108:75: error: no matching function for call to 'esphome::addressable_light::AddressableLightDisplay::image(int, int, esphome::EHMTX_Icon*&)'
       this->config_->display->image(0, 0, this->config_->icons[this->icon]);
                                                                           ^
In file included from src/esphome/components/display/display_buffer.h:6,
                 from src/esphome/components/addressable_light/addressable_light_display.h:5,
                 from src/esphome.h:4,
                 from src/esphome/components/ehmtx/EHMTX_screen.cpp:1:
src/esphome/components/display/display.h:347:8: note: candidate: 'void esphome::display::Display::image(int, int, esphome::display::BaseImage*, esphome::Color, esphome::Color)'
   void image(int x, int y, BaseImage *image, Color color_on = COLOR_ON, Color color_off = COLOR_OFF);
        ^~~~~
src/esphome/components/display/display.h:347:8: note:   no known conversion for argument 3 from 'esphome::EHMTX_Icon*' to 'esphome::display::BaseImage*'
src/esphome/components/display/display.h:358:8: note: candidate: 'void esphome::display::Display::image(int, int, esphome::display::BaseImage*, esphome::display::ImageAlign, esphome::Color, esphome::Color)'
   void image(int x, int y, BaseImage *image, ImageAlign align, Color color_on = COLOR_ON, Color color_off = COLOR_OFF);
        ^~~~~
src/esphome/components/display/display.h:358:8: note:   candidate expects 6 arguments, 3 provided
*** [.pioenvs/ulanzi/src/esphome/components/ehmtx/EHMTX_icons.cpp.o] Error 1
*** [.pioenvs/ulanzi/src/esphome/components/ehmtx/EHMTX.cpp.o] Error 1
*** [.pioenvs/ulanzi/src/esphome/components/ehmtx/EHMTX_store.cpp.o] Error 1
*** [.pioenvs/ulanzi/src/esphome/components/ehmtx/EHMTX_screen.cpp.o] Error 1
========================= [FAILED] Took 17.32 seconds =========================

YAML file:

substitutions:
  devicename: ulanzi
  matrix_pin: GPIO32 
  buzzer_pin: GPIO15
  battery_pin: GPIO34 
  ldr_pin: GPIO35 
  left_button_pin: GPIO26 
  mid_button_pin: GPIO27 
  right_button_pin: GPIO14 
  scl_pin: GPIO22 
  sda_pin: GPIO21 


external_components:
  - source:
      type: git
      #url: https://github.com/lubeda/EsphoMaTrix
      url: https://github.com/RikMuilwijk/EsphoMaTrix
    refresh: 60s 
    components: [ ehmtx ]   

esphome:
  comment: "Ulanzi TC001"
  name: ulanzi
  on_boot:
    then:
      - ds1307.read_time:
  
esp32:
  board: esp32dev
  
ota:

wifi:
  networks:
    - ssid: !secret wifi_ssid          # Uncomment this line (remove # at beginning of line) and enter your details in secrets.yaml file!
      password: !secret wifi_password  # Uncomment this line (remove # at beginning of line) and enter your details in secrets.yaml file!

web_server:


ehmtx:
  id: rgb8x32
  time_component: ehmtx_time
  matrix_component: ehmtx_display
  clock_time: 5            # duration to display the clock after this time the date is display until next "show_screen"
  clock_interval: 120        # show the clock at least each x seconds
  screen_time: 1          # duration to display a screen or a clock/date sequence
  date_format: "%d.%m"     # defaults "%d.%m." (use "%m.%d." for the US)
  time_format: "%H:%M"     # defaults "%H:%M" (use "%I:%M%p" for the US)
  show_dow: true           # draw the day indicator on the bottom of the screen, defaults to true
  show_date: false         # show the date for show_screen - show_clock seconds otherwise only shows the clock for show_screen seconds, defaults to true
  week_start_monday: true  # default monday is first day of week, false = sunday
  yoffset: 6               # the text is aligned BASELINE_LEFT, the baseline defaults to 6
  xoffset: 1               # the text is aligned BASELINE_LEFT, the left defaults to 1
  scroll_interval: 80      # the interval in ms to scroll the text (default=80), should be a multiple of the update_interval from the display (default: 16ms)
  frame_interval: 192      # the interval in ms to display the next anim frame (default=192), should be a multiple of the update_interval from the display (default: 16ms)
  font_id: ehmtx_font
  icons: 
    - id: ha
      lameid: 7956
    - id: tempc
      file: newtempc.gif
    - id: tempcdark
      file: newtempcdark.png

font: 
  # adapt the filename to your local settings
  - file: "monobit.ttf"
    id: ehmtx_font
    size: 16
    glyphs:  |
      !"%()+*=,-_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz€@

animation:
  - id: animation_black
    file: "black.gif"

image:
  - id: image_black
    file: "black.gif"



binary_sensor:
  - platform: status
    name: "$devicename Status"
  - platform: gpio
    pin:
      number: $left_button_pin
      inverted: true
    name: "$devicename left button"
    on_press:
      then:
        - number.decrement: screen_brightness
  - platform: gpio
    pin: 
      inverted: true
      number: $mid_button_pin
      mode: INPUT_PULLUP
    name: "$devicename middle button"
    # on_press:
    #   then:
    #     - switch.toggle: displaycontrol
  - platform: gpio
    pin: 
      number: $right_button_pin
      inverted: true
    name: "$devicename right button"
    on_press:
      then:
        - number.increment: screen_brightness
# example to switch to next screen
#        lambda: |-
#          id(rgb8x32)->skip_screen();
logger:
  level: INFO

# Enable Home Assistant API
api:
  services:
    - service: alarm
      variables:
        icon_name: string
        text: string
      then:
        lambda: |-
          id(rgb8x32)->add_screen(icon_name,text,7,20,true);
          id(rgb8x32)->force_screen(icon_name);
    - service: brightness
      variables:
        brightness: int
      then:
        lambda: |-
          id(rgb8x32)->set_brightness(brightness);
    - service: icons
      then:
        lambda: |-
          id(rgb8x32)->show_all_icons();
    - service: skip_screen
      then:
        lambda: |-
          id(rgb8x32)->skip_screen();
    - service: tuneplay
      variables:
        tune: string
      then:
        - rtttl.play:
            rtttl: !lambda 'return tune;'

number:
  - platform: template
    name: "$devicename brightness"
    id: screen_brightness
    min_value: 0
    max_value: 255
    update_interval: 1s
    step: 25
    lambda: |-
      return id(rgb8x32)->get_brightness();
    set_action:
      lambda: |-
        id(rgb8x32)->set_brightness(x);

switch:
  - platform: template
    name: "$devicename Display"
    id: displaycontrol
    icon: "mdi:power"
    restore_mode: ALWAYS_ON
    lambda: |-
      return id(rgb8x32)->show_display;
    turn_on_action:
      lambda: |-
        id(rgb8x32)->set_display_on();
    turn_off_action:
      lambda: |-
        id(rgb8x32)->set_display_off();

sensor:
  - platform: sht3xd
    temperature:
      name: "$devicename Temperature"
    humidity:
      name: "$devicename Humidity"
    update_interval: 60s
  - platform: adc
    pin: $battery_pin
    name: "$devicename Battery"
    id: battery_voltage
    update_interval: 10s
    device_class: battery
    accuracy_decimals: 0
    attenuation: auto
    filters:
      - sliding_window_moving_average:
          window_size: 15
          send_every: 15
          send_first_at: 1
      - multiply: 1.6
      - lambda: |-
          return ((x - 3) / 0.69 * 100.00);
    unit_of_measurement: '%'
  - platform: adc
    id: light_sensor
    name: "$devicename Illuminance"
    pin: $ldr_pin
    update_interval: 10s
    attenuation: auto
    unit_of_measurement: V
    accuracy_decimals: 0
    filters:
      - lambda: |-
          return (x / 10000.0) * 2000000.0 - 15 ;

output:
  - platform: ledc
    pin: $buzzer_pin
    id: rtttl_out

rtttl:
  output: rtttl_out

i2c:
  sda: 21
  scl: 22
  scan: true
  id: bus_a

light:
  - platform: neopixelbus
    id: ehmtx_light
    type: GRB
    variant: WS2812
    pin: $matrix_pin
    num_leds: 256
    color_correct: [30%, 30%, 30%]
    name: "$devicename Light"
    restore_mode: ALWAYS_OFF
    on_turn_on:
      lambda: |-
         id(ehmtx_display)->set_enabled(false);
    on_turn_off:
       lambda: |-
         id(ehmtx_display)->set_enabled(true);

time:
  - platform: homeassistant
    on_time_sync:
      then:
        ds1307.write_time:
  - platform: ds1307
    update_interval: never
    id: ehmtx_time
  
display:
  - platform: addressable_light
    id: ehmtx_display
    addressable_light_id: ehmtx_light
    width: 32
    height: 8
    pixel_mapper: |-
      if (y % 2 == 0) {
        return (y * 32) + x;
      }
      return (y * 32) + (31 - x);
    rotation: 
    update_interval: 16ms
    auto_clear_enabled: true
    lambda: |-
      id(rgb8x32)->tick();
      id(rgb8x32)->draw();

@lubeda
Copy link
Owner

lubeda commented Nov 2, 2023

@RikMuilwijk You are using the "old" repo https://github.com/lubeda/EsphoMaTrix or a clone of the old repo, which isn't maintained anymore. The newer https://github.com/lubeda/EsphoMaTrixv2 repo especially the branch 2023.9.1 is the way to go. But there are breaking changes for your automations in home assistant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

9 participants