From a0e2ed1d25f66a72cc0decbddab4ced6f21aa0f9 Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Sun, 7 May 2023 19:14:10 +0200 Subject: [PATCH 01/22] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 52 ++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..f40cd22 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,52 @@ +--- +name: Bug report +about: Create a report to help us improve EspHoMaTriXv2 +title: "[BUG]" +labels: bug +assignees: '' + +--- + + + +# Bug report + +## Describe the bug + +Add a description of the bug. Detail the expected behavior in contrast with the behavior you're observing. + +## Additional information + +- used Hardware: + - ESP32 or ESP8266 + - EspHoMaTriXv2 version: [e.g. 2023.5.0] + +## To Reproduce + +Steps to reproduce the behavior: + +## Expected behavior + +A clear and concise description of what you expected to happen. + +## Configuration + +```text +(optional) The YAML you used in epshome without any password +``` + +## Screenshots + +If applicable, add screenshots to help explain your problem. + +## Logs + +```text +(optional) Add relevant logs which could help tackle the problem. +``` + +## Services calls + +```text +(optional) The YAML of your service calls +``` From 770677302bf9b6410d75222e525058da206d841f Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Sun, 7 May 2023 19:15:42 +0200 Subject: [PATCH 02/22] templates --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index cb9cd4d..849d25e 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,6 @@ servicetest .DS_Store components/ehmtxv2/animation.py downloadawtrixicons.ps1 +ltr1.png +ltr2.png +ltr3.png From 00bc54848f4903930dc5532712bd717881a8851d Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Sun, 7 May 2023 19:18:53 +0200 Subject: [PATCH 03/22] Update issue templates --- .github/ISSUE_TEMPLATE/feature_request.md | 28 +++++++++++++++++++++ .github/ISSUE_TEMPLATE/question.md | 30 +++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/question.md diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..e7332aa --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,28 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: "[FEATURE]" +labels: enhancement +assignees: '' + +--- + + + +# Feature Request + +### Is your feature request related to a problem? + +If so, then add a clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +### Describe the solution / feature you'd like + +A clear and concise description of what you want to happen. Add scribbles to explain your wish. + +### Describe alternatives you've considered + +A clear and concise description of any alternative solutions or features you've considered. + +### Additional context + +Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md new file mode 100644 index 0000000..a882e40 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.md @@ -0,0 +1,30 @@ +--- +name: Question +about: Open an issue to ask something about EspHoMaTriXv2 +title: "[QUESTION]" +labels: help wanted, question +assignees: '' + +--- + + + +# Question + +Add here your question. + +## Additional information + +- used Hardware: + - ESP32 or ESP8266 + - EspHoMaTriXv2 version: [e.g. 2023.5.0] + +## Logs + +```text +(optional) Add relevant logs which could help tackle the problem. +``` + +## Additional context + +Add any other context about the problem here. From daaeb0793c50301eb8f214381cd93bb49777988f Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Tue, 9 May 2023 20:32:58 +0200 Subject: [PATCH 04/22] m5 Stack sample --- M5Stack-sample.md | 15 +++++ M5withMIC.yml | 152 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 167 insertions(+) create mode 100644 M5Stack-sample.md create mode 100644 M5withMIC.yml diff --git a/M5Stack-sample.md b/M5Stack-sample.md new file mode 100644 index 0000000..ed627e2 --- /dev/null +++ b/M5Stack-sample.md @@ -0,0 +1,15 @@ +# M5 Stack Sample + +## caution + +This is not the hardware paulus used in his videos for the demonstration. The M5Stack atom echo is sold **out**. So, I used another hardware without a speaker! + +The "M5Stack ATOM Lite ESP32 Development Kit" with "M5Stack PDM MEMS Microphone Unit (SPM1423)" were used. The M5Stack Atom Echo needs another pin configuration! + +The setup was just for demonstration, you should **never** power your matrix via the esp32!!! + +## video + +[Youtube](https://www.youtube.com/watch?v=CsOir14DCbM) + +**Use at your own risk!!!!!** \ No newline at end of file diff --git a/M5withMIC.yml b/M5withMIC.yml new file mode 100644 index 0000000..e77cfbe --- /dev/null +++ b/M5withMIC.yml @@ -0,0 +1,152 @@ +substitutions: + devicename: m5mic + +external_components: + - source: + type: git + url: https://github.com/lubeda/EsphoMaTrix + refresh: 60s + components: [ehmtxv2] + +web_server: + +esphome: + name: $devicename + comment: 8x32 Statusdisplay mit Microphone + on_boot: + lambda: |- + id(rgb8x32)->set_display_on(); + +esp32: + board: m5stack-atom + +i2s_audio: + i2s_lrclk_pin: GPIO32 + i2s_bclk_pin: GPIO19 # Egal + +microphone: + - platform: i2s_audio + id: echo_microphone + i2s_din_pin: GPIO26 + +voice_assistant: + microphone: echo_microphone + on_stt_end: + lambda: |- + id(rgb8x32)->icon_screen("home_assistant",x.c_str()); + id(rgb8x32)->force_screen("home_assistant"); + on_tts_start: + lambda: |- + id(rgb8x32)->icon_screen("mic",x.c_str()); + id(rgb8x32)->force_screen("mic"); + +binary_sensor: + - platform: status + name: "$devicename Status" + - platform: gpio + pin: + number: GPIO39 + inverted: true + name: ${devicename} Button + id: echo_button + on_press: + - voice_assistant.start: + - lambda: |- + id(rgb8x32)->show_alarm(120,0,0,2); + on_release: + - voice_assistant.stop: + - lambda: |- + id(rgb8x32)->hide_alarm(); + +font: !include library/ehmtx_font.yaml + +switch: + - platform: template + name: "$devicename Display" + 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(); + +logger: + level: DEBUG + +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: GPIO25 + 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 + id: ehmtx_time + +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 + matrix_component: ehmtx_display + time_component: ehmtx_time + icons2html: true + default_font_id: ehmtx_font + special_font_id: ehmtx_font + icons: + - id: error + lameid: 40530 + - id: home_assistant + lameid: 47693 + - id: temperature + lameid: 2056 + - id: lightbulb + lameid: 1762 + - id: music + lameid: 45625 + - id: phone + lameid: 1232 + - id: car + lameid: 2819 + - id: sleep8x32 + url: https://user-images.githubusercontent.com/16407309/224850723-634c9b2d-55d9-44f2-9f93-765c0485b090.gif + \ No newline at end of file From f4b555be1669cb8c802edb75266c0a766d3785e3 Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Tue, 9 May 2023 20:38:13 +0200 Subject: [PATCH 05/22] m5stack sample --- M5Stack-sample.md | 2 +- M5withMIC.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/M5Stack-sample.md b/M5Stack-sample.md index ed627e2..295f7e4 100644 --- a/M5Stack-sample.md +++ b/M5Stack-sample.md @@ -12,4 +12,4 @@ The setup was just for demonstration, you should **never** power your matrix via [Youtube](https://www.youtube.com/watch?v=CsOir14DCbM) -**Use at your own risk!!!!!** \ No newline at end of file +**Use at your own risk!!!!** \ No newline at end of file diff --git a/M5withMIC.yml b/M5withMIC.yml index e77cfbe..02b674d 100644 --- a/M5withMIC.yml +++ b/M5withMIC.yml @@ -1,6 +1,6 @@ substitutions: devicename: m5mic - + external_components: - source: type: git From 60fd66371d4c3fb23087f133356e7e54f5aaf202 Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Wed, 10 May 2023 16:12:52 +0200 Subject: [PATCH 06/22] https://github.com/lubeda/EspHoMaTriXv2/issues/10 --- copy2esphome/ulanzi-easy.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/copy2esphome/ulanzi-easy.yaml b/copy2esphome/ulanzi-easy.yaml index c0a0f7e..1a2a49f 100644 --- a/copy2esphome/ulanzi-easy.yaml +++ b/copy2esphome/ulanzi-easy.yaml @@ -253,5 +253,5 @@ ehmtxv2: - homeassistant.event: event: esphome.new_screen data_template: - iconname: !lambda "return x.c_str();" - text: !lambda "return y.c_str();" + iconname: !lambda "return icon.c_str();" + text: !lambda "return text.c_str();" From c48fbd5b64cd7046656db4ef1d7f5d1e6ae47226 Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Wed, 10 May 2023 20:03:54 +0200 Subject: [PATCH 07/22] Create main.yml --- .github/workflows/main.yml | 84 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..781113b --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,84 @@ +name: Build + +on: + workflow_dispatch: + push: + branches: + - cicd + pull_request: + +jobs: + build: + name: Build ${{ matrix.firmware.name }} + runs-on: ubuntu-latest + strategy: + matrix: + firmware: + - file: copy2esphome/ulanzi-easy.yaml + name: Ulanzi-Easy + manifest_filename: ulanzi-easy-manifest.json + - file: copy2esphome/ehtmxv2-template + name: EHMTX template + manifest_filename: ehtmxv2-template-manifest.json + fail-fast: false + steps: + - name: Checkout source code + uses: actions/checkout@v3.3.0 + - name: Build firmware + uses: esphome/build-action@v1.8.0 + id: esphome-build + with: + yaml_file: ${{ matrix.firmware.file }} + version: latest + - name: Copy firmware and manifest + run: | + mkdir output + mv ${{ steps.esphome-build.outputs.name }} output/ + jq -s '{"name": "${{ matrix.firmware.name }}", "version": "${{ steps.esphome-build.outputs.esphome-version }}", "home_assistant_domain": "esphome", "new_install_skip_erase": false, "builds":.}' output/${{ steps.esphome-build.outputs.name }}/manifest.json > output/${{ matrix.firmware.manifest_filename }} + + - name: Upload artifact + uses: actions/upload-artifact@v3.1.2 + with: + name: ${{ matrix.firmware.name }} + path: output + + + consolidate: + if: (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && github.ref == 'refs/heads/main' + name: Consolidate firmwares + runs-on: ubuntu-latest + needs: build + steps: + - name: Checkout source code + uses: actions/checkout@v3 + - name: Download built firmwares + uses: actions/download-artifact@v3 + with: + path: firmwares + - name: Copy files + run: |- + mkdir output + cp -R static/* output/ + cp -R firmwares/*/* output/ + - name: Upload GitHub Pages artifact + uses: actions/upload-pages-artifact@v1.0.7 + with: + path: output + + deploy: + if: (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && github.ref == 'refs/heads/main' + name: Deploy to GitHub Pages + runs-on: ubuntu-latest + needs: consolidate + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Setup Pages + uses: actions/configure-pages@v2 + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1.2.3 From 734773a0e64daf30293f249b0612b157458302b2 Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Wed, 10 May 2023 20:04:30 +0200 Subject: [PATCH 08/22] Update main.yml --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 781113b..7750722 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,6 +5,8 @@ on: push: branches: - cicd + - develop + - main pull_request: jobs: From 6b559ec17bc44dea591574d19c346c746c443518 Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Wed, 10 May 2023 20:06:30 +0200 Subject: [PATCH 09/22] jobs --- .github/workflows/main.yml | 54 +------------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7750722..2a1a299 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,7 +19,7 @@ jobs: - file: copy2esphome/ulanzi-easy.yaml name: Ulanzi-Easy manifest_filename: ulanzi-easy-manifest.json - - file: copy2esphome/ehtmxv2-template + - file: copy2esphome/ehtmxv2-template.yaml name: EHMTX template manifest_filename: ehtmxv2-template-manifest.json fail-fast: false @@ -32,55 +32,3 @@ jobs: with: yaml_file: ${{ matrix.firmware.file }} version: latest - - name: Copy firmware and manifest - run: | - mkdir output - mv ${{ steps.esphome-build.outputs.name }} output/ - jq -s '{"name": "${{ matrix.firmware.name }}", "version": "${{ steps.esphome-build.outputs.esphome-version }}", "home_assistant_domain": "esphome", "new_install_skip_erase": false, "builds":.}' output/${{ steps.esphome-build.outputs.name }}/manifest.json > output/${{ matrix.firmware.manifest_filename }} - - - name: Upload artifact - uses: actions/upload-artifact@v3.1.2 - with: - name: ${{ matrix.firmware.name }} - path: output - - - consolidate: - if: (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && github.ref == 'refs/heads/main' - name: Consolidate firmwares - runs-on: ubuntu-latest - needs: build - steps: - - name: Checkout source code - uses: actions/checkout@v3 - - name: Download built firmwares - uses: actions/download-artifact@v3 - with: - path: firmwares - - name: Copy files - run: |- - mkdir output - cp -R static/* output/ - cp -R firmwares/*/* output/ - - name: Upload GitHub Pages artifact - uses: actions/upload-pages-artifact@v1.0.7 - with: - path: output - - deploy: - if: (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && github.ref == 'refs/heads/main' - name: Deploy to GitHub Pages - runs-on: ubuntu-latest - needs: consolidate - permissions: - pages: write - id-token: write - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - - name: Setup Pages - uses: actions/configure-pages@v2 - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v1.2.3 From 5719bed289948e60a5a32a5c5b9c799aefa503f0 Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Wed, 10 May 2023 20:10:03 +0200 Subject: [PATCH 10/22] ci/cd secrets --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2a1a299..8af1d28 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,7 +4,6 @@ on: workflow_dispatch: push: branches: - - cicd - develop - main pull_request: From 21d08af2024f979da3d9a7126ed87b201262a568 Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Wed, 10 May 2023 20:13:10 +0200 Subject: [PATCH 11/22] CI/CD 1 --- .gitignore | 1 - copy2esphome/secrets.yaml | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 copy2esphome/secrets.yaml diff --git a/.gitignore b/.gitignore index db12f20..859e610 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ venv .esphome/ _icons/ _fonts/ -secrets.yaml esphome.ps1 dev_*.yaml ehmtx8266.yaml diff --git a/copy2esphome/secrets.yaml b/copy2esphome/secrets.yaml new file mode 100644 index 0000000..5f0df53 --- /dev/null +++ b/copy2esphome/secrets.yaml @@ -0,0 +1,3 @@ +# This is just a a sample for CI/CD!! +ota_password: itsecret +wifi_password: itsecret \ No newline at end of file From f916b45de0f2b5ca87d63c69fe436eb39bdff2ea Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Wed, 10 May 2023 20:16:48 +0200 Subject: [PATCH 12/22] CI/CD 3 --- README.md | 2 ++ copy2esphome/secrets.yaml | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3c07f29..8ebb33d 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ A simple but very flexible DIY status display, built with a flexible 8x32 RGB LE ![sample image](./images/sample.png) +If you like to tinker you can use the custom component even as a satelit voice control microphone. [Youtube](https://www.youtube.com/watch?v=CsOir14DCbM) + ## Background There are some "RGB-matrices" status displays/clocks out there, the commercial ones from LaMetric and Ulanzi, also some very good DIY-alternatives. diff --git a/copy2esphome/secrets.yaml b/copy2esphome/secrets.yaml index 5f0df53..fd4d5d8 100644 --- a/copy2esphome/secrets.yaml +++ b/copy2esphome/secrets.yaml @@ -1,3 +1,4 @@ # This is just a a sample for CI/CD!! ota_password: itsecret -wifi_password: itsecret \ No newline at end of file +wifi_password: itsecret +wifi_ssid: itsecret \ No newline at end of file From be9b6fa69721764f229e2b4ce8e0b8a7e181bed2 Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Wed, 10 May 2023 20:26:41 +0200 Subject: [PATCH 13/22] CI/CD 3 --- .github/workflows/main.yml | 4 +- tests/EHMTXv2.ttf | Bin 0 -> 12504 bytes {copy2esphome => tests}/ehtmxv2-template.yaml | 22 +- {copy2esphome => tests}/secrets.yaml | 0 tests/ulanzi-easy.yaml | 257 ++++++++++++++++++ 5 files changed, 263 insertions(+), 20 deletions(-) create mode 100644 tests/EHMTXv2.ttf rename {copy2esphome => tests}/ehtmxv2-template.yaml (82%) rename {copy2esphome => tests}/secrets.yaml (100%) create mode 100644 tests/ulanzi-easy.yaml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8af1d28..f2c706e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,10 +15,10 @@ jobs: strategy: matrix: firmware: - - file: copy2esphome/ulanzi-easy.yaml + - file: tests/ulanzi-easy.yaml name: Ulanzi-Easy manifest_filename: ulanzi-easy-manifest.json - - file: copy2esphome/ehtmxv2-template.yaml + - file: tests/ehtmxv2-template.yaml name: EHMTX template manifest_filename: ehtmxv2-template-manifest.json fail-fast: false diff --git a/tests/EHMTXv2.ttf b/tests/EHMTXv2.ttf new file mode 100644 index 0000000000000000000000000000000000000000..0709311300c50765061316d86f6e77660916bc87 GIT binary patch literal 12504 zcmb7KX^ zdv7G&SKWQP`=0Ndd$zm07EeUFB$7bxTEG70jr;!jvCBoq{u)o`U%l?C_40FBjQb~W zzvPCSmW@C1(7WFj@pj;TYU}RJ`*z*_^vfcp5YLWnJv2Qei~L7L%J1NP>7LC8_RY)) zIE+1x`<8ol-M9VWIS*VZQe7c(!L2*CZN7Wqif6at9ot{B0}o0YN(+Gnp0aqy?&-tN zw#y>i$0B~TYwy<0#~=Hv67b)}v$eZ7AKoW#%WbG{K>MLRn|E(}WXJFxk&D64i}vk3 zF#YwBr@BR!b>RNfl!Qn4gQvfEXZM=_k@EnB^5$L7FUYPlkr(>MaNi<6pQ3=qKQuL^eS-G*N6`4pBe2-hxwP4(%rD9uGX?q3>c`aiq_ZI^Wr6 zr*pMfb#2cOr;c7uUk=+3dnJ}zcd^~)uI#7kw@c^Z*?LMJf_IeZ*}hM&c;B!Nvh;be z?$YpG@xIvJ-n;Fh#`x@4u5T_4UNz;#b`cujpxh-KDD+z%^Yx*~w{geU^U(mgKo&?3 zo^;8>a#UWBA0easQeKz;kdyMBchk_kq36Z~Swdt;-~SMj{e%3AydnQ7|Lfgo-_QK( z%<-8&pLt>CyEEUJ`O}$i%^aP1X6BkVKmW#mz4mOv7ZA;gS1}Uvy~oH(qbs3+yg{j4 zskXGXwRd!Ob@%l4^`A8`XYSea&N+Af;DYmp7A_iIeEtO^OFnSn=tUPVT{gCSytZQE zl9iW!aMkKHlb2l{Ua|H{WXr2JTyyP*uG@J14Iloy@ww7^k+Zwxko<#g-0Lz((gU~l`ntwYrp>oN1k}{51;z_)8CM-Docd(-6Fe; zVB5?^z3_1@BgDe)(79z^E2to9sBP2J@38Zz2%F)z`xX=@~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_)xrA~B ztaGKTLm$@5)ll{|a;Hc7GxN zBs=6waxWD92^et~lzkK`|D^0w^&gaJnEX?6Snikmc8-l*F=no7CrVcx+`pGMH5i8a_Vi0&54A2FXVZMpH@~FkSH8?yv=QI)NX|cf S|AjYr^RvUFSMbX3`Trl2*cZzH literal 0 HcmV?d00001 diff --git a/copy2esphome/ehtmxv2-template.yaml b/tests/ehtmxv2-template.yaml similarity index 82% rename from copy2esphome/ehtmxv2-template.yaml rename to tests/ehtmxv2-template.yaml index 9ba87bb..d72632a 100644 --- a/copy2esphome/ehtmxv2-template.yaml +++ b/tests/ehtmxv2-template.yaml @@ -6,14 +6,12 @@ substitutions: external_components: - source: - type: git - url: https://github.com/lubeda/EspHoMaTriXv2 - ref: release - refresh: 60s + type: local + path: EspHoMaTriXv2/components # e.g. /config/esphome/components components: [ ehmtxv2 ] esphome: - comment: "EHMTXv2 from LuBeDa" + comment: "EHMTXv2 TEXT from LuBeDa" name: $devicename esp32: @@ -52,7 +50,7 @@ light: type: GRB internal: true variant: WS2812 - pin: $ledpin + pin: $matrix_pin num_leds: 256 color_correct: [30%, 30%, 30%] gamma_correct: 2.0 @@ -94,17 +92,5 @@ ehmtxv2: icons: - id: error lameid: 40530 - - id: home_assistant - lameid: 47693 - - id: temperature - lameid: 2056 - - id: lightbulb - lameid: 1762 - - id: music - lameid: 45625 - - id: phone - lameid: 1232 - - id: car - lameid: 2819 - id: sleep8x32 url: https://user-images.githubusercontent.com/16407309/224850723-634c9b2d-55d9-44f2-9f93-765c0485b090.gif diff --git a/copy2esphome/secrets.yaml b/tests/secrets.yaml similarity index 100% rename from copy2esphome/secrets.yaml rename to tests/secrets.yaml diff --git a/tests/ulanzi-easy.yaml b/tests/ulanzi-easy.yaml new file mode 100644 index 0000000..1a2a49f --- /dev/null +++ b/tests/ulanzi-easy.yaml @@ -0,0 +1,257 @@ +substitutions: + devicename: ulanzi + ledpin: GPIO32 + buzzerpin: GPIO15 + friendly_name: LED Matrix + board: esp32dev + # Pin definition from https://github.com/aptonline/PixelIt_Ulanzi + battery_pin: GPIO34 + ldr_pin: GPIO35 + matrix_pin: GPIO32 + left_button_pin: GPIO26 + mid_button_pin: GPIO27 + right_button_pin: GPIO14 + buzzer_pin: GPIO15 + scl_pin: GPIO22 + sda_pin: GPIO21 + +switch: + - 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: + lambda: |- + id(aab_enable) = false; + +globals: + # aab = auto-adjustable brightness + - id: aab_enable + type: "bool" + restore_value: true + initial_value: "true" + - id: aab_add + type: int + initial_value: '10' + - id: aab_max + type: int + initial_value: '220' + - id: aab_min + type: int + initial_value: '20' + +external_components: + - source: + type: git + url: https://github.com/lubeda/EspHoMaTriXv2 + ref: main + refresh: 60s + components: [ ehmtxv2 ] + +esphome: + comment: "EHMTXv2 from LuBeDa" + name: $devicename + on_boot: + then: + - ds1307.read_time: + +esp32: + board: esp32dev + +font: + - file: EHMTXv2.ttf + size: 16 + id: default_font + glyphs: | + !?"%()+*=,-_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnÖÄÜöäüopqrstuvwxyz@<>ß§€/ + +binary_sensor: + - platform: status + name: "$devicename Status" + - platform: gpio + pin: + number: $left_button_pin + inverted: true + name: "Left button" + - platform: gpio + pin: + inverted: true + number: $mid_button_pin + mode: INPUT_PULLUP + name: "Middle button" + - platform: gpio + pin: + number: $right_button_pin + inverted: true + name: "Right button" + +logger: + level: WARN + +api: + services: + - service: tune + variables: + tune: string + then: + - rtttl.play: + rtttl: !lambda 'return tune;' + +sensor: + - platform: sht3xd + temperature: + name: "$devicename Temperature" + humidity: + name: "$devicename Relative 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: |- + auto r = ((x - 3) / 0.69 * 100.00); + if (r >= 100) return 100; + if (r > 0) return r; + if (r <= 0) return 1; + return 0; + unit_of_measurement: '%' + - platform: adc + id: light_sensor + name: "$devicename Illuminance" + pin: $ldr_pin + update_interval: 10s + attenuation: auto + unit_of_measurement: lx + device_class: illuminance + accuracy_decimals: 0 + filters: + - lambda: |- + return (x / 10000.0) * 2000000.0 - 15 ; + on_value: + then: + - lambda: |- + if ( id(aab_enable) ) { + int n = x / 4 + id(aab_add); // new_value + if (n > id(aab_max)) n = id(aab_max); + if (n < id(aab_min)) n = id(aab_min); + int c = id(rgb8x32)->get_brightness(); // current value + int d = (n - c) * 100 / c; // diff in % + if ( abs(d) > 2 ) id(rgb8x32)->set_brightness(n); + } + +ota: + password: !secret ota_password + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + +web_server: + +output: + - platform: ledc + pin: $buzzerpin + id: rtttl_out + +rtttl: + output: rtttl_out + +i2c: + sda: $sda_pin + scl: $scl_pin + scan: true + id: i2cbus + +light: + - platform: neopixelbus + id: ehmtx_light + type: GRB + internal: true + variant: WS2812 + pin: $ledpin + num_leds: 256 + color_correct: [30%, 30%, 30%] + gamma_correct: 2.0 + name: "$devicename Light" + restore_mode: ALWAYS_OFF + +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: 0° + update_interval: 16ms + auto_clear_enabled: true + lambda: |- + id(rgb8x32)->tick(); + id(rgb8x32)->draw(); + +ehmtxv2: + id: rgb8x32 + icons2html: true + matrix_component: ehmtx_display + time_component: ehmtx_time + time_format: "%H:%M" + date_format: "%d.%m." + show_seconds: false + default_font_id: default_font + special_font_id: default_font + icons: + - id: error + lameid: 40530 + - id: home_assistant + lameid: 47693 + - id: temperature + lameid: 2056 + - id: lightbulb + lameid: 1762 + - id: music + lameid: 45625 + - id: phone + lameid: 1232 + - id: car + lameid: 2819 + - id: sleep8x32 + url: https://user-images.githubusercontent.com/16407309/224850723-634c9b2d-55d9-44f2-9f93-765c0485b090.gif + on_next_screen: + - homeassistant.event: + event: esphome.new_screen + data_template: + iconname: !lambda "return icon.c_str();" + text: !lambda "return text.c_str();" From 47fd4b4a8205824660ce31604aed018a86c8df8a Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Wed, 10 May 2023 20:29:53 +0200 Subject: [PATCH 14/22] CI/CD 4 --- tests/ehtmxv2-template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ehtmxv2-template.yaml b/tests/ehtmxv2-template.yaml index d72632a..ffebbad 100644 --- a/tests/ehtmxv2-template.yaml +++ b/tests/ehtmxv2-template.yaml @@ -7,7 +7,7 @@ substitutions: external_components: - source: type: local - path: EspHoMaTriXv2/components # e.g. /config/esphome/components + path: ../components # e.g. /config/esphome/components components: [ ehmtxv2 ] esphome: From 5e1cd6c5b5891879e7cfe50eadb8d72a3d4d0825 Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Wed, 10 May 2023 20:51:48 +0200 Subject: [PATCH 15/22] CI/CD 5 --- .gitignore | 1 + tests/ehtmxv2-template.yaml | 63 +++++++++++++++++++++++++++++++++++- tests/scale.gif | Bin 0 -> 61640 bytes 3 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 tests/scale.gif diff --git a/.gitignore b/.gitignore index 859e610..26a9f37 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ ltr2.png ltr3.png 8x32 iMAGE.xcf +.vscode/c_cpp_properties.json diff --git a/tests/ehtmxv2-template.yaml b/tests/ehtmxv2-template.yaml index ffebbad..b8ffb36 100644 --- a/tests/ehtmxv2-template.yaml +++ b/tests/ehtmxv2-template.yaml @@ -13,7 +13,37 @@ external_components: esphome: comment: "EHMTXv2 TEXT from LuBeDa" name: $devicename - + on_boot: + lambda: |- + if(rgb8x32)->show_indicator(255,100,50,2); + if(rgb8x32)->hide_indicator(); + if(rgb8x32)->show_alarm(255,0,150,3); + if(rgb8x32)->hide_alarm(); + if(rgb8x32)->icon_screen("error","Hallo Text",false,237,20,100,200,150); + if(rgb8x32)->force_screen("error"); + if(rgb8x32)->del_screen("error"); + if(rgb8x32)->del_screen("error",5); + if(rgb8x32)->rainbow_icon_screen("error","Hallo Text",true,237,20,100,200,150); + id(rgb8x32)->status()); + id(rgb8x32)->set_display_on(); + id(rgb8x32)->set_display_off(); + id(rgb8x32)->hold_screen(); + id(rgb8x32)->show_gauge(100,0,200); + id(rgb8x32)->hide_gauge(); + id(rgb8x32)->clock_color(200,100,50); + id(rgb8x32)->today_color(200,100,50); + id(rgb8x32)->weekday_color(200,100,50); + id(rgb8x32)->full_screen("scale"); + id(rgb8x32)->rainbow_icon_screen("error","Oh ein Text"); + id(rgb8x32)->text_screen("text",30); + id(rgb8x32)->rainbow_text_screen("text",30); + id(rgb8x32)->clock_screen(30,5); + id(rgb8x32)->rainbow_clock_screen(30,5); + id(rgb8x32)->date_screen(30,5); + id(rgb8x32)->rainbow_date_screen(30,5); + id(rgb8x32)->rainbow_blank_screen(30,5); + id(rgb8x32)->set_brightness(20); + esp32: board: esp32dev @@ -92,5 +122,36 @@ ehmtxv2: icons: - id: error lameid: 40530 + - id: scale + file: scale.gif + resize: 32x8 - id: sleep8x32 url: https://user-images.githubusercontent.com/16407309/224850723-634c9b2d-55d9-44f2-9f93-765c0485b090.gif + on_next_screen: + - homeassistant.event: + event: esphome.new_screen + data_template: + iconname: !lambda "return icon.c_str();" + text: !lambda "return text.c_str();" + on_add_screen: + - homeassistant.event: + event: esphome.new_screen + data_template: + iconname: !lambda "return icon.c_str();" + text: !lambda "return text.c_str();" + on_next_clock: + - homeassistant.event: + event: esphome.new_screen + data_template: + iconname: "Hallo" + on_expired_screen: + - homeassistant.event: + event: esphome.new_screen + data_template: + iconname: !lambda "return icon.c_str();" + text: !lambda "return text.c_str();" + on_icon_error: + - homeassistant.event: + event: esphome.new_screen + data_template: + iconname: !lambda "return icon.c_str();" \ No newline at end of file diff --git a/tests/scale.gif b/tests/scale.gif new file mode 100644 index 0000000000000000000000000000000000000000..c877064f06a6b1cb3a78ae2b8ad6c2be3e6af940 GIT binary patch literal 61640 zcmeI*c~s2%{|E3-);5>Wib$3gZkD7)tF48WE7B$rY9d72B&l3ltnJf2P20@0Pfblp z=+Z`rR6>aME25P?^P6UpnQ2%3zPEGUb6%(Wp7-bd`RI1|qsMu^Ub9nehqR38g=rB` z2lP8H76`fmK|K%zkFLlNM5+G6^y~i3Ukerp7K6yT5Ik5>_IqnD1XGK)V0uftME{j+ z48drKjD_FQLX)&*i~_#)AHm*)wqhjgAo-}mC%cyz_R6ioj0Wm`SJ z#ic|Q`mo=PGb&7tE)H0y9~q)XFpCJ5KGXQBkZ`OdNXc#a#cgSEPcf=KVw=R$u+L)I zMb$&axN&7Z!UV)4WV+>pz=L_NZR)n@#{~1o{>F}{uvHmWl|`X)H*l}Bh3bo57iCCr zLeQg2?A_z_a)x_%y^J-FyRkaAH@j%|c;*9qc5n7o=hbrw48^|=W@?JmQWzTy<8L?@_ z&BG_`R~%9k9qBxRiS8o!h@geBSCL{|Au!rnQVbgthTIc_OGWtMlUxNXcM|?Gz$auPaF)8aR(%&S%#{*9 zdN68-;VMJoKCc)f+|j0r%SEAsj zX|=W4rACeIUeAm^%`#eitM!3KQqH@Q=$3oW(M?HN5XYMJ88aOn*WG(0_VCp09}1l7 zv**v=b^3nMfh(uu1x^}SrtHKvs6p8IDwl4n1m6Jf+@VMFHkyO6N znUZ@&_X))cdv)1);Ap_1D5j^Ds70d^!C-oWUpf@ z6kXMN^U}jef;4}TL?f54OIlRADym3Xmdo$lHnWWV{KY%2&G)yvVn#AY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9 z)Z4GE6Kz2M`{&VSLD4tjna42^)Q@|NEam7rR9sVS%{v~lDu zv~lFTQ-PpBBOV~A$t9>H{r?0(l>mYQDX1x!f^q-^1!h6j0D=Mp1qccd6d))-Q2!Hx GlKVe6o(5+C literal 0 HcmV?d00001 From b2dd2931b8e2df810e19e07fc02d3ac865d61d85 Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Thu, 11 May 2023 17:16:24 +0200 Subject: [PATCH 16/22] CICD 7 --- tests/ehtmxv2-template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ehtmxv2-template.yaml b/tests/ehtmxv2-template.yaml index b8ffb36..263b76d 100644 --- a/tests/ehtmxv2-template.yaml +++ b/tests/ehtmxv2-template.yaml @@ -138,7 +138,7 @@ ehmtxv2: event: esphome.new_screen data_template: iconname: !lambda "return icon.c_str();" - text: !lambda "return text.c_str();" + mode: !lambda "return mode;" on_next_clock: - homeassistant.event: event: esphome.new_screen From ec57bad917ee331aa60afb4ed32d80429eb52e82 Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Thu, 11 May 2023 17:47:56 +0200 Subject: [PATCH 17/22] naming and CI/CD 8 --- README.md | 10 +++++----- components/ehmtxv2/EHMTX.cpp | 8 ++++---- tests/ehtmxv2-template.yaml | 30 +++++++++++++++--------------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 8ebb33d..ffc72db 100644 --- a/README.md +++ b/README.md @@ -548,7 +548,7 @@ Numerous features are accessible with services from home assistant and lambdas y |service|parameter|result| |---|---|---| -|`status`|none|write some status information to the esphome logs| +|`get_status`|none|write some status information to the esphome logs| |`display_on`|none|turn display off| |`display_off`|none|turn display on| |`hold_screen`|none|show the screen that is currently displayed for the number of seconds longer| @@ -558,9 +558,9 @@ Numerous features are accessible with services from home assistant and lambdas y |`show_gauge"`|"percent", "r", "g", "b"|set the height of the gauge according to the percentage in the given color| |`show_alarm`|"r", "g", "b", "size"|shows the color with the given size in the upper-right corner| |`show_indicator`|"r", "g", "b", "size"|shows the color with the given size in the lower-right corner| -|`clock_color`|"r", "g", "b"|set the default color for the clock/date display| -|`today_color"`|"r", "g", "b"|set the special color for today in the day of week line| -|`weekday_color"`|"r", "g", "b"|set the default color in the day of week line| +|`set_clock_color`|"r", "g", "b"|set the default color for the clock/date display| +|`set_today_color"`|"r", "g", "b"|set the special color for today in the day of week line| +|`set_weekday_color"`|"r", "g", "b"|set the default color in the day of week line| |`del_screen`|"icon_name", "mode"|deletes the specified icon screen from the queue, the [mode](#modes) is a filter| |`force_screen`|"icon_name", "mode"|displays the selected the specified icon screen from the queue, the [mode](#modes) is a filter| |`full_screen`|"icon_name", "lifetime", "screen_time"|show the specified 8x32 icon as full screen| @@ -825,7 +825,7 @@ binary_sensor: id(rgb8x32)->hold_screen(120); ``` -**(D)** Service **status** +**(D)** Service **get_status** This service displays the running queue and a list of icons in the logs diff --git a/components/ehmtxv2/EHMTX.cpp b/components/ehmtxv2/EHMTX.cpp index a739f6f..522bac1 100644 --- a/components/ehmtxv2/EHMTX.cpp +++ b/components/ehmtxv2/EHMTX.cpp @@ -157,7 +157,7 @@ namespace esphome void EHMTX::setup() { ESP_LOGD(TAG, "Setting up services"); - register_service(&EHMTX::get_status, "status"); + register_service(&EHMTX::get_status, "get_status"); register_service(&EHMTX::set_display_on, "display_on"); register_service(&EHMTX::set_display_off, "display_off"); register_service(&EHMTX::hold_screen, "hold_screen", {"time"}); @@ -168,9 +168,9 @@ namespace esphome register_service(&EHMTX::show_alarm, "show_alarm", {"r", "g", "b", "size"}); register_service(&EHMTX::show_indicator, "show_indicator", {"r", "g", "b", "size"}); - register_service(&EHMTX::set_clock_color, "clock_color", {"r", "g", "b"}); - register_service(&EHMTX::set_today_color, "today_color", {"r", "g", "b"}); - register_service(&EHMTX::set_weekday_color, "weekday_color", {"r", "g", "b"}); + register_service(&EHMTX::set_clock_color, "set_clock_color", {"r", "g", "b"}); + register_service(&EHMTX::set_today_color, "set_today_color", {"r", "g", "b"}); + register_service(&EHMTX::set_weekday_color, "set_weekday_color", {"r", "g", "b"}); register_service(&EHMTX::del_screen, "del_screen", {"icon_name", "mode"}); register_service(&EHMTX::force_screen, "force_screen", {"icon_name", "mode"}); diff --git a/tests/ehtmxv2-template.yaml b/tests/ehtmxv2-template.yaml index 263b76d..4f8c1d1 100644 --- a/tests/ehtmxv2-template.yaml +++ b/tests/ehtmxv2-template.yaml @@ -7,7 +7,7 @@ substitutions: external_components: - source: type: local - path: ../components # e.g. /config/esphome/components + path: /config/esphome/EspHoMaTriXv2/components #../components components: [ ehmtxv2 ] esphome: @@ -15,24 +15,24 @@ esphome: name: $devicename on_boot: lambda: |- - if(rgb8x32)->show_indicator(255,100,50,2); - if(rgb8x32)->hide_indicator(); - if(rgb8x32)->show_alarm(255,0,150,3); - if(rgb8x32)->hide_alarm(); - if(rgb8x32)->icon_screen("error","Hallo Text",false,237,20,100,200,150); - if(rgb8x32)->force_screen("error"); - if(rgb8x32)->del_screen("error"); - if(rgb8x32)->del_screen("error",5); - if(rgb8x32)->rainbow_icon_screen("error","Hallo Text",true,237,20,100,200,150); - id(rgb8x32)->status()); + id(rgb8x32)->show_indicator(255,100,50,2); + id(rgb8x32)->hide_indicator(); + id(rgb8x32)->show_alarm(255,0,150,3); + id(rgb8x32)->hide_alarm(); + id(rgb8x32)->icon_screen("error","Hallo Text",false,237,20,100,200,150); + id(rgb8x32)->force_screen("error"); + id(rgb8x32)->del_screen("error"); + id(rgb8x32)->del_screen("error",5); + id(rgb8x32)->rainbow_icon_screen("error","Hallo Text",true,237,20); + id(rgb8x32)->get_status(); id(rgb8x32)->set_display_on(); id(rgb8x32)->set_display_off(); id(rgb8x32)->hold_screen(); id(rgb8x32)->show_gauge(100,0,200); id(rgb8x32)->hide_gauge(); - id(rgb8x32)->clock_color(200,100,50); - id(rgb8x32)->today_color(200,100,50); - id(rgb8x32)->weekday_color(200,100,50); + id(rgb8x32)->set_clock_color(200,100,50); + id(rgb8x32)->set_today_color(200,100,50); + id(rgb8x32)->set_weekday_color(200,100,50); id(rgb8x32)->full_screen("scale"); id(rgb8x32)->rainbow_icon_screen("error","Oh ein Text"); id(rgb8x32)->text_screen("text",30); @@ -41,7 +41,7 @@ esphome: id(rgb8x32)->rainbow_clock_screen(30,5); id(rgb8x32)->date_screen(30,5); id(rgb8x32)->rainbow_date_screen(30,5); - id(rgb8x32)->rainbow_blank_screen(30,5); + id(rgb8x32)->blank_screen(30,5); id(rgb8x32)->set_brightness(20); esp32: From 8e95ffeda065191274a2f8810439c6f8aadb07d6 Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Thu, 11 May 2023 17:52:30 +0200 Subject: [PATCH 18/22] CI/CD 10 --- tests/ehtmxv2-template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ehtmxv2-template.yaml b/tests/ehtmxv2-template.yaml index 4f8c1d1..245595a 100644 --- a/tests/ehtmxv2-template.yaml +++ b/tests/ehtmxv2-template.yaml @@ -7,7 +7,7 @@ substitutions: external_components: - source: type: local - path: /config/esphome/EspHoMaTriXv2/components #../components + path: ../components components: [ ehmtxv2 ] esphome: From b042005e035f28f04fe665e2542c1891ef022492 Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Sat, 13 May 2023 16:49:39 +0200 Subject: [PATCH 19/22] https://github.com/lubeda/EspHoMaTriXv2/issues/11 --- components/ehmtxv2/EHMTX_queue.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/ehmtxv2/EHMTX_queue.cpp b/components/ehmtxv2/EHMTX_queue.cpp index 143c643..ca39be3 100644 --- a/components/ehmtxv2/EHMTX_queue.cpp +++ b/components/ehmtxv2/EHMTX_queue.cpp @@ -127,7 +127,7 @@ namespace esphome case MODE_CLOCK: if (this->config_->clock->now().timestamp > 6000) // valid time { - color_ = (this->mode == MODE_RAINBOW_CLOCK) ? this->config_->rainbow_color : this->text_color; + color_ = (this->mode == MODE_RAINBOW_CLOCK) ? 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, this->config_->time_fmt.c_str(), this->config_->clock->now()); @@ -148,7 +148,7 @@ namespace esphome case MODE_DATE: if (this->config_->clock->now().timestamp > 6000) // valid time { - color_ = (this->mode == MODE_RAINBOW_DATE) ? this->config_->rainbow_color : this->text_color; + 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, this->config_->date_fmt.c_str(), this->config_->clock->now()); From 17676f66c828496c66424990e79e9f0cb0e73aed Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Sat, 13 May 2023 16:49:47 +0200 Subject: [PATCH 20/22] https://github.com/lubeda/EspHoMaTriXv2/issues/11 --- components/ehmtxv2/EHMTX.cpp | 2 +- components/ehmtxv2/EHMTX.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/ehmtxv2/EHMTX.cpp b/components/ehmtxv2/EHMTX.cpp index 522bac1..4cf88eb 100644 --- a/components/ehmtxv2/EHMTX.cpp +++ b/components/ehmtxv2/EHMTX.cpp @@ -223,7 +223,7 @@ namespace esphome void EHMTX::update() // called from polling component { if (!this->is_running){ - if (this->clock->now().timestamp > 6000) { + if (this->clock->now().timestamp > 15) { ESP_LOGD(TAG, "time sync => starting"); this->is_running = true; } diff --git a/components/ehmtxv2/EHMTX.h b/components/ehmtxv2/EHMTX.h index 7ed5507..c07c1ca 100644 --- a/components/ehmtxv2/EHMTX.h +++ b/components/ehmtxv2/EHMTX.h @@ -37,7 +37,7 @@ namespace esphome class EHMTX : public PollingComponent, public api::CustomAPIDevice { protected: - float get_setup_priority() const override { return esphome::setup_priority::WIFI; } + float get_setup_priority() const override { return esphome::setup_priority::PROCESSOR; } uint8_t brightness_; uint32_t boot_anim=0; uint8_t screen_pointer; From e3dc03a795a31a2677c0555b90afa83db38f0f51 Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Sun, 14 May 2023 19:05:22 +0200 Subject: [PATCH 21/22] voice --- M5withMIC.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/M5withMIC.yml b/M5withMIC.yml index 02b674d..b6e692c 100644 --- a/M5withMIC.yml +++ b/M5withMIC.yml @@ -50,14 +50,9 @@ binary_sensor: name: ${devicename} Button id: echo_button on_press: - - voice_assistant.start: - - lambda: |- - id(rgb8x32)->show_alarm(120,0,0,2); - on_release: + - voice_assistant.start: +on_release: - voice_assistant.stop: - - lambda: |- - id(rgb8x32)->hide_alarm(); - font: !include library/ehmtx_font.yaml switch: From db9917d15cbf396209a68ba9ae9b1c563552cff3 Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Mon, 15 May 2023 20:05:25 +0200 Subject: [PATCH 22/22] https://github.com/lubeda/EspHoMaTriXv2/issues/12 --- README.md | 12 ++++ components/ehmtxv2/EHMTX.cpp | 108 +++++++++++++++++++---------- components/ehmtxv2/EHMTX_queue.cpp | 2 +- 3 files changed, 85 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index ffc72db..ecbcba0 100644 --- a/README.md +++ b/README.md @@ -574,6 +574,18 @@ Numerous features are accessible with services from home assistant and lambdas y |`date_screen`|"lifetime", "screen_time", "default_font", "r", "g", "b"|show the date| |`brightness`|"value"|set the display brightness| +#### Parameter description + +"r", "g", "b": Color components for red, green and blue 0..255 +"size": The size of the indicator or alarm, 1-3 +"percent": values from 0..100 +"icon_name": the id of the icon to show, as defined in the YAML file +"text": a text message to display +"lifetime": how long does this screen stay in the queue (minutes) +"screen_time": how long is this screen display in the loop (seconds). For short text without scrolling it is shown the defined time, longer text is scrolled at least `scroll_count` times. +"default_font": use the default font (true) or the special font (false) +"value": the brightness 0..255 + ### Local lambdas #### Add screen to your display queue diff --git a/components/ehmtxv2/EHMTX.cpp b/components/ehmtxv2/EHMTX.cpp index 4cf88eb..9df7e45 100644 --- a/components/ehmtxv2/EHMTX.cpp +++ b/components/ehmtxv2/EHMTX.cpp @@ -504,20 +504,35 @@ namespace esphome } EHMTX_queue *screen = this->find_icon_queue_element(icon); - int x, y, w, h; + int x, y, pixel, h; if (default_font) { - this->display->get_text_bounds(0, 0, text.c_str(), this->default_font, display::TextAlign::LEFT, &x, &y, &w, &h); + this->display->get_text_bounds(0, 0, text.c_str(), this->default_font, display::TextAlign::LEFT, &x, &y, &pixel, &h); } else { - this->display->get_text_bounds(0, 0, text.c_str(), this->special_font, display::TextAlign::LEFT, &x, &y, &w, &h); + this->display->get_text_bounds(0, 0, text.c_str(), this->special_font, display::TextAlign::LEFT, &x, &y, &pixel, &h); } - screen->set_text(text, icon, w, lifetime, screen_time); + if (pixel < 23) + { + screen->centerx_ = ceil((22 - pixel) / 2); + screen->screen_time = screen_time; + } + else + { + screen->centerx_ = 0; + int display_duration = ceil((this->scroll_count * (TEXTSTARTOFFSET + pixel) * this->scroll_interval) / 1000); + screen->screen_time = (display_duration > screen_time) ? display_duration : screen_time; + } + screen->text = text; + screen->pixels_ = pixel; + screen->endtime = this->clock->now().timestamp + lifetime * 60; + screen->shiftx_ = 0; screen->text_color = Color(r, g, b); screen->default_font = default_font; screen->mode = MODE_ICON_SCREEN; screen->icon_name = iconname; + screen->icon = icon; for (auto *t : on_add_screen_triggers_) { t->process(screen->icon_name,(uint8_t)screen->mode); @@ -526,6 +541,59 @@ namespace esphome screen->status(); } +void EHMTX::rainbow_icon_screen(std::string iconname, std::string text, int lifetime, int screen_time, bool default_font) + { + uint8_t icon = this->find_icon(iconname.c_str()); + + if (icon >= this->icon_count) + { + ESP_LOGW(TAG, "icon %d not found => default: 0", icon); + icon = 0; + for (auto *t : on_icon_error_triggers_) + { + t->process(iconname); + } + } + EHMTX_queue *screen = this->find_icon_queue_element(icon); + + int x, y, pixel, h; + if (default_font) + { + this->display->get_text_bounds(0, 0, text.c_str(), this->default_font, display::TextAlign::LEFT, &x, &y, &pixel, &h); + } + else + { + this->display->get_text_bounds(0, 0, text.c_str(), this->special_font, display::TextAlign::LEFT, &x, &y, &pixel, &h); + } + if (pixel < 23) + { + screen->centerx_ = ceil((22 - pixel) / 2); + screen->screen_time = screen_time; + } + else + { + screen->centerx_ = 0; + int display_duration = ceil((this->scroll_count * (TEXTSTARTOFFSET + pixel) * this->scroll_interval) / 1000); + screen->screen_time = (display_duration > screen_time) ? display_duration : screen_time; + } + screen->text = text; + screen->pixels_ = pixel; + screen->endtime = this->clock->now().timestamp + lifetime * 60; + screen->shiftx_ = 0; + screen->default_font = default_font; + screen->mode = MODE_RAINBOW_ICON; + screen->icon_name = iconname; + screen->icon = icon; + for (auto *t : on_add_screen_triggers_) + { + t->process(screen->icon_name,(uint8_t)screen->mode); + } + ESP_LOGD(TAG, "rainbow icon screen icon: %d iconname: %s text: %s lifetime: %d screen_time: %d", icon, iconname.c_str(), text.c_str(), lifetime, screen_time); + screen->status(); + } + + + void EHMTX::rainbow_clock_screen(int lifetime, int screen_time, bool default_font) { EHMTX_queue *screen = this->find_free_queue_element(); @@ -550,38 +618,6 @@ namespace esphome screen->status(); } - - - void EHMTX::rainbow_icon_screen(std::string iconname, std::string text, int lifetime, int screen_time, bool default_font) - { - uint8_t icon = this->find_icon(iconname.c_str()); - - if (icon >= this->icon_count) - { - ESP_LOGW(TAG, "icon %d not found => default: 0", icon); - icon = 0; - for (auto *t : on_icon_error_triggers_) - { - t->process(iconname); - } - } - 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; - screen->default_font = default_font; - screen->mode = MODE_RAINBOW_ICON; - screen->calc_scroll_time(); - for (auto *t : on_add_screen_triggers_) - { - t->process(screen->icon_name,(uint8_t)screen->mode); - } - ESP_LOGD(TAG, "rainbow_icon_screen icon: %d iconname: %s text: %s lifetime: %d screen_time: %d", icon, iconname.c_str(), text.c_str(), lifetime, screen_time); - screen->status(); - } - void EHMTX::text_screen(std::string text, int lifetime, int screen_time, bool default_font, int r, int g, int b) { EHMTX_queue *screen = this->find_free_queue_element(); diff --git a/components/ehmtxv2/EHMTX_queue.cpp b/components/ehmtxv2/EHMTX_queue.cpp index ca39be3..327dd14 100644 --- a/components/ehmtxv2/EHMTX_queue.cpp +++ b/components/ehmtxv2/EHMTX_queue.cpp @@ -238,7 +238,7 @@ namespace esphome this->shiftx_ = 0; float display_duration = ceil((this->config_->scroll_count * (TEXTSTARTOFFSET + pixel) * this->config_->scroll_interval) / 1000); this->screen_time = (display_duration > screen_time) ? display_duration : screen_time; - ESP_LOGD(TAG, "display text: %s pixels %d calculated: %d screen_time: %d", text.c_str(), pixel, this->screen_time, screen_time); + ESP_LOGD(TAG, "display text: %s pixels %d display_duration %d calculated: %d screen_time: %d", text.c_str(), pixel,display_duration, this->screen_time, screen_time); this->endtime = this->config_->clock->now().timestamp + et * 60; this->icon = icon; }