-
Notifications
You must be signed in to change notification settings - Fork 5
/
esph-epaper2.yaml
103 lines (85 loc) · 2.64 KB
/
esph-epaper2.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#
# https://github.com/lewisxhe/TTGO-EPaper-Series
# http://www.lilygo.cn/prod_view.aspx?TypeId=50031&Id=1149&FId=t3:50031:3
# https://github.com/Xinyuan-LilyGO/LilyGo-T5-ink-series
# https://github.com/waveshare/e-Paper/tree/master/Arduino
# custom component: https://github.com/matikij/esphome/tree/gxepd2_epaper/esphome/components/gxepd2_epaper
# resolution: 250 x 122 px
#
esphome:
name: tuerinfo
platform: ESP32
board: esp32dev
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
reboot_timeout: 0s
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
time:
- platform: homeassistant
id: homeassistant_time
sensor:
- platform: wifi_signal
name: "wifi_signal"
update_interval: 60s
#Homeassistant Binary Sensors
text_sensor:
- platform: homeassistant
entity_id: sensor.tuersensor1
id: tuersensor1
- platform: homeassistant
entity_id: sensor.tuersensor2
id: tuersensor2
- platform: homeassistant
entity_id: sensor.tuersensor3
id: tuersensor3
- platform: homeassistant
entity_id: sensor.tuersensor4
id: tuersensor4
# Configure SPI pins
spi:
clk_pin: 18
mosi_pin: 23
# Fonts
font:
- file: "/usr/share/fonts/truetype/msttcorefonts/Arial.ttf"
id: font4
glyphs: "*!?%()+,-_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyzäöüÄÖÜ🌧ᚄ"
- file: "/usr/share/fonts/truetype/msttcorefonts/arial.ttf"
id: font2
size: 10
- file: "/usr/share/fonts/truetype/noto/NotoSansSymbols2-Regular.ttf"
id: font3
glyphs: "☂"
- file: "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"
id: font1
glyphs: "*!?%()+,-_.:°<>0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyzäöüÄÖÜ🌧ᚄ☂"
# Configure e-ink display
# custom component: https://github.com/matikij/esphome/tree/gxepd2_epaper/esphome/components/gxepd2_epaper
display:
- platform: gxepd2_epaper
model: '213_b73'
cs_pin: 5
dc_pin: 17
busy_pin: 4
reset_pin: 16
rotation: 90
lambda: |-
auto time = id(homeassistant_time).now();
int text_x = 1;
int text_h = 20+3;
int offs_y = 15;
//zeile 1
if ( id(tuersensor2).state.length() >1 )
it.print( text_x, 0*text_h+offs_y, id(font1), id(tuersensor2).state.c_str());
else it.strftime(text_x, 0*text_h+offs_y, id(font1), "%d.%m.%Y %H:%M", time);
//zeile 2
it.print(text_x, 1*text_h+offs_y, id(font1), id(tuersensor1).state.c_str());
//zeile 3
it.print(text_x, 2*text_h+offs_y, id(font1), id(tuersensor3).state.c_str());
//zeile 4
it.print(text_x, 3*text_h+offs_y, id(font1), id(tuersensor4).state.c_str());