iobroker.bydhvs 1.4.0 → 1.4.2
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/CHANGELOG_OLD.md +6 -0
- package/README.md +8 -6
- package/admin/admin.d.ts +93 -93
- package/admin/index_m.html +112 -112
- package/admin/style.css +32 -32
- package/admin/words.js +80 -80
- package/io-package.json +306 -280
- package/main.js +43 -31
- package/package.json +15 -15
package/main.js
CHANGED
@@ -53,6 +53,7 @@ let hvsPower;
|
|
53
53
|
let hvsBattType;
|
54
54
|
let hvsBattType_fromSerial;
|
55
55
|
let hvsInvType;
|
56
|
+
let hvsInvType_String;
|
56
57
|
let hvsNumCells; //number of cells in system
|
57
58
|
let hvsNumTemps; // number of temperatures to count with
|
58
59
|
let ConfBatDetailshowoften;
|
@@ -139,24 +140,26 @@ const myErrors = [
|
|
139
140
|
];
|
140
141
|
|
141
142
|
const myINVs = [
|
142
|
-
"Fronius HV",
|
143
|
-
"Goodwe HV",
|
144
|
-
"Fronius HV",
|
145
|
-
"Kostal HV",
|
146
|
-
"Goodwe HV",
|
147
|
-
"SMA SBS3.7/5.0",
|
148
|
-
"Kostal HV",
|
149
|
-
"SMA SBS3.7/5.0",
|
150
|
-
"Sungrow HV",
|
151
|
-
"Sungrow HV",
|
152
|
-
"Kaco HV",
|
153
|
-
"Kaco HV",
|
154
|
-
"Ingeteam HV",
|
155
|
-
"Ingeteam HV",
|
156
|
-
"SMA SBS 2.5 HV",
|
157
|
-
"",
|
158
|
-
"SMA SBS 2.5 HV",
|
159
|
-
"Fronius HV"
|
143
|
+
"Fronius HV", //0
|
144
|
+
"Goodwe HV", //1
|
145
|
+
"Fronius HV", //2
|
146
|
+
"Kostal HV", //3
|
147
|
+
"Goodwe HV", //4
|
148
|
+
"SMA SBS3.7/5.0", //5
|
149
|
+
"Kostal HV", //6
|
150
|
+
"SMA SBS3.7/5.0", //7
|
151
|
+
"Sungrow HV", //8
|
152
|
+
"Sungrow HV", //9
|
153
|
+
"Kaco HV", //10
|
154
|
+
"Kaco HV", //11
|
155
|
+
"Ingeteam HV", //12
|
156
|
+
"Ingeteam HV", //13
|
157
|
+
"SMA SBS 2.5 HV", //14
|
158
|
+
"undefined", //15
|
159
|
+
"SMA SBS 2.5 HV", //16
|
160
|
+
"Fronius HV", //17
|
161
|
+
"undefined", //18
|
162
|
+
"SMA STP" //19
|
160
163
|
];
|
161
164
|
|
162
165
|
const myINVsLVS = [
|
@@ -179,7 +182,8 @@ const myINVsLVS = [
|
|
179
182
|
"SMA SBS2.5 HV",
|
180
183
|
"Solar Edge LV",
|
181
184
|
"Solar Edge LV",
|
182
|
-
"Solar Edge LV"
|
185
|
+
"Solar Edge LV",
|
186
|
+
"unknown"
|
183
187
|
];
|
184
188
|
|
185
189
|
|
@@ -439,11 +443,9 @@ function decodePacket0(data) {
|
|
439
443
|
}
|
440
444
|
hvsBMS = "V" + byteArray[31].toString() + "." + byteArray[32].toString() + "-" + String.fromCharCode(byteArray[34] + 65);
|
441
445
|
hvsModules = parseInt((byteArray[36] - 16).toString());
|
442
|
-
if (byteArray[38] ===
|
443
|
-
|
444
|
-
|
445
|
-
hvsGrid = "OffGrid";
|
446
|
-
}
|
446
|
+
if (byteArray[38] === 0) {hvsGrid = "OffGrid";}
|
447
|
+
if (byteArray[38] === 1) {hvsGrid = "OnGrid";}
|
448
|
+
if (byteArray[38] === 2) {hvsGrid = "Backup";}
|
447
449
|
/* if ((ConfBatDetails) && (hvsModules > 2)) {
|
448
450
|
adapter.log.error("Sorry, Details at the moment only for two modules. I need a wireshark dump from bigger systems to adjust the adapter.");
|
449
451
|
ConfBatDetails = false;
|
@@ -516,6 +518,16 @@ function decodePacket2(data) {
|
|
516
518
|
hvsNumCells = hvsModules * 7;
|
517
519
|
hvsNumTemps = 0;
|
518
520
|
}
|
521
|
+
if (hvsBattType_fromSerial == "LVS") { //unterschiedliche WR-Tabelle je nach Batt-Typ
|
522
|
+
hvsInvType_String = myINVsLVS[hvsInvType];
|
523
|
+
}
|
524
|
+
else {
|
525
|
+
hvsInvType_String = myINVs[hvsInvType];
|
526
|
+
}
|
527
|
+
if (hvsInvType_String == undefined) {
|
528
|
+
hvsInvType_String = "undefined";
|
529
|
+
}
|
530
|
+
|
519
531
|
if (hvsNumCells > 160) { hvsNumCells = 160; }
|
520
532
|
if (hvsNumTemps > 64) { hvsNumTemps = 64; }
|
521
533
|
if (ConfBatDetails && FirstRun) {
|
@@ -657,7 +669,9 @@ function setStates() {
|
|
657
669
|
adapter.log.silly("hvsError >" + hvsError + "<");
|
658
670
|
adapter.log.silly("hvsErrorStr >" + hvsErrorString + "<");
|
659
671
|
adapter.log.silly("hvsSOC (Diag) >" + hvsSOCDiagnosis + "<");
|
660
|
-
|
672
|
+
adapter.log.silly("BattType >" + hvsBattType_fromSerial + "<");
|
673
|
+
adapter.log.silly("Invert. Type >" + hvsInvType_String + ", Nr: " + hvsInvType + "<");
|
674
|
+
|
661
675
|
adapter.setState("System.Serial", hvsSerial, true);
|
662
676
|
adapter.setState("System.BMU", hvsBMU, true);
|
663
677
|
adapter.setState("System.BMUBankA", hvsBMUA, true);
|
@@ -687,12 +701,10 @@ function setStates() {
|
|
687
701
|
adapter.setState("State.Power_Consumption", 0, true);
|
688
702
|
adapter.setState("State.Power_Delivery", -hvsPower, true);
|
689
703
|
}
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
adapter.setState("System.InvType", myINVs[hvsInvType], true);
|
695
|
-
}
|
704
|
+
|
705
|
+
adapter.setState("System.BattType", hvsBattType_fromSerial, true);
|
706
|
+
adapter.setState("System.InvType", hvsInvType_String, true);
|
707
|
+
|
696
708
|
if (myNumberforDetails == 0) {
|
697
709
|
adapter.setState("Diagnosis.mVoltMax", hvsMaxmVolt, true);
|
698
710
|
adapter.setState("Diagnosis.mVoltMin", hvsMinmVolt, true);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "iobroker.bydhvs",
|
3
|
-
"version": "1.4.
|
3
|
+
"version": "1.4.2",
|
4
4
|
"description": "BYD HVS Battery poll data",
|
5
5
|
"author": {
|
6
6
|
"name": "Christian",
|
@@ -17,29 +17,29 @@
|
|
17
17
|
},
|
18
18
|
"dependencies": {
|
19
19
|
"@iobroker/adapter-core": "^2.6.7",
|
20
|
-
"crc": "4.
|
20
|
+
"crc": "4.3.2"
|
21
21
|
},
|
22
22
|
"devDependencies": {
|
23
|
-
"@alcalzone/release-script": "^3.
|
24
|
-
"@iobroker/testing": "^
|
25
|
-
"@types/chai": "^4.3.
|
23
|
+
"@alcalzone/release-script": "^3.6.0",
|
24
|
+
"@iobroker/testing": "^4.1.0",
|
25
|
+
"@types/chai": "^4.3.6",
|
26
26
|
"@types/chai-as-promised": "^7.1.5",
|
27
|
-
"@types/gulp": "^4.0.
|
28
|
-
"@types/mocha": "^
|
29
|
-
"@types/node": "^18.
|
27
|
+
"@types/gulp": "^4.0.10",
|
28
|
+
"@types/mocha": "^10.0.1",
|
29
|
+
"@types/node": "^18.14.2",
|
30
30
|
"@types/proxyquire": "^1.3.28",
|
31
31
|
"@types/sinon": "^10.0.13",
|
32
|
-
"@types/sinon-chai": "^3.2.
|
33
|
-
"axios": "^
|
34
|
-
"chai": "^4.3.
|
32
|
+
"@types/sinon-chai": "^3.2.9",
|
33
|
+
"axios": "^1.3.4",
|
34
|
+
"chai": "^4.3.8",
|
35
35
|
"chai-as-promised": "^7.1.1",
|
36
|
-
"eslint": "^8.
|
36
|
+
"eslint": "^8.35.0",
|
37
37
|
"gulp": "^4.0.2",
|
38
|
-
"mocha": "^10.
|
38
|
+
"mocha": "^10.2.0",
|
39
39
|
"proxyquire": "^2.1.3",
|
40
|
-
"sinon": "^
|
40
|
+
"sinon": "^15.0.1",
|
41
41
|
"sinon-chai": "^3.7.0",
|
42
|
-
"typescript": "^4.
|
42
|
+
"typescript": "^4.9.5"
|
43
43
|
},
|
44
44
|
"main": "main.js",
|
45
45
|
"scripts": {
|