From 37702d9dfbf05cebcf19d108bf8a9912ff095456 Mon Sep 17 00:00:00 2001 From: geekofweek Date: Wed, 3 May 2023 11:44:12 -0500 Subject: [PATCH 1/5] Updated to pass validation Had some trouble with the default configuration options when attempting to test. The reference tag can probably be changed if there is a release tag. I haven't tested a running version yet, but this will pass validation. --- copy2esphome/ulanzi-easy.yaml | 38 ++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/copy2esphome/ulanzi-easy.yaml b/copy2esphome/ulanzi-easy.yaml index d8ebdc0..67f58c1 100644 --- a/copy2esphome/ulanzi-easy.yaml +++ b/copy2esphome/ulanzi-easy.yaml @@ -15,23 +15,24 @@ substitutions: scl_pin: GPIO22 sda_pin: GPIO21 -- platform: template - name: "Auto-Adjust Brightness" - id: switch_autobrightness - icon: mdi:brightness-auto - restore_mode: RESTORE_DEFAULT_ON - lambda: |- - if (id(aab_enable)) { - return true; - } else { - return false; - } - turn_on_action: - lambda: |- - id(aab_enable) = true; - turn_off_action: +switch: + - platform: template + name: "Auto-Adjust Brightness" + id: switch_autobrightness + icon: mdi:brightness-auto + restore_mode: RESTORE_DEFAULT_ON lambda: |- - id(aab_enable) = false; + if (id(aab_enable)) { + return true; + } else { + return false; + } + turn_on_action: + lambda: |- + id(aab_enable) = true; + turn_off_action: + lambda: |- + id(aab_enable) = false; globals: # aab = auto-adjustable brightness @@ -53,7 +54,7 @@ external_components: - source: type: git url: https://github.com/lubeda/EspHoMaTriXv2 - ref: release + ref: main refresh: 60s components: [ ehmtxv2 ] @@ -98,6 +99,7 @@ logger: level: WARN api: + services: - service: tune variables: tune: string @@ -249,7 +251,7 @@ ehmtxv2: url: https://user-images.githubusercontent.com/16407309/224850723-634c9b2d-55d9-44f2-9f93-765c0485b090.gif on_next_screen: - homeassistant.event: - event: ehmtxv2.new_screen + event: esphome.new_screen data_template: iconname: !lambda "return x.c_str();" text: !lambda "return y.c_str();" From 6432da1f2851113b5825a9d6a42d74b65cd8f10f Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Thu, 4 May 2023 20:13:08 +0200 Subject: [PATCH 2/5] removed actions --- components/ehmtxv2/__init__.py | 45 ------------- wiki/type1.jnx | Bin 0 -> 4987 bytes wiki/type1.yaml | 118 +++++++++++++++++++++++++++++++++ wiki/ulanzi.jnx | Bin 0 -> 4987 bytes 4 files changed, 118 insertions(+), 45 deletions(-) create mode 100644 wiki/type1.jnx create mode 100644 wiki/type1.yaml create mode 100644 wiki/ulanzi.jnx diff --git a/components/ehmtxv2/__init__.py b/components/ehmtxv2/__init__.py index 6d5bbe9..c97fb2b 100644 --- a/components/ehmtxv2/__init__.py +++ b/components/ehmtxv2/__init__.py @@ -179,51 +179,6 @@ EHMTX_SCHEMA = cv.Schema({ CONFIG_SCHEMA = cv.All(font.validate_pillow_installed, EHMTX_SCHEMA) -SET_COLOR_ACTION_SCHEMA = cv.Schema( - { - cv.GenerateID(): cv.use_id(EHMTX_), - cv.Optional(CONF_RED,default="80"): cv.templatable(cv.uint8_t), - cv.Optional(CONF_BLUE,default="80"): cv.templatable(cv.uint8_t), - cv.Optional(CONF_GREEN,default="80"): cv.templatable(cv.uint8_t), - } -) - -SetTodayColorAction = ehmtx_ns.class_("SetTodayColor", automation.Action) - -@automation.register_action( - "ehmtx.today.color", SetTodayColorAction, SET_COLOR_ACTION_SCHEMA -) -async def ehmtx_set_today_color_action_to_code(config, action_id, template_arg, args): - paren = await cg.get_variable(config[CONF_ID]) - - var = cg.new_Pvariable(action_id, template_arg, paren) - template_ = await cg.templatable(config[CONF_RED], args, cg.int_) - cg.add(var.set_red(template_)) - template_ = await cg.templatable(config[CONF_GREEN], args, cg.int_) - cg.add(var.set_green(template_)) - template_ = await cg.templatable(config[CONF_BLUE], args, cg.int_) - cg.add(var.set_blue(template_)) - return var - -SetWeekdayColorAction = ehmtx_ns.class_("SetWeekdayColor", automation.Action) - -@automation.register_action( - "ehmtx.weekday.color", SetWeekdayColorAction, SET_COLOR_ACTION_SCHEMA -) - -async def ehmtx_set_week_color_action_to_code(config, action_id, template_arg, args): - paren = await cg.get_variable(config[CONF_ID]) - - var = cg.new_Pvariable(action_id, template_arg, paren) - template_ = await cg.templatable(config[CONF_RED], args, cg.int_) - cg.add(var.set_red(template_)) - template_ = await cg.templatable(config[CONF_GREEN], args, cg.int_) - cg.add(var.set_green(template_)) - template_ = await cg.templatable(config[CONF_BLUE], args, cg.int_) - cg.add(var.set_blue(template_)) - - return var - CODEOWNERS = ["@lubeda"] async def to_code(config): diff --git a/wiki/type1.jnx b/wiki/type1.jnx new file mode 100644 index 0000000000000000000000000000000000000000..7ffcf6a267983001c353fc257214e8a4a56e11b6 GIT binary patch literal 4987 zcmeI!^>@_;9LDhpqg5KjVkjMhksH#f2q;pcI|XSF6p-#t3F$ED?lwRg1e5L#3&i(> z&-Hu{#~=Iy_?+|d+50l&a?f^Ih03uR!eR=A`QosN5EYX*GOA#7WK^N($ml#_VVhI) zAitQ^pZ5eC+pKkXFLtqh)8l*i3jCkfPA^wP_&={*o`jEIxX>#Q!3TOd^!fzpYb|sw ziQ8z(19|ZP`dFWn*vtHTdOY;ynTwAjk=wt@mvvYa^#9S-Lwz(*a1GH2jiDQXkr<`m zMq>=dD!2{Uh)oJ^GqzwWbXRZ{*A(1!+`vr*_X1D$MWlx=g3W-J+?CkMc*FfBTLo{q zd$PUI+x-FC2Yub2vtMA5dojBNOWi-RKjCNhFYF1NbpOWwjz6G>QXnN#L0udrP!j4= zD2+1ic5HieaCc-op|g7iI}@|qv)MVA>)y-m!+!Sx_8<sH@h@!*B&R4&yOF!L7wQtXFW`upK)T+(lf%Wd(N& zw{b_oJO***ByeV9Fhqwag`ef$Mod?Y~VEj9}u>))?z&=rLK;fq#qH4%$i3a&X?prwKv zguxi1;3i@cCM&pASdBFbZYOr(O9gih=W#*7-Nmo?O~Iw*MSKS7^kQj zVkA*;8IcK@6eY_j+~%HoEt-2XN4RnZ1Im&_nT&012Uf5$O>Dbw1=r0e5Bg4ZP`Y z!Zt-ScQ3X#K5&m?$76!~3w99}ySK61vBUin`!jxV-(qj$4s=P849OK-@cF8XqXbGq z7ks|zc4&_d3NHA3)iW>?v!Dw;U-e$>!+r%9e7@=j`VTK$=;xKE`8X+(L6@7&gD7_~ zwm3?-8?X)0$o&r64(;8e*wGl{{)nA{neI*OW^8eP%kITK_ciu9Za@zO-%r&U5c+;n z=Rp+mLR|%+?L7FviXqT{R&$IMcs|rCTQw@n{9)(?y>ARjCW6Er(wE#E4vNb-QTdgvB!Or zy@lJ*L&5h`bw*@DW~g%^61m;g*y^a^uE*9#19yLR00z28up=?by_{WvmF^AfMr?AQ zX3yZP`wDv%*Pu&{G)Sx9fmI}o#t`>V zb{K}cSFx+H#=VwZhxP7r?0H;pUt}-gvRltl9=($f-*_K=^uPPj-@n+Orq!=$<9OqG R!@cpm@!8Pn*CL?T@ozE&l}`Ww literal 0 HcmV?d00001 diff --git a/wiki/type1.yaml b/wiki/type1.yaml new file mode 100644 index 0000000..b6e87ab --- /dev/null +++ b/wiki/type1.yaml @@ -0,0 +1,118 @@ +substitutions: + devicename: ehmtx8266 + ledpin: GPIO02 + +external_components: + - source: + type: local + path: ./EspHoMaTriXv2/components + refresh: 60s + +esphome: + name: $devicename + comment: 8x32 RGB Display in bedroom + +binary_sensor: + - platform: status + name: "$devicename Status" + +esp8266: + board: d1_mini + +font: + - file: EHMTXv2.ttf + id: default_font + size: 16 + glyphs: | + !"%()+*=,-_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz€@üöäÜÖÄß + +logger: + level: WARN + +# Enable Home Assistant API +api: + +ota: + password: !secret ota_password + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + +light: + - platform: neopixelbus + id: ehmtx_light + type: GRB + variant: WS2812 + pin: $ledpin + num_leds: 256 + color_correct: [30%, 30%, 30%] + name: "$devicename Light" + restore_mode: ALWAYS_OFF + effects: + - e131: + universe: 1 + channels: RGB + on_turn_on: + lambda: |- + id(ehmtx_display)->set_enabled(false); + on_turn_off: + lambda: |- + id(ehmtx_display)->set_enabled(true); + +e131: + method: multicast # default: register E1.31 to Multicast group + +time: + - platform: homeassistant + id: ehmtx_time + on_time: !include ehmtx_on_time.yaml + +display: + - platform: addressable_light + id: ehmtx_display + addressable_light_id: ehmtx_light + width: 32 + height: 8 + pixel_mapper: |- + if (x % 2 == 0) { + return (x * 8) + y; + } + return (x * 8) + (7 - y); + rotation: 0° + update_interval: 16ms + auto_clear_enabled: true + lambda: |- + id(rgb8x32)->tick(); + id(rgb8x32)->draw(); + +ehmtxv2: + id: rgb8x32 + show_seconds: true + rainbow_interval: 32 + matrix_component: ehmtx_display + time_component: ehmtx_time + icons2html: true + default_font_id: default_font + special_font_id: default_font + special_font_yoffset: 6 + default_font_yoffset: 6 + icons: + - id: xani + lameid: 6075 + - id: xsta + lameid: 11236 + - url: https://developer.lametric.com/content/apps/icon_thumbs/48720.gif + pingpong: true + id: pipo + frame_duration: 300 + - lameid: 5965 + frame_duration: 180 + id: d180 + - lameid: 5965 + frame_duration: 80 + id: d080 + - id: fullscreen + file: sample8x32.gif + - id: samplegif + file: sample8x8.gif diff --git a/wiki/ulanzi.jnx b/wiki/ulanzi.jnx new file mode 100644 index 0000000000000000000000000000000000000000..143e7fbe56d0d53fd5ac16c0196541f08acf1363 GIT binary patch literal 4987 zcmeI!WmA?37=~d*z*g*5>_$K(RP62+yRciZ6}!8;vAbKbySo*;3tQJcZ}(zn*VzyI z1H8w>>pfqrdBD-K75&pj^7W3Sb6}&x!`IWz!^_9b!y6v%kwO#kCLavfkBiI>^9ykb zW-BMqo4@COJv)2GE&~D`?b!vz`~A=&o`5SaqQRceKiSt>#I+>C5x^Us_yK!uKPHBj z`TOjB`?c(%z!6RsoHL@reos65y0>2=rUe%Zu@T3DiwhS-e9GeU+P?G?!p{DRBt{Yo zE-8{BxdoR3DUr&8ON}&egtLwXA?12Q6$1(z9Fkkx|AhU~~;!R3S-a#?Wh@PIuh zyWGfwycV1n>@U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YRp^=bAD&ZO<^d98vFQ58$9Wl--Mc>Rs$^>``xLcVMS_3%eED)En7N*sNa1uEz%TYIY6Q zs#mZpu}Zy^U54fAMeJfMQ7>Q@A_R8!IW@mt*v~JFU*G-j{`KeEpUp1f&uHtQj-qwc PI%%ERh_jEm!UcZ Date: Fri, 5 May 2023 13:49:06 +0200 Subject: [PATCH 3/5] PR "geekofweek:patch-1" and issue #4 --- components/ehmtxv2/EHMTX.cpp | 1 + copy2esphome/ulanzi-easy.yaml | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/components/ehmtxv2/EHMTX.cpp b/components/ehmtxv2/EHMTX.cpp index 8ae8e08..45d77f6 100644 --- a/components/ehmtxv2/EHMTX.cpp +++ b/components/ehmtxv2/EHMTX.cpp @@ -554,6 +554,7 @@ namespace esphome } EHMTX_queue *screen = this->find_icon_queue_element(icon); screen->icon_name = iconname; + screen->icon = icon; screen->text = text; screen->endtime = this->clock->now().timestamp + lifetime * 60; screen->screen_time = screen_time; diff --git a/copy2esphome/ulanzi-easy.yaml b/copy2esphome/ulanzi-easy.yaml index 67f58c1..c0a0f7e 100644 --- a/copy2esphome/ulanzi-easy.yaml +++ b/copy2esphome/ulanzi-easy.yaml @@ -1,5 +1,5 @@ substitutions: - devicename: + devicename: ulanzi ledpin: GPIO32 buzzerpin: GPIO15 friendly_name: LED Matrix @@ -17,22 +17,22 @@ substitutions: switch: - platform: template - name: "Auto-Adjust Brightness" - id: switch_autobrightness - icon: mdi:brightness-auto - restore_mode: RESTORE_DEFAULT_ON + name: "Auto-Adjust Brightness" + id: switch_autobrightness + icon: mdi:brightness-auto + restore_mode: RESTORE_DEFAULT_ON + lambda: |- + if (id(aab_enable)) { + return true; + } else { + return false; + } + turn_on_action: + lambda: |- + id(aab_enable) = true; + turn_off_action: lambda: |- - if (id(aab_enable)) { - return true; - } else { - return false; - } - turn_on_action: - lambda: |- - id(aab_enable) = true; - turn_off_action: - lambda: |- - id(aab_enable) = false; + id(aab_enable) = false; globals: # aab = auto-adjustable brightness From f7af297c6232616bd7c7eba44d635641b999ea14 Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Fri, 5 May 2023 13:52:21 +0200 Subject: [PATCH 4/5] docu --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fbc0a9b..3d84f46 100644 --- a/README.md +++ b/README.md @@ -1013,6 +1013,7 @@ THE SOFTWARE IS PROVIDED "AS IS", use at your own risk! - **[darkpoet78](https://github.com/darkpoet78/MatrixClockFonts)** for his work on optimized fonts - **[pplucky](https://user-images.githubusercontent.com/16407309/224850723-634c9b2d-55d9-44f2-9f93-765c0485b090.GIF)** for his 8x32 GIF animation - **[dennisse](https://github.com/dennisse)** Auto brightness for the Ulanzi -- ** everbody that found bugs/issues and reported them! +- **[geekofweek](https://github.com/geekofweek)** fixed sample YAML +- **everbody** that found bugs/issues and reported them! ## Special thanks to all sponsors From ffdd1875af65be1ac0d28f2ce68d6c252fc1cf4b Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Fri, 5 May 2023 13:54:37 +0200 Subject: [PATCH 5/5] docu --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3d84f46..f5bfee8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # EspHoMaTriX version 2 (EHMTXv2) -## This is a prerelease beta version! +## **This is a prerelease beta version** ## Important information @@ -28,7 +28,7 @@ But it had to be extensible, e.g. for the use as pool thermometer or as media pl ### Features -Based on a 8x32 RGB matrix, it displays a clock, the date and up to 24 other 'screens' provided by Home Assistant. Each screen (value/text) can be associated with a 8x8 bit RGB icon or GIF animation (see [installation](#installation)). The values/text can be updated or deleted from the display queue. Each screen has a lifetime, if not refreshed in its lifetime, it will disappear. Even 8x32 GIF animations are possible. You can control nearly everything of the component. +Based on a 8x32 RGB matrix, it displays a clock, the date and up to 24 other 'screens' provided by Home Assistant. Each screen (value/text) can be associated with a 8x8 bit RGB icon or GIF animation (see [installation](#installation-of-esphomatrixv2-custom-component). The values/text can be updated or deleted from the display queue. Each screen has a lifetime, if not refreshed in its lifetime, it will disappear. Even 8x32 GIF animations are possible. You can control nearly everything of the component. ### State @@ -596,7 +596,6 @@ sensor: id(rgb8x32)->icon_screen("sun", text); // uses default values for color etc. ``` - ##### Force screen Force the selected [icon_screen](#icon-screen) ```icon_name``` to be displayed next. Afterward the loop continues from this screen. e.g. helpful for alarms. Or after an update of the value/text. @@ -808,7 +807,6 @@ To control your display, it has to be integrated in Home Assistant. Then it prov All communication with Home Assistant use the homeasistant-api. The services can be provided by default or also defined additionally in the YAML. To define the additional services you need the id of the ehmtx-component e.g. ```id(rgb8x32)```. - ### Use in Home Assistant automations The easiest way to use ehmtx as a status display is to use the icon names as trigger id. In my example I have an icon named "wind" when the sensor.wind_speed has a new state, this automation sends the new data to the screen with the icon named "wind" and so on. @@ -977,7 +975,7 @@ sensor: ## Breaking changes -**nothing yet, since it is new** +### **nothing yet, since it is new** ## EspHoMaTriX in the media