iobroker.ebus 3.3.8 → 3.4.0

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/io-package.json CHANGED
@@ -1,8 +1,21 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "ebus",
4
- "version": "3.3.8",
4
+ "version": "3.4.0",
5
5
  "news": {
6
+ "3.4.0": {
7
+ "en": "migration to jsonConfig\nsee issue #383: add optionally parameters to HTTP call",
8
+ "de": "migration nach jsonConfig\nsiehe Ausgabe #383: optionale Parameter zum HTTP-Aufruf hinzufügen",
9
+ "ru": "миграции в jsonConfig\n#383: добавить дополнительные параметры к HTTP-звонку",
10
+ "pt": "migração para jsonConfig\nveja o problema #383: adicione parâmetros opcionalmente à chamada HTTP",
11
+ "nl": "migratie naar jsonConfig\nzie probleem #383: voeg optioneel parameters toe aan HTTP-aanroep",
12
+ "fr": "migration vers jsonConfig\nvoir le numéro #383: ajouter optionnellement des paramètres à l'appel HTTP",
13
+ "it": "migrazione a jsonConfig\nvedi numero #383: aggiungi parametri opzionalmente alla chiamata HTTP",
14
+ "es": "migración a jsonConfig\nver número #383: añadir parámetros opcionalmente a la llamada HTTP",
15
+ "pl": "migracja do jsonConfig\nzobacz numer # 383: dodać opcjonalne parametry do wywołania HTTP",
16
+ "uk": "міграції в jsonConfig\nпереглянути номер #383: додавати додаткові параметри до HTTP виклику",
17
+ "zh-cn": "迁移到 jsonConfig\n参见第383期: 在 HTTP 调用中添加可选参数"
18
+ },
6
19
  "3.3.8": {
7
20
  "en": "update dependencies\nissue #381: install widgets again",
8
21
  "de": "aktualisierung der abhängigkeiten\nausgabe #381: widgets erneut installieren",
@@ -80,19 +93,6 @@
80
93
  "pl": "obniżenie wartości \"socket-socket\" do 7.0.0",
81
94
  "uk": "до 7.0.0",
82
95
  "zh-cn": "将\"承诺-口袋\"降级为7.0.0"
83
- },
84
- "3.3.2": {
85
- "en": "(René) see issue #338: due to error in ebusd json no data are parsed",
86
- "de": "(René) siehe Ausgabe #338: Durch Fehler in ebusd json werden keine Daten pariert",
87
- "ru": "(René) см. вопрос #338: из-за ошибки в ebusd json никакие данные не спариваются",
88
- "pt": "(René) veja a edição #338: devido ao erro no ebusd json nenhum dado é analisado",
89
- "nl": "(René) zie probleem #338: als gevolg van fout in ebusd json geen gegevens worden ontleed",
90
- "fr": "(René) voir le numéro 338 : en raison d'une erreur dans ebusd json aucune donnée n'est analysée",
91
- "it": "(René) vedi problema #338: a causa di errore in ebusd json non vengono analizzati dati",
92
- "es": "(René) ver el número #338: debido al error en ebusd json no se analizan los datos",
93
- "pl": "(René) see issue # 338: due to error in ebudd json no data are parsed",
94
- "uk": "(René) див. питання #338: через помилку в ebusd json немає даних",
95
- "zh-cn": "(René)参见第338期:由于ebusd json中的错误,没有解析数据"
96
96
  }
97
97
  },
98
98
  "titleLang": {
@@ -159,7 +159,7 @@
159
159
  "connectionType": "local",
160
160
  "dataSource": "push",
161
161
  "adminUI": {
162
- "config": "materialize"
162
+ "config": "json"
163
163
  },
164
164
  "messages": [
165
165
  {
@@ -289,13 +289,94 @@
289
289
  "interfacetype": "ebusd",
290
290
  "targetHTTPPort": 8889,
291
291
  "targetTelnetPort": 8890,
292
- "PolledValues": "",
293
- "HistoryValues": "",
294
292
  "parseTimeout": 60,
295
293
  "useBoolean4Onoff": false,
296
294
  "PolledDPs": [],
297
295
  "HistoryDPs": [],
298
296
  "maxretries": 5,
299
- "readInterval": 5
297
+ "readInterval": 5,
298
+ "History4Vis2": false,
299
+ "HTTPparameter": [
300
+ {
301
+ "active": false,
302
+ "name": "since",
303
+ "value": 300
304
+ },
305
+ {
306
+ "active": false,
307
+ "name": "poll",
308
+ "value": "prio"
309
+ },
310
+ {
311
+ "active": false,
312
+ "name": "exact",
313
+ "value": "true"
314
+ },
315
+ {
316
+ "active": false,
317
+ "name": "verbose",
318
+ "value": "true"
319
+ },
320
+ {
321
+ "active": false,
322
+ "name": "indexed",
323
+ "value": "true"
324
+ },
325
+ {
326
+ "active": false,
327
+ "name": "numeric",
328
+ "value": "true"
329
+ },
330
+ {
331
+ "active": false,
332
+ "name": "valuename",
333
+ "value": "true"
334
+ },
335
+ {
336
+ "active": false,
337
+ "name": "full",
338
+ "value": "true"
339
+ },
340
+ {
341
+ "active": false,
342
+ "name": "required",
343
+ "value": "true"
344
+ },
345
+ {
346
+ "active": false,
347
+ "name": "maxage",
348
+ "value": "5000"
349
+ },
350
+ {
351
+ "active": false,
352
+ "name": "write",
353
+ "value": "true"
354
+ },
355
+ {
356
+ "active": false,
357
+ "name": "raw",
358
+ "value": "true"
359
+ },
360
+ {
361
+ "active": false,
362
+ "name": "def",
363
+ "value": "true"
364
+ },
365
+ {
366
+ "active": false,
367
+ "name": "define",
368
+ "value": "DEFINITION"
369
+ },
370
+ {
371
+ "active": false,
372
+ "name": "user",
373
+ "value": "USER"
374
+ },
375
+ {
376
+ "active": false,
377
+ "name": "secret",
378
+ "value": "SECRET"
379
+ }
380
+ ]
300
381
  }
301
382
  }
package/main.js CHANGED
@@ -64,7 +64,7 @@ function startAdapter(options) {
64
64
  switch (obj.command) {
65
65
  case "findParams":
66
66
  // e.g. send email or pushover or whatever
67
- adapter.log.debug("findParams command");
67
+ //adapter.log.debug("findParams command");
68
68
  // Send response in callback if required
69
69
  await FindParams(obj);
70
70
  break;
@@ -96,6 +96,7 @@ async function main() {
96
96
 
97
97
  FillPolledVars();
98
98
  FillHistoryVars();
99
+ FillHTTPParamsVars();
99
100
 
100
101
  await checkVariables();
101
102
 
@@ -256,7 +257,15 @@ function FillHistoryVars() {
256
257
  }
257
258
  }
258
259
 
260
+ let oHTTPParamsVars = [];
261
+ function FillHTTPParamsVars() {
262
+ if (adapter.config.HTTPparameter !== undefined && adapter.config.HTTPparameter != null && adapter.config.HTTPparameter.length > 0) {
259
263
 
264
+ oHTTPParamsVars = adapter.config.HTTPparameter;
265
+
266
+ adapter.log.debug("use optionally HTTP parameter " + JSON.stringify(oHTTPParamsVars));
267
+ }
268
+ }
260
269
 
261
270
 
262
271
 
@@ -385,6 +394,31 @@ async function ebusd_find(){
385
394
 
386
395
  //just call http://192.168.0.123:8889/data
387
396
 
397
+
398
+ /*
399
+ http://localhost:8080/data/mc?verbose&since=1483890000&exact
400
+
401
+ since=seconds: limit to messages that have changed since the specified UTC seconds
402
+ poll=prio: set the poll priority of matching message(s) to prio
403
+ exact[=true]: exact search for circuit/message name
404
+ verbose[=true]: include comments and field units
405
+ indexed[=true]: return field indexes instead of names
406
+ numeric[=true]: return numeric values of value list entries
407
+ valuename[=true]: include value and name of value list entries
408
+ full[=true]: include all available attributes
409
+ required[=true]: retrieve the data from the bus if not yet cached
410
+ maxage[=seconds]: retrieve the data from the bus if cached value is older than specified seconds (or not present at all)
411
+ write[=true]: include write messages in addition to read
412
+ raw[=true]: include the raw master/slave symbols as int arrays
413
+ def[=true]: include message/field definition (qq, id, fielddefs)
414
+ define=DEFINITION: (re-)define the message from DEFINITION (in CSV format)
415
+ user=USER: authenticate with USER name
416
+ secret=SECRET: authenticate with user SECRET
417
+
418
+
419
+ */
420
+
421
+
388
422
  async function subscribeVars() {
389
423
  adapter.subscribeStates("cmd");
390
424
 
@@ -608,12 +642,28 @@ function VersionCheck() {
608
642
  //get data via https in json -> this is the main data receiver; telnet just triggers ebusd to read data;
609
643
  //https://github.com/john30/ebusd/wiki/3.2.-HTTP-client
610
644
 
645
+ async function ebusd_ReceiveData() {
611
646
 
647
+ let sUrl = "http://" + adapter.config.targetIP + ":" + parseInt(adapter.config.targetHTTPPort) + "/data";
612
648
 
649
+ //Erweiterung mit optionalen parametern
650
+ var paramsCnt = 0;
651
+ if (oHTTPParamsVars !== undefined && oHTTPParamsVars != null && oHTTPParamsVars.length > 0) {
652
+ for (let i = 0; i < oHTTPParamsVars.length; i++) {
613
653
 
614
- async function ebusd_ReceiveData() {
654
+ if (oHTTPParamsVars[i].active) {
655
+ if (paramsCnt == 0) {
656
+ sUrl += "?" ;
657
+ }
658
+ else {
659
+ sUrl += "&";
660
+ }
661
+ sUrl += oHTTPParamsVars[i].name + "=" + oHTTPParamsVars[i].value;
662
+ paramsCnt++;
663
+ }
664
+ }
665
+ }
615
666
 
616
- const sUrl = "http://" + adapter.config.targetIP + ":" + parseInt(adapter.config.targetHTTPPort) + "/data";
617
667
  adapter.log.debug("request data from " + sUrl);
618
668
 
619
669
  try {
@@ -1257,72 +1307,86 @@ async function ebusd_ReadValues() {
1257
1307
 
1258
1308
  async function FindParams(obj) {
1259
1309
 
1260
- adapter.log.debug("FindParams " + JSON.stringify(obj));
1310
+ adapter.log.debug("FindParams " + JSON.stringify(obj) + " " + JSON.stringify(obj.message) + " " + JSON.stringify(obj.message.circuit));
1261
1311
 
1262
1312
  const list = [];
1313
+
1263
1314
 
1264
1315
  try {
1265
- const circuit = obj.message;
1316
+ //FindParams {"command":"findParams","message":{"circuit":"cc"},"from":"system.adapter.admin.0","callback":{"message":{"circuit":"cc"},"id":90,"ack":false,"time":1733690088670},"_id":39690903}
1266
1317
 
1267
- const socket = new net.Socket();
1268
- const promiseSocket = new PromiseSocket(socket);
1318
+ if (obj.message != null) {
1269
1319
 
1270
- await promiseSocket.connect(parseInt(adapter.config.targetTelnetPort), adapter.config.targetIP);
1271
- adapter.log.debug("telnet connected for cmd");
1272
- promiseSocket.setTimeout(5000);
1320
+ const circuit = obj.message.circuit;
1273
1321
 
1274
- await promiseSocket.write("find -c " + circuit + " -F circuit,name\n");
1322
+ const socket = new net.Socket();
1323
+ const promiseSocket = new PromiseSocket(socket);
1275
1324
 
1276
- const data = await promiseSocket.read();
1325
+ await promiseSocket.connect(parseInt(adapter.config.targetTelnetPort), adapter.config.targetIP);
1326
+ adapter.log.debug("telnet connected for cmd");
1327
+ promiseSocket.setTimeout(5000);
1277
1328
 
1278
- if (data.includes("ERR")) {
1279
- adapter.log.warn("received error! sent find, received " + data + " please check ebusd logs for details!");
1280
- }
1281
- else {
1282
- adapter.log.debug("received " + typeof data + " " + data);
1283
- }
1284
- /*
1285
- received object ehp,AccelerationTestModeehp,AccelerationTestModeehp,ActualEnvironmentPowerehp,ActualEnvironmentPowerehp,ActualEnvironmentPowerPercentageehp,ActualEnvironmentPowerPercentageehp,ApplianceCodeehp,ApplianceCodeehp,Backupehp,Backupehp,BackupHoursehp,BackupHoursHcehp,BackupHoursHwcehp,BackupHysteresisehp,BackupIntegralehp,BackupModeHcehp,BackupModeHwcehp,BackupPowerCutehp,BackupStartsehp,BackupStartsHcehp,BackupStartsHwcehp,BackupTypeehp,BivalentTempehp,Bleedingehp,Bleedingehp,CirPumpehp,CirPumpehp,Code1ehp,Code1Code2Validehp,Code2ehp,Compehp,Compehp,CompControlStateehp,CompCutPressHighCountehp,CompCutPressLowCountehp,CompCutTempCountehp,CompDemandehp,CompHoursehp,CompHoursHcehp,CompHoursHwcehp,CompHysteresisehp,CompIntegralehp,CompPressHighehp,CompPressHighehp,CompPressLowehp,CompPressLowehp,CompStartsehp,CompStartsHcehp,CompStartsHwcehp,CompStateehp,CondensorTempehp,CondensorTempehp,currenterrorehp,Dateehp,DateTimeehp,DeltaTempT6T7ehp,ElectricWiringDiagramehp,ElectricWiringDiagramehp,EnergyBalancingReleaseehp,errorhistoryehp,FlowTempehp,FlowTempehp,FlowtempCoolingMinehp,FlowTempOffsetehp,Hc1Pumpehp,Hc1Pumpehp,Hc1PumpHoursehp,Hc1PumpPortehp,Hc1PumpStartsehp,Hc2Pumpehp,Hc2PumpHoursehp,HcFlowTempehp,HcFlowTempOffsetehp,HcModeDemandHoursehp,HcModeFulfilledHoursehp,HcParallelStorageFillingEnabledehp,HcPressehp,HcReturnTempehp,HcReturnTempehp,HcReturnTempOffsetehp,HeatPumpStatusehp,HeatPumpStatusehp,HeatpumpTypeehp,HwcHcValveehp,HwcHcValveehp,HwcHcValveStartsehp,HwcLaggingTimeehp,HwcLoadingDelayehp,HwcModeDemandHoursehp,HwcModeFulfilledHoursehp,HwcPumpStartsehp,HwcSwitchehp,HwcTempehp,HwcTempehp,HwcTempOffsetehp,HydraulicSchemeehp,ICLOutehp,ICLOutehp,Injectionehp,Integralehp,Mixer1DutyCycleehp,NumberCompStartsehp,OutsideTempehp,OutsideTempOffsetehp,OverpressureThresholdehp,PhaseOrderehp,PhaseOrderehp,PhaseStatusehp,PhaseStatusehp,PowerCutehp,PowerCutPreloadingehp,PressSwitchehp,PressSwitchehp,RebootCounterehp,ReturnTempMaxehp,SetModeehp,SoftwareCodeehp,Source2PumpHoursehp,Sourceehp,Sourceehp,SourceHoursehp,SourcePortehp,SourcePressehp,SourcePumpPrerunTimeehp,SourceStartsehp,SourceSwitchehp,SourceSwitchehp,SourceTempInputehp,SourceTempInputehp,SourceTempInputOffsetehp,SourceTempOutputehp,SourceTempOutputehp,SourceTempOutputOffsetehp,SourceTempOutputT8Minehp,StateSoftwareCodeehp,StateSoftwareCodeehp,Status01ehp,Status02ehp,Status16ehp,Statusehp,StatusCirPumpehp,StorageTempBottomehp,StorageTempBottomehp,StorageTempBottomOffsetehp,StorageTempTopehp,StorageTempTopehp,StorageTempTopOffsetehp,Subcoolingehp,Superheatehp,T19MaxToCompOffehp,TempInputehp,TempInputehp,TempInputOffsetehp,TempOutputehp,TempOutputehp,TempOutputOffsetehp,Timeehp,TimeBetweenTwoCompStartsMinehp,TimeCompOffMinehp,TimeCompOnMinehp,TimeOfNextPredictedPowerCutehp,TimeOfNextPredictedPowerCutehp,Weekdayehp,YieldTotalehp,YieldTotal
1286
- */
1287
- const str = new TextDecoder().decode(data);
1288
- const datas = str.split(/\r?\n/);
1329
+ const cmd = "find -c " + circuit + " -F circuit,name\n";
1330
+ await promiseSocket.write(cmd);
1289
1331
 
1290
- for (let i = 0; i < datas.length; i++) {
1332
+ const data = await promiseSocket.read();
1291
1333
 
1292
- //adapter.log.debug(JSON.stringify(datas[i]));
1334
+ if (data.includes("ERR")) {
1335
+ adapter.log.warn("received error! sent find, received " + data + " please check ebusd logs for details! " + cmd);
1336
+ }
1337
+ else {
1338
+ adapter.log.debug("received " + typeof data + " " + data + " " + + cmd);
1339
+ }
1340
+ /*
1341
+ received object ehp,AccelerationTestModeehp,AccelerationTestModeehp,ActualEnvironmentPowerehp,ActualEnvironmentPowerehp,ActualEnvironmentPowerPercentageehp,ActualEnvironmentPowerPercentageehp,ApplianceCodeehp,ApplianceCodeehp,Backupehp,Backupehp,BackupHoursehp,BackupHoursHcehp,BackupHoursHwcehp,BackupHysteresisehp,BackupIntegralehp,BackupModeHcehp,BackupModeHwcehp,BackupPowerCutehp,BackupStartsehp,BackupStartsHcehp,BackupStartsHwcehp,BackupTypeehp,BivalentTempehp,Bleedingehp,Bleedingehp,CirPumpehp,CirPumpehp,Code1ehp,Code1Code2Validehp,Code2ehp,Compehp,Compehp,CompControlStateehp,CompCutPressHighCountehp,CompCutPressLowCountehp,CompCutTempCountehp,CompDemandehp,CompHoursehp,CompHoursHcehp,CompHoursHwcehp,CompHysteresisehp,CompIntegralehp,CompPressHighehp,CompPressHighehp,CompPressLowehp,CompPressLowehp,CompStartsehp,CompStartsHcehp,CompStartsHwcehp,CompStateehp,CondensorTempehp,CondensorTempehp,currenterrorehp,Dateehp,DateTimeehp,DeltaTempT6T7ehp,ElectricWiringDiagramehp,ElectricWiringDiagramehp,EnergyBalancingReleaseehp,errorhistoryehp,FlowTempehp,FlowTempehp,FlowtempCoolingMinehp,FlowTempOffsetehp,Hc1Pumpehp,Hc1Pumpehp,Hc1PumpHoursehp,Hc1PumpPortehp,Hc1PumpStartsehp,Hc2Pumpehp,Hc2PumpHoursehp,HcFlowTempehp,HcFlowTempOffsetehp,HcModeDemandHoursehp,HcModeFulfilledHoursehp,HcParallelStorageFillingEnabledehp,HcPressehp,HcReturnTempehp,HcReturnTempehp,HcReturnTempOffsetehp,HeatPumpStatusehp,HeatPumpStatusehp,HeatpumpTypeehp,HwcHcValveehp,HwcHcValveehp,HwcHcValveStartsehp,HwcLaggingTimeehp,HwcLoadingDelayehp,HwcModeDemandHoursehp,HwcModeFulfilledHoursehp,HwcPumpStartsehp,HwcSwitchehp,HwcTempehp,HwcTempehp,HwcTempOffsetehp,HydraulicSchemeehp,ICLOutehp,ICLOutehp,Injectionehp,Integralehp,Mixer1DutyCycleehp,NumberCompStartsehp,OutsideTempehp,OutsideTempOffsetehp,OverpressureThresholdehp,PhaseOrderehp,PhaseOrderehp,PhaseStatusehp,PhaseStatusehp,PowerCutehp,PowerCutPreloadingehp,PressSwitchehp,PressSwitchehp,RebootCounterehp,ReturnTempMaxehp,SetModeehp,SoftwareCodeehp,Source2PumpHoursehp,Sourceehp,Sourceehp,SourceHoursehp,SourcePortehp,SourcePressehp,SourcePumpPrerunTimeehp,SourceStartsehp,SourceSwitchehp,SourceSwitchehp,SourceTempInputehp,SourceTempInputehp,SourceTempInputOffsetehp,SourceTempOutputehp,SourceTempOutputehp,SourceTempOutputOffsetehp,SourceTempOutputT8Minehp,StateSoftwareCodeehp,StateSoftwareCodeehp,Status01ehp,Status02ehp,Status16ehp,Statusehp,StatusCirPumpehp,StorageTempBottomehp,StorageTempBottomehp,StorageTempBottomOffsetehp,StorageTempTopehp,StorageTempTopehp,StorageTempTopOffsetehp,Subcoolingehp,Superheatehp,T19MaxToCompOffehp,TempInputehp,TempInputehp,TempInputOffsetehp,TempOutputehp,TempOutputehp,TempOutputOffsetehp,Timeehp,TimeBetweenTwoCompStartsMinehp,TimeCompOffMinehp,TimeCompOnMinehp,TimeOfNextPredictedPowerCutehp,TimeOfNextPredictedPowerCutehp,Weekdayehp,YieldTotalehp,YieldTotal
1342
+ */
1343
+ const str = new TextDecoder().decode(data);
1344
+ const datas = str.split(/\r?\n/);
1293
1345
 
1294
- const names = datas[i].split(",");
1346
+ for (let i = 0; i < datas.length; i++) {
1295
1347
 
1296
- //doppelte und leere herausfiltern
1297
- let add = true;
1348
+ //adapter.log.debug(JSON.stringify(datas[i]));
1298
1349
 
1299
- if (names[0] == "" || names[1] == "") {
1300
- add = false;
1301
- }
1302
- else {
1350
+ const names = datas[i].split(",");
1303
1351
 
1304
- for (let n = 0; n < list.length; n++) {
1352
+ //doppelte und leere herausfiltern
1353
+ let add = true;
1305
1354
 
1306
- if (list[n].circuit == names[0] && list[n].name == names[1]) {
1307
- add = false;
1308
- //already in list
1355
+ if (names[0] == "" || names[1] == "") {
1356
+ add = false;
1357
+ }
1358
+ else {
1359
+
1360
+ for (let n = 0; n < list.length; n++) {
1361
+
1362
+ if (list[n].circuit == names[0] && list[n].name == names[1]) {
1363
+ add = false;
1364
+ //already in list
1365
+ }
1309
1366
  }
1310
1367
  }
1311
- }
1312
1368
 
1313
- if (add) {
1314
- const entry = {
1315
- active: false,
1316
- circuit: names[0],
1317
- name: names[1]
1318
- };
1369
+ if (add) {
1370
+ const entry = {
1371
+ active: false,
1372
+ circuit: names[0],
1373
+ name: names[1]
1374
+ };
1319
1375
 
1320
- list.push(entry);
1376
+ list.push(entry);
1377
+ }
1321
1378
  }
1322
1379
  }
1380
+ else {
1381
+ adapter.log.error("no circuit defined where to look for parameter, check values!");
1382
+ }
1323
1383
  } catch (e) {
1324
1384
  adapter.log.error("exception in FindParams " + "[" + e + "]");
1325
1385
  }
1386
+
1387
+ adapter.log.info("parameters " + JSON.stringify(list));
1388
+
1389
+
1326
1390
  adapter.sendTo(obj.from, obj.command, list, obj.callback);
1327
1391
  }
1328
1392
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.ebus",
3
- "version": "3.3.8",
3
+ "version": "3.4.0",
4
4
  "description": "ioBroker ebus Adapter",
5
5
  "author": {
6
6
  "name": "René G.",
@@ -23,8 +23,8 @@
23
23
  "node": ">= 18"
24
24
  },
25
25
  "dependencies": {
26
- "@iobroker/adapter-core": "^3.2.2",
27
- "axios": "^1.7.7",
26
+ "@iobroker/adapter-core": "^3.2.3",
27
+ "axios": "^1.7.9",
28
28
  "flat": "^5.0.2",
29
29
  "net": "^1.0.2",
30
30
  "promise-socket": "^7.0.0"