@mega-yfue/eufy-sdk 0.2.0-beta.16 → 0.2.0-beta.17
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/dist/index.js +101 -10
- package/dist/index.js.map +2 -2
- package/dist/model/capabilities/solix.d.ts +102 -15
- package/dist/transport/mqtt/solix-mqtt.d.ts +37 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13631,11 +13631,7 @@ function inspectParams(rec, sn) {
|
|
|
13631
13631
|
|
|
13632
13632
|
// dist/model/capabilities/solix.js
|
|
13633
13633
|
var SOLIX_ENERGY_METER_MEMBERS = {
|
|
13634
|
-
/**
|
|
13635
|
-
* Line-1 voltage (V), ff09 tag `0xAC` — the ONE confirmed meter binding, matched against a live
|
|
13636
|
-
* single-phase frame (a nominal mains voltage). Read-only; the evidence gate installs its getter only
|
|
13637
|
-
* once a frame carrying `0xAC` has landed, so it is absent (not a fabricated `0`) until then.
|
|
13638
|
-
*/
|
|
13634
|
+
/** Line-1 voltage (V), ff09 tag `0xAC` — confirmed live (a nominal mains voltage). */
|
|
13639
13635
|
meterVoltageL1: {
|
|
13640
13636
|
param: 172,
|
|
13641
13637
|
type: "number",
|
|
@@ -13643,6 +13639,87 @@ var SOLIX_ENERGY_METER_MEMBERS = {
|
|
|
13643
13639
|
unit: "V",
|
|
13644
13640
|
provenance: "verified",
|
|
13645
13641
|
description: "Meter line-1 voltage (V) \u2014 ff09 tag 0xAC, confirmed against a live single-phase frame."
|
|
13642
|
+
},
|
|
13643
|
+
/** Line-2 voltage (V), ff09 tag `0xAD` — the app's field; reads 0 until a multi-phase frame carries it. */
|
|
13644
|
+
meterVoltageL2: {
|
|
13645
|
+
param: 173,
|
|
13646
|
+
type: "number",
|
|
13647
|
+
kind: "scalar",
|
|
13648
|
+
unit: "V",
|
|
13649
|
+
provenance: "guessed",
|
|
13650
|
+
description: "Meter line-2 voltage (V) \u2014 ff09 tag 0xAD; phase assignment inferred from block ordering (never observed non-zero), 0 on a single-phase install."
|
|
13651
|
+
},
|
|
13652
|
+
/** Line-3 voltage (V), ff09 tag `0xAE` — the app's field; reads 0 until a multi-phase frame carries it. */
|
|
13653
|
+
meterVoltageL3: {
|
|
13654
|
+
param: 174,
|
|
13655
|
+
type: "number",
|
|
13656
|
+
kind: "scalar",
|
|
13657
|
+
unit: "V",
|
|
13658
|
+
provenance: "guessed",
|
|
13659
|
+
description: "Meter line-3 voltage (V) \u2014 ff09 tag 0xAE; phase assignment inferred from block ordering (never observed non-zero), 0 on a single-phase install."
|
|
13660
|
+
},
|
|
13661
|
+
/** Line-1 current (A), ff09 tag `0xAF` — confirmed live (the line's CT current). */
|
|
13662
|
+
meterCurrentL1: {
|
|
13663
|
+
param: 175,
|
|
13664
|
+
type: "number",
|
|
13665
|
+
kind: "scalar",
|
|
13666
|
+
unit: "A",
|
|
13667
|
+
provenance: "verified",
|
|
13668
|
+
description: "Meter line-1 current (A) \u2014 ff09 tag 0xAF, confirmed against a live single-phase frame."
|
|
13669
|
+
},
|
|
13670
|
+
/** Line-2 current (A), ff09 tag `0xB0` — the app's field; reads 0 until a multi-phase frame carries it. */
|
|
13671
|
+
meterCurrentL2: {
|
|
13672
|
+
param: 176,
|
|
13673
|
+
type: "number",
|
|
13674
|
+
kind: "scalar",
|
|
13675
|
+
unit: "A",
|
|
13676
|
+
provenance: "guessed",
|
|
13677
|
+
description: "Meter line-2 current (A) \u2014 ff09 tag 0xB0; phase assignment inferred from block ordering (never observed non-zero), 0 on a single-phase install."
|
|
13678
|
+
},
|
|
13679
|
+
/** Line-3 current (A), ff09 tag `0xB1` — the app's field; reads 0 until a multi-phase frame carries it. */
|
|
13680
|
+
meterCurrentL3: {
|
|
13681
|
+
param: 177,
|
|
13682
|
+
type: "number",
|
|
13683
|
+
kind: "scalar",
|
|
13684
|
+
unit: "A",
|
|
13685
|
+
provenance: "guessed",
|
|
13686
|
+
description: "Meter line-3 current (A) \u2014 ff09 tag 0xB1; phase assignment inferred from block ordering (never observed non-zero), 0 on a single-phase install."
|
|
13687
|
+
},
|
|
13688
|
+
/** Line-1 active power (W), ff09 tag `0xA8` — confirmed live; negative on export. */
|
|
13689
|
+
meterPowerL1: {
|
|
13690
|
+
param: 168,
|
|
13691
|
+
type: "number",
|
|
13692
|
+
kind: "scalar",
|
|
13693
|
+
unit: "W",
|
|
13694
|
+
provenance: "verified",
|
|
13695
|
+
description: "Meter line-1 active power (W) \u2014 ff09 tag 0xA8, confirmed live; negative on export."
|
|
13696
|
+
},
|
|
13697
|
+
/** Line-2 active power (W), ff09 tag `0xA9` — the app's field; reads 0 until a multi-phase frame carries it. */
|
|
13698
|
+
meterPowerL2: {
|
|
13699
|
+
param: 169,
|
|
13700
|
+
type: "number",
|
|
13701
|
+
kind: "scalar",
|
|
13702
|
+
unit: "W",
|
|
13703
|
+
provenance: "guessed",
|
|
13704
|
+
description: "Meter line-2 active power (W) \u2014 ff09 tag 0xA9; phase assignment inferred from block ordering (never observed non-zero), 0 on a single-phase install."
|
|
13705
|
+
},
|
|
13706
|
+
/** Line-3 active power (W), ff09 tag `0xAA` — the app's field; reads 0 until a multi-phase frame carries it. */
|
|
13707
|
+
meterPowerL3: {
|
|
13708
|
+
param: 170,
|
|
13709
|
+
type: "number",
|
|
13710
|
+
kind: "scalar",
|
|
13711
|
+
unit: "W",
|
|
13712
|
+
provenance: "guessed",
|
|
13713
|
+
description: "Meter line-3 active power (W) \u2014 ff09 tag 0xAA; phase assignment inferred from block ordering (never observed non-zero), 0 on a single-phase install."
|
|
13714
|
+
},
|
|
13715
|
+
/** Aggregate active power (W), ff09 tag `0xAB` — confirmed live; equals line-1 on a single phase. */
|
|
13716
|
+
meterPowerTotal: {
|
|
13717
|
+
param: 171,
|
|
13718
|
+
type: "number",
|
|
13719
|
+
kind: "scalar",
|
|
13720
|
+
unit: "W",
|
|
13721
|
+
provenance: "verified",
|
|
13722
|
+
description: "Meter total active power (W) \u2014 ff09 tag 0xAB, confirmed live; equals L1 on one phase."
|
|
13646
13723
|
}
|
|
13647
13724
|
};
|
|
13648
13725
|
var CATEGORY_CAPABILITIES = {
|
|
@@ -26529,8 +26606,20 @@ var SolixClient = class {
|
|
|
26529
26606
|
// dist/transport/mqtt/solix-mqtt.js
|
|
26530
26607
|
import { EventEmitter as EventEmitter10 } from "node:events";
|
|
26531
26608
|
var SOLIX_METER_FIELD_NAMES = {
|
|
26532
|
-
|
|
26609
|
+
168: "meterPowerL1",
|
|
26610
|
+
169: "meterPowerL2",
|
|
26611
|
+
170: "meterPowerL3",
|
|
26612
|
+
171: "meterPowerTotal",
|
|
26613
|
+
172: "meterVoltageL1",
|
|
26614
|
+
173: "meterVoltageL2",
|
|
26615
|
+
174: "meterVoltageL3",
|
|
26616
|
+
175: "meterCurrentL1",
|
|
26617
|
+
176: "meterCurrentL2",
|
|
26618
|
+
177: "meterCurrentL3",
|
|
26619
|
+
179: "meterImportEnergy",
|
|
26620
|
+
180: "meterExportEnergy"
|
|
26533
26621
|
};
|
|
26622
|
+
var SOLIX_METER_PRODUCT_PREFIXES = ["AE1X0"];
|
|
26534
26623
|
function readSolixChannel(value) {
|
|
26535
26624
|
if (!value || value.length < 1)
|
|
26536
26625
|
return void 0;
|
|
@@ -26564,8 +26653,9 @@ function decodeSolixParamFrame(buf) {
|
|
|
26564
26653
|
deviceSn = a2.subarray(1).toString("latin1").replace(/\0+$/, "") || void 0;
|
|
26565
26654
|
return { deviceSn, fields };
|
|
26566
26655
|
}
|
|
26567
|
-
function solixReadings(frame) {
|
|
26656
|
+
function solixReadings(frame, productCode) {
|
|
26568
26657
|
const out = {};
|
|
26658
|
+
const named = SOLIX_METER_PRODUCT_PREFIXES.some((p) => productCode.startsWith(p));
|
|
26569
26659
|
for (const [tag2, value] of frame.fields) {
|
|
26570
26660
|
if (tag2 < 166)
|
|
26571
26661
|
continue;
|
|
@@ -26573,7 +26663,7 @@ function solixReadings(frame) {
|
|
|
26573
26663
|
if (ch?.type !== 5 || ch.float === void 0)
|
|
26574
26664
|
continue;
|
|
26575
26665
|
out[`channel_${tag2.toString(16)}`] = ch.float;
|
|
26576
|
-
const name = SOLIX_METER_FIELD_NAMES[tag2];
|
|
26666
|
+
const name = named ? SOLIX_METER_FIELD_NAMES[tag2] : void 0;
|
|
26577
26667
|
if (name)
|
|
26578
26668
|
out[name] = ch.float;
|
|
26579
26669
|
}
|
|
@@ -26755,12 +26845,13 @@ var SolixMqtt = class extends EventEmitter10 {
|
|
|
26755
26845
|
if (!frame)
|
|
26756
26846
|
return;
|
|
26757
26847
|
const parts = topic.split("/");
|
|
26848
|
+
const productCode = parts[2] ?? "";
|
|
26758
26849
|
const reading = {
|
|
26759
26850
|
deviceSn: frame.deviceSn ?? parts[3] ?? "",
|
|
26760
|
-
productCode
|
|
26851
|
+
productCode,
|
|
26761
26852
|
topic,
|
|
26762
26853
|
frame,
|
|
26763
|
-
values: solixReadings(frame)
|
|
26854
|
+
values: solixReadings(frame, productCode)
|
|
26764
26855
|
};
|
|
26765
26856
|
this.emit("reading", reading);
|
|
26766
26857
|
}
|