@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.
package/dist/index.js CHANGED
@@ -27155,45 +27155,79 @@ var SolixClient = class _SolixClient {
27155
27155
  import { EventEmitter as EventEmitter10 } from "node:events";
27156
27156
  var SOLIX_METER_FIELD_NAMES = {
27157
27157
  168: "meterPowerL1",
27158
+ // Anker Modbus: primary_phase_1_active_power
27158
27159
  169: "meterPowerL2",
27160
+ // Anker Modbus: primary_phase_2_active_power
27159
27161
  170: "meterPowerL3",
27162
+ // Anker Modbus: primary_phase_3_active_power
27160
27163
  171: "meterPowerTotal",
27164
+ // Anker Modbus: primary_total_active_power
27161
27165
  172: "meterVoltageL1",
27166
+ // Anker Modbus: primary_phase_1_voltage
27162
27167
  173: "meterVoltageL2",
27168
+ // Anker Modbus: primary_phase_2_voltage
27163
27169
  174: "meterVoltageL3",
27170
+ // Anker Modbus: primary_phase_3_voltage
27164
27171
  175: "meterCurrentL1",
27172
+ // Anker Modbus: primary_phase_1_current
27165
27173
  176: "meterCurrentL2",
27174
+ // Anker Modbus: primary_phase_2_current
27166
27175
  177: "meterCurrentL3",
27176
+ // Anker Modbus: primary_phase_3_current
27167
27177
  179: "meterImportEnergy",
27178
+ // Anker Modbus: primary_total_forward_active_energy
27168
27179
  180: "meterExportEnergy"
27180
+ // Anker Modbus: primary_total_reverse_active_energy
27169
27181
  };
27170
27182
  var SOLIX_METER_PRODUCT_PREFIXES = ["AE1X0"];
27171
27183
  var SOLIX_SOLARBANK_PRODUCT_PREFIX = "AE10";
27172
27184
  var SOLIX_SOLARBANK_FIELD_NAMES = {
27173
27185
  171: "photovoltaicPower",
27174
- // total PV input across the strings
27186
+ // total PV input across the strings — Anker Modbus: pv_power
27175
27187
  172: "batteryPower",
27188
+ // signed net pack power — Anker Modbus: battery_charging_power − battery_discharging_power
27176
27189
  188: "chargePower",
27190
+ // Anker Modbus: battery_charging_power
27177
27191
  173: "dischargePower",
27192
+ // Anker Modbus: battery_discharging_power
27178
27193
  174: "acPlugPower",
27194
+ // AC plug, signed — Anker Modbus: ac_grid_output_power
27179
27195
  175: "socketPower",
27180
- // the unit's own on-board AC socket (an appliance plugged into the Solarbank)
27196
+ // the unit's own on-board AC socket (an appliance plugged into the Solarbank) — no Anker register
27181
27197
  196: "gridInputPower",
27198
+ // Anker Modbus: grid_import_power
27182
27199
  197: "homeLoadPower",
27200
+ // Anker Modbus: load_power
27183
27201
  198: "pv1Power",
27184
- // the four PV-string inputs (0 when a string is unused / dark)
27202
+ // the four PV-string inputs (0 when a string is unused / dark); Anker exposes only a pv_power total
27185
27203
  199: "pv2Power",
27186
27204
  200: "pv3Power",
27187
27205
  201: "pv4Power"
27188
27206
  };
27189
27207
  var SOLIX_STATE_FIELD_NAMES = {
27190
27208
  169: "mode",
27191
- // current operating (EMS) mode (1 custom, 2 self-consumption, 4 rapid charge, 7 smart, 8 dynamic tariff)
27209
+ // current operating (EMS) mode, AE103 numbering: 1 custom, 2 self-consumption, 4 rapid charge, 7 smart, 8 dynamic tariff (NOT the Modbus SOLIX_MODBUS_EMS_MODES numbering)
27192
27210
  170: "maxLoad"
27193
27211
  // configured max home load (W) — matches get_site_device_param max_load
27194
27212
  // NOTE `0xab` is grid-in/out-related power but its exact meaning is not yet pinned, so it stays raw
27195
27213
  // `state_ab` (a diagnostic a consumer can watch) rather than being asserted under a guessed name.
27196
27214
  };
27215
+ var SOLIX_MODBUS_EMS_MODES = {
27216
+ 0: "selfConsumption",
27217
+ // Self-Consumption Mode (Anker: self_consumption, 0x8006 BIT0)
27218
+ 1: "timeOfUse",
27219
+ // Time Of Use Mode (Anker: tou_mode, BIT1)
27220
+ 3: "thirdPartyControl",
27221
+ // Third-Party Controlled (Anker: third_party_control, BIT5)
27222
+ 4: "custom",
27223
+ // Custom Mode (Anker: custom_mode, BIT2)
27224
+ 5: "socketOverlay",
27225
+ // Socket Overlay Mode (Anker: socket_overlay_mode, BIT4)
27226
+ 6: "smart",
27227
+ // Smart Mode (Anker: smart_mode, BIT3)
27228
+ 7: "dynamicTariff"
27229
+ // Dynamic Tariff Mode (Anker: dynamic_pricing, BIT6)
27230
+ };
27197
27231
  function solixStateReadings(frame) {
27198
27232
  const out = {};
27199
27233
  for (const [tag2, value] of frame.fields) {
@@ -27280,6 +27314,7 @@ function addSolarbankScalars(frame, out) {
27280
27314
  const body = frame.fields.get(164)?.subarray(1);
27281
27315
  if (body && body.length >= 8 && body[body.length - 6] === soc) {
27282
27316
  out.batteryTemperature = body[body.length - 8];
27317
+ out.batteryHealth = body[body.length - 5];
27283
27318
  }
27284
27319
  }
27285
27320
  const b5 = frame.fields.get(181);
@@ -27756,6 +27791,7 @@ export {
27756
27791
  SMOKE_MEMBERS,
27757
27792
  SOLIX_ENERGY_METER_MEMBERS,
27758
27793
  SOLIX_LOCAL_KEY_HEX,
27794
+ SOLIX_MODBUS_EMS_MODES,
27759
27795
  STATE_EVENT_FIELDS,
27760
27796
  STATION_CHANNEL3 as STATION_CHANNEL,
27761
27797
  STATION_CHUNK_BYTES,