Last active
January 20, 2025 03:48
-
-
Save g4bri3lDev/14942e8e5480715aa8de777c138fe2b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| blueprint: | |
| name: Lines5 | |
| description: > | |
| ### Legacy lines5 fields using drawcustom | |
| Format Syntax: | |
| * First character (alignment): 'l'/'m'/'r' → sets x position and anchor | |
| * Second character (background): 'w'/'b'/'r' → rectangle fill | |
| * Third character (border): 'w'/'b'/'r' → rectangle outline | |
| * Fourth character (text): 'w'/'b'/'r' → text color | |
| Templating is supported, for example: | |
| `{{ state_attr("weather.forecast_home", "temperature") }}°C` | |
| domain: automation | |
| source_url: https://gist.github.com/g4bri3lDev/14942e8e5480715aa8de777c138fe2b4 | |
| author: g4bri3lDev | |
| input: | |
| trigger_id: | |
| name: Trigger | |
| description: Select the trigger(s) that should activate this automation | |
| default: [] | |
| selector: | |
| trigger: | |
| condition_id: | |
| name: Condition | |
| description: Additional conditions to evaluate | |
| default: [] | |
| selector: | |
| condition: | |
| device_id: | |
| name: E-Paper Display(s) | |
| description: Select the ESL device(s) to display text on | |
| selector: | |
| device: | |
| filter: | |
| integration: open_epaper_link | |
| multiple: true | |
| line1: | |
| name: Line 1 | |
| description: Content for line 1 | |
| default: "" | |
| selector: | |
| text: | |
| line2: | |
| name: Line 2 | |
| description: Content for line 2 | |
| default: "" | |
| selector: | |
| text: | |
| line3: | |
| name: Line 3 | |
| description: Content for line 3 | |
| default: "" | |
| selector: | |
| text: | |
| line4: | |
| name: Line 4 | |
| description: Content for line 4 | |
| default: "" | |
| selector: | |
| text: | |
| line5: | |
| name: Line 5 | |
| description: Content for line 5 | |
| default: "" | |
| selector: | |
| text: | |
| format1: | |
| name: Format Line 1 | |
| description: "Format code for line 1 (e.g., mwwb, mbbw)" | |
| default: "mwwb" | |
| selector: | |
| text: | |
| format2: | |
| name: Format Line 2 | |
| description: "Format code for line 2 (e.g., mwwb, mbbw)" | |
| default: "mwwb" | |
| selector: | |
| text: | |
| format3: | |
| name: Format Line 3 | |
| description: "Format code for line 3 (e.g., mwwb, mbbw)" | |
| default: "mwwb" | |
| selector: | |
| text: | |
| format4: | |
| name: Format Line 4 | |
| description: "Format code for line 4 (e.g., mwwb, mbbw)" | |
| default: "mwwb" | |
| selector: | |
| text: | |
| format5: | |
| name: Format Line 5 | |
| description: "Format code for line 5 (e.g., mwwb, mbbw)" | |
| default: "mwwb" | |
| selector: | |
| text: | |
| border: | |
| name: Border Color | |
| default: w | |
| selector: | |
| select: | |
| options: | |
| - value: w | |
| label: White | |
| - value: b | |
| label: Black | |
| - value: r | |
| label: Accent (Red/Yellow) | |
| trigger: !input trigger_id | |
| condition: !input condition_id | |
| variables: | |
| line1: !input "line1" | |
| line2: !input "line2" | |
| line3: !input "line3" | |
| line4: !input "line4" | |
| line5: !input "line5" | |
| format1: !input "format1" | |
| format2: !input "format2" | |
| format3: !input "format3" | |
| format4: !input "format4" | |
| format5: !input "format5" | |
| border: !input "border" | |
| action: | |
| - action: open_epaper_link.drawcustom | |
| target: | |
| device_id: !input device_id | |
| data: | |
| background: white | |
| rotate: 0 | |
| payload: | |
| # Main border | |
| - type: rectangle | |
| x_start: 0 | |
| y_start: 0 | |
| x_end: 151 | |
| y_end: 151 | |
| outline: >- | |
| {% set colors = {'w':'white', 'b':'black', 'r':'accent'} %} | |
| {{ colors[border] }} | |
| width: 1 | |
| # Line 1 background | |
| - type: rectangle | |
| x_start: 1 | |
| y_start: 1 | |
| x_end: 150 | |
| y_end: 30 | |
| fill: >- | |
| {% set colors = {'w':'white', 'b':'black', 'r':'accent'} %} | |
| {{ colors[format1[1]] }} | |
| outline: >- | |
| {% set colors = {'w':'white', 'b':'black', 'r':'accent'} %} | |
| {{ colors[format1[2]] }} | |
| # Line 1 text | |
| - type: text | |
| value: !input line1 | |
| x: >- | |
| {% if format1[0] == 'l' %}3 | |
| {% elif format1[0] == 'r' %}147 | |
| {% else %}76{% endif %} | |
| y: 15 | |
| size: 23 | |
| font: ppb.ttf | |
| color: >- | |
| {% set colors = {'w':'white', 'b':'black', 'r':'accent'} %} | |
| {{ colors[format1[3]] }} | |
| anchor: >- | |
| {{ format1[0] }}m | |
| max_width: 147 | |
| # Line 2 background | |
| - type: rectangle | |
| x_start: 1 | |
| y_start: 31 | |
| x_end: 150 | |
| y_end: 60 | |
| fill: >- | |
| {% set colors = {'w':'white', 'b':'black', 'r':'accent'} %} | |
| {{ colors[format2[1]] }} | |
| outline: >- | |
| {% set colors = {'w':'white', 'b':'black', 'r':'accent'} %} | |
| {{ colors[format2[2]] }} | |
| # Line 2 text | |
| - type: text | |
| value: !input line2 | |
| x: >- | |
| {% if format2[0] == 'l' %}3 | |
| {% elif format2[0] == 'r' %}147 | |
| {% else %}76{% endif %} | |
| y: 45 | |
| size: 23 | |
| font: ppb.ttf | |
| color: >- | |
| {% set colors = {'w':'white', 'b':'black', 'r':'accent'} %} | |
| {{ colors[format2[3]] }} | |
| anchor: >- | |
| {{ format2[0] }}m | |
| max_width: 147 | |
| # Line 3 background | |
| - type: rectangle | |
| x_start: 1 | |
| y_start: 61 | |
| x_end: 150 | |
| y_end: 90 | |
| fill: >- | |
| {% set colors = {'w':'white', 'b':'black', 'r':'accent'} %} | |
| {{ colors[format3[1]] }} | |
| outline: >- | |
| {% set colors = {'w':'white', 'b':'black', 'r':'accent'} %} | |
| {{ colors[format3[2]] }} | |
| # Line 3 text | |
| - type: text | |
| value: !input line3 | |
| x: >- | |
| {% if format3[0] == 'l' %}3 | |
| {% elif format3[0] == 'r' %}147 | |
| {% else %}76{% endif %} | |
| y: 75 | |
| size: 23 | |
| font: ppb.ttf | |
| color: >- | |
| {% set colors = {'w':'white', 'b':'black', 'r':'accent'} %} | |
| {{ colors[format3[3]] }} | |
| anchor: >- | |
| {{ format3[0] }}m | |
| max_width: 147 | |
| # Line 4 background | |
| - type: rectangle | |
| x_start: 1 | |
| y_start: 91 | |
| x_end: 150 | |
| y_end: 120 | |
| fill: >- | |
| {% set colors = {'w':'white', 'b':'black', 'r':'accent'} %} | |
| {{ colors[format4[1]] }} | |
| outline: >- | |
| {% set colors = {'w':'white', 'b':'black', 'r':'accent'} %} | |
| {{ colors[format4[2]] }} | |
| # Line 4 text | |
| - type: text | |
| value: !input line4 | |
| x: >- | |
| {% if format4[0] == 'l' %}3 | |
| {% elif format4[0] == 'r' %}147 | |
| {% else %}76{% endif %} | |
| y: 105 | |
| size: 23 | |
| font: ppb.ttf | |
| color: >- | |
| {% set colors = {'w':'white', 'b':'black', 'r':'accent'} %} | |
| {{ colors[format4[3]] }} | |
| anchor: >- | |
| {{ format4[0] }}m | |
| max_width: 147 | |
| # Line 5 background | |
| - type: rectangle | |
| x_start: 1 | |
| y_start: 121 | |
| x_end: 150 | |
| y_end: 150 | |
| fill: >- | |
| {% set colors = {'w':'white', 'b':'black', 'r':'accent'} %} | |
| {{ colors[format5[1]] }} | |
| outline: >- | |
| {% set colors = {'w':'white', 'b':'black', 'r':'accent'} %} | |
| {{ colors[format5[2]] }} | |
| # Line 5 text | |
| - type: text | |
| value: !input line5 | |
| x: >- | |
| {% if format5[0] == 'l' %}3 | |
| {% elif format5[0] == 'r' %}147 | |
| {% else %}76{% endif %} | |
| y: 135 | |
| size: 23 | |
| font: ppb.ttf | |
| color: >- | |
| {% set colors = {'w':'white', 'b':'black', 'r':'accent'} %} | |
| {{ colors[format5[3]] }} | |
| anchor: >- | |
| {{ format5[0] }}m | |
| max_width: 147 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment