iobroker.poolcontrol 1.3.2 → 1.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -21
- package/io-package.json +40 -40
- package/lib/helpers/solarInsightsHelper.js +802 -0
- package/lib/helpers/solarLogbookHelper.js +606 -0
- package/lib/i18n/de.json +67 -1
- package/lib/i18n/en.json +67 -1
- package/lib/i18n/es.json +67 -1
- package/lib/i18n/fr.json +67 -1
- package/lib/i18n/it.json +67 -1
- package/lib/i18n/nl.json +67 -1
- package/lib/i18n/pl.json +67 -1
- package/lib/i18n/pt.json +67 -1
- package/lib/i18n/ru.json +67 -1
- package/lib/i18n/uk.json +67 -1
- package/lib/i18n/zh-cn.json +67 -1
- package/lib/stateDefinitions/solarInsightsStates.js +783 -0
- package/main.js +24 -0
- package/package.json +1 -1
|
@@ -0,0 +1,783 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* solarInsightsStates.js
|
|
5
|
+
* ---------------------
|
|
6
|
+
* Erstellt alle States für analytics.insights.solar.
|
|
7
|
+
*
|
|
8
|
+
* Struktur:
|
|
9
|
+
* analytics.insights.solar.inputs.*
|
|
10
|
+
* analytics.insights.solar.calculation.*
|
|
11
|
+
* analytics.insights.solar.results.*
|
|
12
|
+
* analytics.insights.solar.logbook.*
|
|
13
|
+
* analytics.insights.solar.debug.*
|
|
14
|
+
*
|
|
15
|
+
* - Transparente Solar-Analyse als Schätzung (estimated)
|
|
16
|
+
* - JSON- und HTML-Ausgaben parallel
|
|
17
|
+
* - EN + DE direkt enthalten
|
|
18
|
+
* - Keine Steuerlogik, nur Analyse-States
|
|
19
|
+
* - Tagesanalyse nur gültig, wenn Solar an dem Tag gelaufen ist
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @param {ioBroker.Adapter} adapter - Instanz des ioBroker-Adapters
|
|
24
|
+
*/
|
|
25
|
+
async function createSolarInsightsStates(adapter) {
|
|
26
|
+
adapter.log.debug('solarInsightsStates: Solar insights initialization started.');
|
|
27
|
+
|
|
28
|
+
// Oberstruktur
|
|
29
|
+
await adapter.setObjectNotExistsAsync('analytics', {
|
|
30
|
+
type: 'channel',
|
|
31
|
+
common: {
|
|
32
|
+
name: {
|
|
33
|
+
en: 'Analytics & insights (statistics, history, reports)',
|
|
34
|
+
de: 'Analysen & Statistiken (Verlauf, Berichte)',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
native: {},
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
await adapter.setObjectNotExistsAsync('analytics.insights', {
|
|
41
|
+
type: 'channel',
|
|
42
|
+
common: {
|
|
43
|
+
name: {
|
|
44
|
+
en: 'Insights & analysis',
|
|
45
|
+
de: 'Erkenntnisse & Analysen',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
native: {},
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
await adapter.setObjectNotExistsAsync('analytics.insights.solar', {
|
|
52
|
+
type: 'channel',
|
|
53
|
+
common: {
|
|
54
|
+
name: {
|
|
55
|
+
en: 'Solar insights (analysis)',
|
|
56
|
+
de: 'Solar Insights (Analyse)',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
native: {},
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// -------------------------------------------------------------
|
|
63
|
+
// INPUTS
|
|
64
|
+
// -------------------------------------------------------------
|
|
65
|
+
await adapter.setObjectNotExistsAsync('analytics.insights.solar.inputs', {
|
|
66
|
+
type: 'channel',
|
|
67
|
+
common: {
|
|
68
|
+
name: {
|
|
69
|
+
en: 'Inputs (sensors & data)',
|
|
70
|
+
de: 'Eingänge (Sensoren & Daten)',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
native: {},
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const inputStates = [
|
|
77
|
+
{
|
|
78
|
+
id: 'collector_available',
|
|
79
|
+
name: { en: 'Collector sensor available', de: 'Kollektorsensor verfügbar' },
|
|
80
|
+
desc: {
|
|
81
|
+
en: 'Shows whether the collector sensor is available for the solar insights analysis',
|
|
82
|
+
de: 'Zeigt an, ob der Kollektorsensor für die Solar-Insights-Analyse verfügbar ist',
|
|
83
|
+
},
|
|
84
|
+
type: 'boolean',
|
|
85
|
+
role: 'indicator',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: 'surface_available',
|
|
89
|
+
name: { en: 'Surface sensor available', de: 'Oberflächensensor verfügbar' },
|
|
90
|
+
desc: {
|
|
91
|
+
en: 'Shows whether the pool surface sensor is available for the solar insights analysis',
|
|
92
|
+
de: 'Zeigt an, ob der Oberflächensensor für die Solar-Insights-Analyse verfügbar ist',
|
|
93
|
+
},
|
|
94
|
+
type: 'boolean',
|
|
95
|
+
role: 'indicator',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
id: 'ground_available',
|
|
99
|
+
name: { en: 'Ground sensor available', de: 'Bodensensor verfügbar' },
|
|
100
|
+
desc: {
|
|
101
|
+
en: 'Shows whether the ground sensor is available for the solar insights analysis',
|
|
102
|
+
de: 'Zeigt an, ob der Bodensensor für die Solar-Insights-Analyse verfügbar ist',
|
|
103
|
+
},
|
|
104
|
+
type: 'boolean',
|
|
105
|
+
role: 'indicator',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
id: 'flow_available',
|
|
109
|
+
name: { en: 'Flow data available', de: 'Durchflussdaten verfügbar' },
|
|
110
|
+
desc: {
|
|
111
|
+
en: 'Shows whether a flow value is available for the solar insights analysis',
|
|
112
|
+
de: 'Zeigt an, ob ein Durchflusswert für die Solar-Insights-Analyse verfügbar ist',
|
|
113
|
+
},
|
|
114
|
+
type: 'boolean',
|
|
115
|
+
role: 'indicator',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
id: 'return_available',
|
|
119
|
+
name: { en: 'Return sensor available', de: 'Rücklaufsensor verfügbar' },
|
|
120
|
+
desc: {
|
|
121
|
+
en: 'Shows whether the return sensor is available for the solar insights analysis',
|
|
122
|
+
de: 'Zeigt an, ob der Rücklaufsensor für die Solar-Insights-Analyse verfügbar ist',
|
|
123
|
+
},
|
|
124
|
+
type: 'boolean',
|
|
125
|
+
role: 'indicator',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
id: 'outside_available',
|
|
129
|
+
name: { en: 'Outside temperature available', de: 'Außentemperatur verfügbar' },
|
|
130
|
+
desc: {
|
|
131
|
+
en: 'Shows whether outside temperature data is available for the solar insights analysis',
|
|
132
|
+
de: 'Zeigt an, ob Außentemperaturdaten für die Solar-Insights-Analyse verfügbar sind',
|
|
133
|
+
},
|
|
134
|
+
type: 'boolean',
|
|
135
|
+
role: 'indicator',
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
id: 'weather_available',
|
|
139
|
+
name: { en: 'Weather data available', de: 'Wetterdaten verfügbar' },
|
|
140
|
+
desc: {
|
|
141
|
+
en: 'Shows whether weather data is available for the solar insights analysis',
|
|
142
|
+
de: 'Zeigt an, ob Wetterdaten für die Solar-Insights-Analyse verfügbar sind',
|
|
143
|
+
},
|
|
144
|
+
type: 'boolean',
|
|
145
|
+
role: 'indicator',
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
id: 'collector_used',
|
|
149
|
+
name: { en: 'Collector sensor used', de: 'Kollektorsensor verwendet' },
|
|
150
|
+
desc: {
|
|
151
|
+
en: 'Shows whether the collector sensor is currently used in the solar insights calculation',
|
|
152
|
+
de: 'Zeigt an, ob der Kollektorsensor aktuell in der Solar-Insights-Berechnung verwendet wird',
|
|
153
|
+
},
|
|
154
|
+
type: 'boolean',
|
|
155
|
+
role: 'indicator',
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
id: 'surface_used',
|
|
159
|
+
name: { en: 'Surface sensor used', de: 'Oberflächensensor verwendet' },
|
|
160
|
+
desc: {
|
|
161
|
+
en: 'Shows whether the pool surface sensor is currently used in the solar insights calculation',
|
|
162
|
+
de: 'Zeigt an, ob der Oberflächensensor aktuell in der Solar-Insights-Berechnung verwendet wird',
|
|
163
|
+
},
|
|
164
|
+
type: 'boolean',
|
|
165
|
+
role: 'indicator',
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
id: 'ground_used',
|
|
169
|
+
name: { en: 'Ground sensor used', de: 'Bodensensor verwendet' },
|
|
170
|
+
desc: {
|
|
171
|
+
en: 'Shows whether the ground sensor is currently used in the solar insights calculation',
|
|
172
|
+
de: 'Zeigt an, ob der Bodensensor aktuell in der Solar-Insights-Berechnung verwendet wird',
|
|
173
|
+
},
|
|
174
|
+
type: 'boolean',
|
|
175
|
+
role: 'indicator',
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
id: 'flow_used',
|
|
179
|
+
name: { en: 'Flow data used', de: 'Durchflussdaten verwendet' },
|
|
180
|
+
desc: {
|
|
181
|
+
en: 'Shows whether the flow value is currently used in the solar insights calculation',
|
|
182
|
+
de: 'Zeigt an, ob der Durchflusswert aktuell in der Solar-Insights-Berechnung verwendet wird',
|
|
183
|
+
},
|
|
184
|
+
type: 'boolean',
|
|
185
|
+
role: 'indicator',
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
id: 'return_used',
|
|
189
|
+
name: { en: 'Return sensor used', de: 'Rücklaufsensor verwendet' },
|
|
190
|
+
desc: {
|
|
191
|
+
en: 'Shows whether the return sensor is currently used in the solar insights calculation',
|
|
192
|
+
de: 'Zeigt an, ob der Rücklaufsensor aktuell in der Solar-Insights-Berechnung verwendet wird',
|
|
193
|
+
},
|
|
194
|
+
type: 'boolean',
|
|
195
|
+
role: 'indicator',
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
id: 'outside_used',
|
|
199
|
+
name: { en: 'Outside temperature used', de: 'Außentemperatur verwendet' },
|
|
200
|
+
desc: {
|
|
201
|
+
en: 'Shows whether outside temperature data is currently used in the solar insights calculation',
|
|
202
|
+
de: 'Zeigt an, ob Außentemperaturdaten aktuell in der Solar-Insights-Berechnung verwendet werden',
|
|
203
|
+
},
|
|
204
|
+
type: 'boolean',
|
|
205
|
+
role: 'indicator',
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
id: 'weather_used',
|
|
209
|
+
name: { en: 'Weather data used', de: 'Wetterdaten verwendet' },
|
|
210
|
+
desc: {
|
|
211
|
+
en: 'Shows whether weather data is currently used in the solar insights calculation',
|
|
212
|
+
de: 'Zeigt an, ob Wetterdaten aktuell in der Solar-Insights-Berechnung verwendet werden',
|
|
213
|
+
},
|
|
214
|
+
type: 'boolean',
|
|
215
|
+
role: 'indicator',
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
id: 'used_sensors_text',
|
|
219
|
+
name: { en: 'Used sensors (text)', de: 'Verwendete Sensoren (Text)' },
|
|
220
|
+
desc: {
|
|
221
|
+
en: 'Compact text output of the sensors currently used in the solar insights calculation',
|
|
222
|
+
de: 'Kompakte Textausgabe der aktuell in der Solar-Insights-Berechnung verwendeten Sensoren',
|
|
223
|
+
},
|
|
224
|
+
type: 'string',
|
|
225
|
+
role: 'text',
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
id: 'used_sensors_json',
|
|
229
|
+
name: { en: 'Used sensors (JSON)', de: 'Verwendete Sensoren (JSON)' },
|
|
230
|
+
desc: {
|
|
231
|
+
en: 'Structured JSON output of the available and used sensors for the solar insights calculation',
|
|
232
|
+
de: 'Strukturierte JSON-Ausgabe der verfügbaren und verwendeten Sensoren für die Solar-Insights-Berechnung',
|
|
233
|
+
},
|
|
234
|
+
type: 'string',
|
|
235
|
+
role: 'json',
|
|
236
|
+
},
|
|
237
|
+
];
|
|
238
|
+
|
|
239
|
+
for (const def of inputStates) {
|
|
240
|
+
await adapter.setObjectNotExistsAsync(`analytics.insights.solar.inputs.${def.id}`, {
|
|
241
|
+
type: 'state',
|
|
242
|
+
common: {
|
|
243
|
+
name: def.name,
|
|
244
|
+
desc: def.desc,
|
|
245
|
+
type: def.type,
|
|
246
|
+
role: def.role,
|
|
247
|
+
read: true,
|
|
248
|
+
write: false,
|
|
249
|
+
def: def.type === 'boolean' ? false : '',
|
|
250
|
+
persist: true,
|
|
251
|
+
},
|
|
252
|
+
native: {},
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// -------------------------------------------------------------
|
|
257
|
+
// CALCULATION
|
|
258
|
+
// -------------------------------------------------------------
|
|
259
|
+
await adapter.setObjectNotExistsAsync('analytics.insights.solar.calculation', {
|
|
260
|
+
type: 'channel',
|
|
261
|
+
common: {
|
|
262
|
+
name: {
|
|
263
|
+
en: 'Calculation',
|
|
264
|
+
de: 'Berechnung',
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
native: {},
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
const calculationStates = [
|
|
271
|
+
{
|
|
272
|
+
id: 'mode',
|
|
273
|
+
name: { en: 'Calculation mode', de: 'Berechnungsmodus' },
|
|
274
|
+
desc: {
|
|
275
|
+
en: 'Active calculation mode for the solar insights analysis',
|
|
276
|
+
de: 'Aktiver Berechnungsmodus für die Solar-Insights-Analyse',
|
|
277
|
+
},
|
|
278
|
+
type: 'string',
|
|
279
|
+
role: 'text',
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
id: 'quality_level',
|
|
283
|
+
name: { en: 'Quality level', de: 'Qualitätsstufe' },
|
|
284
|
+
desc: {
|
|
285
|
+
en: 'Quality level of the current solar insights calculation',
|
|
286
|
+
de: 'Qualitätsstufe der aktuellen Solar-Insights-Berechnung',
|
|
287
|
+
},
|
|
288
|
+
type: 'string',
|
|
289
|
+
role: 'text',
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
id: 'confidence_percent',
|
|
293
|
+
name: { en: 'Confidence (%)', de: 'Vertrauen (%)' },
|
|
294
|
+
desc: {
|
|
295
|
+
en: 'Estimated confidence of the current solar insights calculation in percent',
|
|
296
|
+
de: 'Geschätzte Vertrauensstufe der aktuellen Solar-Insights-Berechnung in Prozent',
|
|
297
|
+
},
|
|
298
|
+
type: 'number',
|
|
299
|
+
role: 'value',
|
|
300
|
+
unit: '%',
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
id: 'pool_reference_source',
|
|
304
|
+
name: { en: 'Pool reference source', de: 'Pool-Referenzquelle' },
|
|
305
|
+
desc: {
|
|
306
|
+
en: 'Selected pool reference source used for the solar insights calculation',
|
|
307
|
+
de: 'Ausgewählte Pool-Referenzquelle für die Solar-Insights-Berechnung',
|
|
308
|
+
},
|
|
309
|
+
type: 'string',
|
|
310
|
+
role: 'text',
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
id: 'flow_source',
|
|
314
|
+
name: { en: 'Flow source', de: 'Durchflussquelle' },
|
|
315
|
+
desc: {
|
|
316
|
+
en: 'Source of the flow value used for the solar insights calculation',
|
|
317
|
+
de: 'Quelle des für die Solar-Insights-Berechnung verwendeten Durchflusswerts',
|
|
318
|
+
},
|
|
319
|
+
type: 'string',
|
|
320
|
+
role: 'text',
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
id: 'weather_correction_active',
|
|
324
|
+
name: { en: 'Weather correction active', de: 'Wetterkorrektur aktiv' },
|
|
325
|
+
desc: {
|
|
326
|
+
en: 'Shows whether weather-based correction or plausibility is active in the solar insights calculation',
|
|
327
|
+
de: 'Zeigt an, ob eine wetterbasierte Korrektur oder Plausibilisierung in der Solar-Insights-Berechnung aktiv ist',
|
|
328
|
+
},
|
|
329
|
+
type: 'boolean',
|
|
330
|
+
role: 'indicator',
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
id: 'note',
|
|
334
|
+
name: { en: 'Calculation note', de: 'Berechnungshinweis' },
|
|
335
|
+
desc: {
|
|
336
|
+
en: 'Additional note about the current solar insights calculation',
|
|
337
|
+
de: 'Zusätzlicher Hinweis zur aktuellen Solar-Insights-Berechnung',
|
|
338
|
+
},
|
|
339
|
+
type: 'string',
|
|
340
|
+
role: 'text',
|
|
341
|
+
},
|
|
342
|
+
];
|
|
343
|
+
|
|
344
|
+
for (const def of calculationStates) {
|
|
345
|
+
await adapter.setObjectNotExistsAsync(`analytics.insights.solar.calculation.${def.id}`, {
|
|
346
|
+
type: 'state',
|
|
347
|
+
common: {
|
|
348
|
+
name: def.name,
|
|
349
|
+
desc: def.desc,
|
|
350
|
+
type: def.type,
|
|
351
|
+
role: def.role,
|
|
352
|
+
unit: def.unit || undefined,
|
|
353
|
+
read: true,
|
|
354
|
+
write: false,
|
|
355
|
+
def: def.type === 'number' ? null : def.type === 'boolean' ? false : '',
|
|
356
|
+
persist: true,
|
|
357
|
+
},
|
|
358
|
+
native: {},
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// -------------------------------------------------------------
|
|
363
|
+
// RESULTS
|
|
364
|
+
// -------------------------------------------------------------
|
|
365
|
+
await adapter.setObjectNotExistsAsync('analytics.insights.solar.results', {
|
|
366
|
+
type: 'channel',
|
|
367
|
+
common: {
|
|
368
|
+
name: {
|
|
369
|
+
en: 'Results',
|
|
370
|
+
de: 'Ergebnisse',
|
|
371
|
+
},
|
|
372
|
+
},
|
|
373
|
+
native: {},
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
const resultStates = [
|
|
377
|
+
{
|
|
378
|
+
id: 'analysis_active',
|
|
379
|
+
name: { en: 'Analysis active', de: 'Analyse aktiv' },
|
|
380
|
+
desc: {
|
|
381
|
+
en: 'Shows whether the solar insights analysis is currently active',
|
|
382
|
+
de: 'Zeigt an, ob die Solar-Insights-Analyse aktuell aktiv ist',
|
|
383
|
+
},
|
|
384
|
+
type: 'boolean',
|
|
385
|
+
role: 'indicator',
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
id: 'solar_effective_now',
|
|
389
|
+
name: { en: 'Solar effective now', de: 'Solar aktuell wirksam' },
|
|
390
|
+
desc: {
|
|
391
|
+
en: 'Shows whether solar heating is currently effective according to the solar insights analysis',
|
|
392
|
+
de: 'Zeigt an, ob die Solarerwärmung laut Solar-Insights-Analyse aktuell wirksam ist',
|
|
393
|
+
},
|
|
394
|
+
type: 'boolean',
|
|
395
|
+
role: 'indicator',
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
id: 'solar_gain_state',
|
|
399
|
+
name: { en: 'Solar gain state', de: 'Solargewinn-Status' },
|
|
400
|
+
desc: {
|
|
401
|
+
en: 'Qualitative state of the current estimated solar gain',
|
|
402
|
+
de: 'Qualitativer Status des aktuell geschätzten Solarertrags',
|
|
403
|
+
},
|
|
404
|
+
type: 'string',
|
|
405
|
+
role: 'text',
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
id: 'solar_ran_today',
|
|
409
|
+
name: { en: 'Solar ran today', de: 'Solar lief heute' },
|
|
410
|
+
desc: {
|
|
411
|
+
en: 'Shows whether solar was active at least once today',
|
|
412
|
+
de: 'Zeigt an, ob Solar heute mindestens einmal aktiv war',
|
|
413
|
+
},
|
|
414
|
+
type: 'boolean',
|
|
415
|
+
role: 'indicator',
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
id: 'collector_temp_used',
|
|
419
|
+
name: { en: 'Collector temperature used', de: 'Verwendete Kollektortemperatur' },
|
|
420
|
+
desc: {
|
|
421
|
+
en: 'Collector temperature value used for the current solar insights calculation',
|
|
422
|
+
de: 'Für die aktuelle Solar-Insights-Berechnung verwendeter Kollektortemperaturwert',
|
|
423
|
+
},
|
|
424
|
+
type: 'number',
|
|
425
|
+
role: 'value.temperature',
|
|
426
|
+
unit: '°C',
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
id: 'pool_reference_temp_used',
|
|
430
|
+
name: { en: 'Pool reference temperature used', de: 'Verwendete Pool-Referenztemperatur' },
|
|
431
|
+
desc: {
|
|
432
|
+
en: 'Pool reference temperature value used for the current solar insights calculation',
|
|
433
|
+
de: 'Für die aktuelle Solar-Insights-Berechnung verwendeter Pool-Referenztemperaturwert',
|
|
434
|
+
},
|
|
435
|
+
type: 'number',
|
|
436
|
+
role: 'value.temperature',
|
|
437
|
+
unit: '°C',
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
id: 'delta_t_used',
|
|
441
|
+
name: { en: 'Delta T used', de: 'Verwendetes Delta T' },
|
|
442
|
+
desc: {
|
|
443
|
+
en: 'Temperature difference used for the current solar insights calculation',
|
|
444
|
+
de: 'Für die aktuelle Solar-Insights-Berechnung verwendete Temperaturdifferenz',
|
|
445
|
+
},
|
|
446
|
+
type: 'number',
|
|
447
|
+
role: 'value.temperature',
|
|
448
|
+
unit: 'K',
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
id: 'surface_ground_delta',
|
|
452
|
+
name: { en: 'Surface-ground delta', de: 'Differenz Oberfläche-Boden' },
|
|
453
|
+
desc: {
|
|
454
|
+
en: 'Difference between surface and ground temperature used for plausibility in the solar insights analysis',
|
|
455
|
+
de: 'Für die Plausibilisierung in der Solar-Insights-Analyse verwendete Differenz zwischen Oberfläche und Boden',
|
|
456
|
+
},
|
|
457
|
+
type: 'number',
|
|
458
|
+
role: 'value.temperature',
|
|
459
|
+
unit: 'K',
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
id: 'outside_temp_used',
|
|
463
|
+
name: { en: 'Outside temperature used', de: 'Verwendete Außentemperatur' },
|
|
464
|
+
desc: {
|
|
465
|
+
en: 'Outside temperature value used for the current solar insights calculation',
|
|
466
|
+
de: 'Für die aktuelle Solar-Insights-Berechnung verwendeter Außentemperaturwert',
|
|
467
|
+
},
|
|
468
|
+
type: 'number',
|
|
469
|
+
role: 'value.temperature',
|
|
470
|
+
unit: '°C',
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
id: 'flow_lh_used',
|
|
474
|
+
name: { en: 'Flow used (l/h)', de: 'Verwendeter Durchfluss (l/h)' },
|
|
475
|
+
desc: {
|
|
476
|
+
en: 'Flow value in liters per hour used for the current solar insights calculation',
|
|
477
|
+
de: 'Für die aktuelle Solar-Insights-Berechnung verwendeter Durchflusswert in Litern pro Stunde',
|
|
478
|
+
},
|
|
479
|
+
type: 'number',
|
|
480
|
+
role: 'value',
|
|
481
|
+
unit: 'l/h',
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
id: 'pump_power_w_used',
|
|
485
|
+
name: { en: 'Pump power used (W)', de: 'Verwendete Pumpenleistung (W)' },
|
|
486
|
+
desc: {
|
|
487
|
+
en: 'Pump power value used for the current solar insights calculation',
|
|
488
|
+
de: 'Für die aktuelle Solar-Insights-Berechnung verwendeter Pumpenleistungswert',
|
|
489
|
+
},
|
|
490
|
+
type: 'number',
|
|
491
|
+
role: 'value.power',
|
|
492
|
+
unit: 'W',
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
id: 'estimated_thermal_power_w',
|
|
496
|
+
name: { en: 'Estimated thermal power (W)', de: 'Geschätzte thermische Leistung (W)' },
|
|
497
|
+
desc: {
|
|
498
|
+
en: 'Estimated thermal solar power in watts based on the current solar insights calculation',
|
|
499
|
+
de: 'Geschätzte thermische Solarleistung in Watt auf Basis der aktuellen Solar-Insights-Berechnung',
|
|
500
|
+
},
|
|
501
|
+
type: 'number',
|
|
502
|
+
role: 'value.power',
|
|
503
|
+
unit: 'W',
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
id: 'estimated_thermal_power_kw',
|
|
507
|
+
name: { en: 'Estimated thermal power (kW)', de: 'Geschätzte thermische Leistung (kW)' },
|
|
508
|
+
desc: {
|
|
509
|
+
en: 'Estimated thermal solar power in kilowatts based on the current solar insights calculation',
|
|
510
|
+
de: 'Geschätzte thermische Solarleistung in Kilowatt auf Basis der aktuellen Solar-Insights-Berechnung',
|
|
511
|
+
},
|
|
512
|
+
type: 'number',
|
|
513
|
+
role: 'value.power',
|
|
514
|
+
unit: 'kW',
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
id: 'estimated_efficiency_ratio',
|
|
518
|
+
name: { en: 'Estimated efficiency ratio', de: 'Geschätztes Effizienzverhältnis' },
|
|
519
|
+
desc: {
|
|
520
|
+
en: 'Estimated efficiency ratio of the current solar insights calculation',
|
|
521
|
+
de: 'Geschätztes Effizienzverhältnis der aktuellen Solar-Insights-Berechnung',
|
|
522
|
+
},
|
|
523
|
+
type: 'number',
|
|
524
|
+
role: 'value',
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
id: 'estimated_gain_today_wh',
|
|
528
|
+
name: { en: 'Estimated gain today (Wh)', de: 'Geschätzter Tagesertrag (Wh)' },
|
|
529
|
+
desc: {
|
|
530
|
+
en: 'Estimated solar gain of today in watt hours',
|
|
531
|
+
de: 'Geschätzter Solarertrag des heutigen Tages in Wattstunden',
|
|
532
|
+
},
|
|
533
|
+
type: 'number',
|
|
534
|
+
role: 'value.power.consumption',
|
|
535
|
+
unit: 'Wh',
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
id: 'estimated_gain_today_kwh',
|
|
539
|
+
name: { en: 'Estimated gain today (kWh)', de: 'Geschätzter Tagesertrag (kWh)' },
|
|
540
|
+
desc: {
|
|
541
|
+
en: 'Estimated solar gain of today in kilowatt hours',
|
|
542
|
+
de: 'Geschätzter Solarertrag des heutigen Tages in Kilowattstunden',
|
|
543
|
+
},
|
|
544
|
+
type: 'number',
|
|
545
|
+
role: 'value.power.consumption',
|
|
546
|
+
unit: 'kWh',
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
id: 'active_minutes_today',
|
|
550
|
+
name: { en: 'Active minutes today', de: 'Aktive Minuten heute' },
|
|
551
|
+
desc: {
|
|
552
|
+
en: 'Accumulated active minutes of solar operation used for the daily solar insights evaluation',
|
|
553
|
+
de: 'Aufsummierte aktive Minuten des Solarbetriebs für die tägliche Solar-Insights-Auswertung',
|
|
554
|
+
},
|
|
555
|
+
type: 'number',
|
|
556
|
+
role: 'value',
|
|
557
|
+
unit: 'min',
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
id: 'peak_power_today_w',
|
|
561
|
+
name: { en: 'Peak power today (W)', de: 'Heutige Spitzenleistung (W)' },
|
|
562
|
+
desc: {
|
|
563
|
+
en: 'Highest estimated thermal solar power of today in watts',
|
|
564
|
+
de: 'Höchste geschätzte thermische Solarleistung des heutigen Tages in Watt',
|
|
565
|
+
},
|
|
566
|
+
type: 'number',
|
|
567
|
+
role: 'value.power',
|
|
568
|
+
unit: 'W',
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
id: 'summary_json',
|
|
572
|
+
name: { en: 'Summary (JSON)', de: 'Zusammenfassung (JSON)' },
|
|
573
|
+
desc: {
|
|
574
|
+
en: 'Structured JSON summary of the current or daily solar insights result',
|
|
575
|
+
de: 'Strukturierte JSON-Zusammenfassung des aktuellen oder täglichen Solar-Insights-Ergebnisses',
|
|
576
|
+
},
|
|
577
|
+
type: 'string',
|
|
578
|
+
role: 'json',
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
id: 'summary_html',
|
|
582
|
+
name: { en: 'Summary (HTML)', de: 'Zusammenfassung (HTML)' },
|
|
583
|
+
desc: {
|
|
584
|
+
en: 'HTML summary of the current or daily solar insights result',
|
|
585
|
+
de: 'HTML-Zusammenfassung des aktuellen oder täglichen Solar-Insights-Ergebnisses',
|
|
586
|
+
},
|
|
587
|
+
type: 'string',
|
|
588
|
+
role: 'html',
|
|
589
|
+
},
|
|
590
|
+
];
|
|
591
|
+
|
|
592
|
+
for (const def of resultStates) {
|
|
593
|
+
await adapter.setObjectNotExistsAsync(`analytics.insights.solar.results.${def.id}`, {
|
|
594
|
+
type: 'state',
|
|
595
|
+
common: {
|
|
596
|
+
name: def.name,
|
|
597
|
+
desc: def.desc,
|
|
598
|
+
type: def.type,
|
|
599
|
+
role: def.role,
|
|
600
|
+
unit: def.unit || undefined,
|
|
601
|
+
read: true,
|
|
602
|
+
write: false,
|
|
603
|
+
def: def.type === 'number' ? null : def.type === 'boolean' ? false : '',
|
|
604
|
+
persist: true,
|
|
605
|
+
},
|
|
606
|
+
native: {},
|
|
607
|
+
});
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
// -------------------------------------------------------------
|
|
611
|
+
// LOGBOOK
|
|
612
|
+
// -------------------------------------------------------------
|
|
613
|
+
await adapter.setObjectNotExistsAsync('analytics.insights.solar.logbook', {
|
|
614
|
+
type: 'channel',
|
|
615
|
+
common: {
|
|
616
|
+
name: {
|
|
617
|
+
en: 'Solar logbook (readable daily texts)',
|
|
618
|
+
de: 'Solar-Logbuch (lesbare Tages-Texte)',
|
|
619
|
+
},
|
|
620
|
+
},
|
|
621
|
+
native: {},
|
|
622
|
+
});
|
|
623
|
+
|
|
624
|
+
const logbookStates = [
|
|
625
|
+
{
|
|
626
|
+
id: 'current_entry',
|
|
627
|
+
name: { en: 'Current entry', de: 'Aktueller Eintrag' },
|
|
628
|
+
desc: {
|
|
629
|
+
en: 'Current readable solar text entry',
|
|
630
|
+
de: 'Aktueller lesbarer Solar-Text-Eintrag',
|
|
631
|
+
},
|
|
632
|
+
type: 'string',
|
|
633
|
+
role: 'text',
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
id: 'current_entry_html',
|
|
637
|
+
name: { en: 'Current entry (HTML)', de: 'Aktueller Eintrag (HTML)' },
|
|
638
|
+
desc: {
|
|
639
|
+
en: 'Current readable solar text entry as HTML',
|
|
640
|
+
de: 'Aktueller lesbarer Solar-Text-Eintrag als HTML',
|
|
641
|
+
},
|
|
642
|
+
type: 'string',
|
|
643
|
+
role: 'html',
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
id: 'day_log_json',
|
|
647
|
+
name: { en: 'Day log (JSON)', de: 'Tageslog (JSON)' },
|
|
648
|
+
desc: {
|
|
649
|
+
en: 'Structured JSON day log with readable solar entries',
|
|
650
|
+
de: 'Strukturiertes JSON-Tageslog mit lesbaren Solareinträgen',
|
|
651
|
+
},
|
|
652
|
+
type: 'string',
|
|
653
|
+
role: 'json',
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
id: 'day_log_text',
|
|
657
|
+
name: { en: 'Day log (text)', de: 'Tageslog (Text)' },
|
|
658
|
+
desc: {
|
|
659
|
+
en: 'Readable text day log with solar entries',
|
|
660
|
+
de: 'Lesbares Text-Tageslog mit Solareinträgen',
|
|
661
|
+
},
|
|
662
|
+
type: 'string',
|
|
663
|
+
role: 'text',
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
id: 'last_entry_time',
|
|
667
|
+
name: { en: 'Last entry time', de: 'Zeitpunkt des letzten Eintrags' },
|
|
668
|
+
desc: {
|
|
669
|
+
en: 'Timestamp of the last readable solar log entry',
|
|
670
|
+
de: 'Zeitstempel des letzten lesbaren Solar-Logeintrags',
|
|
671
|
+
},
|
|
672
|
+
type: 'string',
|
|
673
|
+
role: 'value.time',
|
|
674
|
+
},
|
|
675
|
+
];
|
|
676
|
+
|
|
677
|
+
for (const def of logbookStates) {
|
|
678
|
+
await adapter.setObjectNotExistsAsync(`analytics.insights.solar.logbook.${def.id}`, {
|
|
679
|
+
type: 'state',
|
|
680
|
+
common: {
|
|
681
|
+
name: def.name,
|
|
682
|
+
desc: def.desc,
|
|
683
|
+
type: def.type,
|
|
684
|
+
role: def.role,
|
|
685
|
+
read: true,
|
|
686
|
+
write: false,
|
|
687
|
+
def: '',
|
|
688
|
+
persist: true,
|
|
689
|
+
},
|
|
690
|
+
native: {},
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
// -------------------------------------------------------------
|
|
695
|
+
// DEBUG
|
|
696
|
+
// -------------------------------------------------------------
|
|
697
|
+
await adapter.setObjectNotExistsAsync('analytics.insights.solar.debug', {
|
|
698
|
+
type: 'channel',
|
|
699
|
+
common: {
|
|
700
|
+
name: {
|
|
701
|
+
en: 'Debug',
|
|
702
|
+
de: 'Debug',
|
|
703
|
+
},
|
|
704
|
+
},
|
|
705
|
+
native: {},
|
|
706
|
+
});
|
|
707
|
+
|
|
708
|
+
const debugStates = [
|
|
709
|
+
{
|
|
710
|
+
id: 'last_update',
|
|
711
|
+
name: { en: 'Last update', de: 'Letzte Aktualisierung' },
|
|
712
|
+
desc: {
|
|
713
|
+
en: 'Timestamp of the last solar insights update',
|
|
714
|
+
de: 'Zeitstempel der letzten Solar-Insights-Aktualisierung',
|
|
715
|
+
},
|
|
716
|
+
type: 'string',
|
|
717
|
+
role: 'value.time',
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
id: 'last_recalculation_reason',
|
|
721
|
+
name: { en: 'Last recalculation reason', de: 'Letzter Neuberechnungsgrund' },
|
|
722
|
+
desc: {
|
|
723
|
+
en: 'Reason for the last recalculation of the solar insights analysis',
|
|
724
|
+
de: 'Grund für die letzte Neuberechnung der Solar-Insights-Analyse',
|
|
725
|
+
},
|
|
726
|
+
type: 'string',
|
|
727
|
+
role: 'text',
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
id: 'last_valid_mode',
|
|
731
|
+
name: { en: 'Last valid mode', de: 'Letzter gültiger Modus' },
|
|
732
|
+
desc: {
|
|
733
|
+
en: 'Last valid calculation mode of the solar insights analysis',
|
|
734
|
+
de: 'Letzter gültiger Berechnungsmodus der Solar-Insights-Analyse',
|
|
735
|
+
},
|
|
736
|
+
type: 'string',
|
|
737
|
+
role: 'text',
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
id: 'last_invalid_reason',
|
|
741
|
+
name: { en: 'Last invalid reason', de: 'Letzter ungültiger Grund' },
|
|
742
|
+
desc: {
|
|
743
|
+
en: 'Reason why the last solar insights calculation was considered invalid',
|
|
744
|
+
de: 'Grund, warum die letzte Solar-Insights-Berechnung als ungültig angesehen wurde',
|
|
745
|
+
},
|
|
746
|
+
type: 'string',
|
|
747
|
+
role: 'text',
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
id: 'debug_text',
|
|
751
|
+
name: { en: 'Debug text', de: 'Debug-Text' },
|
|
752
|
+
desc: {
|
|
753
|
+
en: 'Detailed debug text for the solar insights analysis',
|
|
754
|
+
de: 'Detaillierter Debug-Text für die Solar-Insights-Analyse',
|
|
755
|
+
},
|
|
756
|
+
type: 'string',
|
|
757
|
+
role: 'text',
|
|
758
|
+
},
|
|
759
|
+
];
|
|
760
|
+
|
|
761
|
+
for (const def of debugStates) {
|
|
762
|
+
await adapter.setObjectNotExistsAsync(`analytics.insights.solar.debug.${def.id}`, {
|
|
763
|
+
type: 'state',
|
|
764
|
+
common: {
|
|
765
|
+
name: def.name,
|
|
766
|
+
desc: def.desc,
|
|
767
|
+
type: def.type,
|
|
768
|
+
role: def.role,
|
|
769
|
+
read: true,
|
|
770
|
+
write: false,
|
|
771
|
+
def: '',
|
|
772
|
+
persist: true,
|
|
773
|
+
},
|
|
774
|
+
native: {},
|
|
775
|
+
});
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
adapter.log.debug('solarInsightsStates: Solar insights states created successfully.');
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
module.exports = {
|
|
782
|
+
createSolarInsightsStates,
|
|
783
|
+
};
|