forked from sebirdman/m5paper_esphome
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.yaml
158 lines (138 loc) · 3.04 KB
/
example.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
esp32:
board: esp32dev
framework:
type: arduino
esphome:
name: m5paper
on_boot:
priority: 750.0
then:
- IT8951E.clear
- delay: 100ms
- component.update: m5paper_display
external_components:
- source:
type: git
url: https://github.com/BluetriX/m5paper_esphome
ref: main
components: [ bm8563, gt911, it8951e, m5paper, spi ]
# Enable logging
logger:
# Enable psram
psram:
# Enable Home Assistant API
api:
encryption:
key: "rrVoOaXSkSp/B0xZJlgPQS/+JCN7mvMQTWsRVx5rDSk="
ota:
password: "b0b4026c10c7d4a1152169d16fbe0a1c"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "M5Paper Fallback Hotspot"
password: "5LDgjqkLCPjZ"
captive_portal:
font:
- file: "gfonts://Roboto"
id: font1
size: 20
- file: "gfonts://Roboto"
id: large_font
size: 40
spi:
clk_pin: GPIO14
mosi_pin: GPIO12
miso_pin: GPIO13
i2c:
sda: GPIO21
scl: GPIO22
display:
- platform: it8951e
id: m5paper_display
display_cs_pin: GPIO15
reset_pin: GPIO23
busy_pin: GPIO27
rotation: 90
reversed: False
update_interval: "10s"
lambda: |-
it.printf(25, 25, id(large_font), "%.1f°", id(current_temperature).state);
it.strftime(350, 25, id(large_font), "%H:%M:%S", id(rtc_time).now());
touchscreen:
- platform: gt911
display: m5paper_display
id: gt911_touchscreen
interrupt_pin: GPIO36
# Deep sleep works, but it's not great battery life, i'd advise using the
# bm
#deep_sleep:
# id: deep_sleep_1
# run_duration: 30s
# sleep_duration: 20min
# wakeup_pin:
# number: GPIO38
# inverted: true
# esp32_ext1_wakeup:
# pins:
# - GPIO37
# mode: ALL_LOW
time:
- platform: homeassistant
id: ha_time
on_time_sync:
- bm8563.write_time
- platform: bm8563
id: rtc_time
sleep_duration: 3600000ms
m5paper:
battery_power_pin: GPIO5
main_power_pin: GPIO2
update_interval: 10s
battery_voltage:
name: "M5Paper Battery"
sensor:
- platform: sht3xd
temperature:
name: "M5Paper Temperature"
id: current_temperature
humidity:
name: "M5Paper Humidity"
address: 0x44
update_interval: 10s
binary_sensor:
- platform: gpio
name: "Right"
id: right_button
pin:
number: GPIO37
inverted: true
on_press:
- component.update: m5paper_display
on_release:
- component.update: m5paper_display
- platform: gpio
name: "BTN/PWR"
pin:
number: GPIO38
inverted: true
- platform: gpio
name: "Left"
pin:
number: GPIO39
inverted: true
- platform: touchscreen
name: Top Left Touch Button
id: top_left_touch_button
touchscreen_id: gt911_touchscreen
internal: true
x_min: 0
x_max: 100
y_min: 0
y_max: 100
on_press:
# Example of applying the sleep duration and shutting down to the lowest power mode
- bm8563.apply_sleep_duration
- delay: 1s
- m5paper.shutdown_main_power