@mega-yfue/eufy-sdk 0.2.0-beta.22 → 0.2.0-beta.24

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.
@@ -5,3 +5,4 @@ export * from "./broker-discovery.js";
5
5
  export * from "./biz-stream.js";
6
6
  export { SolixMqtt } from "./solix-mqtt.js";
7
7
  export type { SolixMqttOptions, SolixMqttDevice, SolixReading, SolixParamFrame, SolixChannel } from "./solix-mqtt.js";
8
+ export { SOLIX_MODBUS_EMS_MODES } from "./solix-mqtt.js";
@@ -46,10 +46,20 @@ export interface SolixParamFrame {
46
46
  * slots read 0 on a single-CT install.
47
47
  *
48
48
  * The frame carries sixteen float slots (`0xa8`..`0xb7`). The four that name no field — `0xb2`, `0xb5`,
49
- * `0xb6`, `0xb7` — stay raw `channel_<hex tag>` (see {@link solixReadings}). `0xb2` in particular is NOT
50
- * a current total: under a 1.371 A line current it reads 0.009, three orders of magnitude off. Both
51
- * `0xb2` and `0xb7` read zero at idle and non-zero under load, so they carry *something* load-related;
52
- * what, is not established.
49
+ * `0xb6`, `0xb7` — stay raw `channel_<hex tag>` (see {@link solixReadings}). Both `0xb2` and `0xb7` read
50
+ * zero at idle and non-zero under load, so they carry *something* load-related; what, is not established.
51
+ * `0xb2` is dimensionally consistent with **power factor** and rules **reactive power** out: on the same
52
+ * frame the line reads ~240 V at 1.371 A (apparent power S = V·I ≈ 328 VA), so a reactive-power slot would
53
+ * read in the hundreds of VAR, not `0xb2`'s 0.009 — whereas a power factor P/S is a sub-unity ratio of the
54
+ * right magnitude (~0.008). It is left raw regardless, since a single frame doesn't pin it. `0xb7` (~0.1
55
+ * under load) has no such magnitude tell and stays fully open.
56
+ *
57
+ * Each name is annotated with the equivalent register from Anker's OWN vendor integration for the
58
+ * newer Modbus-TCP meter generation (Smart Meter Gen 2), which independently corroborates the meaning
59
+ * of each tag: our `meterPowerL1` is their `primary_phase_1_active_power`, and so on. Same physical
60
+ * quantities, different hardware/transport (their meter reports two CT channels — `primary` and
61
+ * `secondary` — and also exposes `reactive_power`, `power_factor` and per-phase energy, none of which
62
+ * this single-channel ff09 frame carries).
53
63
  *
54
64
  * This table is **meter-family-specific**: the same tag carries a different quantity on another Solix
55
65
  * device (a Solarbank's `0xac` reads a power value, not a voltage), so {@link solixReadings} applies
@@ -92,6 +102,13 @@ export declare const SOLIX_SOLARBANK_PRODUCT_PREFIX = "AE10";
92
102
  * (a uint8) and temperature from the `0xa4` BMS status blob. The 4 PV-string channels (`0xc6`–`0xc9`),
93
103
  * the AC currents (`0xb2`/`0xb3`) and export energy (`0xb4`) are not yet confirmed, so they stay raw
94
104
  * `channel_<hex>` until a capture pins them.
105
+ *
106
+ * Names are annotated with the equivalent register from Anker's OWN vendor integration for the newer
107
+ * Modbus-TCP Solarbank generation (which includes a "Solarbank 4 E5000 Pro" config — the same product as
108
+ * `AE103`, a newer hardware rev), cross-checking each meaning. Their integration splits our signed
109
+ * `batteryPower` into `battery_charging_power` / `battery_discharging_power` off one register, and exposes
110
+ * a single `pv_power` total rather than our four per-string channels; `socketPower` (the on-board AC
111
+ * outlet) has no register there. Same quantities, different transport.
95
112
  */
96
113
  export declare const SOLIX_SOLARBANK_FIELD_NAMES: Readonly<Record<number, string>>;
97
114
  /**
@@ -103,6 +120,28 @@ export declare const SOLIX_SOLARBANK_FIELD_NAMES: Readonly<Record<number, string
103
120
  * stays raw `state_<hex>` until confirmed the same way.
104
121
  */
105
122
  export declare const SOLIX_STATE_FIELD_NAMES: Readonly<Record<number, string>>;
123
+ /**
124
+ * The Solarbank EMS `operating_mode` enumeration from Anker's OWN vendor integration for the newer
125
+ * **Modbus-TCP** hardware rev (Solarbank 4 E5000 Pro, register `operating_mode` gated by the `0x8006`
126
+ * capability mask). Value → English label:
127
+ * - `0` selfConsumption — "Self-Consumption Mode"
128
+ * - `1` timeOfUse — "Time Of Use Mode"
129
+ * - `3` thirdPartyControl — "Third-Party Controlled"
130
+ * - `4` custom — "Custom Mode"
131
+ * - `5` socketOverlay — "Socket Overlay Mode"
132
+ * - `6` smart — "Smart Mode"
133
+ * - `7` dynamicTariff — "Dynamic Tariff Mode"
134
+ *
135
+ * Value `2` is unassigned there — seven modes across `{0,1,3,4,5,6,7}`, not eight.
136
+ *
137
+ * NOT a decoder for this SDK's ff09 `mode` (`state_info` tag `0xa9`): that OLDER cloud/MQTT `AE103`
138
+ * numbering is DIFFERENT on every value — `1`=custom, `2`=self-consumption, `4`=rapid charge, `7`=smart,
139
+ * `8`=dynamic tariff (recorded on the `0xa9` field above, correlated against the app). Labelling an ff09
140
+ * `mode` value with this Modbus map would be confidently wrong. It is exported as the vendor's own
141
+ * reference enumeration and the thing an AE103 `0xa9` correlation capture would be checked against —
142
+ * fold the two only if such a capture proves the numbers match.
143
+ */
144
+ export declare const SOLIX_MODBUS_EMS_MODES: Readonly<Record<number, string>>;
106
145
  /**
107
146
  * Decode a `state_info` ff09 frame to named + raw settings values. Skips the header tags (`< 0xa5`:
108
147
  * request marker, serial, timestamps). Each settings tag is emitted under `state_<hex>` (a plain number
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mega-yfue/eufy-sdk",
3
- "version": "0.2.0-beta.22",
3
+ "version": "0.2.0-beta.24",
4
4
  "description": "One typed TypeScript client for the Anker eufy v6 cloud — capability-driven devices, realtime events over P2P/MQTT/push, and live media",
5
5
  "license": "Apache-2.0",
6
6
  "author": "mega-yfue",