Repository navigation
Expand file tree
/
Copy pathservices.yaml
More file actions
258 lines (243 loc) · 7.62 KB
/
Copy pathservices.yaml
File metadata and controls
258 lines (243 loc) · 7.62 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
backfill_now:
name: Backfill statistics now
description: Fetch daily data from lesvr and build cache for the last N days.
fields:
days:
name: Days
description: Number of past days to backfill (inclusive of today).
required: false
example: 365
selector:
number:
min: 1
max: 3650
mode: box
recompute_month_year:
name: Recompute month/year aggregates
description: Recalculate monthly arrays and yearly totals from cached daily data for the current year.
fields: {}
optimize_cache:
name: Optimize cache
description: Normalize cache by removing empty days (all zeros) to reduce size and improve performance.
fields:
year:
name: Year
description: Year to optimize (defaults to current year if omitted).
required: false
example: 2025
selector:
number:
min: 2000
max: 2100
mode: box
all_years:
name: All years
description: If true, optimize all years (up to max_years).
required: false
default: false
selector:
boolean:
max_years:
name: Max years
description: Maximum years to optimize when all_years is true.
required: false
default: 10
selector:
number:
min: 1
max: 50
mode: box
dry_run:
name: Dry run
description: If true, don't save changes, just return stats.
required: false
default: false
selector:
boolean:
purge_cache:
name: Purge cached statistics
description: Delete cached statistics file for a specific year of the configured device.
fields:
year:
name: Year
description: Year to purge (defaults to current year if omitted).
required: false
example: 2025
selector:
number:
min: 2000
max: 2100
mode: box
purge_all_cache:
name: Purge toàn bộ cache
description: Xóa tất cả cache files (.json) cho device này.
fields: {}
purge_and_backfill:
name: Xóa cache và backfill lại (Smart)
description: "Xóa toàn bộ cache cũ và smart backfill lại dữ liệu từ đầu - nhanh hơn 10-100x so với backfill cũ."
fields:
max_years:
name: Max years
description: Số năm cần backfill (mặc định 5).
required: false
example: 5
selector:
number:
min: 1
max: 100
mode: box
optimize_cache:
name: Optimize cache
description: Nếu true, tự động optimize cache sau khi backfill.
required: false
default: true
selector:
boolean:
smart_backfill:
name: Smart backfill (tối ưu)
description: "Backfill thông minh sử dụng getYearData/getMonthData API - nhanh hơn 10-100x so với daily backfill. Tự động phát hiện gaps và optimize cache."
fields:
max_years:
name: Max years
description: Số năm tối đa để backfill (mặc định 10).
required: false
example: 10
selector:
number:
min: 1
max: 50
mode: box
optimize_cache:
name: Optimize cache
description: Nếu true, tự động optimize cache sau khi backfill.
required: false
default: true
selector:
boolean:
backfill_all:
name: Backfill toàn bộ dữ liệu (cũ)
description: "Quét lùi dữ liệu từ hiện tại về quá khứ. Nếu chỉ định max_years: quét đủ số năm đó (KHÔNG dừng vì empty_streak, hữu ích khi có khoảng thời gian dài thiết bị nghỉ). Nếu để trống max_years: quét không giới hạn cho đến khi gặp empty_streak."
fields:
max_years:
name: Max years
description: "Tối đa số năm cần quét (mặc định 5). Nếu chỉ định: sẽ quét đủ số năm, bỏ qua empty_streak. Để trống = không giới hạn, chỉ dừng theo empty_streak."
required: false
example: 5
selector:
number:
min: 1
max: 100
mode: box
empty_streak:
name: Empty streak threshold
description: "Số ngày liên tiếp không có dữ liệu để dừng (mặc định 14, chỉ áp dụng khi max_years không được chỉ định)."
required: false
example: 14
selector:
number:
min: 3
max: 60
mode: box
backfill_gaps:
name: Backfill các ngày còn thiếu
description: Lấp dần các ngày còn thiếu trong cache, giới hạn số ngày mỗi lần chạy.
fields:
max_years:
name: Max years
description: Số năm gần nhất để kiểm tra (mặc định 3).
required: false
example: 3
selector:
number:
min: 1
max: 10
mode: box
max_days_per_run:
name: Max days per run
description: Giới hạn số ngày fetch mỗi lần chạy (mặc định 30).
required: false
example: 30
selector:
number:
min: 1
max: 200
mode: box
backfill_empty_dates:
name: Backfill lại các ngày đã đánh dấu empty
description: "Re-check các ngày đã bị đánh dấu empty với logic mới (có fallback và cải thiện). Hữu ích sau khi cải thiện logic fetch/parse để phát hiện các ngày bị đánh dấu empty nhầm."
fields:
max_years:
name: Max years
description: Số năm gần nhất để kiểm tra (mặc định 5).
required: false
example: 5
selector:
number:
min: 1
max: 10
mode: box
max_days_per_run:
name: Max days per run
description: Giới hạn số ngày được re-check mỗi lần chạy (mặc định 100).
required: false
example: 100
selector:
number:
min: 1
max: 500
mode: box
mark_empty_dates:
name: Đánh dấu ngày rỗng
description: Đánh dấu các ngày chắc chắn không có dữ liệu để bỏ qua vĩnh viễn.
fields:
year:
name: Year
description: Năm của các ngày cần đánh dấu.
required: true
example: 2025
selector:
number:
min: 2000
max: 2100
mode: box
dates:
name: Dates
description: Danh sách ngày (YYYY-MM-DD) cần đánh dấu rỗng.
required: true
example: ["2024-12-31", "2025-01-01"]
selector:
object:
mark_coverage_range:
name: Đặt phạm vi bao phủ dữ liệu
description: Ghi lại khoảng [earliest, latest] đã có dữ liệu đầy đủ cho 1 năm.
fields:
year:
name: Year
description: Năm cần thiết lập phạm vi bao phủ.
required: true
example: 2025
selector:
number:
min: 2000
max: 2100
mode: box
earliest:
name: Earliest date
description: Ngày đầu tiên có đủ dữ liệu (YYYY-MM-DD). Bỏ trống nếu không thay đổi.
required: false
selector:
text:
latest:
name: Latest date
description: Ngày cuối cùng có đủ dữ liệu (YYYY-MM-DD). Bỏ trống nếu không thay đổi.
required: false
selector:
text:
enable_purge_on_startup:
name: Enable purge and backfill on startup
description: "Bật flag để tự động xóa cache và backfill lại khi restart Home Assistant. Flag sẽ tự động tắt sau khi backfill hoàn tất."
fields: {}
disable_purge_on_startup:
name: Disable purge and backfill on startup
description: "Tắt flag purge và backfill tự động khi startup."
fields: {}