lubeda / esphomatrix Goto Github PK
View Code? Open in Web Editor NEWA simple DIY status display with an 8x32 RGB LED panel implemented with esphome.io and Home Assistant
License: MIT License
A simple DIY status display with an 8x32 RGB LED panel implemented with esphome.io and Home Assistant
License: MIT License
The component cannot be updated after updating ESPhome. I haven't changed anything in the configuration and everything works, but it can't be updated.
src/main.cpp:76:10: error: 'SetAlarmColor' in namespace 'esphome' does not name a template type; did you mean 'SetClockColor'?
76 | esphome::SetAlarmColor<> *esphome_setalarmcolor;
| ^~~~~~~~~~~~~
| SetClockColor
/config/esphome/led-8x32.yaml: In function 'void setup()':
/config/esphome/led-8x32.yaml:42:3: error: 'esphome_setalarmcolor' was not declared in this scope; did you mean 'esphome_setclockcolor'?
42 | id: rgb8x32
| ^ ~~~~~~~~~~~
| esphome_setclockcolor
/config/esphome/led-8x32.yaml:42:40: error: 'SetAlarmColor' in namespace 'esphome' does not name a template type; did you mean 'SetClockColor'?
42 | id: rgb8x32
| ^
| SetClockColor
/config/esphome/led-8x32.yaml:42:54: error: expected primary-expression before '>' token
42 | id: rgb8x32
| ^
/config/esphome/led-8x32.yaml:47:143: error: cannot convert '<brace-enclosed initializer list>' to 'const std::vector<esphome::Action<>*, std::allocator<esphome::Action<>*> >&'
47 | esp8266:
| ^
In file included from src/esphome/components/display/display_buffer.h:5,
from src/esphome/components/addressable_light/addressable_light_display.h:5,
from src/esphome.h:3,
from src/main.cpp:3:
src/esphome/core/automation.h:237:56: note: initializing argument 1 of 'void esphome::Automation<Ts>::add_actions(const std::vector<esphome::Action<Ts ...>*>&) [with Ts = {}]'
237 | void add_actions(const std::vector<Action<Ts...> *> &actions) { this->actions_.add_actions(actions); }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
*** [/data/led-8x32/.pioenvs/led-8x32/src/main.cpp.o] Error 1
========================= [FAILED] Took 28.66 seconds =========================
========== [ERROR] /config/esphome/led-8x32.yaml ==========
Is it possible to add a service that will variably change the color of the LEDs displaying the days of the week?
In my awtrix matrix, there is a turn off animation whenever the display is turned off, which I think it is nice.
I built an Addressable Lambda Effect in esphome to mimic the same animation on my Ulanzi EsphoMaTrix, assigned it to the light component and it works fine if I trigger the effect manually.
Probably there are simpler ways to achieve this, but here it is for reference, if anyone wants to use it also:
addressable_lambda:
name: "ZZZ"
update_interval: 100ms
lambda: |-
static int x = 0;
if (initial_run) {
x = 1;
it.all() = Color(0,0,0);
}
// it.range() seems to include initial LED # but excludes last LED #
switch (x) {
case 1:
// Line 8 - right to left (from 224)
it.range(231, 236) = Color(255,255,255);
x += 1;
break;
case 2:
// Line 7 - left to right (from 192)
it.range(210, 215) = Color(255,255,255);
// Line 8 - right to left (from 224)
it.range(231, 236) = Color(0,0,0);
it[233] = Color(255,255,255);
x += 1;
break;
case 3:
// Line 6 - right to left (from 160)
it.range(172, 177) = Color(255,255,255);
// Line 7 - left to right (from 192)
it.range(210, 215) = Color(0,0,0);
it[211] = Color(255,255,255);
// Line 8 - right to left (from 224)
it[233] = Color(0,0,0);
it[237] = Color(255,255,255);
x += 1;
break;
case 4:
// Line 5 - left to right (from 128)
it.range(141, 146) = Color(255,255,255);
// Line 6 - right to left (from 160)
it.range(172, 177) = Color(0,0,0);
it[174] = Color(255,255,255);
// Line 7 - left to right (from 192)
it[211] = Color(0,0,0);
it[208] = Color(255,255,255);
// Line 8 - right to left (from 224)
it[237] = Color(0,0,0);
it[240] = Color(255,255,255);
x += 1;
break;
case 5:
// Line 4 - right to left (from 96)
it.range(111, 116) = Color(255,255,255);
// Line 5 - left to right (from 128)
it.range(141, 146) = Color(0,0,0);
it[144] = Color(255,255,255);
// Line 6 - right to left (from 160)
it[174] = Color(0,0,0);
it[176] = Color(255,255,255);
// Line 7 - left to right (from 192)
it[208] = Color(0,0,0);
it[206] = Color(255,255,255);
// Line 8 - right to left (from 224)
it[240] = Color(0,0,0);
it[242] = Color(255,255,255);
x += 1;
break;
case 6:
// Line 3 - left to right (from 64)
it.range(75, 80) = Color(255,255,255);
// Line 4 - right to left (from 96)
it.range(111, 116) = Color(0,0,0);
it[112] = Color(255,255,255);
// Line 5 - left to right (from 128)
it[144] = Color(0,0,0);
it[142] = Color(255,255,255);
// Line 6 - right to left (from 160)
it[176] = Color(0,0,0);
it[178] = Color(255,255,255);
// Line 7 - left to right (from 192)
it[206] = Color(0,0,0);
it[204] = Color(255,255,255);
// Line 8 - right to left (from 224)
it[242] = Color(0,0,0);
it[244] = Color(255,255,255);
x += 1;
break;
case 7:
// Line 2 - right to left (from 32)
it.range(49, 54) = Color(255,255,255);
// Line 3 - left to right (from 64)
it.range(75, 80) = Color(0,0,0);
it[78] = Color(255,255,255);
// Line 4 - right to left (from 96)
it[112] = Color(0,0,0);
it[114] = Color(255,255,255);
// Line 5 - left to right (from 128)
it[142] = Color(0,0,0);
it[140] = Color(255,255,255);
// Line 6 - right to left (from 160)
it[178] = Color(0,0,0);
it[180] = Color(255,255,255);
// Line 7 - left to right (from 192)
it[204] = Color(0,0,0);
it[202] = Color(255,255,255);
// Line 8 - right to left (from 224)
it[244] = Color(0,0,0);
it.range(241, 246) = Color(255,255,255);
x += 1;
break;
case 8:
// Line 1 - left to right (from 0)
it.range(8, 13) = Color(255,255,255);
// Line 2 - right to left (from 32)
it.range(49, 54) = Color(0,0,0);
it[51] = Color(255,255,255);
// Line 3 - left to right (from 64)
it[78] = Color(0,0,0);
it[75] = Color(255,255,255);
// Line 4 - right to left (from 96)
it[114] = Color(0,0,0);
it[117] = Color(255,255,255);
// Line 5 - left to right (from 128)
it[140] = Color(0,0,0);
it[137] = Color(255,255,255);
// Line 6 - right to left (from 160)
it[180] = Color(0,0,0);
it[183] = Color(255,255,255);
// Line 7 - left to right (from 192)
it[202] = Color(0,0,0);
it.range(200, 206) = Color(255,255,255);
// Line 8 - right to left (from 224)
it.range(241, 246) = Color(0,0,0);
x += 1;
break;
case 9:
// Line 1 - left to right (from 0)
it.range(8, 13) = Color(0,0,0);
it[13] = Color(255,255,255);
// Line 6 - right to left (from 160)
it[183] = Color(0,0,0);
it.range(178, 183) = Color(255,255,255);
// Line 7 - left to right (from 192)
it.range(200, 206) = Color(0,0,0);
x += 1;
break;
case 10:
// Line 5 - left to right (from 128)
it[137] = Color(0,0,0);
it.range(138, 143) = Color(255,255,255);
// Line 6 - right to left (from 160)
it.range(178, 183) = Color(0,0,0);
x += 1;
break;
case 11:
// Line 4 - right to left (from 96)
it[117] = Color(0,0,0);
it.range(112, 117) = Color(255,255,255);
// Line 5 - left to right (from 128)
it.range(138, 143) = Color(0,0,0);
x += 1;
break;
case 12:
// Line 3 - left to right (from 64)
it[75] = Color(0,0,0);
it.range(76, 81) = Color(255,255,255);
// Line 4 - right to left (from 96)
it.range(112, 117) = Color(0,0,0);
x += 1;
break;
case 13:
// Line 2 - right to left (from 32)
it[51] = Color(0,0,0);
it.range(46, 51) = Color(255,255,255);
// Line 3 - left to right (from 64)
it.range(76, 81) = Color(0,0,0);
x += 1;
break;
case 14:
// Line 1 - left to right (from 0)
it[13] = Color(0,0,0);
it.range(14, 19) = Color(255,255,255);
// Line 2 - right to left (from 32)
it.range(46, 51) = Color(0,0,0);
x += 1;
break;
case 15:
it.all() = Color(0,0,0);
break;
}
If I turn on the light with the effect, it switches from the clock to the animation.
The "problem" is that to stop the animation, I either need:
So my question here is: how would you guys better include this to behave as a turn off animation? Going from clock or whatever is on the display to the animation and then display off.
Thanks for any suggestions.
I found out, that the minimal Brightness for Ulanzi TC001 can be set to 30
. Lower than that it turns completely off. However to sleep nearby it is still too bright then for my Taste.
Is there a Possibility to come around?
I would like to propose an API change: I would like to use a screen name or id as a reference to add, update or delete a screen instead of using the name of an icon.
void add_screen(std::string screen_name, std::string icon, std::string text, uint16_t duration, bool alarm);
void del_screen(std::string screen_name);
This brings two advantages:
My main use case is a weather screen: With the current implementation, I have to remove a screen and add a new one everytime when the weather condition changes. If I could call the API with a screen name, the update is much simpler.
I implemented this change I while ago(https://github.com/jd1/EsphoMaTrix/tree/id), but never polished to code to create a PR. I had this code running for a while and used it without problems, but I'm currently not using my LED display, therefore the code is outdated and has probably some merge conflicts now :)
For most usecases there is not much that you have to change, but I see one risk: I implemented the name/id of a screen as std::string
which could consume too much memory. I hope that there is a better solution for this.
On my reference branch I duplicated the add_screen
and del_screen
methods to keep the API stable, but I would prefer a clean solution with only two methods.
I am happy to receive feedback on my proposal.
If we can agree how to proceed, I'm happy to adapt my code and create a PR.
Not sure if I should add default provided services add_screen
(which can be used for regular screens or alarms and specify duration) and force_screen
to README, in the services part, also included in #63?
What do you think @lubeda?
hello I just wanted to install your new esphomatrix version for the ulanzi TC001 but I get an error that it does not find it? see code
error:
INFO Reading configuration /config/esphome/ulanzi.yaml...
ERROR Error while reading config: Invalid YAML syntax:
Error reading file /config/esphome/ehmtx_font.yaml: [Errno 2] No such file or directory: '/config/esphome/ehmtx_font.yaml'
code yaml :
substitutions:
devicename: ulanzi
ledpin: GPIO32
buzzerpin: GPIO15
external_components:
- source:
type: git
url: https://github.com/lubeda/EsphoMaTrix
refresh: 60s
components: [ ehmtx ]
esphome:
comment: "Ulanzi Work in Progress"
name: $devicename
on_boot:
then:
- ds1307.read_time:
esp32:
board: esp32dev
font: !include ehmtx_font.yaml
binary_sensor:
- platform: status
name: "$devicename Status"
- platform: gpio
pin:
number: $left_button_pin
inverted: true
name: "$devicename left button"
- platform: gpio
pin:
inverted: true
number: $mid_button_pin
mode: INPUT_PULLUP
name: "$devicename middle button"
- platform: gpio
pin:
number: $right_button_pin
inverted: true
name: "$devicename right button"
logger:
level: INFO
# Enable Home Assistant API
api:
services:
- service: gauge
variables:
val: int
then:
lambda: |-
id(rgb8x32).set_gauge_value(val);
- service: alarm
variables:
icon_name: string
text: string
then:
lambda: |-
id(rgb8x32)->add_screen(icon_name,text,7,true);
id(rgb8x32)->force_screen(icon_name);
- service: screen
variables:
icon_name: string
text: string
then:
- ehmtx.add.screen:
id: rgb8x32
text: !lambda return text;
icon_name: !lambda return icon_name;
alarm: false
- service: brightness
variables:
brightness: int
then:
lambda: |-
id(rgb8x32)->set_brightness(brightness);
- service: status
then:
lambda: |-
id(rgb8x32)->get_status();
- service: del_screen
variables:
icon_name: string
then:
- ehmtx.delete.screen:
id: rgb8x32
icon_name: !lambda return icon_name;
- service: indicator_on
variables:
r: int
g: int
b: int
then:
- ehmtx.indicator.on:
id: rgb8x32
red: !lambda return r;
green: !lambda return g;
blue: !lambda return b;
- service: force_screen
variables:
icon_name: string
then:
- ehmtx.force.screen:
id: rgb8x32
icon_name: !lambda return icon_name;
- service: text_color
variables:
r: int
g: int
b: int
then:
lambda: |-
id(rgb8x32)->set_text_color(r,g,b);
- service: alarm_color
variables:
r: int
g: int
b: int
then:
lambda: |-
id(rgb8x32)->set_alarm_color(r,g,b);
- service: indicator_off
then:
- ehmtx.indicator.off:
id: rgb8x32
encryption:
key: "iEvQjMi6GHXTS94Qmda/VlFQZOAo+Qo+T6mvphuaNOU="
number:
- platform: template
name: "$devicename brightness"
min_value: 0
max_value: 255
step: 1
lambda: |-
return id(rgb8x32)->get_brightness();
set_action:
lambda: |-
id(rgb8x32)->set_brightness(x);
sensor:
- platform: sht3xd
temperature:
name: "$devicename Temperature"
humidity:
name: "$devicename Relative Humidity"
update_interval: 60s
- platform: adc
pin: 36
# not really working
name: "$devicename Battery"
update_interval: 60s
- platform: adc
id: source_sensor
# not really working
name: "$devicename LDR"
pin: A7
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: 21
scl: 22
scan: true
id: bus_a
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
on_turn_on:
lambda: |-
id(ehmtx_display)->set_enabled(false);
on_turn_off:
lambda: |-
id(ehmtx_display)->set_enabled(true);
time:
- platform: homeassistant
on_time_sync:
then:
ds1307.write_time:
- platform: ds1307
update_interval: never
id: ehmtx_time
display:
- platform: addressable_light
id: ehmtx_display
addressable_light_id: ehmtx_light
width: 32
height: 8
pixel_mapper: |-
if (y % 2 == 0) {
return (y * 32) + x;
}
return (y * 32) + (31 - x);
rotation: 0°
update_interval: 16ms
auto_clear_enabled: true
lambda: |-
id(rgb8x32)->tick();
id(rgb8x32)->draw();
ehmtx:
id: rgb8x32
show_clock: 6
show_screen: 6
html: true
display8x32: ehmtx_display
time: ehmtx_time
duration: 7
font_id: ehmtx_font
icons: !include ehmtx_icons.yaml
Great to see you have added Ulanzi support to EspHoMaTrix, I’ll look forward to flashing and giving it a go.
I see you have referenced the use of the pinouts from my PixelIt Ulanzi repository in the code (which is great) and also included me in a ‘Thanks’ in the README, it’s appreciated. Could I ask however that you add @wsbtak to the thanks for all their hard work (and head scratching) to get Pixelit working on the Ulanzi? If it wasn’t for them we wouldn’t be where we are today 😀.
Thanks again and keep up the good work.
It would be nice if the screen would update immediately when you call force screen.
E.g. I would like to show the current caller on my landline phone and it is annoying if I have to wait until the screen moves to the next to see the caller.
If you would like to keep the current behaviour, you could also split it up in two methods:
It's been over half a year since I had a deeper look at the code, so I'm not sure how much effort this is. This is just an idea for an improvement, no show stopper :)
Is it possible to have a separate control of how long the clock, date and other details will be displayed. i am trying to figure out a way to display the date a little bit longer as i think it is displaying just about a second or even less and i cant figure out for the life of me. haha. i may just be missing some documentation but i would appreciate it if you can point me to it. thanks!
I was wondering if it is possible to display a timer using EsphoMaTrix. E.g. a service is called in Home Assistant, which leads to an timer of specified duration (e.g. 5 minutes) being displayed on the matrix display.
Or are there any workarounds that would enable such functionality.
P.S. Thank you for developing this project.
GIF is not working on my setup. it is just showing a static image.
below is my yaml file
substitutions:
devicename: ehmtx8266
mypin: GPIO02
# GPIO04
external_components:
- source:
type: git
url: https://github.com/lubeda/EsphoMaTrix
ref: date-time
refresh: 120s
components: [ ehmtx ]
#type: local
#path: components/components
esphome:
name: $devicename
on_boot:
priority: -100
then:
- ehmtx.text.color:
id: rgb8x32
red: !lambda return 200;
green: !lambda return 200;
blue: !lambda return 200;
- ehmtx.today.color:
id: rgb8x32
red: !lambda return 255;
green: !lambda return 165;
blue: !lambda return 0;
- ehmtx.clock.color:
id: rgb8x32
red: !lambda return 255;
green: !lambda return 165;
blue: !lambda return 0;
- ehmtx.weekday.color:
id: rgb8x32
red: !lambda return 0;
green: !lambda return 128;
blue: !lambda return 128;
- lambda: !lambda |-
id(rgb8x32)->show_all_icons();
esp8266:
board: nodemcuv2
font:
- file: monobit.ttf
id: ehmtx_font
size: 16
glyphs: |
!?"%()+*=,-_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz€@<>/
binary_sensor:
- platform: status
name: "$devicename Status"
logger:
# Enable Home Assistant API
api:
services:
- service: show_all_icons
then:
lambda: |-
id(rgb8x32)->show_all_icons();
- service: alarm
variables:
icon_name: string
text: string
then:
lambda: |-
id(rgb8x32)->add_screen(icon_name,text,7 ,true);
id(rgb8x32)->force_screen(icon_name);
- service: screen
variables:
icon_name: string
text: string
then:
- ehmtx.add.screen:
id: rgb8x32
text: !lambda return text;
icon_name: !lambda return icon_name;
duration: 1440
alarm: false
- service: brightness
variables:
brightness: int
then:
lambda: |-
id(rgb8x32)->set_brightness(brightness);
- service: status
then:
lambda: |-
id(rgb8x32)->get_status();
- service: del_screen
variables:
icon_name: string
then:
- ehmtx.delete.screen:
id: rgb8x32
icon_name: !lambda return icon_name;
- service: indicator_on
variables:
r: int
g: int
b: int
then:
- ehmtx.indicator.on:
id: rgb8x32
red: !lambda return r;
green: !lambda return g;
blue: !lambda return b;
- service: force_screen
variables:
icon_name: string
then:
- ehmtx.force.screen:
id: rgb8x32
icon_name: !lambda return icon_name;
- service: text_color
variables:
r: int
g: int
b: int
then:
lambda: |-
id(rgb8x32)->set_text_color(r,g,b);
- service: alarm_color
variables:
r: int
g: int
b: int
then:
lambda: |-
id(rgb8x32)->set_alarm_color(r,g,b);
- service: indicator_off
then:
- ehmtx.indicator.off:
id: rgb8x32
- service: clock_text_color
variables:
r: int
g: int
b: int
then:
lambda: |-
id(rgb8x32)->set_clock_color(r,g,b);
id(rgb8x32)->set_today_color(r,g,b);
number:
- platform: template
name: "$devicename brightness"
min_value: 0
max_value: 255
step: 1
lambda: |-
return id(rgb8x32)->get_brightness();
set_action:
lambda: |-
id(rgb8x32)->set_brightness(x);
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: $mypin
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
timezone: "Asia/Manila"
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: 100ms
auto_clear_enabled: true
lambda: |-
id(rgb8x32)->tick();
id(rgb8x32)->draw();
ehmtx:
id: rgb8x32
# show_clock: 5
show_screen: 5
display8x32: ehmtx_display
time: ehmtx_time
time_format: "%I:%M"
date_format: "%m.%d"
week_start_monday: true
duration: 7
font_id: ehmtx_font
icons:
- file: _icons/1918.gif #https://awtrix.blueforcer.de/icons/1918
duration: 200
pingpong: true
id: heart
- url: https://awtrix.blueforcer.de/icons/175
id: phflag
- url: https://awtrix.blueforcer.de/icons/1286
duration: 10000
id: weather
- file: _icons/warning.gif #https://awtrix.blueforcer.de/icons/1901
duration: 100
id: warning
- url: https://awtrix.blueforcer.de/icons/766
id: smiley
I noticed when EsphoMaTrix is connected to home assistant that it’s reporting temperature and humidity but from our investigations the Ulanzi doesn’t appear to have such sensors. Is this an omission from the provided sample or have we missed seeing these sensors 🤣.
On testing the sample Ulanzi .yaml file I noticed the speed of communication between Home Assistant and Ulanzi to be quite slow. There was a number of seconds between changes.
Appreciate this is still in early stages of development but just wanted to flag 😀.
Hi.
Sorry for garbled issue, accidentally hit Enter while typing.
Don't hesitate to tell me if I'm asking something wrong, but I'm not sure where to start debugging.
I use 30-pin WROOM 32 for this project, want to build an informer from a 8x32 LED panel, I'm using standart GPIO16(D2) for data and VIN/GDN for LED power.
ESP32 was tested with WLED project so I know it works fine, power supply is USB charger 5V/3A.
For testing purposes I removed icons from ESPHome code and changed font file with bitmap Cozette (https://github.com/slavfox/Cozette, font size 13px), everything else left untouched.
On your video switching power makes matrix display "01.01", but my stays unlit blank, what could I miss?
Again, feel free to move issue if I'm not supposed to ask such things here.
Thank you advance.
Hi all together.
I am trying to do a Esphomatrix Panel but I have Problems to get it running.
Home Assistant detects the ESPHome Device automaticly, so it is already in my WiFi.
But when i try to configure it, ist gives me an Error:
Here is my YAML file:
substitutions:
devicename: esphomatrix-01
mypin: D3
board: d1_mini
external_components:
- source:
type: git
url: https://github.com/lubeda/EsphoMaTrix
esphome:
name: $devicename
on_boot:
priority: -100
then:
- ehmtx.text.color:
id: rgb8x32
red: !lambda return 200;
blue: !lambda return 170;
- ehmtx.today.color:
id: rgb8x32
red: !lambda return 10;
green: !lambda return 250;
- ehmtx.clock.color:
id: rgb8x32
red: !lambda return 50;
green: !lambda return 150;
blue: !lambda return 230;
- ehmtx.alarm.color:
id: rgb8x32
red: !lambda return 250;
green: !lambda return 50;
blue: !lambda return 30;
- ehmtx.weekday.color:
id: rgb8x32
red: !lambda return 250;
green: !lambda return 50;
blue: !lambda return 30;
esp8266:
board: $board
font:
- file: _fonts/monobit.ttf
id: ehmtx_font
size: 16
glyphs: |
!?"%()+*=,-_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz€@<>/
logger:
binary_sensor:
- platform: status
name: "$devicename Status"
# Enable Home Assistant API
api:
encryption:
key: "MYKEYMYKEYMYKEYMYKEYMYKEYMYKEYMYKEYMYKEY"
services:
- service: alarm
variables:
icon_name: string
text: string
then:
lambda: |-
id(rgb8x32)->add_screen(icon_name,text,7,true);
id(rgb8x32)->force_screen(icon_name);
- service: screen
variables:
icon_name: string
text: string
then:
- ehmtx.add.screen:
id: rgb8x32
text: !lambda return text;
icon_name: !lambda return icon_name;
alarm: false
- service: brightness
variables:
brightness: int
then:
lambda: |-
id(rgb8x32)->set_brightness(brightness);
- service: status
then:
lambda: |-
id(rgb8x32)->get_status();
- service: del_screen
variables:
icon_name: string
then:
- ehmtx.delete.screen:
id: rgb8x32
icon_name: !lambda return icon_name;
- service: indicator_on
variables:
r: int
g: int
b: int
then:
- ehmtx.indicator.on:
id: rgb8x32
red: !lambda return r;
green: !lambda return g;
blue: !lambda return b;
- service: force_screen
variables:
icon_name: string
then:
- ehmtx.force.screen:
id: rgb8x32
icon_name: !lambda return icon_name;
- service: text_color
variables:
r: int
g: int
b: int
then:
lambda: |-
id(rgb8x32)->set_text_color(r,g,b);
- service: clock_color
variables:
r: int
g: int
b: int
then:
- ehmtx.clock.color:
id: rgb8x32
red: !lambda return r;
green: !lambda return g;
blue: !lambda return b;
- service: alarm_color
variables:
r: int
g: int
b: int
then:
lambda: |-
id(rgb8x32)->set_alarm_color(r,g,b);
- service: indicator_off
then:
- ehmtx.indicator.off:
id: rgb8x32
ota:
password: "myOtaPassword"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: $devicename
password: "InM2TlqVfJe4"
light:
- platform: neopixelbus
id: ehmtx_light
type: GRB
variant: WS2812
pin: $mypin
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);
number:
- platform: template
name: "LED brightness"
min_value: 0
max_value: 255
step: 1
lambda: |-
return id(rgb8x32)->get_brightness();
set_action:
lambda: |-
id(rgb8x32)->set_brightness(x);
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();
ehmtx:
id: rgb8x32
show_clock: 4
show_screen: 6
display8x32: ehmtx_display
time: ehmtx_time
duration: 7
font_id: ehmtx_font
on_next_screen:
- homeassistant.event:
event: esphome.next_screen
data_template:
iconname: !lambda "return x.c_str();"
text: !lambda "return y.c_str();"
icons:
- awtrixid: 1851
id: heart
I have rearly no Idea what could be wrong.
Maybe someone here with some Ideas?
THX @ all
David
If I use your example, everything works fine.
esphome:
name: $devicename
on_boot:
priority: -100
then:
- ehmtx.text.color:
id: rgb8x32
red: !lambda return 200;
blue: !lambda return 170;
- ehmtx.today.color:
id: rgb8x32
red: !lambda return 10;
green: !lambda return 250;
- ehmtx.clock.color:
id: rgb8x32
red: !lambda return 50;
green: !lambda return 150;
blue: !lambda return 230;
- ehmtx.weekday.color:
id: rgb8x32
red: !lambda return 250;
green: !lambda return 50;
blue: !lambda return 30;
If I add an alarm color, the compilation will fail
- ehmtx.alarm.color:
id: rgb8x32
red: !lambda return 250;
green: !lambda return 50;
blue: !lambda return 30;
src/main.cpp:76:10: error: 'SetAlarmColor' in namespace 'esphome' does not name a template type; did you mean 'SetClockColor'?
76 | esphome::SetAlarmColor<> *esphome_setalarmcolor;
| ^~~~~~~~~~~~~
| SetClockColor
/config/esphome/led-8x32.yaml: In function 'void setup()':
/config/esphome/led-8x32.yaml:42:3: error: 'esphome_setalarmcolor' was not declared in this scope; did you mean 'esphome_setclockcolor'?
42 | id: rgb8x32
| ^ ~~~~~~~~~~~
| esphome_setclockcolor
/config/esphome/led-8x32.yaml:42:40: error: 'SetAlarmColor' in namespace 'esphome' does not name a template type; did you mean 'SetClockColor'?
42 | id: rgb8x32
| ^
| SetClockColor
/config/esphome/led-8x32.yaml:42:54: error: expected primary-expression before '>' token
42 | id: rgb8x32
| ^
/config/esphome/led-8x32.yaml:47:143: error: cannot convert '<brace-enclosed initializer list>' to 'const std::vector<esphome::Action<>*, std::allocator<esphome::Action<>*> >&'
47 | esp8266:
| ^
In file included from src/esphome/components/display/display_buffer.h:5,
from src/esphome/components/addressable_light/addressable_light_display.h:5,
from src/esphome.h:3,
from src/main.cpp:3:
src/esphome/core/automation.h:237:56: note: initializing argument 1 of 'void esphome::Automation<Ts>::add_actions(const std::vector<esphome::Action<Ts ...>*>&) [with Ts = {}]'
237 | void add_actions(const std::vector<Action<Ts...> *> &actions) { this->actions_.add_actions(actions); }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
*** [/data/led-8x32/.pioenvs/led-8x32/src/main.cpp.o] Error 1
Hi,
since the removal of the awtrixid feature I've changed the icons to url mode. Sadly the GIF icons don't move at all and are static.
What do I have to do to get moving icons?
Cheers
Marco
Hello.
Just got my Ulanzi clock yesterday and managed to get EsphoMaTrix working on it. Great work, thanks in advance.
In "other" clock applications I used (awtrix, for instance), these __ __ only appeared in case more than 1 information was to be shown (date, day of week, etc).
As per my personal settings, I usually only display the clock, so I wonder if removing the __ __ appearing below the clock is feasible, in case only time is set to be displayed.
Thanks in advance.
Hello, I have a flexible 32x8 led matrix, I sent your scirpt to my esp, but the lighting of the leds is not in the right place, and I can't understand what to modify , and I did not find other examples on the internet, on PixelIT I must set to Row major. Can you help me please; thanks in advance
Even if the indicator in the right bottom corner is turned off it still does not allow the font on top of it to show which makes it look like some LEDs are broken.
Hi,
First of all, thank you for this awesome project of yours! Im using it at the moment and it is fantastic! If i may request, is it possible to have as a setting the hour and date formats. Say 12 hour format for the hours or the inclusion of seconds and for the dates, the inclusion of year and changing to different locale.
Thanks!
Seeing show_time
as new parameter for add_screen
service starting from 2023.4.0, has reminded of an issue/limitation that might be solved in a similar way.
Allowing a text_color
to be set differently for each screen, rather than using the last set text_color
for each active screen. The text_color
as of today could be used as a global screen default, optionally changeable per screen and valid for that screen only.
Right now if I have an active screen with a color and I start a new simultaneous screen with a different color, text for both screens will be displayed using the new color.
Would this be something possibly/easily implementable?
Thanks in advance for all the great work you've been doing in this custom component.
I tried implementing skip_screen function on left button or as a service but got compiler errors. readme refers to it but the code doesn't have the function
Hi, is it possible to have a new method to have an instant alert screen? I have tried to add a screen, and force that screen but it didn't work immediately. I'm looking for something that will stop the current loop, display the alert, then go back to the loop.
Using latest Home Assistant Version & ESPHome with a D1 Mini I get a compile error:
INFO Reading configuration /config/esphome/matrix.yaml...
INFO Detected timezone 'Europe/Berlin'
INFO Generating C++ source...
Traceback (most recent call last):
File "/usr/local/bin/esphome", line 33, in
sys.exit(load_entry_point('esphome', 'console_scripts', 'esphome')())
File "/esphome/esphome/main.py", line 825, in main
return run_esphome(sys.argv)
File "/esphome/esphome/main.py", line 812, in run_esphome
rc = POST_CONFIG_ACTIONS[args.command](args, config)
File "/esphome/esphome/main.py", line 326, in command_compile
exit_code = write_cpp(config)
File "/esphome/esphome/main.py", line 159, in write_cpp
generate_cpp_contents(config)
File "/esphome/esphome/main.py", line 171, in generate_cpp_contents
CORE.flush_tasks()
File "/esphome/esphome/core/init.py", line 613, in flush_tasks
self.event_loop.flush_tasks()
File "/esphome/esphome/coroutine.py", line 245, in flush_tasks
next(task.iterator)
File "/esphome/esphome/main.py", line 151, in wrapped
await coro(conf)
File "/config/esphome/.esphome/external_components/66a08d7e/components/ehmtx/init.py", line 560, in to_code
espImage.IMAGE_TYPE["RGB565"],
KeyError: 'RGB565'
Any hints for me? I used one single Icon in the yaml, tried different file formats (gif, png) but as far as I understand this should not be the issue here. I tried to replace the Key RGB585 with RGB24, which throws another error. (I have to admit I have no clue what I am doing there ;) )
If I replace the Key with RGB24 in the code, this error is thrown:
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- 1.0
|-- 1.2
|-- 2.6.9
| |-- 1.0
Compiling /data/matrix/.pioenvs/matrix/src/esphome/components/ehmtx/EHMTX_icons.cpp.o
Compiling /data/matrix/.pioenvs/matrix/lib67b/ESP8266WiFi/ESP8266WiFiGratuitous.cpp.o
Compiling /data/matrix/.pioenvs/matrix/lib67b/ESP8266WiFi/ESP8266WiFiMulti.cpp.o
Compiling /data/matrix/.pioenvs/matrix/lib67b/ESP8266WiFi/ESP8266WiFiSTA-WPS.cpp.o
Compiling /data/matrix/.pioenvs/matrix/lib67b/ESP8266WiFi/ESP8266WiFiSTA.cpp.o
Compiling /data/matrix/.pioenvs/matrix/lib67b/ESP8266WiFi/ESP8266WiFiScan.cpp.o
Compiling /data/matrix/.pioenvs/matrix/lib67b/ESP8266WiFi/WiFiClient.cpp.o
src/esphome/components/ehmtx/EHMTX_icons.cpp: In member function 'void esphome::EHMTX_Icon::next_frame()':
src/esphome/components/ehmtx/EHMTX_icons.cpp:33:20: error: 'prev_frame' is not a member of 'esphome::display::Animation'
33 | Animation::prev_frame();
| ^~~~~~~~~~
Compiling /data/matrix/.pioenvs/matrix/lib67b/ESP8266WiFi/WiFiClientSecureBearSSL.cpp.o
*** [/data/matrix/.pioenvs/matrix/src/esphome/components/ehmtx/EHMTX_icons.cpp.o] Error 1
========================= [FAILED] Took 15.85 seconds =========================
I would be happy for anything pointing me into the right direction. Thank you! :)
The gauge seems to always start with 2 pixels even at 1% which is a loss of detail in my opinion.
It would be nice to have 12.5% per pixel (assuming 8 pixel height) or a way to configure the steps.
Hi, I have the Ulanzi clock and so far so good! One question: how do I center the text? For example if I want to display the temperature, 40°
, it shows it left aligned next to icon. I'd rather it centered. Thoughts?
sensor:
but I can't put it in loop at the date and time, could you tell me how to insert it? bearing in mind that I am using the sample code
thank you very much if anyone replies
For some reason whenever i dont have a screen displayed and just the clock and date are showing, the lights goes on and then boot loop so the workaround i did was to automate it in home assistant so that when the light goes on, it will turn it off.
substitutions:
devicename: ehmtx8266
mypin: GPIO02
# GPIO04
external_components:
- source:
type: git
url: https://github.com/lubeda/EsphoMaTrix
ref: date-time
refresh: 120s
components: [ ehmtx ]
#type: local
#path: components/components
esphome:
name: $devicename
on_boot:
priority: -100
then:
- ehmtx.text.color:
id: rgb8x32
red: !lambda return 200;
green: !lambda return 200;
blue: !lambda return 200;
- ehmtx.today.color:
id: rgb8x32
red: !lambda return 255;
green: !lambda return 165;
blue: !lambda return 0;
- ehmtx.clock.color:
id: rgb8x32
red: !lambda return 255;
green: !lambda return 165;
blue: !lambda return 0;
- ehmtx.weekday.color:
id: rgb8x32
red: !lambda return 0;
green: !lambda return 128;
blue: !lambda return 128;
- lambda: !lambda |-
id(rgb8x32)->show_all_icons();
esp8266:
board: nodemcuv2
font:
- file: monobit.ttf
id: ehmtx_font
size: 16
glyphs: |
!?"%()+*=,-_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz€@<>/
binary_sensor:
- platform: status
name: "$devicename Status"
logger:
# Enable Home Assistant API
api:
services:
- service: show_all_icons
then:
lambda: |-
id(rgb8x32)->show_all_icons();
- service: alarm
variables:
icon_name: string
text: string
then:
lambda: |-
id(rgb8x32)->add_screen(icon_name,text,7 ,true);
id(rgb8x32)->force_screen(icon_name);
- service: screen
variables:
icon_name: string
text: string
then:
- ehmtx.add.screen:
id: rgb8x32
text: !lambda return text;
icon_name: !lambda return icon_name;
duration: 1440
alarm: false
- service: brightness
variables:
brightness: int
then:
lambda: |-
id(rgb8x32)->set_brightness(brightness);
- service: status
then:
lambda: |-
id(rgb8x32)->get_status();
- service: del_screen
variables:
icon_name: string
then:
- ehmtx.delete.screen:
id: rgb8x32
icon_name: !lambda return icon_name;
- service: indicator_on
variables:
r: int
g: int
b: int
then:
- ehmtx.indicator.on:
id: rgb8x32
red: !lambda return r;
green: !lambda return g;
blue: !lambda return b;
- service: force_screen
variables:
icon_name: string
then:
- ehmtx.force.screen:
id: rgb8x32
icon_name: !lambda return icon_name;
- service: text_color
variables:
r: int
g: int
b: int
then:
lambda: |-
id(rgb8x32)->set_text_color(r,g,b);
- service: alarm_color
variables:
r: int
g: int
b: int
then:
lambda: |-
id(rgb8x32)->set_alarm_color(r,g,b);
- service: indicator_off
then:
- ehmtx.indicator.off:
id: rgb8x32
- service: clock_text_color
variables:
r: int
g: int
b: int
then:
lambda: |-
id(rgb8x32)->set_clock_color(r,g,b);
id(rgb8x32)->set_today_color(r,g,b);
number:
- platform: template
name: "$devicename brightness"
min_value: 0
max_value: 255
step: 1
lambda: |-
return id(rgb8x32)->get_brightness();
set_action:
lambda: |-
id(rgb8x32)->set_brightness(x);
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: $mypin
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
timezone: "Asia/Manila"
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: 100ms
auto_clear_enabled: true
lambda: |-
id(rgb8x32)->tick();
id(rgb8x32)->draw();
ehmtx:
id: rgb8x32
# show_clock: 5
show_screen: 5
display8x32: ehmtx_display
time: ehmtx_time
time_format: "%I:%M"
date_format: "%m.%d"
week_start_monday: true
duration: 7
font_id: ehmtx_font
icons:
- file: _icons/1918.gif #https://awtrix.blueforcer.de/icons/1918
duration: 200
pingpong: true
id: heart
- url: https://awtrix.blueforcer.de/icons/175
id: phflag
- url: https://awtrix.blueforcer.de/icons/1286
duration: 10000
id: weather
- file: _icons/warning.gif #https://awtrix.blueforcer.de/icons/1901
duration: 100
id: warning
- url: https://awtrix.blueforcer.de/icons/766
id: smiley
Hi,
When I use the force screen feature, the timer is not reset. Depending on when the service is called, the message can sometimes be barely visible. Would it be possible to force the reset of the timer?
Thanks in advance.
Hi,
After updating to 2023.03.05, brightness service and this code to show and adjust brightness are no longer working: no matter what interger value you user with "brightness" service, or how much you move the brightness slider, return brightness value is always 0.
But real brightness is not 0 as figures and icons are visible in the screen.
Please advise.
`number:
Hi ,
my 8*32 matrix connected to an esp8266 shows only "random" pixels.
The screen seems to switch between two states, probably date and time, but it is not readable.
When i use awtrix i also had to select matriy type 2 or so. does this option exist here too?
best regards
Hey, I've started to have a look if it's possible to port this to a simple WS2812B 16x16 led matrix.
The concept is to have 2 rows (8x16 + 8x16), like:
Also to have background color settings (but I'm not sure if that's already implemented)
Do you think it's possible using this setup?
Thanks, awesome job btw :)
hello my matrix is perfectly functional, however the gifs are fixed, it does not move. THANKS
Hello I get an error when I want to send the code to my esp32
Error:
`INFO Reading configuration /config/esphome/esphomatrix.yaml...
INFO Detected timezone 'Europe/Paris'
INFO Generating C++ source...
/usr/lib/python3/dist-packages/PIL/Image.py:962: UserWarning: Palette images with Transparency expressed in bytes should be converted to RGBA images
warnings.warn(
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/requests/models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.9/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/esphome", line 33, in
sys.exit(load_entry_point('esphome', 'console_scripts', 'esphome')())
File "/esphome/esphome/main.py", line 963, in main
return run_esphome(sys.argv)
File "/esphome/esphome/main.py", line 950, in run_esphome
rc = POST_CONFIG_ACTIONS[args.command](args, config)
File "/esphome/esphome/main.py", line 395, in command_run
exit_code = write_cpp(config)
File "/esphome/esphome/main.py", line 176, in write_cpp
generate_cpp_contents(config)
File "/esphome/esphome/main.py", line 188, in generate_cpp_contents
CORE.flush_tasks()
File "/esphome/esphome/core/init.py", line 619, in flush_tasks
self.event_loop.flush_tasks()
File "/esphome/esphome/coroutine.py", line 246, in flush_tasks
next(task.iterator)
File "/esphome/esphome/main.py", line 168, in wrapped
await coro(conf)
File "/config/esphome/.esphome/external_components/66a08d7e/components/ehmtx/init.py", line 438, in to_code
awtrixdata = r.json()
File "/usr/local/lib/python3.9/dist-packages/requests/models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
`
My code:
`display:
Traceback (most recent call last):
File "/usr/local/bin/esphome", line 33, in
sys.exit(load_entry_point('esphome', 'console_scripts', 'esphome')())
File "/esphome/esphome/main.py", line 825, in main
return run_esphome(sys.argv)
File "/esphome/esphome/main.py", line 812, in run_esphome
rc = POST_CONFIG_ACTIONS[args.command](args, config)
File "/esphome/esphome/main.py", line 366, in command_run
exit_code = write_cpp(config)
File "/esphome/esphome/main.py", line 159, in write_cpp
generate_cpp_contents(config)
File "/esphome/esphome/main.py", line 171, in generate_cpp_contents
CORE.flush_tasks()
File "/esphome/esphome/core/init.py", line 613, in flush_tasks
self.event_loop.flush_tasks()
File "/esphome/esphome/coroutine.py", line 245, in flush_tasks
next(task.iterator)
File "/esphome/esphome/main.py", line 151, in wrapped
await coro(conf)
File "/config/esphome/.esphome/external_components/66a08d7e/components/ehmtx/init.py", line 560, in to_code
espImage.IMAGE_TYPE["RGB565"],
KeyError: 'RGB565'
I bought the higher resolution matrix and I thought it would just be a matter of changing the width and height in the code but when I do that it just crashes the whole thing. Am I doing this wrong?
Hello.
Recently bought an Ulanzi clock and glad to have EsphoMaTrix working on it.
While using awtrix, there are 2 things which I REALLY miss in EsphoMaTrix (and which I think that fits in its different purpose compared to awtrix), which is to:
Would this be something potentially implementable in the future?
Thanks in advance.
Hello,
So far I've been using awtrix, but I'm very enthusiastic about your project with the connection to HA.
With awtrix, I always have a lot of text stutters, so I'm just trying a comparable setup with your project.
But I somehow fail to set up a fixed loop behavior. I do not want to compare both projects in detail, but I think its somehow useful also for other beginners with your project.
I use the display to regularly display some room information, such as temperature and humidity.
This should simply be repeated at regular intervals.
clock (300s) -> room 1 (room name, temp, hum, co2) one time -> room 2 (room name, temp, hum, co2) one time -> room 3 (room name, temp, hum, co2) one time -> back to beginning with clock: clock for 300s.
Well, for the standard loop I have created a HA automation; in a sequence the screens are created. I have used a sequence, because there seems to be no other chance to specify a specific order of the messages/icons.
But I am not able to setup the described behavior above.
The room information is repeated all the time (room 1, room 2, room 3, room 1) and I think when the clock_interval is reached, the display jumps back to the clock from any position in the loop.
Its possible to setup this scenario?
If not yet, from your point of view, does an implementation make sense?
Additionally some other messages pop up, e.g. garage open - these messages shall be placed at the end of the standard loop and should not influence it. There could be a message with standard priority, which can be added at the end of the loop; but there could also be a prio message which should be shown directly.
Do you plan an implementation like this?
When I actually add a new screen with the HA service, its located "somewhere" in the sequence, but not at the end of the existing loop.
I have now written a lot of text, I would be happy about a feedback or discussion.
Hello Ludger,
I have the following setup of screens.
[19:53:27][I][EHMTX:287]: status time: 23.3.2023 19:53
[19:53:27][I][EHMTX:290]: status brightness: 80 (0..255)
[19:53:27][I][EHMTX:291]: status default duration: 10
[19:53:27][I][EHMTX:292]: status date format: %d.%m.
[19:53:27][I][EHMTX:293]: status time format: %H:%M
[19:53:27][I][EHMTX:294]: status text_color: RGB(40,128,248)
[19:53:27][I][EHMTX:295]: status alarm_color: RGB(248,48,24)
[19:53:27][I][EHMTX:302]: status indicator off
[19:53:27][I][EHMTX:306]: status display on
[19:53:27][I][EHMTX:141]: status active slot: 8
[19:53:27][I][EHMTX:142]: status screen count: 12 of 24
[19:53:27][I][EHMTX:149]: status slot 0 icon 22 text: 19:53 alarm: 0 dd: 8 sec end: 573 sec
[19:53:27][I][EHMTX:149]: status slot 1 icon 3 text: WOHNZIMMER alarm: 0 dd: 14 sec end: 393 sec
[19:53:27][I][EHMTX:149]: status slot 2 icon 0 text: 22.2 alarm: 0 dd: 7 sec end: 398 sec
[19:53:27][I][EHMTX:149]: status slot 3 icon 2 text: 50% alarm: 0 dd: 7 sec end: 403 sec
[19:53:27][I][EHMTX:149]: status slot 4 icon 1 text: 1088 alarm: 0 dd: 8 sec end: 408 sec
[19:53:27][I][EHMTX:149]: status slot 5 icon 7 text: SCHLAFZIMMER alarm: 0 dd: 16 sec end: 408 sec
[19:53:27][I][EHMTX:149]: status slot 6 icon 4 text: 20.7 alarm: 0 dd: 7 sec end: 413 sec
[19:53:27][I][EHMTX:149]: status slot 7 icon 6 text: 53% alarm: 0 dd: 7 sec end: 418 sec
[19:53:27][I][EHMTX:149]: status slot 8 icon 5 text: 970 alarm: 0 dd: 7 sec end: 423 sec
[19:53:27][I][EHMTX:149]: status slot 9 icon 17 text: DRAUSSEN alarm: 0 dd: 12 sec end: 423 sec
[19:53:27][I][EHMTX:149]: status slot 10 icon 16 text: 13.2 alarm: 0 dd: 7 sec end: 428 sec
[19:53:27][I][EHMTX:149]: status slot 11 icon 23 text: Dies ist ein langer Text. 12345678910111213141516171819202122232425 alarm: 0 dd: 12 sec end: 548 sec
The last screen shall display a longer text. It is send via the HA screen service.
But it is not shown completely - the first loop is interrupted at "Dies ist ein lan", the 2nd repetition is interrupted at "Dies ist ein".
It did not check if the issue occurs only in combination with the other screens, or if this is a general topic.
I expect somehow a limitation of the text length, but this seems to be an unexpected behavior.
Time / date switching does not work after updating ESPhome. I tried to add:
show_date: true
date_format: "%d.%m."
That didn't help. Only the time is still displayed.
hello i started today with your nice project everyone i run into 1 big problem with all icons with gif don't work i can't see any movement what am i doing wrong see configuration?
substitutions:
devicename: esphomatrix
mypin: GPIO4
board: nodemcuv2
external_components:
- source:
type: git
url: https://github.com/lubeda/EsphoMaTrix
esphome:
name: $devicename
on_boot:
priority: -100
then:
- ehmtx.text.color:
id: rgb8x32
red: !lambda return 200;
blue: !lambda return 170;
- ehmtx.today.color:
id: rgb8x32
red: !lambda return 10;
green: !lambda return 250;
- ehmtx.clock.color:
id: rgb8x32
red: !lambda return 50;
green: !lambda return 150;
blue: !lambda return 230;
- ehmtx.alarm.color:
id: rgb8x32
red: !lambda return 250;
green: !lambda return 50;
blue: !lambda return 30;
- ehmtx.weekday.color:
id: rgb8x32
red: !lambda return 250;
green: !lambda return 50;
blue: !lambda return 30;
esp8266:
board: $board
font:
- file: _fonts/monobit.ttf
id: ehmtx_font
size: 16
glyphs: |
!?"%()+*=,-_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz€@<>/
logger:
binary_sensor:
- platform: status
name: "$devicename Status"
# Enable Home Assistant API
api:
services:
- service: alarm
variables:
icon_name: string
text: string
then:
lambda: |-
id(rgb8x32)->add_screen(icon_name,text,7,true);
id(rgb8x32)->force_screen(icon_name);
- service: screen
variables:
icon_name: string
text: string
then:
- ehmtx.add.screen:
id: rgb8x32
text: !lambda return text;
icon_name: !lambda return icon_name;
alarm: false
- service: brightness
variables:
brightness: int
then:
lambda: |-
id(rgb8x32)->set_brightness(brightness);
- service: status
then:
lambda: |-
id(rgb8x32)->get_status();
- service: del_screen
variables:
icon_name: string
then:
- ehmtx.delete.screen:
id: rgb8x32
icon_name: !lambda return icon_name;
- service: indicator_on
variables:
r: int
g: int
b: int
then:
- ehmtx.indicator.on:
id: rgb8x32
red: !lambda return r;
green: !lambda return g;
blue: !lambda return b;
- service: force_screen
variables:
icon_name: string
then:
- ehmtx.force.screen:
id: rgb8x32
icon_name: !lambda return icon_name;
- service: text_color
variables:
r: int
g: int
b: int
then:
lambda: |-
id(rgb8x32)->set_text_color(r,g,b);
- service: clock_color
variables:
r: int
g: int
b: int
then:
- ehmtx.clock.color:
id: rgb8x32
red: !lambda return r;
green: !lambda return g;
blue: !lambda return b;
- service: alarm_color
variables:
r: int
g: int
b: int
then:
lambda: |-
id(rgb8x32)->set_alarm_color(r,g,b);
- service: indicator_off
then:
- ehmtx.indicator.off:
id: rgb8x32
ota:
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: $devicename
password: "InM2TlqVfJe4"
light:
- platform: neopixelbus
id: ehmtx_light
type: GRB
variant: WS2812
pin: $mypin
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);
number:
- platform: template
name: "LED brightness"
min_value: 0
max_value: 255
step: 1
lambda: |-
return id(rgb8x32)->get_brightness();
set_action:
lambda: |-
id(rgb8x32)->set_brightness(x);
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();
ehmtx:
id: rgb8x32
show_clock: 4
show_screen: 6
display8x32: ehmtx_display
time: ehmtx_time
duration: 7
html: true
font_id: ehmtx_font
on_next_screen:
- homeassistant.event:
event: esphome.next_screen
data_template:
iconname: !lambda "return x.c_str();"
text: !lambda "return y.c_str();"
icons:
- file: _icons/home.gif
id: thuis
- file: _icons/thuis-komst.gif
id: thuis_komst
- file: _icons/not-home.gif
id: weg
- file: _icons/weg-gaan.gif
id: weg_gaan
- file: _icons/deur-open.gif
id: deur_open
- file: _icons/door-gesloten.gif
id: deur_gesloten
- file: _icons/raam-open.gif
id: raam_open
- file: _icons/raam-gesloten.gif
id: raam_gesloten
- file: _icons/geen-post.png
id: geen_post
- file: _icons/wel-post.png
id: wel_post
- file: _icons/bewolk.png
id: bewolkt
- file: _icons/bliksem.gif
id: bliksem
- file: _icons/zon-met-regen.gif
id: zon_met_regen
- file: _icons/regen.gif
id: regen
- file: _icons/sneeuw-val.gif
id: sneeuw
- file: _icons/wind.gif
id: wind
- file: _icons/sun.gif
id: zon
- file: _icons/maan.png
id: maan
- file: _icons/hartje.gif
id: hartje
- file: _icons/i-love-you.gif
id: i_love_you
- file: _icons/loveman.png
id: loveman
- file: _icons/kushartje.png
id: kushartje
- file: _icons/i-love.png
id: i_love
- file: _icons/restafval.png
id: restafval
- file: _icons/pmd.png
id: pmd
- file: _icons/papier.png
id: papier
- file: _icons/geen-afval.png
id: geen_afval
- file: _icons/wel-afval.png
id: wel_afval
- file: _icons/Home-Assistant.png
id: home_assistant
- file: _icons/HomeAssistantgif.gif
id: home_assistant_gif
- file: _icons/instagram.png
id: instagram
- file: _icons/kerstboom_sneew.gif
id: kerstboom_sneew
- file: _icons/temperature.png
id: temperature
- file: _icons/calender.png
id: agenda
I had everything running nice and smooth for nearly a day :-) But now ESPHome is criticising the YAML which I copied 1:1 from the example and changed nothing. If I try to validate I get this:
INFO Reading configuration /config/esphome/pixelclock.yaml...
INFO Updating https://github.com/lubeda/EsphoMaTrix@None
WARNING
WARNING If you are upgrading EsphoMaTrix from a version before 2023.4.0,
WARNING you should read the section https://github.com/lubeda/EsphoMaTrix/#how-to-update for tipps.
WARNING
WARNING GPIO15 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
INFO Detected timezone 'Europe/Berlin'
INFO Detected timezone 'Europe/Berlin'
Failed config
ehmtx: [source /config/esphome/pixelclock.yaml:47]
'matrix_component' is a required option for [ehmtx].
id: rgb8x32
[display8x32] is an invalid option for [ehmtx]. Please check the indentation.
display8x32: ehmtx_display
[html] is an invalid option for [ehmtx]. Please check the indentation.
html: True
[show_clock] is an invalid option for [ehmtx]. Did you mean [show_dow], [show_seconds], [on_next_clock]?
show_clock: 5
clock_interval: 60
[show_screen] is an invalid option for [ehmtx]. Did you mean [show_seconds], [on_next_screen], [show_date]?
show_screen: 6
[duration] is an invalid option for [ehmtx]. Please check the indentation.
duration: 5
date_format: %d.%m
time_format: %H:%M
[dayofweek] is an invalid option for [ehmtx]. Please check the indentation.
dayofweek: False
show_date: True
week_start_monday: True
yoffset: 8
xoffset: 1
[scroll_intervall] is an invalid option for [ehmtx]. Did you mean [scroll_interval], [clock_interval], [frame_interval]?
scroll_intervall: 80
[anim_intervall] is an invalid option for [ehmtx]. Did you mean [frame_interval], [clock_interval], [scroll_interval]?
anim_intervall: 192
[time] is an invalid option for [ehmtx]. Did you mean [hold_time]?
time: ehmtx_time
font_id: ehmtx_font
icons:
- id: ha
lameid: 7956
- id: tempc
lameid: 2422
- id: plug
lameid: 403
- id: humidity
lameid: 51764
- id: co2
lameid: 30662
required key not provided
My YAML is this:
substitutions:
devicename: pixelclock1
matrix_pin: GPIO32
buzzer_pin: GPIO15
battery_pin: GPIO34
ldr_pin: GPIO35
left_button_pin: GPIO26
mid_button_pin: GPIO27
right_button_pin: GPIO14
scl_pin: GPIO22
sda_pin: GPIO21
external_components:
- source:
type: git
url: https://github.com/lubeda/EsphoMaTrix
refresh: 60s
components: [ ehmtx ]
esphome:
comment: "Pixeluhr1"
name: $devicename
on_boot:
then:
- ds1307.read_time:
esp32:
board: esp32dev
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
web_server:
font:
# adapt the filename to your local settings
- file: Calcium.ttf
id: ehmtx_font
size: 16
glyphs: |
!?"%‰()+*=,-_.:°µ²³0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnÖÄÜöäüopqrstuvwxyz€$@<>/
ehmtx:
id: rgb8x32
display8x32: ehmtx_display
html: true
show_clock: 5 # duration to display the clock after this time the date is display until next "show_screen"
clock_interval: 60 # show the clock at least each x seconds
show_screen: 6 # duration to display a screen or a clock/date sequence
duration: 5 # lifetime of a screen in minutes
date_format: "%d.%m" # defaults "%d.%m." (use "%m.%d." for the US)
time_format: "%H:%M" # defaults "%H:%M" (use "%I:%M%p" for the US)
dayofweek: false # draw the day indicator on the bottom of the screen, defaults to true
show_date: true # show the date for show_screen - show_clock seconds otherwise only shows the clock for show_screen seconds, defaults to true
week_start_monday: true # default monday is first day of week, false = sunday
yoffset: 8 # the text is aligned BASELINE_LEFT, the baseline defaults to 6
xoffset: 1 # the text is aligned BASELINE_LEFT, the left defaults to 1
scroll_intervall: 80 # the interval in ms to scroll the text (default=80), should be a multiple of the update_interval from the display (default: 16ms)
anim_intervall: 192 # the interval in ms to display the next anim frame (default=192), should be a multiple of the update_interval from the display (default: 16ms)
time: ehmtx_time
font_id: ehmtx_font
icons:
- id: ha
lameid: 7956
- id: tempc
lameid: 2422
- id: plug
lameid: 403
- id: humidity
lameid: 51764
- id: co2
lameid: 30662
binary_sensor:
- platform: status
name: "$devicename Status"
- platform: gpio
pin:
number: $left_button_pin
inverted: true
name: "$devicename left button"
on_press:
then:
- number.decrement: screen_brightness
- platform: gpio
pin:
inverted: true
number: $mid_button_pin
mode: INPUT_PULLUP
name: "$devicename middle button"
on_press:
then:
- switch.toggle: displaycontrol
- platform: gpio
pin:
number: $right_button_pin
inverted: true
name: "$devicename right button"
on_press:
then:
- number.increment: screen_brightness
# example to switch to next screen
# lambda: |-
# id(rgb8x32)->skip_screen();
logger:
level: INFO
# Enable Home Assistant API
api:
services:
- service: alarm
variables:
icon_name: string
text: string
then:
lambda: |-
id(rgb8x32)->add_screen(icon_name,text,7,true);
id(rgb8x32)->force_screen(icon_name);
- service: brightness
variables:
brightness: int
then:
lambda: |-
id(rgb8x32)->set_brightness(brightness);
- service: icons
then:
lambda: |-
id(rgb8x32)->show_all_icons();
- service: skip_screen
then:
lambda: |-
id(rgb8x32)->skip_screen();
- service: tuneplay
variables:
tune: string
then:
- rtttl.play:
rtttl: !lambda 'return tune;'
number:
- platform: template
name: "$devicename brightness"
id: screen_brightness
min_value: 0
max_value: 255
update_interval: 1s
step: 25
lambda: |-
return id(rgb8x32)->get_brightness();
set_action:
lambda: |-
id(rgb8x32)->set_brightness(x);
switch:
- platform: template
name: "$devicename Display"
id: displaycontrol
icon: "mdi:power"
restore_mode: ALWAYS_ON
lambda: |-
return id(rgb8x32)->show_display;
turn_on_action:
lambda: |-
id(rgb8x32)->set_display_on();
turn_off_action:
lambda: |-
id(rgb8x32)->set_display_off();
sensor:
- platform: sht3xd
temperature:
name: "$devicename Temperature"
humidity:
name: "$devicename Humidity"
update_interval: 60s
- platform: adc
pin: $battery_pin
name: "$devicename Battery"
id: battery_voltage
update_interval: 10s
device_class: battery
accuracy_decimals: 0
attenuation: auto
filters:
- sliding_window_moving_average:
window_size: 15
send_every: 15
send_first_at: 1
- multiply: 1.6
- lambda: |-
return ((x - 3) / 0.69 * 100.00);
unit_of_measurement: '%'
- platform: adc
id: light_sensor
name: "$devicename Illuminance"
pin: $ldr_pin
update_interval: 10s
attenuation: auto
unit_of_measurement: lx
accuracy_decimals: 0
filters:
- lambda: |-
return (x / 10000.0) * 2000000.0 - 15 ;
output:
- platform: ledc
pin: $buzzer_pin
id: rtttl_out
rtttl:
output: rtttl_out
i2c:
sda: 21
scl: 22
scan: true
id: bus_a
light:
- platform: neopixelbus
id: ehmtx_light
type: GRB
variant: WS2812
pin: $matrix_pin
num_leds: 256
color_correct: [30%, 30%, 30%]
name: "$devicename Light"
restore_mode: ALWAYS_OFF
on_turn_on:
lambda: |-
id(ehmtx_display)->set_enabled(false);
on_turn_off:
lambda: |-
id(ehmtx_display)->set_enabled(true);
time:
- platform: homeassistant
on_time_sync:
then:
ds1307.write_time:
- platform: ds1307
update_interval: never
id: ehmtx_time
display:
- platform: addressable_light
id: ehmtx_display
addressable_light_id: ehmtx_light
width: 32
height: 8
pixel_mapper: |-
if (y % 2 == 0) {
return (y * 32) + x;
}
return (y * 32) + (31 - x);
rotation: 0°
update_interval: 16ms
auto_clear_enabled: true
lambda: |-
id(rgb8x32)->tick();
id(rgb8x32)->draw();
any ideas what to do?
hello is it possible to set the startup screen brightness to your own set brightness ? so that it doesn't have to be done every time?
hello,
when I push the del_screen service from homeassistant to the display, it only change the icon to the first icon in my list and i have to send it again with this icon to really delete the screen.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.