-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheink_clock_with_temp.yaml
140 lines (108 loc) · 3.29 KB
/
eink_clock_with_temp.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
substitutions:
device_name: eink-clock-temp
temperature_entity_id: sensor.kids_room_temperature #replace with your temperature entity_id
humidity_entity_id: sensor.kids_room_humidity #replace with your humidity entity_id
esphome:
name: eink-clock-temp
esp8266:
board: d1_mini
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
password: !secret my_ap_password
wifi:
ssid: !secret my_ap_ssid
password: !secret my_ap_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "eink-clock-temp"
password: "12345678"
captive_portal:
time:
- platform: homeassistant
id: ha_time
binary_sensor:
- platform: status
name: "${device_name} Status"
id: system_status
sensor:
- platform: wifi_signal
id: wifisignal
name: "${device_name} WiFi Signal"
update_interval: 60s
- platform: homeassistant
entity_id: ${temperature_entity_id}
id: temp_data
- platform: homeassistant
entity_id: ${humidity_entity_id}
id: hum_data
font:
- file: "fonts/GothamRnd-Book.ttf"
id: time_font
size: 80
glyphs: [0, 1, 2, 3, 4, 5, 6, 7 ,8, 9, ':']
- file: "fonts/GothamRnd-Bold.ttf"
id: temp_font
size: 30
glyphs: &font-glyphs
['!', ',', '.', '"', '%', '-', '_', ':', '°', '/',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ' ',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
- file: "fonts/GothamRnd-Book.ttf"
id: book_40
size: 40
glyphs: *font-glyphs
- file: "fonts/GothamRnd-Bold.ttf"
id: bold_40
size: 40
glyphs: *font-glyphs
- file: "fonts/GothamRnd-Bold.ttf"
id: bold_25
size: 25
glyphs: *font-glyphs
- file: "fonts/GothamRnd-Book.ttf"
id: date_font
size: 30
glyphs: *font-glyphs
- file: "fonts/materialdesignicons.ttf"
id: icon_font
size: 30
glyphs:
- "\U000F058E" # mdi-water-percent
- "\U000F050F" # mdi-thermometer
spi:
clk_pin: D5
mosi_pin: D7
display:
- platform: waveshare_epaper
id: my_display
cs_pin: D8
dc_pin: D2
busy_pin: D1
reset_pin: D4
model: 2.90in
rotation: 270
update_interval: 10s
full_update_every: 60
lambda: |-
//time
it.strftime(75,1, id(time_font), TextAlign::TOP_CENTER, "%H",id(ha_time).now());
it.printf(150,-6, id(time_font), TextAlign::TOP_CENTER, ":");
it.strftime(225,1, id(time_font), TextAlign::TOP_CENTER, "%M",id(ha_time).now());
it.strftime(150, 70, id(date_font), TextAlign::TOP_CENTER, "%Y/%m/%d %a", id(ha_time).now());
//temp
it.print(25, 97, id(icon_font),TextAlign::TOP_CENTER, "\U000F050F");
if(id(temp_data).has_state()){
it.printf(90,100, id(temp_font), TextAlign::TOP_CENTER, "%.1f°C", id(temp_data).state);
}
//hum
it.print(185, 100, id(icon_font),TextAlign::TOP_CENTER, "\U000F058E");
if(id(hum_data).has_state()){
it.printf(240, 100, id(temp_font), TextAlign::TOP_CENTER, "%.1f%%", id(hum_data).state);
}