Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
Merge pull request #68 from lubeda/8x32
Browse files Browse the repository at this point in the history
8x32
  • Loading branch information
lubeda authored Mar 25, 2023
2 parents 5644ca3 + 2542f19 commit 6ed829c
Show file tree
Hide file tree
Showing 12 changed files with 352 additions and 492 deletions.
30 changes: 20 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,36 @@
# Changelog

## 2023.3.5
- new: show_seconds indicator top left corner
- breaking: removed automatic scaling of images
- new: support 8x32 icons without text
- breaking: added status,display_on,display_off as default service => remove these from your yaml
- breaking: added indicator_on/off as default service => remove these from your yaml
- breaking: added alarm_color,text_color,clock_color as default service => remove these from your yaml
- breaking: gauge is also schown while the clock is displayed but without moving the screen to the right
- breaking: show_icons as default service => remove from yaml

## 2023.3.4

added: option to not display clock/date #53
added: dynamic set_show_clock
added: on_next_clock trigger
- added: option to not display clock/date #53
- added: dynamic set_show_clock
- added: on_next_clock trigger

## 2023.3.3

fixed: force_screen skips imediatly to the selected screen
added: hold_time configurable
- fixed: force_screen skips imediatly to the selected screen
- added: hold_time configurable

## 2023.3.2

added: hold_screen for 20 additional seconds
- added: hold_screen for 20 additional seconds

## 2023.3.1

added: del_screen with wildcards
changed: maximum icons to 80
fixed: skip_next
fixed: show_all_icons on boot
- added: del_screen with wildcards
- changed: maximum icons to 80
- fixed: skip_next
- fixed: show_all_icons on boot

## 2023.3.0

Expand Down
110 changes: 53 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ There are some "RGB-matrix" status displays/clocks out there, the commercial one

The other d.i.y. solutions have their pros and cons. I tried both 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. The main reason, for me is the Home Assistant integration!

There is a little hype around the Ulanzi TC001 pixel clock. This hardware can be used with **EspHoMaTriX** (with some limitations). You can connect the device and flash it via USB-C. As a starting point you can use the [``UlanziTC001.yaml``](https://github.com/lubeda/EsphoMaTrix/blob/main/UlanziTC001.yaml). Yet the LDR and battery sensor are not perfectly supported. For another use of the hardware see [PixelIT_Ulanzi](https://github.com/aptonline/PixelIt_Ulanzi) firmware.
There is a little hype around the Ulanzi TC001 pixel clock. This hardware can be used with **EspHoMaTriX** (with some limitations). You can connect the device and flash it via USB-C. As a starting point you can use the [``UlanziTC001.yaml``](https://github.com/lubeda/EsphoMaTrix/blob/main/UlanziTC001.yaml). Yet the LDR and battery sensor are not perfectly supported. For another use of the hardware see [PixelIT_Ulanzi](https://github.com/aptonline/PixelIt_Ulanzi) or [AWTRIX-LIGHT](https://github.com/Blueforcer/awtrix-light) firmwares.

See this German tutorial video with information on setting up your display [RGB-LED Status Display für Home Assistant mit ESPHome | ESPHoMaTrix](https://www.youtube.com/watch?v=DTd9vAhet9A).

Another german tutorial video focused at the Ulanzi [Smarte Pixel Clock über Home Assistant steuern - Entitäten / Icons und mehr in der Ulanzi](https://www.youtube.com/watch?v=LgaT0mNbl34)

See this [nice article](https://blakadder.com/esphome-pixel-clock/) about EsphoMaTrix on a Ulanzi TC001 from [blakadder](https://github.com/blakadder).

See this english discussions:
Expand All @@ -26,12 +28,11 @@ See this english discussions:
Or in german:
[Showroom](https://community.simon42.com/t/8x32-pixel-uhr-mit-homeassistant-anbindung/1076)


### State

It is a working solution with core functionality coded. Advanced features, like automatic brightness control can be done with esphome actions and automations.

See it in action on [YouTube](https://www.youtube.com/watch?v=ZyaFj7ArIdY) (boring, no sound but subtitles).
See it in action on [YouTube](https://www.youtube.com/watch?v=ZyaFj7ArIdY) (no sound but subtitles).

### Features

Expand Down Expand Up @@ -93,7 +94,7 @@ font:
### Icons and Animations
Download and install all needed icons (.jpg/.png) and animations (.gif) under the `ehmtx:` key. All icons are automagically scaled to 8x8 on compile-time. This doesn't work well for gif's, you will have to resize them beforehand!
Download and install all needed icons (.jpg/.png) and animations (.gif) under the `ehmtx:` key. All icons have to be 8x8 or 8x32 piksels.

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.

Expand Down Expand Up @@ -123,7 +124,7 @@ First defined icon will be used as a fallback icon in case of an error, e.g. if

GIFs are limited to 16 frames to limit the flash space. The first icon in your list is the fallback.

All other solutions provide ready made icons, especially Lametric has a big database of [icons](https://developer.lametric.com/icons). Please check the copyright of the icons you use. The amount of icons is limited to 64 in the code and also by the flash space and the RAM of your board.
All other solutions provide ready made icons, especially Lametric has a big database of [icons](https://developer.lametric.com/icons). Please check the copyright of the icons you use. The amount of icons is limited to 80 in the code and also by the flash space and the RAM of your board.

***Parameters***

Expand Down Expand Up @@ -165,17 +166,6 @@ esphome:
id(rgb8x32)->show_all_icons();
```

Here you can show all of your icons via a service call:

```yaml
api:
services:
- service: icons
then:
lambda: |-
id(rgb8x32)->show_all_icons();
```

### esphome custom component

#### local use
Expand Down Expand Up @@ -266,6 +256,8 @@ binary_sensor:
**date_format** (Optional, string): formats the date display with [strftime syntax](https://esphome.io/components/time.html?highlight=strftime), defaults `"%d.%m."` (use `"%m.%d."` for the US)
**show_seconds** (Optional, boolean): toggle an indicator for seconds while the clock is displayed (default: false))
**time_format** (Optional, string): formats the date display with [strftime syntax](https://esphome.io/components/time.html?highlight=strftime), defaults `"%H:%M"` (use `"%I:%M%p"` for the US)
**yoffset** (Optional, pixel): yoffset the text is aligned BASELINE_LEFT, the baseline defaults to `6`
Expand Down Expand Up @@ -320,7 +312,7 @@ There is a trigger available to do some local magic. The trigger ```on_next_scre

See the examples:

##### Write information to log
##### Write information to homeassistant log

```yaml
ehmtx:
Expand Down Expand Up @@ -407,7 +399,7 @@ Force the selected screen ```icon_name``` to be displayed next. Afterwards the l
icon_name: !lambda return icon_name;
```

##### Set (text/alarm/clock/weekday/today) color action
##### Set (alarm/clock/gauge/text/today/weekday) color action

Sets the color of the select element

Expand All @@ -423,11 +415,12 @@ You have to use use id of your ehmtx component, e.g. `rgb8x32`

valid elements:

- `ehmtx.text.color:`
- `ehmtx.alarm.color:`
- `ehmtx.clock.color:`
- `ehmtx.weekday.color:`
- `ehmtx.gauge.color:`
- `ehmtx.text.color:`
- `ehmtx.today.color:`
- `ehmtx.weekday.color:`
- ```red, green, blue```: the color components (`0..255`) _(default = `80`)_

*Example*
Expand Down Expand Up @@ -458,29 +451,6 @@ esphome:
blue: !lambda return 30;
```

##### Indicator on

The indicator is a static colored corner on the display.

You have to use use id of your ehmtx component, e.g. ```rgb8x32```

```yaml
- ehmtx.indicator.on:
id: rgb8x32
red: !lambda return r;
green: !lambda return g;
blue: !lambda return b;
```

- ```red, green, blue```: the color components (0..255) (default=80)

##### Indicator off

```yaml
- ehmtx.indicator.off:
id: rgb8x32
```

##### Add screen to loop

```yaml
Expand All @@ -506,7 +476,7 @@ Adapt all other data in the yaml to your needs, I use GPIO04/GPIO16 (esp8266/ESP

## Integration in Home Assistant

To control your display it has to be integrated in Home Assistant. Then it provides at least three services, all prefixed with the configured `devicename` e.g. "ehmtx". See the [sample yaml](https://github.com/lubeda/EsphoMaTrix/blob/main/ehmtx32.yaml) for the default services, but you can add your own.
To control your display it has to be integrated in Home Assistant. Then it provides a number of services, all prefixed with the configured `devicename` e.g. "ehmtx". See the default services marked as **(D)** [below](https://github.com/lubeda/EsphoMaTrix#services), but you can add your own.

### Use the light component

Expand All @@ -529,7 +499,7 @@ light:

### Services

All communication with Home Assistant use the homeasistant-api. The services are defined in the yaml. To define the 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)```.

*Example*

Expand All @@ -545,7 +515,7 @@ api:
id(rgb8x32)->add_screen(icon_name, text, 7, true); // 7 Minutes alarm=true
```

Service **_brightness**
**(D)** Service **brightness**

Sets the overall brightness of the display (`0..255`)

Expand All @@ -569,7 +539,7 @@ number:
id(rgb8x32)->set_brightness(x);
```

Service **_screen**
Service **screen**

Queues a screen with an icon/animation and a text. There can only be one text per icon id. If you need to show e.g. an indoor and an outdoor temperature you have to use different icon id's!

Expand All @@ -580,7 +550,7 @@ _parameters:_
- ```icon_name```: The number of the predefined icons (see installation)
- ```text```: The text to be displayed

Service **_screen_t**
Service **screen_t**

Same as above with a special duration paremeter. E.g. to indicate someone's birthday you can use `24*60` for 1440 minutes.

Expand All @@ -590,7 +560,7 @@ _parameters:_
- ```text```: The text to be displayed
- ```duration```: The lifetime in minutes

Service **_alarm**
Service **alarm**

Alarm is like a regular screen but it is displayed two minutes longer and has a red text color and a red marker in the upper right corner.

Expand All @@ -599,7 +569,7 @@ _parameters:_
- ```icon_name```: The name of the predefined icon id (see installation)
- ```text```: The text to be displayed

Service **del_screen**
**(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.

Expand All @@ -611,7 +581,9 @@ _parameters:_

- ```icon_name```: Icon `id` defined in the yaml (see installation)

Service **indicator_on**
**(D)** Service **indicator_on** / **indicator_off**

Turns indicator on/off

Display a colored corner on all screens and the clock. You can define the color by parameter.

Expand All @@ -621,13 +593,19 @@ _parameters:_
- ```g``` green in 0..255
- ```b``` blue in 0..255

Service **indicator_off**
**(D)** Service **alarm_color** / **clock_color** / **gauge_color** / **text_color** / **today_color** / **weekday_color**

removes the indicator
Set the color of the named text-type

Service **display_on** / **display_off**
_parameters:_

turns the display on or off
- ```r``` red in 0..255
- ```g``` green in 0..255
- ```b``` blue in 0..255

**(D)** Service **display_on** / **display_off**

Turns the display on or off

There's an easier way in using a switch component:

Expand Down Expand Up @@ -666,7 +644,7 @@ binary_sensor:

Service **hold_screen**

displays the current screen for configured ammount (see **hold_time**) (default=20) seconds longer.
Displays the current screen for configured ammount (see **hold_time**) (default=20) seconds longer.

e.g. on the Ulanzi TC001

Expand All @@ -682,7 +660,7 @@ binary_sensor:
```
Service **status**
**(D)** Service **status**
This service displays the running queue and a list of icons in the logs
Expand All @@ -699,6 +677,19 @@ This service displays the running queue and a list of icons in the logs
[13:10:10][I][EHMTX:186]: status icon: 4 name: rain
```

**(D)** Service **show_all_icons**

Display all of your icons sequentially by ID.

Service **gauge_value** / **gauge_off**

**(D)** Turns gauge on/off
Displays a colored gauge. You can define the color by parameter.

_parameters:_

- ```percent``` gauge percentage

### 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.
Expand Down Expand Up @@ -902,6 +893,11 @@ There is an optional [notifier custom component](https://github.com/lubeda/EHMTX

- 2022.6.1 removed image types only `rgb565` is valid!
- 2023.2.0 removed awtrix icon `awtrixid` support
- 2023.3.5 removed automatic scaling of images and animations
- 2023.3.5 added status,display_on,display_off as default service => remove these from your yaml
- 2023.3.5 added indicator_on/off as default services => remove these from your yaml
- 2023.3.5 added *_color as default services => remove these from your yaml
- 2023.3.5 added show_all_icons,gauge_percent/gauge_off as default services => remove these from your yaml

## 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.
Expand Down
Loading

0 comments on commit 6ed829c

Please sign in to comment.