cleanup and docu

pull/2/head
LuBeDa 3 years ago
parent e932a086a7
commit 70e6741d32

@ -16,7 +16,9 @@ There are some "RGB-matrix" status displays/clocks out there, the commercial one
- [Ulanzi TC001](https://www.aliexpress.com/item/1005005008682055.html) commercial ~ 50€
- [Awtrix](https://awtrixdocs.blueforcer.de/#/) (project has been discontinued after more than 4 years now in August 2022)
- [PixelIt](https://docs.bastelbunker.de/pixelit/) (project is under active development)
- [Awtrix-Light](https://github.com/Blueforcer/awtrix-light) From the developer of Awtrix, optimized for the Ulanzi TC001 Hardware
- [Awtrix-Light](https://github.com/Blueforcer/awtrix-light) From the developer of Awtrix, optimized for the Ulanzi TC001
Hardware
- [lamatrix](https://github.com/noahwilliamsson/lamatrix/tree/master) micropython based an around 5 years old
The solutions have their pros and cons. I tried some and used AwTrix for a long time. But the cons are so big (in my opinion) that I started an esphome.io variant. Targeted to an optimized Home Assistant integration, without paid blueprints and the need of mqtt. But it had to be extensible, e.g. for the use as poolthermometer or as mediaplayer. All done by the magical power of esphome.
@ -29,7 +31,6 @@ Another german tutorial video focused at the Ulanzi [Smarte Pixel Clock über Ho
See this [nice article](https://blakadder.com/esphome-pixel-clock/) about EsphoMaTrix on a Ulanzi TC001 from [blakadder](https://github.com/blakadder).
Short video on Instagram [@blak_adder](https://www.instagram.com/reel/CpYVByRIaSI)
https://www.instagram.com/reel/CpYVByRIaSI
See this english discussions:
[Share your projects](https://community.home-assistant.io/t/esphomatrix-a-simple-clock-status-display/425325)
@ -137,7 +138,7 @@ void icon_screen(std::string icon, std::string text, int lifetime=D_LIFETIME, in
For 8x32 icons or animations
<img src="https://raw.githubusercontent.com/lubeda/EsphoMaTrix/2023.5.b1/images/fullscreen.png" width=320 height=80 alt="Fullscreen">
![fullscreen](./images/fullscreen.png)
###### service
@ -149,7 +150,6 @@ For 8x32 icons or animations
void EHMTX::fullscreen(std::string iconname, int lifetime, int screen_time)
```
#### Installation
##### **EspHoMaTriXv2** custom component
@ -303,6 +303,8 @@ Download and install all needed icons (.jpg/.png) and animations (.gif) under th
You can also specify an URL to directly download the image file. The URLs will only be downloaded once at compile time, so there is no additional traffic on the hosting website.
The [icons](awtrix.blueforcer.de/icons) and [animations](https://awtrix.blueforcer.de/animations) from the awtrix and atrix-light could be used, but have to be scaled down to 8x32 or 8x8 pixels. Check the licence befor using them!
There are maximum 90 icons possible.
***Sample***
@ -407,7 +409,7 @@ ehmtx:
**frame_interval** (optional, ms): the interval in ms to display the next animation/icon frame (default = 192), should be a multiple of the ```update_interval``` from the [display](https://esphome.io/components/display/addressable_light.html). Can be overwritten per icon/gif see [icons](#icons-and-animations) parameter `frame_duration`
**icons2html** (optional, boolean): If true, generate the html (_filename_.html) file to show all included icons. (default = `false`)
**icons2html** (optional, boolean): If true, generate the html (*filename*.html) file to show all included icons. (default = `false`)
***Example output:***
![icon preview](./images/icons_preview.png)
@ -452,7 +454,6 @@ sensor:
id(rgb8x32)->icon_screen("sun", text); // uses default values for color etc.
```
#### Set (alarm/clock/gauge/text/today/weekday) color action
Sets the default color of the selected element
@ -474,7 +475,7 @@ Force the selected [icon_screen](#icon-screen) ```icon_name``` to be displayed n
##### Change configuration during runtime
_Configuration variables/functions:_
*Configuration variables/functions:*
Experienced programmers can use this public methods:
@ -544,7 +545,7 @@ ehmtx:
Sets the overall brightness of the display (`0..255`)
_parameters:_
*parameters:*
- ```brightness```: from dark to bright (`0..255`) (default = `80`) as set in the light component by ```color_correct: [30%, 30%, 30%]```
@ -564,7 +565,6 @@ number:
id(rgb8x32)->set_brightness(x);
```
**(D)** Service **del_screen**
Removes a screen from the display by icon name. If this screen is actually display while sending this command the screen will be displayed until its "show_screen"-time has ended.
@ -573,7 +573,7 @@ optionally you can suffix a * to the icon name to perform a wildcard delete whic
For example if you have multiple icons named weather_sunny, weather_rain & weather_cloudy, you can issue a del_screen weather_* to remove whichever screen is currently in a slot and replace it with a new weather screen.
_parameters:_
*parameters:*
- ```icon_name```: Icon `id` defined in the yaml (see installation)
- ```mode```: The mode is for internal purposes use 5 for icon_screen
@ -584,7 +584,7 @@ Turns indicator on/off
Display a colored corner on all screens and the clock. You can define the color by parameter.
_parameters:_
*parameters:*
- ```r``` red in 0..255
- ```g``` green in 0..255
@ -637,7 +637,7 @@ Displays the current screen for configured ammount (see **hold_time**) (default=
e.g. on the Ulanzi TC001
```
```yaml
binary_sensor:
- platform: gpio
pin:
@ -670,7 +670,7 @@ Service **show_gauge** / **del_gauge_off**
**(D)** Turns gauge on/off
Displays a colored gauge at the left side of the display. You can define the color by parameter.
_parameters:_
*parameters:*
- ```percent``` gauge percentage
@ -877,7 +877,6 @@ sensor:
## Breaking changes
## Usage
The integration works with the Home Assistant api so, after boot of the device, it takes a few seconds until the service calls start working. If you see a growing green rectangle after boot you have to wait a bit until the api is connected etc.
@ -897,6 +896,7 @@ THE SOFTWARE IS PROVIDED "AS IS", use at your own risk!
- **[wsbtak](https://github.com/wsbtak)** for the work on the ulanzi hardware
- **[ofirsnb](https://github.com/ofirsnb)** for his contributions
- **[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
- ** everbody that found bugs/issues and reported them!
## Special thanks to all sponsors

@ -25,7 +25,7 @@ namespace esphome
ESP_LOGD(TAG, "queue: empty slot");
break;
case MODE_BLANK:
ESP_LOGD(TAG, "queue: show empty screen");
ESP_LOGD(TAG, "queue: show blank screen");
break;
case MODE_CLOCK:
ESP_LOGD(TAG, "queue: show clock for %d sec", this->screen_time);

@ -1,6 +1,6 @@
blueprint:
name: |-
ehmtxv2':' delete screen from 8x32 RGB-display
ehmtxv2: delete screen from 8x32 RGB-display
description: This blueprint is triggered by a state change. If the state is between certain values it will be displayed with special colors or no state change will be displayed
domain: automation
input:
@ -35,87 +35,8 @@ blueprint:
select:
mode: dropdown
options:
[
"*",
"error",
"github",
"precipitation",
"nina",
"waschmaschine",
"car",
"lamp",
"sonos",
"print3d",
"internet",
"speaker",
"alien",
"temp",
"garage",
"door",
"wind",
"rain",
"shop",
"phone",
"fire",
"alexa",
"tv",
"frost",
"muell",
"cookit",
"nature",
"work",
"bike",
"school",
"amazon",
"post",
"money",
"power",
"solar",
"yoga",
"startrek",
"energy",
"sun",
"diesel",
"benzine10",
"vacuum",
"rainprecip",
"iss",
"thunder",
"nina_warning",
"birthday",
"firework",
"coffee",
"lightning",
"xmastree",
"sauna",
"trash_grey",
"trash_blue",
"trash_yell",
"trash_brow",
"weather_clear_night",
"weather_cloudy",
"weather_fog",
"weather_lightingrainy",
"weather_partlycloudy",
"weather_pouring",
"weather_rainy",
"weather_snowy",
"weather_snowy_rainy",
"weather_sunny",
"f_mario",
"f_onair",
"f_bat",
"f_matrix",
"f_invaders",
"f_amongus",
"theodor",
"f_sleeping",
"mops",
"girl",
"timer",
"lasticon",
]
default: homeassistant
["*","error","home_assistant","temperature","lightbulb","music","phone","car","sleep8x32",]
default: home_assistant
low_value:
name: below this vaule is a special color
selector:

@ -0,0 +1,52 @@
blueprint:
name: |-
ehmtxv2: hide screen elements to 8x32 RGB-display
description: removes the gauge,indicator or alarm element from your display
domain: automation
input:
ehmtx_device:
name: which device to display at
selector:
device:
integration: esphome
element:
name: the element
selector:
select:
custom_value: true
mode: dropdown
options:
- label: alarm
value: hide_alarm
- label: gauge
value: hide_gauge
- label: indicator
value: hide_indicator
default: hide_indicator
element_color:
name: The color for the element
description: the color
selector:
color_rgb:
default: [240, 40, 40]
variables:
display: !input ehmtx_device
element_color: !input element_color
sercice: !input element
value: !input gauge_value
trigger:
- platform: state
entity_id: !input trigger_sensor
action:
- service: esphome.{{ device_attr(display, "name") }}_{{service}}
data:
value: {{ value }}
r: |-
{{ element_color[0] }}
g: |-
{{ element_color[1] }}
b: |-
{{ element_color[2] }}

@ -0,0 +1,58 @@
blueprint:
name: |-
ehmtxv2: show screen elements to 8x32 RGB-display
description: add a gauge,indicator or alarm element to your display
domain: automation
input:
ehmtx_device:
name: which device to display at
selector:
device:
integration: esphome
element:
name: the element
selector:
select:
custom_value: true
mode: dropdown
options:
- label: alarm
value: show_alarm
- label: gauge
value: show_gauge
- label: indicator
value: show_indicator
default: show_indicator
gauge_value:
name: the value on the gauge
selector:
number:
mode: slider
min: 0
max: 100
element_color:
name: The color for the element
description: the color
selector:
color_rgb:
default: [240, 40, 40]
variables:
display: !input ehmtx_device
element_color: !input element_color
sercice: !input element
value: !input gauge_value
trigger:
- platform: state
entity_id: !input trigger_sensor
action:
- service: esphome.{{ device_attr(display, "name") }}_{{service}}
data:
r: |-
{{ element_color[0] }}
g: |-
{{ element_color[1] }}
b: |-
{{ element_color[2] }}

@ -43,81 +43,8 @@ blueprint:
select:
mode: dropdown
options:
[
"error",
"lamp",
"sonos",
"print3d",
"internet",
"speaker",
"alien",
"temp",
"garage",
"door",
"wind",
"rain",
"shop",
"phone",
"fire",
"alexa",
"tv",
"frost",
"muell",
"cookit",
"nature",
"work",
"bike",
"school",
"amazon",
"post",
"money",
"power",
"solar",
"yoga",
"startrek",
"energy",
"sun",
"diesel",
"benzine10",
"vacuum",
"rainprecip",
"iss",
"thunder",
"nina_warning",
"birthday",
"firework",
"coffee",
"lightning",
"xmastree",
"sauna",
"trash_grey",
"trash_blue",
"trash_yell",
"trash_brow",
"weather_clear_night",
"weather_cloudy",
"weather_fog",
"weather_lightingrainy",
"weather_partlycloudy",
"weather_pouring",
"weather_rainy",
"weather_snowy",
"weather_snowy_rainy",
"weather_sunny",
"f_mario",
"f_onair",
"f_bat",
"f_matrix",
"f_invaders",
"f_amongus",
"theodor",
"f_sleeping",
"mops",
"girl",
"timer",
"lasticon",
]
default: homeassistant
["error","home_assistant","temperature","lightbulb","music","phone","car","sleep8x32",]
default: home_assistant
use_colors:
name: Use colors based on state values
selector:

@ -18,7 +18,8 @@ substitutions:
external_components:
- source:
type: git
url: https://github.com/lubeda/EsphoMaTrix
url: https://github.com/lubeda/EspHoMaTriXv2
ref: release
refresh: 60s
components: [ ehmtx ]
@ -33,12 +34,10 @@ esp32:
board: esp32dev
font:
- file: MatrixClock-Chunky8.bdf
- file: EHMTXv2.ttf
id: default_font
glyphs: |
!?"%()+*=,-_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnÖÄÜöäüopqrstuvwxyz@<>ß§/
- file: MatrixClock-Chunky6.bdf
id: special_font
!?"%()+*=,-_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnÖÄÜöäüopqrstuvwxyz@<>ß§€/
binary_sensor:
- platform: status
@ -61,9 +60,8 @@ binary_sensor:
name: "Right button"
logger:
level: WARNING
level: DEBUG
# Enable Home Assistant API
api:
services:
- service: alarm
@ -72,14 +70,15 @@ api:
text: string
then:
lambda: |-
id(rgb8x32)->add_icon_screen(icon_name,text, 5, 30, true, true, 200, 50, 50);
id(rgb8x32)->force_icon_screen(icon_name);
id(rgb8x32)->icon_screen(icon_name,text, 5, 30, true, 200, 50, 50);
id(rgb8x32)->force_screen(icon_name);
- service: screen
variables:
icon_name: string
text: string
then:
id(rgb8x32)->add_icon_screen(icon_name,text, 5, 20, false, true, 240, 240, 240);
lambda: |-
id(rgb8x32)->icon_screen(icon_name,text);
- service: tune
variables:
tune: string
@ -127,6 +126,19 @@ sensor:
filters:
- lambda: |-
return (x / 10000.0) * 2000000.0 - 15 ;
on_value_range:
- below: 100.0
then:
lambda: |-
id(rgb8x32)->set_brightness(20);
- below: 250.0
then:
lambda: |-
id(rgb8x32)->set_brightness(40);
- above: 250.0
then:
lambda: |-
id(rgb8x32)->set_brightness(80);
ota:
password: !secret ota_password
@ -160,7 +172,7 @@ light:
pin: $ledpin
num_leds: 256
color_correct: [30%, 30%, 30%]
gamma_correction: 1.0
gamma_correct: 2.0
name: "$devicename Light"
restore_mode: ALWAYS_OFF
@ -179,7 +191,6 @@ display:
addressable_light_id: ehmtx_light
width: 32
height: 8
internal: true
pixel_mapper: |-
if (y % 2 == 0) {
return (y * 32) + x;
@ -194,14 +205,32 @@ display:
ehmtx:
id: rgb8x32
clock_time: 8
clock_time: 10
screen_time: 10
hold_time: 27
hold_time: 30
icons2html: true
yoffset: 7
default_font_yoffset: 6
matrix_component: ehmtx_display
time_component: ehmtx_time
time_format: "%H:%M"
date_format: "%d.%m."
show_seconds: false
font_id: special_font
icons: !include ehmtx_icons.yaml
default_font_id: default_font
special_font_id: default_font # for starters yust one 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
Loading…
Cancel
Save