-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathm5s-atom-s3r-0387f4.yaml
More file actions
262 lines (246 loc) · 7.26 KB
/
Copy pathm5s-atom-s3r-0387f4.yaml
File metadata and controls
262 lines (246 loc) · 7.26 KB
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
packages:
# --- COMMON PACKAGES ---
<<: !include_dir_named common
# <<: !include_dir_named bluetooth
# --- BOARD AND MODULES ---
board: !include board/m5stack_atom_s3r.yaml
# i2c_int: !include extension/internal_i2c.yaml
grove: !include board/extension/grove_i2c.yaml
# env: !include board/module/hat_env_iii.yaml
ncir: !include board/module/unit_ncir.yaml
# --- FEATURE PACKAGES ---
# combined_env_sensors: !include features/combined_env_sensors.yaml
# --- GUI PACKAGES ---
colors: !include gui/themes/colors_night_owl.yaml
lvgl: !include gui/128x128.yaml
# --- LVGL WIDGET PACKAGES ---
room_temperature_widget_sensors: !include { file: gui/widgets/labels/number_sensor.yaml, vars: {
uid: room_temp_value,
entity_id: sensor.t22_temperature
}}
substitutions:
common:
# log_level: WARN
# log_baud_rate: "115200"
device:
name: m5s-as3r-0387f4
location: "Storage"
framework:
type: esp-idf
display:
home_page: page_imu
page:
temperature:
area_label: T22
esphome:
comment: ${device.model} @ ${device.location}
name: ${device.name}
friendly_name: ${device.name}
area: ${device.location}
wifi:
# use_address: 192.168.69.64
use_address: ${device.name}.local
manual_ip:
gateway: 192.168.68.1
subnet: 255.255.252.0
static_ip: 192.168.71.64
# --- LVGL CLOCKS ---
time:
- id: !extend time_homeassistant
on_time_sync:
- script.execute: lvgl_time_update
on_time:
- minutes: '*'
seconds: 0
then:
- script.execute: lvgl_time_update
binary_sensor:
- id: !extend btn_display
on_press:
- lvgl.page.next:
animation: OUT_TOP
time: 100ms
# Call sensors from HA.
- platform: homeassistant
entity_id: binary_sensor.etg2_simen_occupancy
id: presence1
- platform: homeassistant
entity_id: binary_sensor.etg2_gang_occupancy
id: presence2
# Turn on display while room is occupied
- id: !extend presence_detected
lambda: !lambda |-
if ( (id(presence1).state) or (id(presence2).state) ) {
return true;
} else {
return false;
}
lvgl:
buffer_size: 40%
rotation: 180
style_definitions:
- id: circle
radius: circle
outline_width: 1
outline_color: c_yellow
align: center
- id: dashline
width: 100%
height: 100%
line_dash_width: 4
line_dash_gap: 4
line_color: c_yellow
pages:
- id: page_imu
pad_top: 24
pad_bottom: 0
on_load:
- lvgl.label.update:
id: lbl_page_title
text: "\U000F0D49" # axis-arrow
<<: !include
file: gui/functions/swipe_navigation.yaml
widgets:
- obj:
pad_top: 2
pad_bottom: 3
pad_left: 3
pad_right: 3
scrollable: false
width: 100%
height: 100%
border_width: 0
radius: 0
align: CENTER
widgets:
- container:
max_height: 66
max_width: 66
styles: circle
bg_color: c_bg_s
bg_opa: cover
widgets:
- container:
styles: circle
width: 66%
height: 66%
- container:
styles: circle
width: 33%
height: 33%
- line:
styles: dashline
points:
- 50%,0
- 50%,100%
- line:
styles: dashline
points:
- {x: 0, y: 50%}
- [100%, 50%]
- container:
styles: circle
width: 10%
height: 10%
bg_color: c_gray
bg_opa: 50%
- container:
id: indicator_container
width: 100%
height: 100%
transform_pivot_x: 50%
transform_pivot_y: 50%
widgets:
- container:
id: indicator
styles: circle
width: 12%
height: 12%
bg_color: c_red
bg_opa: 100%
x: 10
y: 10
- label:
text: R
align: bottom_mid
text_font: font_sm
text_color: c_dark_gray
- label:
text: F
align: top_mid
text_font: font_sm
text_color: c_dark_gray
- label:
text: L
align: left_mid
text_font: font_md
text_color: c_dark_gray
- label:
text: R
align: right_mid
text_font: font_md
text_color: c_dark_gray
script:
- id: update_motion
then:
- if:
condition:
lambda: return abs(id(motion_roll).state) < 1.0f && abs(id(motion_pitch).state) < 1.0f;
then:
lvgl.widget.update:
id: indicator
bg_color: c_green
x: !lambda return (int)(clamp(id(motion_roll).state, -20.0f, 20.0f) / 20.0f * 35);
y: !lambda return (int)(clamp(id(motion_pitch).state, -20.0f, 20.0f) / 20.0f * 35);
else:
lvgl.widget.update:
id: indicator
bg_color: c_red
x: !lambda return (int)(clamp(id(motion_roll).state, -20.0f, 20.0f) / 20.0f * 35);
y: !lambda return (int)(clamp(id(motion_pitch).state, -20.0f, 20.0f) / 20.0f * 35);
sensor:
- id: !extend motion_roll
on_value:
script.execute: update_motion
# Combine sensors
# - id: !extend temperature_local
# sources:
# Base BTC
# - source: temperature_sht30_base_btc
# HAT ENV III
# - source: temperature_sht30_hat_env
# - source: temperature_qmp6988_hat_env
# Unit ENV III
# - source: temperature_sht30_unit_env
# - source: temperature_qmp6988_unit_env
# Unit ENV IV
# - source: temperature_bmp280_unit_env
# - source: temperature_sht40_unit_env
# Unit ENV Pro
# - source: temperature_bme688
# Unit CO2
# - source: temperature_scd40_unit_co2
# - id: !extend humidity_local
# sources:
# Base BTC
# - source: humidity_sht30_base_btc
# HAT ENV III
# - source: humidity_sht30_hat_env
# Unit ENV III
# - source: humidity_sht30_unit_env
# Unit ENV IV
# - source: humidity_sht40_unit_env
# Unit ENV Pro
# - source: humidity_bme688
# Unit CO2
# - source: humidity_scd40_unit_co2
# - id: !extend pressure_local
# sources:
# HAT ENV III
# - source: pressure_qmp6988_hat_env
# Unit ENV III
# - source: pressure_qmp6988_unit_env
# Unit ENV IV
# - source: pressure_bmp280_unit_env
# Unit ENV Pro
# - source: pressure_bme688