diff --git a/8x32 iMAGE.xcf b/8x32 iMAGE.xcf index aafe1322..8ececd6e 100644 Binary files a/8x32 iMAGE.xcf and b/8x32 iMAGE.xcf differ diff --git a/CHANGELOG.md b/CHANGELOG.md index b6689ee3..8aec96ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,12 @@ # Changelog -## 2023.6.4 +## 2023.6.5 -- introduced `scroll_small_text` -- introduced `allow_empty_screen` +- introduced `blend_steps: 16` +- introduced service color_gauge +- fixed bitmap_small with gauge +- fixed del_screen with "*" +- improved blueprint selection @andrew-codechimp ## 2023.6.3 diff --git a/README.md b/README.md index 2d75b46b..3ee5e7d9 100644 --- a/README.md +++ b/README.md @@ -537,6 +537,8 @@ ehmtxv2: **show_dow** (optional, bool): draw the day of week rindicator on the bottom of the clock screen. Disable, e.g., if you want larger fonts, defaults to true. +**blend_steps** (optional, int): on screen transition you can blend in the new screen, a value of 16 works nice, defaults 0. + **time_component** (required, ID): ID of the time component. The display shows `!t!` until the time source is valid. **default_font** (required, ID): ID of the default font @@ -800,7 +802,7 @@ For example, if you have multiple icons named weather_sunny, weather_rain & weat *Parameters:* - ```icon_name```: Icon `id` defined in the YAML (see installation) -- ```mode```: The mode is for internal purposes use `5`  for icon_screen +- ```mode```: The mode is a filter to select different screen types e. g. use `5`for icon_screen ##### modes @@ -808,14 +810,14 @@ For example, if you have multiple icons named weather_sunny, weather_rain & weat |----|----| |MODE_BLANK|1| |MODE_CLOCK | 2| -| MODE_DATE | 3| -| MODE_FULL_SCREEN | 4| -|MODE_ICON_SCREEN | 5| -|MODE_TEXT_SCREEN | 6| -|MODE_RAINBOW_ICON | 7| -|MODE_RAINBOW_TEXT |8| -| MODE_RAINBOW_CLOCK | 9| -| MODE_RAINBOW_DATE | 10| +|MODE_DATE | 3| +|MODE_FULL_SCREEN| 4| +|MODE_ICON_SCREEN| 5| +|MODE_TEXT_SCREEN| 6| +|MODE_RAINBOW_ICON| 7| +|MODE_RAINBOW_TEXT|8| +|MODE_RAINBOW_CLOCK| 9| +|MODE_RAINBOW_DATE| 10| **(D)** Service **display_on** / **display_off** @@ -1107,7 +1109,7 @@ THE SOFTWARE IS PROVIDED “AS IS”, use at your own risk! ## Thanks - **[blakadder](https://github.com/blakadder)** for his contribution (cleanup README.md, fixed sample) -- **[andrew-codechimp](https://github.com/andrew-codechimp)** for his contribution (display on/off & del_screen "*" & show_clock with 0) +- **[andrew-codechimp](https://github.com/andrew-codechimp)** for his contribution (display on/off & del_screen "*" & show_clock with 0) and improved blueprint slelection - **[jd1](https://github.com/jd1)** for his contributions - **[aptonline](https://github.com/aptonline)** for his work on the Ulanzi hardware - **[wsbtak](https://github.com/wsbtak)** for the work on the Ulanzi hardware diff --git a/components/ehmtxv2/EHMTX.cpp b/components/ehmtxv2/EHMTX.cpp index 4e183dcf..77852945 100644 --- a/components/ehmtxv2/EHMTX.cpp +++ b/components/ehmtxv2/EHMTX.cpp @@ -20,8 +20,6 @@ namespace esphome this->clock_color = Color(C_RED, C_GREEN, C_BLUE); this->rainbow_color = Color(CA_RED, CA_GREEN, CA_BLUE); this->alarm_color = Color(CA_RED, CA_GREEN, CA_BLUE); - this->gauge_color = Color(CD_RED, CD_GREEN, CD_BLUE); - this->gauge_value = 0; this->next_action_time = 0; this->last_scroll_time = 0; this->screen_pointer = MAXQUEUE; @@ -197,6 +195,7 @@ namespace esphome ESP_LOGW(TAG, "bitmap_screen is not available on ESP8266"); } #endif + uint8_t EHMTX::find_icon(std::string name) { for (uint8_t i = 0; i < this->icon_count; i++) @@ -232,6 +231,50 @@ namespace esphome ESP_LOGD(TAG, "hide gauge"); } +#ifndef USE_ESP8266 + void EHMTX::color_gauge(std::string text) + { + ESP_LOGD(TAG, "color_gauge: %s", text.c_str()); + const size_t CAPACITY = JSON_ARRAY_SIZE(8); + StaticJsonDocument doc; + deserializeJson(doc, text); + JsonArray array = doc.as(); + uint8_t i = 0; + for (JsonVariant v : array) + { + uint16_t buf = v.as(); + + unsigned char b = (((buf)&0x001F) << 3); + unsigned char g = (((buf)&0x07E0) >> 3); // Fixed: shift >> 5 and << 2 + unsigned char r = (((buf)&0xF800) >> 8); // shift >> 11 and << 3 + Color c = Color(r, g, b); + this->cgauge[i++] = c; + this->display_gauge = true; + } + } + + void EHMTX::show_gauge(int percent, int r, int g, int b, int bg_r, int bg_g, int bg_b) + { + if (percent <= 100) + { + Color c = Color(r, g, b); + Color bgc = Color(bg_r, bg_g, bg_b); + for (uint8_t i = 0; i < 8; i++) + { + if (percent > i * 12.5) + { + this->cgauge[7 - i] = c; + } + else + { + this->cgauge[7 - i] = bgc; + } + } + this->display_gauge = true; + ESP_LOGD(TAG, "show_gauge 2 color %d", round(percent)); + } + } +#else void EHMTX::show_gauge(int percent, int r, int g, int b, int bg_r, int bg_g, int bg_b) { this->display_gauge = false; @@ -242,8 +285,11 @@ namespace esphome this->display_gauge = true; this->gauge_value = (uint8_t)(100 - percent) * 7 / 100; } + ESP_LOGD(TAG, "show_gauge 2 color %d", round(percent)); } +#endif +#ifdef USE_ESP8266 void EHMTX::draw_gauge() { if (this->display_gauge) @@ -253,6 +299,19 @@ namespace esphome this->display->line(0, 7, 0, this->gauge_value, this->gauge_color); } } +#else + void EHMTX::draw_gauge() + { + if (this->display_gauge) + { + for (uint8_t y = 0; y < 8; y++) + { + this->display->draw_pixel_at(0, y, this->cgauge[y]); + } + this->display->line(1, 7, 1, 0, esphome::display::COLOR_OFF); + } + } +#endif void EHMTX::setup() { @@ -295,6 +354,7 @@ namespace esphome register_service(&EHMTX::set_brightness, "brightness", {"value"}); #ifndef USE_ESP8266 + register_service(&EHMTX::color_gauge, "color_gauge", {"colors"}); register_service(&EHMTX::bitmap_screen, "bitmap_screen", {"icon", "lifetime", "screen_time"}); register_service(&EHMTX::bitmap_small, "bitmap_small", {"icon", "text", "lifetime", "screen_time", "default_font", "r", "g", "b"}); #endif @@ -505,6 +565,7 @@ namespace esphome this->remove_expired_queue_element(); this->screen_pointer = this->find_last_clock(); this->scroll_step = 0; + this->ticks_ = 0; if (this->screen_pointer == MAXQUEUE) { @@ -538,7 +599,7 @@ namespace esphome } else { - if(!EHMTXv2_ALLOW_EMPTY_SCREEN) + if (!EHMTXv2_ALLOW_EMPTY_SCREEN) { ESP_LOGW(TAG, "tick: nothing to do. Restarting clock display!"); this->clock_screen(24 * 60, this->clock_time, false, C_RED, C_GREEN, C_BLUE); @@ -547,6 +608,17 @@ namespace esphome } } } + // blend handling + +#ifdef EHMTXv2_BLEND_STEPS + if (this->ticks_ <= EHMTXv2_BLEND_STEPS) + { + uint8_t b = this->brightness_; + float br = lerp((float)this->ticks_ / EHMTXv2_BLEND_STEPS, 0, (float)b / 255); + this->display->get_light()->set_correction(br, br, br); + } +#endif + this->ticks_++; } else { @@ -620,17 +692,26 @@ namespace esphome if (this->queue[i]->mode == mode) { bool force = true; - ESP_LOGW(TAG, "del_screen: icon %s in position: %d mode %d", icon_name.c_str(), i, mode); + ESP_LOGD(TAG, "del_screen: icon %s in position: %s mode %d", icon_name.c_str(), this->queue[i]->icon_name.c_str(), mode); if ((mode == MODE_ICON_SCREEN) || (mode == MODE_FULL_SCREEN) || (mode == MODE_RAINBOW_ICON)) { - if (strcmp(this->queue[i]->icon_name.c_str(), icon_name.c_str()) != 0) + if (this->string_has_ending(icon_name, "*")) + { + std::string comparename = icon_name.substr(0, icon_name.length() - 1); + + if (this->queue[i]->icon_name.rfind(comparename, 0) != 0) + { + force = false; + } + } + else if(strcmp(this->queue[i]->icon_name.c_str(), icon_name.c_str()) != 0) { force = false; } } if (force) { - ESP_LOGW(TAG, "del_screen: force"); + ESP_LOGW(TAG, "del_screen: slot %d deleted",i); this->queue[i]->mode = MODE_EMPTY; this->queue[i]->endtime = 0; if (i == this->screen_pointer) @@ -964,9 +1045,9 @@ namespace esphome { ESP_LOGCONFIG(TAG, "show date"); } - #ifdef EHMTXv2_USE_RTL - ESP_LOGCONFIG(TAG, "RTL activated"); - #endif +#ifdef EHMTXv2_USE_RTL + ESP_LOGCONFIG(TAG, "RTL activated"); +#endif if (EHMTXv2_WEEK_START) { ESP_LOGCONFIG(TAG, "weekstart: monday"); diff --git a/components/ehmtxv2/EHMTX.h b/components/ehmtxv2/EHMTX.h index c340c1a4..26c6c3b8 100644 --- a/components/ehmtxv2/EHMTX.h +++ b/components/ehmtxv2/EHMTX.h @@ -22,7 +22,7 @@ const uint8_t TEXTSCROLLSTART = 8; const uint8_t TEXTSTARTOFFSET = (32 - 8); const uint16_t POLLINGINTERVAL = 250; -static const char *const EHMTX_VERSION = "2023.6.4"; +static const char *const EHMTX_VERSION = "2023.6.5"; static const char *const TAG = "EHMTXv2"; #ifndef USE_ESP8266 static const char *const EHMTX_LOGO = "[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63519,63519,63519,63519,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63519,0,0,0,0,2016,0,0,0,0,0,0,0,0,0,0,31,0,0,0,0,0,0,0,0,0,63488,0,63488,0,0,0,63519,0,0,0,0,2016,2016,0,0,0,65514,0,65514,0,0,0,31,0,0,0,64512,0,0,64512,0,63488,63488,0,63488,63488,0,0,63519,63519,63519,0,0,2016,0,2016,0,65514,0,65514,0,65514,0,31,31,31,0,0,0,64512,64512,0,0,63488,63488,63488,63488,63488,0,0,63519,0,0,0,0,2016,0,2016,0,65514,0,65514,0,65514,0,0,31,0,0,0,0,64512,64512,0,0,0,63488,63488,63488,0,0,0,63519,63519,63519,63519,0,2016,0,2016,0,65514,0,65514,0,65514,0,0,0,31,31,0,64512,0,0,64512,0,0,0,63488,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]"; @@ -79,15 +79,17 @@ namespace esphome uint16_t hue_ = 0; void dump_config(); #ifdef USE_ESP32 - PROGMEM Color text_color, alarm_color, gauge_color, gauge_bgcolor, rindicator_color, lindicator_color,clock_color, today_color, weekday_color, rainbow_color; + PROGMEM Color text_color, alarm_color, rindicator_color, lindicator_color,clock_color, today_color, weekday_color, rainbow_color; PROGMEM Color bitmap[256]; PROGMEM Color sbitmap[64]; + PROGMEM Color cgauge[8]; PROGMEM EHMTX_Icon *icons[MAXICONS]; #endif #ifdef USE_ESP8266 Color text_color, alarm_color, gauge_color, gauge_bgcolor,rindicator_color,lindicator_color, clock_color, today_color, weekday_color, rainbow_color; EHMTX_Icon *icons[MAXICONS]; + uint8_t gauge_value; #endif display::Font *default_font; display::Font *special_font; @@ -98,7 +100,7 @@ namespace esphome bool display_gauge; bool is_running = false; bool show_date; - uint8_t gauge_value; + uint16_t clock_time; uint16_t scroll_step; @@ -165,6 +167,7 @@ namespace esphome void blank_screen(int lifetime = D_LIFETIME, int screen_time = D_SCREEN_TIME); void bitmap_screen(std::string text, int lifetime = D_LIFETIME, int screen_time = D_SCREEN_TIME); + void color_gauge(std::string text); void bitmap_small(std::string, std::string,int lifetime = D_LIFETIME, int screen_time = D_SCREEN_TIME, bool default_font = true, int r = C_RED, int g = C_GREEN, int b = C_BLUE); void rainbow_icon_screen(std::string icon_name, std::string text, int lifetime = D_LIFETIME, int screen_time = D_SCREEN_TIME, bool default_font = true); void rainbow_text_screen(std::string text, int lifetime = D_LIFETIME, int screen_time = D_SCREEN_TIME, bool default_font = true); diff --git a/components/ehmtxv2/EHMTX_queue.cpp b/components/ehmtxv2/EHMTX_queue.cpp index 277ec587..9dd744a5 100644 --- a/components/ehmtxv2/EHMTX_queue.cpp +++ b/components/ehmtxv2/EHMTX_queue.cpp @@ -105,18 +105,18 @@ namespace esphome result = startx + this->config_->scroll_step; } #else - #ifdef EHMTXv2_SCROLL_SMALL_TEXT - result = startx - this->config_->scroll_step + width; - #else - if (this->pixels_ < width) - { - result = startx + ceil((width - this->pixels_) / 2); - } - else - { - result = startx - this->config_->scroll_step + width; - } - #endif +#ifdef EHMTXv2_SCROLL_SMALL_TEXT + result = startx - this->config_->scroll_step + width; +#else + if (this->pixels_ < width) + { + result = startx + ceil((width - this->pixels_) / 2); + } + else + { + result = startx - this->config_->scroll_step + width; + } +#endif #endif return result; } @@ -148,7 +148,7 @@ namespace esphome display::Font *font = this->default_font ? this->config_->default_font : this->config_->special_font; int8_t yoffset = this->default_font ? EHMTXv2_DEFAULT_FONT_OFFSET_Y : EHMTXv2_SPECIAL_FONT_OFFSET_Y; int8_t xoffset = this->default_font ? EHMTXv2_DEFAULT_FONT_OFFSET_X : EHMTXv2_SPECIAL_FONT_OFFSET_X; - int8_t extraoffset = 0; + Color color_; if (this->config_->is_running) { @@ -169,33 +169,37 @@ namespace esphome } break; case MODE_BITMAP_SMALL: - if (this->pixels_ > TEXTSTARTOFFSET) - { - extraoffset = TEXTSTARTOFFSET; - } color_ = this->text_color; #ifdef EHMTXv2_USE_RTL - this->config_->display->print(this->xpos() + xoffset, yoffset, font, color_, esphome::display::TextAlign::BASELINE_RIGHT, - this->text.c_str()); + this->config_->display->print(this->xpos() + xoffset, yoffset, font, color_, esphome::display::TextAlign::BASELINE_RIGHT, + this->text.c_str()); #else - this->config_->display->print(this->xpos() + xoffset, yoffset, font, color_, esphome::display::TextAlign::BASELINE_LEFT, - this->text.c_str()); + this->config_->display->print(this->xpos() + xoffset, yoffset, font, color_, esphome::display::TextAlign::BASELINE_LEFT, + this->text.c_str()); #endif if (this->config_->display_gauge) { this->config_->display->line(10, 0, 10, 7, esphome::display::COLOR_OFF); + for (uint8_t x = 0; x < 8; x++) + { + for (uint8_t y = 0; y < 8; y++) + { + this->config_->display->draw_pixel_at(x + 2, y, this->config_->sbitmap[x + y * 8]); + } + } } else { this->config_->display->line(8, 0, 8, 7, esphome::display::COLOR_OFF); - } - for (uint8_t x = 0; x < 8; x++) - { - for (uint8_t y = 0; y < 8; y++) + for (uint8_t x = 0; x < 8; x++) { - this->config_->display->draw_pixel_at(x, y, this->config_->sbitmap[x + y * 8]); + for (uint8_t y = 0; y < 8; y++) + { + this->config_->display->draw_pixel_at(x, y, this->config_->sbitmap[x + y * 8]); + } } } + break; #endif case MODE_RAINBOW_CLOCK: @@ -226,7 +230,7 @@ namespace esphome { color_ = (this->mode == MODE_RAINBOW_DATE) ? this->config_->rainbow_color : this->config_->clock_color; time_t ts = this->config_->clock->now().timestamp; - this->config_->display->strftime(xoffset + 15, yoffset, font, color_, display::TextAlign::BASELINE_CENTER,EHMTXv2_DATE_FORMAT , + this->config_->display->strftime(xoffset + 15, yoffset, font, color_, display::TextAlign::BASELINE_CENTER, EHMTXv2_DATE_FORMAT, this->config_->clock->now()); if ((this->config_->clock->now().second % 2 == 0) && this->config_->show_seconds) { @@ -248,22 +252,13 @@ namespace esphome case MODE_ICON_SCREEN: case MODE_RAINBOW_ICON: { - if (this->pixels_ > TEXTSTARTOFFSET) - { - extraoffset = TEXTSTARTOFFSET; - } - if (this->config_->display_gauge) - { - extraoffset += 2; - } - color_ = (this->mode == MODE_RAINBOW_ICON) ? this->config_->rainbow_color : this->text_color; #ifdef EHMTXv2_USE_RTL - this->config_->display->print(this->xpos() + xoffset, yoffset, font, color_, esphome::display::TextAlign::BASELINE_RIGHT, - this->text.c_str()); + this->config_->display->print(this->xpos() + xoffset, yoffset, font, color_, esphome::display::TextAlign::BASELINE_RIGHT, + this->text.c_str()); #else - this->config_->display->print(this->xpos() + xoffset, yoffset, font, color_, esphome::display::TextAlign::BASELINE_LEFT, - this->text.c_str()); + this->config_->display->print(this->xpos() + xoffset, yoffset, font, color_, esphome::display::TextAlign::BASELINE_LEFT, + this->text.c_str()); #endif if (this->config_->display_gauge) { @@ -279,22 +274,13 @@ namespace esphome break; case MODE_TEXT_SCREEN: case MODE_RAINBOW_TEXT: - - if (this->pixels_ > 32) - { - extraoffset = 32; - } - if (this->config_->display_gauge) - { - extraoffset += 2; - } color_ = (this->mode == MODE_RAINBOW_TEXT) ? this->config_->rainbow_color : this->text_color; #ifdef EHMTXv2_USE_RTL - this->config_->display->print(this->xpos() + xoffset, yoffset, font, color_, esphome::display::TextAlign::BASELINE_RIGHT, - this->text.c_str()); + this->config_->display->print(this->xpos() + xoffset, yoffset, font, color_, esphome::display::TextAlign::BASELINE_RIGHT, + this->text.c_str()); #else - this->config_->display->print(this->xpos() + xoffset, yoffset, font, color_, esphome::display::TextAlign::BASELINE_LEFT, - this->text.c_str()); + this->config_->display->print(this->xpos() + xoffset, yoffset, font, color_, esphome::display::TextAlign::BASELINE_LEFT, + this->text.c_str()); #endif break; default: @@ -329,17 +315,17 @@ namespace esphome { this->config_->display->get_text_bounds(0, 0, text.c_str(), this->config_->special_font, display::TextAlign::LEFT, &x, &y, &w, &h); } - + this->pixels_ = w; - + switch (this->mode) { case MODE_RAINBOW_TEXT: case MODE_TEXT_SCREEN: #ifdef EHMTXv2_SCROLL_SMALL_TEXT - max_steps = (EHMTXv2_SCROLL_COUNT + 1) * (width - startx) + EHMTXv2_SCROLL_COUNT * this->pixels_; - display_duration = ceil((max_steps * EHMTXv2_SCROLL_INTERVALL) / 1000); - this->screen_time_ = (display_duration > screen_time) ? display_duration : screen_time; + max_steps = (EHMTXv2_SCROLL_COUNT + 1) * (width - startx) + EHMTXv2_SCROLL_COUNT * this->pixels_; + display_duration = ceil((max_steps * EHMTXv2_SCROLL_INTERVALL) / 1000); + this->screen_time_ = (display_duration > screen_time) ? display_duration : screen_time; #else if (this->pixels_ < 32) { diff --git a/components/ehmtxv2/__init__.py b/components/ehmtxv2/__init__.py index 9a7f53e4..d31e1fe3 100644 --- a/components/ehmtxv2/__init__.py +++ b/components/ehmtxv2/__init__.py @@ -73,6 +73,7 @@ def rgb565_svg(x,y,r,g,b): CONF_MATRIXCOMPONENT = "matrix_component" CONF_HTML = "icons2html" CONF_SCROLLINTERVAL = "scroll_interval" +CONF_BLENDSTEPS = "blend_steps" CONF_RAINBOWINTERVAL = "rainbow_interval" CONF_FRAMEINTERVAL = "frame_interval" CONF_DEFAULT_FONT_ID = "default_font_id" @@ -157,6 +158,8 @@ def rgb565_svg(x,y,r,g,b): ): cv.templatable(cv.int_range(min=-32, max=32)), cv.Optional(CONF_SCROLLINTERVAL, default="80" ): cv.templatable(cv.positive_int), + cv.Optional(CONF_BLENDSTEPS, default="0" + ): cv.templatable(cv.positive_int), cv.Optional(CONF_RAINBOWINTERVAL, default="32" ): cv.templatable(cv.positive_int), cv.Optional(CONF_SCROLLCOUNT, default="2" @@ -392,6 +395,8 @@ def thumbnails(frames): cg.add_define("EHMTXv2_TIME_FORMAT",config[CONF_TIME_FORMAT]) cg.add_define("EHMTXv2_SCROLL_SMALL_TEXT",config[CONF_SCROLL_SMALL_TEXT]) cg.add_define("EHMTXv2_ALLOW_EMPTY_SCREEN",config[CONF_ALLOW_EMPTY_SCREEN]) + if (config[CONF_BLENDSTEPS]) >0: + cg.add_define("EHMTXv2_BLEND_STEPS",config[CONF_BLENDSTEPS]) if config[CONF_RTL]: cg.add_define("EHMTXv2_USE_RTL") diff --git a/copy2esphome/EHMTX_easy_color_gauge.yaml b/copy2esphome/EHMTX_easy_color_gauge.yaml new file mode 100644 index 00000000..abee53c3 --- /dev/null +++ b/copy2esphome/EHMTX_easy_color_gauge.yaml @@ -0,0 +1,88 @@ +blueprint: + name: |- + ehmtxv2: colored bar/gauge at the left side + description: |- + feed this function with eight rgb565 values, to convert from rgb888 see this: + {{ (((red | bitwise_and(0xf8)) / 8) | int ) * 2048 + (((green | bitwise_and(0xfC)) / 4 )| int) * 32 + ((blue | bitwise_and(0xf8)) / 8 )| int }} + domain: script + + input: + ehmtx_device: + name: Which EspHoMaTriX-device to display at? + selector: + device: + integration: esphome + pix0_color: + name: Color of pixel 1 + selector: + color_rgb: + default: [240, 24, 240] + pix1_color: + name: Color of pixel 2 + selector: + color_rgb: + default: [240, 240, 24] + pix2_color: + name: Color of pixel 3 + selector: + color_rgb: + default: [24, 24, 240] + pix3_color: + name: Color of pixel 4 + selector: + color_rgb: + default: [240, 24, 24] + pix4_color: + name: Color of pixel 5 + selector: + color_rgb: + default: [24, 240, 24] + pix5_color: + name: Color of pixel 6 + selector: + color_rgb: + default: [120, 240, 240] + pix6_color: + name: Color of pixel 7 + selector: + color_rgb: + default: [240, 120, 240] + pix7_color: + name: Color of pixel 8 + selector: + color_rgb: + default: [240, 120, 120] + +variables: + display: !input ehmtx_device + pix0: !input pix0_color + pix1: !input pix1_color + pix2: !input pix2_color + pix3: !input pix3_color + pix4: !input pix4_color + pix5: !input pix5_color + pix6: !input pix6_color + pix7: !input pix7_color + c0: |- + {{ (((pix0[0] | bitwise_and(0xf8)) / 8) | int ) * 2048 + (((pix0[1] | bitwise_and(0xfC)) / 4 )| int) * 32 + ((pix0[2] | bitwise_and(0xf8)) / 8 )| int }} + c1: |- + {{ (((pix1[0] | bitwise_and(0xf8)) / 8) | int ) * 2048 + (((pix1[1] | bitwise_and(0xfC)) / 4 )| int) * 32 + ((pix1[2] | bitwise_and(0xf8)) / 8 )| int }} + c2: |- + {{ (((pix2[0] | bitwise_and(0xf8)) / 8) | int ) * 2048 + (((pix2[1] | bitwise_and(0xfC)) / 4 )| int) * 32 + ((pix2[2] | bitwise_and(0xf8)) / 8 )| int }} + c3: |- + {{ (((pix3[0] | bitwise_and(0xf8)) / 8) | int ) * 2048 + (((pix3[1] | bitwise_and(0xfC)) / 4 )| int) * 32 + ((pix3[2] | bitwise_and(0xf8)) / 8 )| int }} + c4: |- + {{ (((pix4[0] | bitwise_and(0xf8)) / 8) | int ) * 2048 + (((pix4[1] | bitwise_and(0xfC)) / 4 )| int) * 32 + ((pix4[2] | bitwise_and(0xf8)) / 8 )| int }} + c5: |- + {{ (((pix5[0] | bitwise_and(0xf8)) / 8) | int ) * 2048 + (((pix5[1] | bitwise_and(0xfC)) / 4 )| int) * 32 + ((pix5[2] | bitwise_and(0xf8)) / 8 )| int }} + c6: |- + {{ (((pix6[0] | bitwise_and(0xf8)) / 8) | int ) * 2048 + (((pix6[1] | bitwise_and(0xfC)) / 4 )| int) * 32 + ((pix6[2] | bitwise_and(0xf8)) / 8 )| int }} + c7: |- + {{ (((pix7[0] | bitwise_and(0xf8)) / 8) | int ) * 2048 + (((pix7[1] | bitwise_and(0xfC)) / 4 )| int) * 32 + ((pix7[2] | bitwise_and(0xf8)) / 8 )| int }} + +sequence: + - service: |- + esphome.{{ device_attr(display, "name") }}_color_gauge + data: + colors: |- + [{{c0}},{{c1}},{{c2}},{{c3}},{{c4}},{{c5}},{{c6}},{{c7}}] diff --git a/copy2esphome/EHMTX_easy_delete.yaml b/copy2esphome/EHMTX_easy_delete.yaml index a96f9abe..72ec0546 100644 --- a/copy2esphome/EHMTX_easy_delete.yaml +++ b/copy2esphome/EHMTX_easy_delete.yaml @@ -8,7 +8,9 @@ blueprint: name: Which EspHoMaTriXv2 device to use selector: device: - integration: esphome + filter: + - integration: esphome + model: EHMTXv2 trigger_sensor: name: Which state change triggers the automation? selector: diff --git a/copy2esphome/EHMTX_easy_hide.yaml b/copy2esphome/EHMTX_easy_hide.yaml index abf657fc..ea9dcb7a 100644 --- a/copy2esphome/EHMTX_easy_hide.yaml +++ b/copy2esphome/EHMTX_easy_hide.yaml @@ -5,10 +5,12 @@ blueprint: domain: automation input: ehmtx_device: - name: Which display to use + name: Which EspHoMaTriXv2 device to use selector: device: - integration: esphome + filter: + - integration: esphome + model: EHMTXv2 trigger_sensor: name: Which state change triggers this automation selector: diff --git a/copy2esphome/EHMTX_easy_show.yaml b/copy2esphome/EHMTX_easy_show.yaml index c34d5339..988729d2 100644 --- a/copy2esphome/EHMTX_easy_show.yaml +++ b/copy2esphome/EHMTX_easy_show.yaml @@ -5,10 +5,12 @@ blueprint: domain: automation input: ehmtx_device: - name: Which device to display at? + name: Which EspHoMaTriXv2 device to use selector: device: - integration: esphome + filter: + - integration: esphome + model: EHMTXv2 trigger_sensor: name: Which state-change triggers the screen element selector: diff --git a/copy2esphome/EHMTX_easy_state.yaml b/copy2esphome/EHMTX_easy_state.yaml index a275865f..035634b6 100644 --- a/copy2esphome/EHMTX_easy_state.yaml +++ b/copy2esphome/EHMTX_easy_state.yaml @@ -5,10 +5,12 @@ blueprint: domain: automation input: ehmtx_device: - name: Which EspHoMaTriX-device to display at? + name: Which EspHoMaTriXv2 device to use selector: device: - integration: esphome + filter: + - integration: esphome + model: EHMTXv2 trigger_sensor: name: Which sensor state to show? description: This sensor state will be displayed. diff --git a/copy2esphome/EHMTX_extended_state.yaml b/copy2esphome/EHMTX_extended_state.yaml index a47d7a3c..d93cdbff 100644 --- a/copy2esphome/EHMTX_extended_state.yaml +++ b/copy2esphome/EHMTX_extended_state.yaml @@ -5,10 +5,12 @@ blueprint: domain: automation input: ehmtx_device: - name: Which EspHoMaTriX-device to display at? + name: Which EspHoMaTriXv2 device to use selector: device: - integration: esphome + filter: + - integration: esphome + model: EHMTXv2 trigger_sensor: name: Which sensor state to show? description: This sensor state will be displayed. diff --git a/copy2esphome/ulanzi-easy.yaml b/copy2esphome/ulanzi-easy.yaml index 87321520..003d7d76 100644 --- a/copy2esphome/ulanzi-easy.yaml +++ b/copy2esphome/ulanzi-easy.yaml @@ -59,6 +59,9 @@ external_components: esphome: comment: "EHMTXv2 from LuBeDa" name: $devicename + project: + name: "Ulanzi.EHMTXv2" + version: "2.0.0" on_boot: then: - ds1307.read_time: diff --git a/tests/ehtmxv2-special.yaml b/tests/ehtmxv2-special.yaml index b6c8239b..e321eb5e 100644 --- a/tests/ehtmxv2-special.yaml +++ b/tests/ehtmxv2-special.yaml @@ -123,6 +123,7 @@ ehmtxv2: scroll_small_text: true default_clock_font: false allow_empty_screen: true + blend_steps: 16 frame_interval: 210 rtl: true default_font_id: default_font diff --git a/wiki/sucess-stories.md b/wiki/sucess-stories.md new file mode 100644 index 00000000..b61d7c3e --- /dev/null +++ b/wiki/sucess-stories.md @@ -0,0 +1,5 @@ +# People who succesfully use EspHoMaTriX and EspHoMaTriXv2 + +## Videos in german +- [Wetterwarnungen](https://smarthomeyourself.de/wiki/templates/alle-aktuelle-wetterwarnungen-in-home-assistant-ausgeben-mit-templates/) + \ No newline at end of file