iobroker.senec 1.4.1 → 1.4.3
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 +6 -0
- package/admin/jsonConfig.json +31 -0
- package/io-package.json +29 -2
- package/main.js +20 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -366,6 +366,12 @@ This channel contains calculated values. Currently these are day/week/month/year
|
|
|
366
366
|
*Read-only number, which designates the number of wallbox [0..3]. This is only available on systems with configured wallboxes.*
|
|
367
367
|
|
|
368
368
|
## Changelog
|
|
369
|
+
### 1.4.3 (NoBl)
|
|
370
|
+
* Working on https connection. Please test and report!
|
|
371
|
+
|
|
372
|
+
### 1.4.2 (NoBl)
|
|
373
|
+
* Added option to use https for connecting to SENEC (only activate if your appliance supports / requires this!)
|
|
374
|
+
|
|
369
375
|
### 1.4.1 (NoBl)
|
|
370
376
|
* Fix: Autarky calculations are working again.
|
|
371
377
|
|
package/admin/jsonConfig.json
CHANGED
|
@@ -33,6 +33,37 @@
|
|
|
33
33
|
"default": "0.0.0.0",
|
|
34
34
|
"newLine": true
|
|
35
35
|
},
|
|
36
|
+
"useHttps": {
|
|
37
|
+
"type": "checkbox",
|
|
38
|
+
"label": {
|
|
39
|
+
"en": "Use https?",
|
|
40
|
+
"de": "https verwenden?",
|
|
41
|
+
"ru": "Используйте https?",
|
|
42
|
+
"pt": "Usar https?",
|
|
43
|
+
"nl": "HTP's gebruiken?",
|
|
44
|
+
"fr": "Utiliser des https ?",
|
|
45
|
+
"it": "Utilizzare https?",
|
|
46
|
+
"es": "¿Usar https?",
|
|
47
|
+
"pl": "Użycie https?",
|
|
48
|
+
"uk": "Використовуйте HTTPS?",
|
|
49
|
+
"zh-cn": "使用网址?"
|
|
50
|
+
},
|
|
51
|
+
"help": {
|
|
52
|
+
"en": "Is https required to connect to SENEC? Only check if SENEC supports https already!",
|
|
53
|
+
"de": "Ist https erforderlich, um mit SENEC zu verbinden? Nur aktivieren, falls SENEC bereits https unterstützt!",
|
|
54
|
+
"ru": "Необходимо ли подключиться к SENEC? Только проверьте, поддерживает ли SENEC https уже!",
|
|
55
|
+
"pt": "São necessários https para se conectar ao SENEC? Basta verificar se o SENEC suporta https já!",
|
|
56
|
+
"nl": "Is HTP's nodig om te verbinden met SENEC? Controleer of SENEC al HTP's steunt!",
|
|
57
|
+
"fr": "Les https sont-ils nécessaires pour se connecter à SENEC? Vérifiez seulement si SENEC prend déjà en charge https!",
|
|
58
|
+
"it": "Https è necessario connettersi a SENEC? Controlla solo se SENEC supporta già https!",
|
|
59
|
+
"es": "¿Se requiere https para conectarse a SENEC? ¡Sólo comprueba si SENEC admite https ya!",
|
|
60
|
+
"pl": "Czy https musi łączyć się z SENEC? Jeśli SENEC obsługuje https już!",
|
|
61
|
+
"uk": "Чи потрібен HTTPS для підключення до SENEC? Тільки перевірте, чи підтримує SENEC HTTPS вже!",
|
|
62
|
+
"zh-cn": "是否需要与ENEC联系? 只有检查有无国界协会支持已经!"
|
|
63
|
+
},
|
|
64
|
+
"default": false,
|
|
65
|
+
"newLine": false
|
|
66
|
+
},
|
|
36
67
|
"interval": {
|
|
37
68
|
"type": "number",
|
|
38
69
|
"label": {
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "senec",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.3",
|
|
5
5
|
"news": {
|
|
6
|
+
"1.4.3": {
|
|
7
|
+
"en": "Working on https connection. Please test and report!",
|
|
8
|
+
"de": "Arbeiten an https-Verbindung. Bitte testen und melden!",
|
|
9
|
+
"ru": "Работает на связи https. Пожалуйста, проверьте и сообщите!",
|
|
10
|
+
"pt": "A trabalhar na ligação https. Por favor, teste e informe!",
|
|
11
|
+
"nl": "Werken aan HTP's verbinding. test en rapporteer!",
|
|
12
|
+
"fr": "Travailler sur la connexion https. S'il vous plaît tester et rapporter!",
|
|
13
|
+
"it": "Lavorare sul collegamento https. Si prega di testare e segnalare!",
|
|
14
|
+
"es": "Trabajando en la conexión https. ¡Por favor, prueba e informe!",
|
|
15
|
+
"pl": "Pracuje nad połączeniem https. Protestować i sprawdzić!",
|
|
16
|
+
"uk": "Робота на підключення HTTPS. Будь ласка, перевірте та звітуйте!",
|
|
17
|
+
"zh-cn": "关于网址的工作。 请试验和报告!"
|
|
18
|
+
},
|
|
19
|
+
"1.4.2": {
|
|
20
|
+
"en": "Added option to use https for connecting to SENEC (only activate if your appliance supports / requires this!)",
|
|
21
|
+
"de": "Zusätzliche Option zur Verwendung von https zur Verbindung mit SENEC hinzugefügt (nur aktivieren, wenn Ihr Gerät dies unterstützt / erfordert)",
|
|
22
|
+
"ru": "Добавлена возможность использования https для подключения к SENEC (только активируйте, если ваше приложение поддерживает / требует этого)",
|
|
23
|
+
"pt": "Adicionado opção para usar https para conectar-se ao SENEC (apenas ativar se o seu aparelho suporta / requer este)",
|
|
24
|
+
"nl": "Aangepaste optie om HTP's te gebruiken voor verbinding met SENEC (only geactiveerd als je appliance steunt / vereist dit",
|
|
25
|
+
"fr": "Ajout de l'option d'utiliser les https pour se connecter à SENEC (seulement activer si votre appareil prend en charge / nécessite ceci) ",
|
|
26
|
+
"it": "Aggiunta opzione per utilizzare https per il collegamento a SENEC (solo attivare se il tuo elettrodomestici supporta / richiede questo)",
|
|
27
|
+
"es": "Opción agregada para usar https para conectarse a SENEC (sólo activar si su dispositivo soporta / requiere esto)",
|
|
28
|
+
"pl": "Dodana opcja do używania https dla połączenia z SENEC (w sposób aktywowana, jeśli dana osoba obsługuje / wymaga to)",
|
|
29
|
+
"uk": "Додано можливість використовувати HTTPS для підключення до SENEC (тільки активуйте, якщо підтримує додаток / вимагає цього)",
|
|
30
|
+
"zh-cn": "增加使用连接到SENEC的网站的选择(如果你的可靠支持/要求这样做)"
|
|
31
|
+
},
|
|
6
32
|
"1.4.1": {
|
|
7
33
|
"en": "Autarky calculations are working again.",
|
|
8
34
|
"de": "Autarkieberechnungen funktionieren wieder.",
|
|
@@ -126,7 +152,8 @@
|
|
|
126
152
|
"intervalLow": 60,
|
|
127
153
|
"pollingTimeout": 5000,
|
|
128
154
|
"retries": 10,
|
|
129
|
-
"retrymultiplier": 2
|
|
155
|
+
"retrymultiplier": 2,
|
|
156
|
+
"useHttps": false
|
|
130
157
|
},
|
|
131
158
|
"objects": [],
|
|
132
159
|
"instanceObjects": [{
|
package/main.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
+
//process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = '0'; // not cool, not nice - but well ... just a last option if everything else fails
|
|
3
|
+
|
|
4
|
+
const https = require('https');
|
|
5
|
+
const agent = new https.Agent({
|
|
6
|
+
requestCert: true,
|
|
7
|
+
rejectUnauthorized: false
|
|
8
|
+
});
|
|
2
9
|
|
|
3
10
|
const utils = require('@iobroker/adapter-core');
|
|
4
11
|
const axios = require('axios').default;
|
|
@@ -7,6 +14,7 @@ const state_trans = require(__dirname + '/lib/state_trans.js');
|
|
|
7
14
|
|
|
8
15
|
let retry = 0; // retry-counter
|
|
9
16
|
let retryLowPrio = 0; // retry-counter
|
|
17
|
+
let connectVia = "http://";
|
|
10
18
|
|
|
11
19
|
let unloaded = false;
|
|
12
20
|
|
|
@@ -96,21 +104,26 @@ class Senec extends utils.Adapter {
|
|
|
96
104
|
this.log.warn("(checkConf) Config retry multiplier " + this.config.retrymultiplier + " not [1..10] seconds. Using default: 2");
|
|
97
105
|
this.config.retrymultiplier = 2;
|
|
98
106
|
}
|
|
107
|
+
this.log.debug("(checkConf) Configured https-usage: " + this.config.useHttps);
|
|
108
|
+
if (this.config.useHttps) {
|
|
109
|
+
connectVia = "https://";
|
|
110
|
+
this.log.debug("(checkConf) Switching to https ... " + this.config.useHttps);
|
|
111
|
+
}
|
|
99
112
|
}
|
|
100
113
|
|
|
101
114
|
/**
|
|
102
115
|
* checks connection to senec service
|
|
103
116
|
*/
|
|
104
117
|
async checkConnection() {
|
|
105
|
-
const url =
|
|
118
|
+
const url = connectVia + this.config.senecip + '/lala.cgi';
|
|
106
119
|
const form = '{"ENERGY":{"STAT_STATE":""}}';
|
|
107
120
|
try {
|
|
108
|
-
this.log.info('connecting to Senec: ' +
|
|
121
|
+
this.log.info('connecting to Senec: ' + url);
|
|
109
122
|
const body = await this.doGet(url, form, this, this.config.pollingTimeout);
|
|
110
|
-
this.log.info('connected to Senec: ' +
|
|
123
|
+
this.log.info('connected to Senec: ' + url);
|
|
111
124
|
this.setState('info.connection', true, true);
|
|
112
125
|
} catch (error) {
|
|
113
|
-
throw new Error("Error connecting to Senec (IP: " + this.config.senecip + "). Exiting! (" + error + ")");
|
|
126
|
+
throw new Error("Error connecting to Senec (IP: " + connectVia + this.config.senecip + "). Exiting! (" + error + "). Try to toggle https-mode in settings and check FQDN of SENEC appliance.");
|
|
114
127
|
}
|
|
115
128
|
}
|
|
116
129
|
|
|
@@ -123,6 +136,7 @@ class Senec extends utils.Adapter {
|
|
|
123
136
|
return new Promise(function (resolve, reject) {
|
|
124
137
|
axios({
|
|
125
138
|
method: 'post',
|
|
139
|
+
httpsAgent: agent,
|
|
126
140
|
url: pUrl,
|
|
127
141
|
data: pForm,
|
|
128
142
|
timeout: pollingTimeout
|
|
@@ -168,7 +182,7 @@ class Senec extends utils.Adapter {
|
|
|
168
182
|
// "PM1OBJ1":{"FREQ":"","U_AC":"","I_AC":"","P_AC":"","P_TOTAL":""},"PM1OBJ2":{"FREQ":"","U_AC":"","I_AC":"","P_AC":"","P_TOTAL":""}
|
|
169
183
|
// "ENERGY":{"STAT_HOURS_OF_OPERATION":"","STAT_DAYS_SINCE_MAINT":"","GUI_BAT_DATA_POWER":"","GUI_BAT_DATA_VOLTAGE":"","GUI_BAT_DATA_CURRENT":"","GUI_BAT_DATA_FUEL_CHARGE":"","GUI_BAT_DATA_OA_CHARGING":"","STAT_SULFAT_CHRG_COUNTER":"","STAT_LIMITED_NET_SKEW":"","STAT_LIMITED_NO_STAND_BY":"","GUI_CAP_TEST_DIS_COUNT":"","GUI_SCHARGE_REMAIN":"","GUI_SCHARGE_ELAPSED":"","GUI_CHARGING_INFO":"","OFFPEAK_DURATION":"","OFFPEAK_RUNNING":"","OFFPEAK_CURRENT":"","OFFPEAK_TARGET":""},"SYS_UPDATE":{"NPU_VER":"","NPU_IMAGE_VERSION":""}}
|
|
170
184
|
|
|
171
|
-
const url =
|
|
185
|
+
const url = connectVia + this.config.senecip + '/lala.cgi';
|
|
172
186
|
var form = '{';
|
|
173
187
|
form += '"BMS":{"CELL_TEMPERATURES_MODULE_A":"","CELL_TEMPERATURES_MODULE_B":"","CELL_TEMPERATURES_MODULE_C":"","CELL_TEMPERATURES_MODULE_D":"","CELL_VOLTAGES_MODULE_A":"","CELL_VOLTAGES_MODULE_B":"","CELL_VOLTAGES_MODULE_C":"","CELL_VOLTAGES_MODULE_D":"","CURRENT":"","SOC":"","SYSTEM_SOC":"","TEMP_MAX":"","TEMP_MIN":"","VOLTAGE":""}';
|
|
174
188
|
form += ',"ENERGY":{"STAT_STATE":"","GUI_BAT_DATA_POWER":"","GUI_INVERTER_POWER":"","GUI_HOUSE_POW":"","GUI_GRID_POW":"","GUI_BAT_DATA_FUEL_CHARGE":"","GUI_CHARGING_INFO":"","GUI_BOOSTING_INFO":"","GUI_BAT_DATA_POWER":"","GUI_BAT_DATA_VOLTAGE":"","GUI_BAT_DATA_CURRENT":"","GUI_BAT_DATA_FUEL_CHARGE":"","GUI_BAT_DATA_OA_CHARGING":"","STAT_LIMITED_NET_SKEW":""}';
|
|
@@ -214,7 +228,7 @@ class Senec extends utils.Adapter {
|
|
|
214
228
|
this.log.info('LowPrio polling ...');
|
|
215
229
|
// we are polling all known objects ...
|
|
216
230
|
|
|
217
|
-
const url =
|
|
231
|
+
const url = connectVia + this.config.senecip + '/lala.cgi';
|
|
218
232
|
const form = '{"STATISTIC":{},"ENERGY":{},"FEATURES":{},"LOG":{},"SYS_UPDATE":{},"WIZARD":{},"BMS":{},"BAT1":{},"BAT1OBJ1":{},"BAT1OBJ2":{},"BAT1OBJ2":{},"BAT1OBJ3":{},"BAT1OBJ4":{},"PWR_UNIT":{},"PM1OBJ1":{},"PM1OBJ2":{},"PV1":{},"FACTORY":{},"GRIDCONFIG":{},"EG_CONTROL":{},"RTC":{},"PM1":{},"TEMPMEASURE":{},"DEBUG":{},"SOCKETS":{},"CASC":{},"WALLBOX":{},"CONNX50":{},"STECA":{}}';
|
|
219
233
|
|
|
220
234
|
try {
|