Merge pull request #6 from lubeda/develop

Develop
pull/9/head
LuBeDa 3 years ago committed by GitHub
commit 9713398113
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,6 +1,6 @@
# EspHoMaTriX version 2 (EHMTXv2) # EspHoMaTriX version 2 (EHMTXv2)
## This is a prerelease beta version! ## **This is a prerelease beta version**
## Important information ## Important information
@ -28,7 +28,7 @@ But it had to be extensible, e.g. for the use as pool thermometer or as media pl
### Features ### Features
Based on a 8x32 RGB matrix, it displays a clock, the date and up to 24 other 'screens' provided by Home Assistant. Each screen (value/text) can be associated with a 8x8 bit RGB icon or GIF animation (see [installation](#installation)). The values/text can be updated or deleted from the display queue. Each screen has a lifetime, if not refreshed in its lifetime, it will disappear. Even 8x32 GIF animations are possible. You can control nearly everything of the component. Based on a 8x32 RGB matrix, it displays a clock, the date and up to 24 other 'screens' provided by Home Assistant. Each screen (value/text) can be associated with a 8x8 bit RGB icon or GIF animation (see [installation](#installation-of-esphomatrixv2-custom-component). The values/text can be updated or deleted from the display queue. Each screen has a lifetime, if not refreshed in its lifetime, it will disappear. Even 8x32 GIF animations are possible. You can control nearly everything of the component.
### State ### State
@ -596,7 +596,6 @@ sensor:
id(rgb8x32)->icon_screen("sun", text); // uses default values for color etc. id(rgb8x32)->icon_screen("sun", text); // uses default values for color etc.
``` ```
##### Force screen ##### Force screen
Force the selected [icon_screen](#icon-screen) ```icon_name``` to be displayed next. Afterward the loop continues from this screen. e.g. helpful for alarms. Or after an update of the value/text. Force the selected [icon_screen](#icon-screen) ```icon_name``` to be displayed next. Afterward the loop continues from this screen. e.g. helpful for alarms. Or after an update of the value/text.
@ -808,7 +807,6 @@ To control your display, it has to be integrated in Home Assistant. Then it prov
All communication with Home Assistant use the homeasistant-api. The services can be provided by default or also defined additionally in the YAML. To define the additional services you need the id of the ehmtx-component e.g. ```id(rgb8x32)```. All communication with Home Assistant use the homeasistant-api. The services can be provided by default or also defined additionally in the YAML. To define the additional services you need the id of the ehmtx-component e.g. ```id(rgb8x32)```.
### Use in Home Assistant automations ### Use in Home Assistant automations
The easiest way to use ehmtx as a status display is to use the icon names as trigger id. In my example I have an icon named "wind" when the sensor.wind_speed has a new state, this automation sends the new data to the screen with the icon named "wind" and so on. The easiest way to use ehmtx as a status display is to use the icon names as trigger id. In my example I have an icon named "wind" when the sensor.wind_speed has a new state, this automation sends the new data to the screen with the icon named "wind" and so on.
@ -977,7 +975,7 @@ sensor:
## Breaking changes ## Breaking changes
**nothing yet, since it is new** ### **nothing yet, since it is new**
## EspHoMaTriX in the media ## EspHoMaTriX in the media
@ -1013,6 +1011,7 @@ THE SOFTWARE IS PROVIDED "AS IS", use at your own risk!
- **[darkpoet78](https://github.com/darkpoet78/MatrixClockFonts)** for his work on optimized fonts - **[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 - **[pplucky](https://user-images.githubusercontent.com/16407309/224850723-634c9b2d-55d9-44f2-9f93-765c0485b090.GIF)** for his 8x32 GIF animation
- **[dennisse](https://github.com/dennisse)** Auto brightness for the Ulanzi - **[dennisse](https://github.com/dennisse)** Auto brightness for the Ulanzi
- ** everbody that found bugs/issues and reported them! - **[geekofweek](https://github.com/geekofweek)** fixed sample YAML
- **everbody** that found bugs/issues and reported them!
## Special thanks to all sponsors ## Special thanks to all sponsors

@ -554,6 +554,7 @@ namespace esphome
} }
EHMTX_queue *screen = this->find_icon_queue_element(icon); EHMTX_queue *screen = this->find_icon_queue_element(icon);
screen->icon_name = iconname; screen->icon_name = iconname;
screen->icon = icon;
screen->text = text; screen->text = text;
screen->endtime = this->clock->now().timestamp + lifetime * 60; screen->endtime = this->clock->now().timestamp + lifetime * 60;
screen->screen_time = screen_time; screen->screen_time = screen_time;

@ -179,51 +179,6 @@ EHMTX_SCHEMA = cv.Schema({
CONFIG_SCHEMA = cv.All(font.validate_pillow_installed, EHMTX_SCHEMA) CONFIG_SCHEMA = cv.All(font.validate_pillow_installed, EHMTX_SCHEMA)
SET_COLOR_ACTION_SCHEMA = cv.Schema(
{
cv.GenerateID(): cv.use_id(EHMTX_),
cv.Optional(CONF_RED,default="80"): cv.templatable(cv.uint8_t),
cv.Optional(CONF_BLUE,default="80"): cv.templatable(cv.uint8_t),
cv.Optional(CONF_GREEN,default="80"): cv.templatable(cv.uint8_t),
}
)
SetTodayColorAction = ehmtx_ns.class_("SetTodayColor", automation.Action)
@automation.register_action(
"ehmtx.today.color", SetTodayColorAction, SET_COLOR_ACTION_SCHEMA
)
async def ehmtx_set_today_color_action_to_code(config, action_id, template_arg, args):
paren = await cg.get_variable(config[CONF_ID])
var = cg.new_Pvariable(action_id, template_arg, paren)
template_ = await cg.templatable(config[CONF_RED], args, cg.int_)
cg.add(var.set_red(template_))
template_ = await cg.templatable(config[CONF_GREEN], args, cg.int_)
cg.add(var.set_green(template_))
template_ = await cg.templatable(config[CONF_BLUE], args, cg.int_)
cg.add(var.set_blue(template_))
return var
SetWeekdayColorAction = ehmtx_ns.class_("SetWeekdayColor", automation.Action)
@automation.register_action(
"ehmtx.weekday.color", SetWeekdayColorAction, SET_COLOR_ACTION_SCHEMA
)
async def ehmtx_set_week_color_action_to_code(config, action_id, template_arg, args):
paren = await cg.get_variable(config[CONF_ID])
var = cg.new_Pvariable(action_id, template_arg, paren)
template_ = await cg.templatable(config[CONF_RED], args, cg.int_)
cg.add(var.set_red(template_))
template_ = await cg.templatable(config[CONF_GREEN], args, cg.int_)
cg.add(var.set_green(template_))
template_ = await cg.templatable(config[CONF_BLUE], args, cg.int_)
cg.add(var.set_blue(template_))
return var
CODEOWNERS = ["@lubeda"] CODEOWNERS = ["@lubeda"]
async def to_code(config): async def to_code(config):

@ -1,5 +1,5 @@
substitutions: substitutions:
devicename: devicename: ulanzi
ledpin: GPIO32 ledpin: GPIO32
buzzerpin: GPIO15 buzzerpin: GPIO15
friendly_name: LED Matrix friendly_name: LED Matrix
@ -15,6 +15,7 @@ substitutions:
scl_pin: GPIO22 scl_pin: GPIO22
sda_pin: GPIO21 sda_pin: GPIO21
switch:
- platform: template - platform: template
name: "Auto-Adjust Brightness" name: "Auto-Adjust Brightness"
id: switch_autobrightness id: switch_autobrightness
@ -53,7 +54,7 @@ external_components:
- source: - source:
type: git type: git
url: https://github.com/lubeda/EspHoMaTriXv2 url: https://github.com/lubeda/EspHoMaTriXv2
ref: release ref: main
refresh: 60s refresh: 60s
components: [ ehmtxv2 ] components: [ ehmtxv2 ]
@ -98,6 +99,7 @@ logger:
level: WARN level: WARN
api: api:
services:
- service: tune - service: tune
variables: variables:
tune: string tune: string
@ -249,7 +251,7 @@ ehmtxv2:
url: https://user-images.githubusercontent.com/16407309/224850723-634c9b2d-55d9-44f2-9f93-765c0485b090.gif url: https://user-images.githubusercontent.com/16407309/224850723-634c9b2d-55d9-44f2-9f93-765c0485b090.gif
on_next_screen: on_next_screen:
- homeassistant.event: - homeassistant.event:
event: ehmtxv2.new_screen event: esphome.new_screen
data_template: data_template:
iconname: !lambda "return x.c_str();" iconname: !lambda "return x.c_str();"
text: !lambda "return y.c_str();" text: !lambda "return y.c_str();"

Binary file not shown.

@ -0,0 +1,118 @@
substitutions:
devicename: ehmtx8266
ledpin: GPIO02
external_components:
- source:
type: local
path: ./EspHoMaTriXv2/components
refresh: 60s
esphome:
name: $devicename
comment: 8x32 RGB Display in bedroom
binary_sensor:
- platform: status
name: "$devicename Status"
esp8266:
board: d1_mini
font:
- file: EHMTXv2.ttf
id: default_font
size: 16
glyphs: |
!"%()+*=,-_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz€@üöäÜÖÄß
logger:
level: WARN
# Enable Home Assistant API
api:
ota:
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
light:
- platform: neopixelbus
id: ehmtx_light
type: GRB
variant: WS2812
pin: $ledpin
num_leds: 256
color_correct: [30%, 30%, 30%]
name: "$devicename Light"
restore_mode: ALWAYS_OFF
effects:
- e131:
universe: 1
channels: RGB
on_turn_on:
lambda: |-
id(ehmtx_display)->set_enabled(false);
on_turn_off:
lambda: |-
id(ehmtx_display)->set_enabled(true);
e131:
method: multicast # default: register E1.31 to Multicast group
time:
- platform: homeassistant
id: ehmtx_time
on_time: !include ehmtx_on_time.yaml
display:
- platform: addressable_light
id: ehmtx_display
addressable_light_id: ehmtx_light
width: 32
height: 8
pixel_mapper: |-
if (x % 2 == 0) {
return (x * 8) + y;
}
return (x * 8) + (7 - y);
rotation: 0°
update_interval: 16ms
auto_clear_enabled: true
lambda: |-
id(rgb8x32)->tick();
id(rgb8x32)->draw();
ehmtxv2:
id: rgb8x32
show_seconds: true
rainbow_interval: 32
matrix_component: ehmtx_display
time_component: ehmtx_time
icons2html: true
default_font_id: default_font
special_font_id: default_font
special_font_yoffset: 6
default_font_yoffset: 6
icons:
- id: xani
lameid: 6075
- id: xsta
lameid: 11236
- url: https://developer.lametric.com/content/apps/icon_thumbs/48720.gif
pingpong: true
id: pipo
frame_duration: 300
- lameid: 5965
frame_duration: 180
id: d180
- lameid: 5965
frame_duration: 80
id: d080
- id: fullscreen
file: sample8x32.gif
- id: samplegif
file: sample8x8.gif

Binary file not shown.
Loading…
Cancel
Save