-
Notifications
You must be signed in to change notification settings - Fork 5
/
conf.py.dist
315 lines (301 loc) · 14.2 KB
/
conf.py.dist
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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
"""SETTINGS Dataformats
"""
DATE_FORMAT_HM = '%H:%M'
DATE_FORMAT_HMS = '%H:%M:%S'
DATE_FORMAT_H = '%H'
DATEFORMAT_YMD = '%Y-%m-%d'
DATEFORMAT_YM = '%Y-%m'
DATEFORMAT_Y = '%Y'
DATEFORMAT_UTC = '%Y-%m-%dT%H:%M:%SZ'
DATEFORMAT_TIMESTAMP = '%Y-%m-%d %H:%M:%S.%f'
DATEFORMAT_MISCAN = '%Y-%m-%d %H:%M:%S'
LAST_TIMESTAMP = None
"""SETTINGS LOGGER
"""
# switch logging on/off
LOG_LEVEL = 10 # LOG_LEVEL DEBUG: 10
# LOG_LEVEL = 20 # LOG_LEVEL INFO: 20
# LOG_LEVEL = 30 ## LOG_LEVEL WARNING: 30
# LOG_LEVEL = 40 ## LOG_LEVEL ERROR: 40
# LOG_LEVEL = 50 ## LOG_LEVEL CRITICAL: 50
# LOG_LEVEL = 100 ## LOG_LEVEL DISABLED: 100
LOG_DIR = './logs/'
"""SETTINGS MQTT Client
"""
MQTT_HOST = 'localhost' # Add your MQTT HOST
MQTT_PORT = 1883
MQTT_TIMEOUT = 60
MQTT_USERNAME = 'miscale.service'
MQTT_PASSWORD = '8DmLcN7YPGmg8q9jy63C'
MQTT_DISCOVERY = True
MQTT_DISCOVERY_PREFIX = 'homeassistant'
MQTT_AVAILABILITY_TOPIC = 'tele/miscale2/LWT'
MQTT_DATATOPIC = 'tele/bodyscale/data'
MQTT_TOPIC = 'tele/miscale2/data'
MQTT_PREFIX = 'tele/miscale2'
MQTT_CLEINTID = 'misacle.service'
MQTT_KEEPALIVE = 60
MQTT_ENABLE_LOGGING = False
"""SETTINGS INFLUX DATABASR SERVICE
"""
# all for the influx database
# disable INFLUXDB Service: set INFLUXDB = None
INFLUXDB_NAME = 'historydata'
INFLUXDB_HOST = 'localhost' # Add your INFLUXDB HOST
INFLUXDB_PORT = 8086
INFLUXDB_USER = 'admin'
INFLUXDB_PASSWORD = '3parpXA7AhN3B3i5si4E'
INFLUXDB_LOG_DIR = None # './data/influxdb'
INFLUXDB_MEASUREMENT = 'miscale_'
IFLUXDB_DATALIST = [
"metabolic_age",
"bmi",
"weight",
"impedance",
"lbm",
"fat",
"visceral",
"water",
"bone",
"muscle",
"protein",
"bmr",
"ffm",
"ffmi",
"tdee"
]
"""SETTINGS MISCALE V2
"""
MI2_MAC = "5c:ca:d3:4c:ee:74"
M12_TYPE = "XMTZC05HM"
MI2_NAME = "MI Body Composition Scale 2"
MI2_SHORTNAME = "MIBCS2"
MI2_SCALE2ID = '1b18'
MI2_DATAREADY = 22
MI2_DATAFLAG = 1
MI2_NOSERVICE = 2
MI2_LOCALNAME = 9
MI2_MANUFACTORID = 255
HCI_DEV = 'hci0' # sudo hciconfig
TIME_INTERVAL = 30
ATTRIBUTION = 'Data provided by Peter Siebler'
"""SETTINGS for all users
"""
USER1_GT = 60
USER1_SEX = "male"
USER1_NAME = "Peter"
USER1_HEIGHT = 175
USER1_ATHLETIC = True
USER1_ACTIVITY = 1.8 # Typical adult PAL values range from 1.20 to 2.40.
USER1_DOB = "2000-12-16"
USER1_SCORES = {
"WEIGHT": 70.00,
"FAT": 11.50,
"VISCERAL": 7.00,
"MUSCLE": 56.00,
"WATER": 55.00,
"BONES": 3.70,
"BMR": 2200,
"PROTEIN": 22.00
}
# rescale factors based on the history data (see tests/scalefactors.py)
USER1_ADJUSTMENTS = {
"62.0": {"bone":1.288, "fat":0.464, "water":1.029, "muscle":1.135},
"62.1": {"bone":1.288, "fat":0.462, "water":1.030, "muscle":1.134},
"62.3": {"bone":1.283, "fat":0.469, "water":1.031, "muscle":1.131},
"62.4": {"bone":1.326, "fat":0.560, "water":1.014, "muscle":1.130},
"62.5": {"bone":1.283, "fat":0.470, "water":1.031, "muscle":1.127},
"62.6": {"bone":1.283, "fat":0.473, "water":1.031, "muscle":1.126},
"62.7": {"bone":1.321, "fat":0.477, "water":1.032, "muscle":1.123},
"62.9": {"bone":1.316, "fat":0.478, "water":1.032, "muscle":1.120},
"63.0": {"bone":1.316, "fat":0.482, "water":1.031, "muscle":1.119},
"63.1": {"bone":1.316, "fat":0.479, "water":1.032, "muscle":1.116},
"63.2": {"bone":1.316, "fat":0.483, "water":1.033, "muscle":1.116},
"63.3": {"bone":1.316, "fat":0.486, "water":1.033, "muscle":1.113},
"63.4": {"bone":1.316, "fat":0.534, "water":1.024, "muscle":1.101},
"63.5": {"bone":1.316, "fat":0.487, "water":1.033, "muscle":1.111},
"63.6": {"bone":1.311, "fat":0.491, "water":1.034, "muscle":1.108},
"63.7": {"bone":1.311, "fat":0.494, "water":1.033, "muscle":1.105},
"63.8": {"bone":1.311, "fat":0.492, "water":1.034, "muscle":1.105},
"63.9": {"bone":1.311, "fat":0.495, "water":1.034, "muscle":1.104},
"64.0": {"bone":1.311, "fat":0.498, "water":1.035, "muscle":1.101},
"64.1": {"bone":1.311, "fat":0.501, "water":1.034, "muscle":1.101},
"64.2": {"bone":1.306, "fat":0.499, "water":1.035, "muscle":1.100},
"64.3": {"bone":1.306, "fat":0.465, "water":1.043, "muscle":1.106},
"64.4": {"bone":1.306, "fat":0.505, "water":1.035, "muscle":1.097},
"64.5": {"bone":1.306, "fat":0.508, "water":1.035, "muscle":1.094},
"64.6": {"bone":1.306, "fat":0.506, "water":1.036, "muscle":1.093},
"64.7": {"bone":1.255, "fat":0.626, "water":1.180, "muscle":1.041},
"64.8": {"bone":1.306, "fat":0.513, "water":1.036, "muscle":1.089},
"64.9": {"bone":1.301, "fat":0.516, "water":1.037, "muscle":1.086},
"65.0": {"bone":1.301, "fat":0.519, "water":1.036, "muscle":1.086},
"65.1": {"bone":1.301, "fat":0.517, "water":1.037, "muscle":1.085},
"65.2": {"bone":1.301, "fat":0.520, "water":1.036, "muscle":1.082},
"65.3": {"bone":1.301, "fat":0.518, "water":1.037, "muscle":1.082},
"65.4": {"bone":1.301, "fat":0.521, "water":1.037, "muscle":1.079},
"65.5": {"bone":1.296, "fat":0.488, "water":1.044, "muscle":1.087},
"65.6": {"bone":1.296, "fat":0.522, "water":1.037, "muscle":1.078},
"65.7": {"bone":1.319, "fat":0.522, "water":1.037, "muscle":1.080},
"65.8": {"bone":1.296, "fat":0.528, "water":1.039, "muscle":1.074},
"65.9": {"bone":1.296, "fat":0.531, "water":1.038, "muscle":1.071},
"66.0": {"bone":1.296, "fat":0.529, "water":1.039, "muscle":1.071},
"66.1": {"bone":1.296, "fat":0.532, "water":1.038, "muscle":1.068},
"66.2": {"bone":1.292, "fat":0.530, "water":1.039, "muscle":1.067},
"66.3": {"bone":1.292, "fat":0.533, "water":1.038, "muscle":1.067},
"66.4": {"bone":1.328, "fat":0.536, "water":1.039, "muscle":1.064},
"66.5": {"bone":1.328, "fat":0.539, "water":1.039, "muscle":1.063},
"66.6": {"bone":1.328, "fat":0.542, "water":1.040, "muscle":1.060},
"66.7": {"bone":1.328, "fat":0.539, "water":1.039, "muscle":1.060},
"66.8": {"bone":1.328, "fat":0.543, "water":1.040, "muscle":1.059},
"66.9": {"bone":1.324, "fat":0.540, "water":1.041, "muscle":1.059},
"67.0": {"bone":1.324, "fat":0.543, "water":1.040, "muscle":1.056},
"67.1": {"bone":1.324, "fat":0.546, "water":1.041, "muscle":1.055},
"67.2": {"bone":1.324, "fat":0.544, "water":1.040, "muscle":1.050},
"67.3": {"bone":1.324, "fat":0.552, "water":1.041, "muscle":1.052},
"67.4": {"bone":1.324, "fat":0.550, "water":1.040, "muscle":1.046},
"67.5": {"bone":1.324, "fat":0.553, "water":1.041, "muscle":1.037},
"67.6": {"bone":1.304, "fat":0.549, "water":1.042, "muscle":1.051},
"67.7": {"bone":1.319, "fat":0.558, "water":1.041, "muscle":1.036},
"67.8": {"bone":1.304, "fat":0.549, "water":1.042, "muscle":1.049},
"67.9": {"bone":1.304, "fat":0.553, "water":1.042, "muscle":1.046},
"68.0": {"bone":1.304, "fat":0.555, "water":1.042, "muscle":1.046},
"68.1": {"bone":1.319, "fat":0.560, "water":1.042, "muscle":1.029},
"68.2": {"bone":1.314, "fat":0.563, "water":1.042, "muscle":1.028},
"68.3": {"bone":1.314, "fat":0.566, "water":1.042, "muscle":1.025},
"68.4": {"bone":1.300, "fat":0.562, "water":1.042, "muscle":1.039},
"68.5": {"bone":1.314, "fat":0.567, "water":1.042, "muscle":1.024},
"68.6": {"bone":1.314, "fat":0.570, "water":1.042, "muscle":1.021},
"68.7": {"bone":1.314, "fat":0.572, "water":1.042, "muscle":1.021},
"68.8": {"bone":1.314, "fat":0.570, "water":1.043, "muscle":1.018},
"68.9": {"bone":1.309, "fat":0.573, "water":1.042, "muscle":1.018},
"69.0": {"bone":1.309, "fat":0.571, "water":1.043, "muscle":1.017},
"69.1": {"bone":1.309, "fat":0.574, "water":1.044, "muscle":1.016},
"69.2": {"bone":1.309, "fat":0.577, "water":1.043, "muscle":1.013},
"69.3": {"bone":1.309, "fat":0.579, "water":1.042, "muscle":1.013},
"69.4": {"bone":1.309, "fat":0.577, "water":1.043, "muscle":1.010},
"69.5": {"bone":1.309, "fat":0.580, "water":1.044, "muscle":1.010},
"69.6": {"bone":1.304, "fat":0.583, "water":1.043, "muscle":1.009},
"69.7": {"bone":1.304, "fat":0.586, "water":1.044, "muscle":1.006},
"69.8": {"bone":1.304, "fat":0.583, "water":1.043, "muscle":1.006},
"69.9": {"bone":1.304, "fat":0.586, "water":1.044, "muscle":1.003},
"70.0": {"bone":1.304, "fat":0.589, "water":1.043, "muscle":1.003},
"70.1": {"bone":1.304, "fat":0.587, "water":1.044, "muscle":1.002},
"70.2": {"bone":1.300, "fat":0.590, "water":1.043, "muscle":1.001},
"70.3": {"bone":1.300, "fat":0.592, "water":1.044, "muscle":0.999},
"70.4": {"bone":1.300, "fat":0.595, "water":1.043, "muscle":0.998},
"70.5": {"bone":1.300, "fat":0.593, "water":1.044, "muscle":0.998},
"70.6": {"bone":1.300, "fat":0.596, "water":1.045, "muscle":0.995},
"70.7": {"bone":1.336, "fat":0.573, "water":1.051, "muscle":1.001},
"70.8": {"bone":1.331, "fat":0.571, "water":1.052, "muscle":1.000},
"70.9": {"bone":1.331, "fat":0.599, "water":1.044, "muscle":0.991},
"71.0": {"bone":1.331, "fat":0.577, "water":1.052, "muscle":0.997},
"71.1": {"bone":1.331, "fat":0.604, "water":1.044, "muscle":0.988},
"71.2": {"bone":1.331, "fat":0.578, "water":1.051, "muscle":0.996},
"71.3": {"bone":1.331, "fat":0.580, "water":1.051, "muscle":0.993},
"71.4": {"bone":1.331, "fat":0.583, "water":1.052, "muscle":0.992},
"71.5": {"bone":1.326, "fat":0.585, "water":1.051, "muscle":0.992},
"71.6": {"bone":1.326, "fat":0.584, "water":1.051, "muscle":0.989},
"71.7": {"bone":1.326, "fat":0.586, "water":1.051, "muscle":0.989},
"71.8": {"bone":1.326, "fat":0.589, "water":1.051, "muscle":0.986},
"71.9": {"bone":1.326, "fat":0.591, "water":1.051, "muscle":0.985},
"72.0": {"bone":1.326, "fat":0.590, "water":1.051, "muscle":0.985},
"72.1": {"bone":1.321, "fat":0.592, "water":1.052, "muscle":0.982},
"72.2": {"bone":1.321, "fat":0.591, "water":1.051, "muscle":0.981},
"72.3": {"bone":1.321, "fat":0.593, "water":1.052, "muscle":0.981},
"72.4": {"bone":1.321, "fat":0.596, "water":1.051, "muscle":0.978},
"72.5": {"bone":1.321, "fat":0.622, "water":1.045, "muscle":0.980},
"72.6": {"bone":1.321, "fat":0.625, "water":1.044, "muscle":0.980},
"72.7": {"bone":1.321, "fat":0.623, "water":1.045, "muscle":0.977},
"72.8": {"bone":1.307, "fat":0.622, "water":1.045, "muscle":0.980},
"72.9": {"bone":1.317, "fat":0.628, "water":1.045, "muscle":0.976},
"73.0": {"bone":1.317, "fat":0.626, "water":1.044, "muscle":0.973},
"73.1": {"bone":1.317, "fat":0.629, "water":1.044, "muscle":0.973},
"73.2": {"bone":1.317, "fat":0.631, "water":1.043, "muscle":0.972},
"73.3": {"bone":1.317, "fat":0.630, "water":1.044, "muscle":0.970},
"73.4": {"bone":1.317, "fat":0.632, "water":1.045, "muscle":0.969},
"73.5": {"bone":1.317, "fat":0.634, "water":1.044, "muscle":0.962},
"73.6": {"bone":1.312, "fat":0.637, "water":1.045, "muscle":0.966},
"73.7": {"bone":1.312, "fat":0.635, "water":1.044, "muscle":0.965},
"73.8": {"bone":1.312, "fat":0.638, "water":1.045, "muscle":0.965},
"73.9": {"bone":1.312, "fat":0.640, "water":1.045, "muscle":0.964},
"74.0": {"bone":1.312, "fat":0.638, "water":1.045, "muscle":0.962},
"74.1": {"bone":1.263, "fat":0.724, "water":1.045, "muscle":0.920},
"74.3": {"bone":1.263, "fat":0.725, "water":1.045, "muscle":0.919},
"74.4": {"bone":1.298, "fat":0.727, "water":1.045, "muscle":0.916},
"74.5": {"bone":1.294, "fat":0.729, "water":1.045, "muscle":0.915},
"74.6": {"bone":1.294, "fat":0.727, "water":1.045, "muscle":0.915},
"74.8": {"bone":1.294, "fat":0.732, "water":1.046, "muscle":0.912},
"74.9": {"bone":1.294, "fat":0.734, "water":1.046, "muscle":0.911},
"75.0": {"bone":1.294, "fat":0.736, "water":1.046, "muscle":0.909},
"75.1": {"bone":1.294, "fat":0.734, "water":1.046, "muscle":0.908},
"75.2": {"bone":1.289, "fat":0.736, "water":1.046, "muscle":0.908},
"75.3": {"bone":1.289, "fat":0.738, "water":1.046, "muscle":0.907},
"75.5": {"bone":1.289, "fat":0.739, "water":1.046, "muscle":0.904},
"75.6": {"bone":1.289, "fat":0.741, "water":1.047, "muscle":0.904},
"75.7": {"bone":1.289, "fat":0.744, "water":1.047, "muscle":0.903},
"75.8": {"bone":1.289, "fat":0.742, "water":1.047, "muscle":0.901},
"75.9": {"bone":1.285, "fat":0.744, "water":1.047, "muscle":0.900},
"76.1": {"bone":1.285, "fat":0.744, "water":1.047, "muscle":0.890},
"76.3": {"bone":1.285, "fat":0.745, "water":1.047, "muscle":0.896},
"76.4": {"bone":1.285, "fat":0.750, "water":1.047, "muscle":0.896},
"76.5": {"bone":1.285, "fat":0.749, "water":1.047, "muscle":0.893},
"76.6": {"bone":1.280, "fat":0.751, "water":1.047, "muscle":0.893},
"76.7": {"bone":1.280, "fat":0.750, "water":1.048, "muscle":0.892},
"76.9": {"bone":1.280, "fat":0.754, "water":1.048, "muscle":0.889},
"77.1": {"bone":1.280, "fat":0.754, "water":1.048, "muscle":0.888},
"77.2": {"bone":1.276, "fat":0.756, "water":1.048, "muscle":0.886},
"77.5": {"bone":1.276, "fat":0.759, "water":1.048, "muscle":0.884},
"77.6": {"bone":1.276, "fat":0.761, "water":1.049, "muscle":0.882},
"77.9": {"bone":1.271, "fat":0.764, "water":1.049, "muscle":0.878},
"78.1": {"bone":1.271, "fat":0.764, "water":1.049, "muscle":0.877},
"78.2": {"bone":1.271, "fat":0.766, "water":1.049, "muscle":0.877}
}
USER2_LT = 60
USER2_SEX = "female"
USER2_NAME = "Reni"
USER2_HEIGHT = 168
USER2_ATHLETIC = False
USER2_ACTIVITY = 1.5 # Typical adult PAL values range from 1.20 to 2.40.
USER2_DOB = "2004-01-02"
USER2_SCORES = {
"WEIGHT": 54.00,
"FAT": 15.50,
"VISCERAL": 7.00,
"MUSCLE": 48.00,
"WATER": 57.00,
"BONES": 3.20,
"BMR": 1850,
"PROTEIN": 18.00
}
USER2_ADJUSTMENTS = None
USER3_SEX = "female"
USER3_NAME = "Tina"
USER3_HEIGHT = 165
USER3_ATHLETIC = False
USER2_ACTIVITY = 1.10 # Typical adult PAL values range from 1.20 to 2.40.
USER3_DOB = "1980-10-18"
USER3_SCORES = {
"WEIGHT": 68.00,
"FAT": 16.50,
"VISCERAL": 7.00,
"MUSCLE": 42.00,
"WATER": 55.00,
"BONES": 3.70,
"BMR": 1800,
"PROTEIN": 18.00
}
USER3_ADJUSTMENTS = None
"""SETTINGS folders
"""
BASE_DIR = os.path.dirname(os.path.realpath(__file__))
DATA_DIR = os.path.join(os.path.dirname(__file__), 'data/')
BODY_SCALE_TYPES = [
"Fettleibig", "Übergewichtig", "Dick", "Bewegungsmangel", "Ausgeglichen", "Ausgeglichen Muskulös", "Dünn", "Ausgeglichen Dünn", "Dünn Muskulös",
]
DIFF_TEXT_DE = [
"Abgenommen", "Keine Veränderung", "Zugenommen"
]