-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmcu-m5paper.yaml
179 lines (162 loc) · 3.34 KB
/
mcu-m5paper.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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
substitutions:
device: m5paper
name: M5Paper
comment: "DEV | m5paper"
esphome:
name: mcu-${device}
comment: ${comment}
esp32:
board: m5stack-core2
framework:
# type: arduino
type: esp-idf
psram:
external_components:
# - source: github://pr#4027
# refresh: 0s
# components:
# # - bm8563
# - gt911
# - it8951e
# - m5paper
# - spi
- source:
type: git
url: https://github.com/Passific/m5paper_esphome
ref: main
components:
- bm8563
- gt911
- it8951e
- m5paper
- spi
# external_components:
# - source: components
packages:
common: !include common/common.yaml
time:
- platform: homeassistant
id: ha_time
timezone: Europe/Bratislava
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: "${name} Battery"
# 0x44 SHT30
# 0x50
# 0x51
# 0x5D GT911
i2c:
- id: i2c_main
sda: 21
scl: 22
scan: true #false
# - id: i2c_a
# sda: 25
# scl: 32
# scan: true #false
# - id: i2c_b
# sda: 26
# scl: 33
# scan: true #false
# - id: i2c_c
# sda: 18
# scl: 19
# scan: true #false
spi:
clk_pin: 14
miso_pin: 13
mosi_pin: 12
binary_sensor:
- platform: gpio
name: ${name} Button UP
id: button_up
pin:
number: 37
inverted: true
on_press:
- component.update: m5paper_display
on_release:
- component.update: m5paper_display
- platform: gpio
name: ${name} Button Press
id: button_press
pin:
number: 38
inverted: true
- platform: gpio
name: ${name} Button Down
id: button_down
pin:
number: 39
inverted: true
- platform: touchscreen
name: ${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
font:
- file: "gfonts://Roboto"
id: font_default
size: 20
- file: "gfonts://Roboto"
id: roboto_32
size: 32
- file: "gfonts://Roboto"
id: roboto_24
size: 24
- file: "gfonts://Roboto"
id: roboto_12
size: 12
display:
- platform: it8951e
id: m5paper_display
display_cs_pin: GPIO15
reset_pin: GPIO23
busy_pin: GPIO27
rotation: 90
reversed: False
update_interval: "never"
lambda: |-
it.printf(25, 25, id(roboto_32), "%.1f°", id(current_temperature).state);
it.strftime(350, 25, id(roboto_32), "%H:%M:%S", id(rtc_time).now());
touchscreen:
- platform: gt911
display: m5paper_display
id: gt911_touchscreen
interrupt_pin: GPIO36
# display:
# - platform: waveshare_epaper
# cs_pin: 15
# model: 2.90in
# full_update_every: 30
# lambda: |-
# it.print(0, 0, id(font1), "Hello World!");
sensor:
- platform: sht3xd
temperature:
name: "${name} Temperature"
id: current_temperature
humidity:
name: "${name} Humidity"
address: 0x44
update_interval: 60s
# touchscreen:
# - platform: gt911
# interrupt_pin: 36