Skip to content

Commit

Permalink
V0.72
Browse files Browse the repository at this point in the history
![image](https://github.com/Blueforcer/awtrix-light/assets/31169771/efca3cf3-d709-41af-9cfd-2fdf04143b92)


- ### 📈 New Features
- Adds 9 App transition effects wich can be set via settings API or new HA entity.
- Allows to change color and speed of the effects with "effectSettings".
- Allows to create custom color palettes for effects.
- Adds ScreenMirror page where you can download screenshots and GIFS of the current matrix content to share with the community and friends.
- Adds /api/screen endpoint to get the current matrix as an color array.
- Adds the possibility to ask for the color array via MQTT.
- Adds new modes to the time app wich can show a calendar in different ways next to the time.
- Adds 2 new effects "ColorWaves" and "MovingLine".
- Adds effects and transistion topics&endpoints to get an array of them.

### 🐞 Bug Fixes and Optimizations
- moves currentApp topic to /stats/currentApp 
- fixes DFplayer lib to work with some china clones. closes #245 
- Adds icon and favicon to the webinterface. closes #240 
- Adds version to the release binaries. closes #235
  • Loading branch information
Blueforcer authored Aug 3, 2023
2 parents 3be5374 + 3f73db4 commit 6c9f5c4
Show file tree
Hide file tree
Showing 27 changed files with 2,012 additions and 939 deletions.
57 changes: 47 additions & 10 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
# MQTT / HTTP API

## Status
In MQTT awtrix send its stats every 10s to `[PREFIX]/stats`
With HTTP, make GET request to `http://[IP]/api/stats`
| Topic | URL | Description |
| --- | --- | --- |
| `[PREFIX]/stats` | `http://[IP]/api/stats` | Various device stats like battery, RAM etc.
| `[PREFIX]/stats/effects` | `http://[IP]/api/effects` | Returns all effects.
| `[PREFIX]/stats/transitions` | `http://[IP]/api/transitions` | Returns all transition effects.
| `[PREFIX]/stats/loop` | `http://[IP]/api/loop` | Returns all apps inside the loop.
MQTT also send some other informations like button presses and current app

## ScreenMirror
You can get the current matrix screen as an array of colors.

| Topic | URL | Payload/Body | HTTP method |
| --- | --- | --- | --- |
| `[PREFIX]/screen` | `http://[IP]/api/screen` | - | GET |

When trigger the MQTT API, awtrix send the array to `[PREFIX]/screen`

AWTRIX also provide a liveview screen in your browser at `http://[IP]/screen`.
You can also download a screenshot or generate a GIF from the actual display content.


## Turn display on or off

| Topic | URL | Payload/Body | HTTP method |
Expand All @@ -31,7 +48,7 @@ Send empty payload to disable moodlight.
| Topic | URL | Payload/Body | HTTP method |
| --- | --- | --- | --- |
| `[PREFIX]/moodlight` | `http://[IP]/api/moodlight` | see below | POST |


Possible moodlight options:
```json
Expand Down Expand Up @@ -84,16 +101,16 @@ The JSON object has the following properties,
| `textCase` | integer | Changes the Uppercase setting. 0=global setting, 1=forces uppercase; 2=shows as it sent. | 0 | X | X |
| `topText` | boolean | Draw the text on top | false | X | X |
| `textOffset` | integer | Sets an offset for the x position of a starting text. | 0 | X | X |
| `color` | string or array of integers | The text, bar or line color | | X | X |
| `background` | string or array of integers | Sets a background color | | X | X |
| `color` | string or array of integers | The text, bar or line color | N/A | X | X |
| `background` | string or array of integers | Sets a background color | N/A | X | X |
| `rainbow` | boolean | Fades each letter in the text differently through the entire RGB spectrum. | false | X | X |
| `icon` | string | The icon ID or filename (without extension) to display on the app. | N/A | X | X |
| `pushIcon` | integer | 0 = Icon doesn't move. 1 = Icon moves with text and will not appear again. 2 = Icon moves with text but appears again when the text starts to scroll again. | 0 | X | X |
| `repeat` | integer | Sets how many times the text should be scrolled through the matrix before the app ends. | 1 | X | X |
| `duration` | integer | Sets how long the app or notification should be displayed. | 5 | X | X |
| `hold` | boolean | Set it to true, to hold your **notification** on top until you press the middle button or dismiss it via HomeAssistant. This key only belongs to notification. | false | | X |
| `sound` | string | The filename of your RTTTL ringtone file placed in the MELODIES folder (without extension). | N/A | | X |
| `rtttl` | string | Allows to send the RTTTL sound string with the json | | | X |
| `rtttl` | string | Allows to send the RTTTL sound string with the json | N/A | | X |
| `loopSound` | boolean | Loops the sound or rtttl as long as the notification is running | false | | X |
| `bar` | array of integers | draws a bargraph. Without icon maximum 16 values, with icon 11 values | N/A | X | X |
| `line` | array of integers | draws a linechart. Without icon maximum 16 values, with icon 11 values | N/A | X | X |
Expand All @@ -110,15 +127,16 @@ The JSON object has the following properties,
| `clients` | array of strings | Allows to forward a notification to other awtrix. Use the MQTT prefix for MQTT and IP adresses for HTTP | | | X |
| `scrollSpeed` | integer | Modifies the scrollspeed. You need to enter a percentage value | 100 | X | X |
| `effect` | string | Shows an [effect](https://blueforcer.github.io/awtrix-light/#/effects) as background | | X | X |
| `effectSettings` | json map | Changes color and speed of the [effect](https://blueforcer.github.io/awtrix-light/#/effects) | | X | X |
| `save` | boolean | Saves your customapp into flash and reload it after boot. You should avoid that with customapps wich has high update frequency because ESPs flashmemory has limited writecycles | | X | |


Color values can have a hex string or an array of R,G,B values:
`"#FFFFFF" or [255,255,0]`

#### Example

Here's an example JSON object to display the text "Hello, AWTRIX Light!" with the icon name "1", in rainbow colors, for 10 seconds:
Here's an example JSON object to display the text "Hello, AWTRIX Light!" in rainbow colors, for 10 seconds:

```json
{
Expand All @@ -145,7 +163,8 @@ Each drawing instruction is an object with a required command key and an array o
| `dfc` | `[x, y, r, cl]` | Draw a filled circle with center at (`x`, `y`), radius `r`, and color `cl` |
| `dt` | `[x, y, t, cl]` | Draw text `t` with top-left corner at (`x`, `y`) and color `cl` |
| `db` | `[x, y, w, h, [bmp]]` | Draws a RGB565 bitmap array `[bmp]` with top-left corner at (`x`, `y`) and size of (`w`, `h`) |



### Example

Here's an example JSON object to draw a red circle, a blue rectangle, and the text "Hello" in green:
Expand Down Expand Up @@ -245,8 +264,11 @@ Each property is optional; you do not need to send all.
| Key | Type | Description | Value Range | Default |
| --- | --- | --- | --- | --- |
| `ATIME` | number | Determines the duration an app is displayed in seconds. | Any positive integer value. | 7 |
| `TEFF` | number | Choose beween app transision effects. See below for possible transitions. | 0-9 | 0 |
| `TSPEED` | number | The time the transition to the next app takes in milliseconds. | Any positive integer value. | 500 |
| `TCOL` | string / array of ints| Sets the textcolor | an array of RGB values `[255,0,0]` or any valid 6-digit hexadecimal color value, e.g. "#FF0000" for red. | N/A |
| `TMODE` | integer | Changes the time app style | 0-4 | 1 |
| `CCOL` | string / array of ints| Sets the calendar color of the time app | an array of RGB values hexadecimal color value | N/A |
| `WD` | bool | Enable or disable the weekday display | true/false | true |
| `WDCA` | string / array of ints| Sets the active weekday color | an array of RGB values `[255,0,0]` or any valid 6-digit hexadecimal color value, e.g. "#FF0000" for red. | N/A |
| `WDCI` | string / array of ints| Sets the inactive weekday color | an array of RGB values `[255,0,0]` or any valid 6-digit hexadecimal color value, e.g. "#FFFF" for white. | N/A |
Expand All @@ -269,6 +291,20 @@ Each property is optional; you do not need to send all.
| `BAT_COL` | string / array of ints| Sets the textcolor of the battery app. Set 0 for global textcolor | an array of RGB values hexadecimal color value | N/A |
| `SSPEED` | integer | Modifies the scrollspeed | percentage value of the original scrollspeed | 100 |

**Transision effects:**
```bash
0 - Slide
1 - Dim
2 - Zoom
3 - Rotate
4 - Pixelate
5 - Curtain
6 - Ripple
7 - Blink
8 - Reload
9 - Fade
```

**Timeformats:**
```bash
%H:%M:%S 13:30:45
Expand Down Expand Up @@ -300,7 +336,8 @@ You can start the firmware update with update button in HA or:
| Topic | URL | Payload/Body | HTTP Header | HTTP method |
| --- | --- | --- | --- | --- |
| `[PREFIX]/doupdate` |`http://[IP]/api/doupdate` | JSON | empty payload/body | POST |



## Reboot Awtrix

| Topic | URL | Payload/Body | HTTP method |
Expand Down
Binary file modified docs/assets/ColorWaves.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/MovingLine.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/TheaterChase.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
102 changes: 98 additions & 4 deletions docs/effects.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Effects

with v0.71 AWTRIX light can show effects wherever you want
AWTRIX light can show effects wherever you want
- Notification and CustomApps. This will show the effect as the first layer, so you can stil draw text over it.
- Backgroundlayer. This will show the effect behind everything and in each app. You can add it via Hidden features.

Just call the name for your favorite effect.

Just call the name for your favorite effect.
AWTRIX sends all effect names once after start via MQTT to stats/effects. So you can create external selectors.
Its also accessable via HTTTP /api/effects

<table>
<tr>
Expand Down Expand Up @@ -65,14 +67,106 @@ Just call the name for your favorite effect.
<tr>
<td>PlasmaCloud</td>
<td><img src="https://raw.githubusercontent.com/Blueforcer/awtrix-light/main/docs/assets/PlasmaCloud.gif" style="max-height:100px;"></td>
<td>ColorWaves</td>
<td><img src="https://raw.githubusercontent.com/Blueforcer/awtrix-light/main/docs/assets/ColorWaves.gif" style="max-height:100px;"></td>
</tr>
<tr>
<td>MovingLine</td>
<td><img src="https://raw.githubusercontent.com/Blueforcer/awtrix-light/main/docs/assets/MovingLine.gif" style="max-height:100px;"></td>
</tr>
</table>


# Effect settings
example:
```json
{
"effect":"Plasma",
"effectSettings":{
"speed":3,
"palette":"Rainbow",
"blend":true
}
}
```
All settings keys are optional

**speed:**
Mostly 3 as standard . Higher means faster
**palette:**
A color palette is an array of 16 colors to create transitions between colors.
Build-in palettes: `Cloud, Lava, Ocean, Forest, Stripe, Party, Heat, Rainbow`
**blend:**
Interpolates between colors, creating a broad array of in-between hues for smooth color transitions.

Standard values:

| Effect Name | Speed | Palette | Blend |
|-------------|-------|---------|-----------|
| Fade | 1 | Rainbow | true |
| MovingLine | 1 | Rainbow | true |
| BrickBreaker | - | - | - |
| PingPong | 8 | Rainbow | - |
| Radar | 1 | Rainbow | true |
| Checkerboard | 1 | Rainbow | true |
| Fireworks | 0.8 | Rainbow | true |
| PlasmaCloud | 3 | Rainbow | true |
| Ripple | 3 | Rainbow | true |
| Snake | 3 | Rainbow | - |
| Pacifica | 3 | Ocean | true |
| TheaterChase | - | - | - |
| Plasma | 2 | Rainbow | true |
| Matrix | 8 | - | false |
| SwirlIn | 4 | Rainbow | - |
| SwirlOut | 4 | Rainbow | - |
| LookingEyes | - | - | - |
| TwinklingStars | 4 | Ocean | false |
| ColorWaves | 3 | Rainbow | true |



# Custom Color Palette Creation Guide

This guide will show you how to create a custom color palette for use with AWTRIX effects.

A color palette in AWTRIX is an array of 16 colors. Each color is represented as a `RGB` object, which contains red, green, and blue components.

AWTRIX uses these palettes to create transitions between colors in effects. The 16 colors in the palette are not the only colors that will be displayed. Instead, AWTRIX interpolates between these colors to create a wide spectrum of in-between hues. This creates smooth, visually pleasing color transitions in your effects.

## Creating a Custom Color Palette

1. Create a text file with the `.txt` extension (for example, `sunny.txt`) in the `/PALETTES/` directory..
2. In the text file, define 16 colors in hexadecimal format. Each color should be on a new line. A color is defined in the format `#RRGGBB`, where `RR` is the red component, `GG` is the green component, and `BB` is the blue component. Each component is a two-digit hexadecimal number (00 to FF).

For example, a sunny palette might look like this:
Note, dont use comments in your palettes file.

```
0000FF // Deep blue sky at the horizon's edge
0047AB // Lighter sky
0080FF // Even lighter sky
00BFFF // Light blue sky
87CEEB // Slightly cloudy sky
87CEFA // Light blue sky
F0E68C // Light clouds
FFD700 // Start of sun colors
FFA500 // Darker sun colors
FF4500 // Even darker sun colors
FF6347 // Red-orange sun colors
FF4500 // Dark sun colors
FFA500 // Bright sun colors
FFD700 // Bright yellow sun colors
FFFFE0 // Very bright sun colors
FFFFFF // White sun colors, very bright light
```

Remember, the colors you define in your palette serve as key points in the color transitions. AWTRIX interpolates between these colors, creating a broad array of in-between hues for smooth color transitions in your animations. Experiment with different color placements in your palette to achieve different visual effects. You can use blend=false to not use interpolate colors.

# Artnet (DMX)

Awtrix light supports Artnet out of the box.
For [Jinx!](http://www.live-leds.de/) you can <a href="awtrix_light.jnx" download>download this template</a>. Just change the IP of both universes to your awtrix IP and youre ready to go.

**For any Other Arnet controller:**
**For any Other Artnet controller:**
Create 2 universes with 384 channels each. Also add a new matrix layout with 8 strings á 32 Strands and top left starting position. When you start to send data, AWTRIX will stop its normal operation and shows your data. 1s after you stop sending data, AWTRIX will return to normal operation.

2 changes: 1 addition & 1 deletion docs/icons.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ The icon needs to be a GIF (.gif) or JPG (.jpg) with a resolution of 8x8.

!> The Awtrix GIF renderer only supports 8bit gifs at the moment without transparency.
If you have some graphic glitches on the matrix, try to replace the transparency pixels with solid blak color.
For example with this [online tool](https://onlinegiftools.com/add-gif-background)
For example with this [online tool](https://onlinegiftools.com/add-gif-background)
Loading

0 comments on commit 6c9f5c4

Please sign in to comment.