@enyo-energy/energy-app-sdk 1.46.0 → 1.48.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.
Files changed (34) hide show
  1. package/README.md +41 -0
  2. package/dist/cjs/energy-app-model-feature.enum.cjs +2 -0
  3. package/dist/cjs/energy-app-model-feature.enum.d.cts +2 -0
  4. package/dist/cjs/implementations/storage/battery-charge-now-validators.cjs +81 -0
  5. package/dist/cjs/implementations/storage/battery-charge-now-validators.d.cts +57 -0
  6. package/dist/cjs/index.cjs +1 -0
  7. package/dist/cjs/index.d.cts +1 -0
  8. package/dist/cjs/integrations/inverter-integration-energy-app.cjs +20 -0
  9. package/dist/cjs/integrations/inverter-integration-energy-app.d.cts +9 -1
  10. package/dist/cjs/types/enyo-data-bus-value.cjs +89 -1
  11. package/dist/cjs/types/enyo-data-bus-value.d.cts +257 -0
  12. package/dist/cjs/types/enyo-energy-manager.cjs +10 -0
  13. package/dist/cjs/types/enyo-energy-manager.d.cts +10 -0
  14. package/dist/cjs/types/enyo-inverter-appliance.cjs +6 -0
  15. package/dist/cjs/types/enyo-inverter-appliance.d.cts +7 -1
  16. package/dist/cjs/version.cjs +1 -1
  17. package/dist/cjs/version.d.cts +1 -1
  18. package/dist/energy-app-model-feature.enum.d.ts +2 -0
  19. package/dist/energy-app-model-feature.enum.js +2 -0
  20. package/dist/implementations/storage/battery-charge-now-validators.d.ts +57 -0
  21. package/dist/implementations/storage/battery-charge-now-validators.js +76 -0
  22. package/dist/index.d.ts +1 -0
  23. package/dist/index.js +1 -0
  24. package/dist/integrations/inverter-integration-energy-app.d.ts +9 -1
  25. package/dist/integrations/inverter-integration-energy-app.js +20 -0
  26. package/dist/types/enyo-data-bus-value.d.ts +257 -0
  27. package/dist/types/enyo-data-bus-value.js +88 -0
  28. package/dist/types/enyo-energy-manager.d.ts +10 -0
  29. package/dist/types/enyo-energy-manager.js +10 -0
  30. package/dist/types/enyo-inverter-appliance.d.ts +7 -1
  31. package/dist/types/enyo-inverter-appliance.js +6 -0
  32. package/dist/version.d.ts +1 -1
  33. package/dist/version.js +1 -1
  34. package/package.json +1 -1
package/README.md CHANGED
@@ -4103,6 +4103,7 @@ Drives a PV inverter. Controls grid feed-in limits and publishes electrical metr
4103
4103
  - **Implement:** `handleSetInverterFeedInLimit` (`data.feedInLimitW` may be `null` to clear), `handleGridOperatorPowerLimitation`.
4104
4104
  - **Publish helpers:**
4105
4105
  - `publishInverterValuesUpdate(applianceId, data)` — DC strings, AC voltages, total PV power, operating state.
4106
+ - `publishGridStatusUpdate(applianceId, data)` — grid outage detection: reports `EnyoGridStatusEnum.OnGrid` / `OffGrid` (plus optional `sinceIso` and `backupPowerActive`) as a `GridStatusUpdateV1` message. Only for inverters declaring `EnyoInverterApplianceAvailableFeaturesEnum.GridOutageDetection`; publish on every status change and once on startup.
4106
4107
 
4107
4108
  ### AirConditioningIntegrationEnergyApp
4108
4109
 
@@ -5154,6 +5155,46 @@ A session kept running because it **must not be paused** at all — the charger'
5154
5155
 
5155
5156
  **Fluctuating PV surplus.** When the surplus jumps around (clouds passing) and the energy manager holds an appliance's power steady instead of following every dip, state `PvSurplusFluctuating` (category `PvSurplus`) with `powerW` set to the power being held — e.g. "Charging power held steady while clouds pass." / "Ladeleistung wird gehalten, solange Wolken durchziehen." It is a smoothing decision, told apart from `PvSurplusAvailable` / `PvSurplusUnavailable`.
5156
5157
 
5158
+ ## Battery Charge Now
5159
+
5160
+ A one-time user request to charge a home battery to full — or to a target SoC — right now. The request is a data bus message **addressed to the battery appliance** but **handled by the energy manager**. The battery integration ignores it, and the energy manager charges the battery with its regular storage commands. If the request went to the battery integration directly, the energy manager's next optimization cycle would override it.
5161
+
5162
+ ```
5163
+ App ──RequestBatteryChargeNowV1 (applianceId = battery)──▶ Energy manager ──SetStorageControlV2 (Charge, reason UserRequest)──▶ Battery integration
5164
+ ▲ │
5165
+ └──────────────BatteryChargeNowStatusV1 (accepted → running → completed / cancelled / aborted / rejected)
5166
+ ```
5167
+
5168
+ | Message | Sent by | Purpose |
5169
+ |---|---|---|
5170
+ | `RequestBatteryChargeNowV1` | app / core | Start: optional `targetSocPercent` (default 100), `allowGridCharging` (default: allowed), `maxDurationMinutes` (safety stop) |
5171
+ | `CancelBatteryChargeNowV1` | app / core | Stop early. Optional `requestMessageId` to cancel only that request. Idempotent |
5172
+ | `BatteryChargeNowStatusV1` | energy manager | Progress for the request's `id`: `state`, `stopReason`, `effectiveTargetSocPercent`, `currentSocPercent`, `chargingPowerW`, `estimatedCompletionIso` |
5173
+
5174
+ **Offer the button only when someone will act on it.** The app shows "charge battery full now" only if the active energy manager declares `EnergyManagerFeatureEnum.BatteryChargeNow` (check `EnergyManagerInfo.features`) and the battery allows control (`controlAllowed` is not `false`, and its `features` include `ManualCharge` when the list is given).
5175
+
5176
+ **What the energy manager must do:**
5177
+
5178
+ - Validate the request with `validateBatteryChargeNowRequest(message, metadata, currentSoc)` and publish the result as the first status: `Accepted`, or `Rejected` with a `stopReason`.
5179
+ - Rank the request above regular optimization (arbitrage, PV priority, EV discharge rules), but below a grid operator limitation (§14a) and device protection. While one of those caps the battery, the request stays `Running`.
5180
+ - Charge with `SetStorageControlV2` (`Controlled` / `Charge`, maximum charging power, reason `UserRequest`). Charge from the grid unless the request says `allowGridCharging: false`. The explicit request overrides the general `BatteryChargeFromGrid` setting.
5181
+ - End with `Completed` when the effective target is reached (the requested target, capped at `maxSoC`), with `Aborted` + `MaxDurationReached` / `BatteryStoppedCharging` / `ApplianceOffline` when it can't be finished, or with `Cancelled` on `CancelBatteryChargeNowV1`. Then return to regular planning.
5182
+ - Keep at most one request per battery: a new request replaces the running one, which ends `Aborted` + `Superseded`.
5183
+
5184
+ ```typescript
5185
+ em.registerFeatures([EnergyManagerFeatureEnum.BatteryChargeNow]);
5186
+
5187
+ dataBus.listenForMessages([EnyoDataBusMessageEnum.RequestBatteryChargeNowV1], (msg) => {
5188
+ const request = msg as EnyoDataBusRequestBatteryChargeNowV1;
5189
+ const battery = appliances.get(request.applianceId);
5190
+ const result = validateBatteryChargeNowRequest(request, battery?.metadata?.battery, currentSoc(request.applianceId));
5191
+ publishStatus(request, result.state, result.stopReason, result.effectiveTargetSocPercent);
5192
+ if (result.state === EnyoBatteryChargeNowStateEnum.Accepted) {
5193
+ startChargeNow(request, result.effectiveTargetSocPercent!);
5194
+ }
5195
+ });
5196
+ ```
5197
+
5157
5198
  ## Dynamic Grid Fees & Tariff Bonuses
5158
5199
 
5159
5200
  An electricity price is rarely one number. It is the energy price, plus the grid operator's network
@@ -23,6 +23,8 @@ var EnergyAppModelFeatureEnum;
23
23
  EnergyAppModelFeatureEnum["PvFeedInLimitation"] = "pv-feed-in-limitation";
24
24
  /** The inverter active power output can be limited */
25
25
  EnergyAppModelFeatureEnum["InverterPowerLimitation"] = "inverter-power-limitation";
26
+ /** The inverter detects grid outages and reports on grid / off grid status */
27
+ EnergyAppModelFeatureEnum["InverterGridOutageDetection"] = "inverter-grid-outage-detection";
26
28
  // Wallbox / Charging
27
29
  /** Charging can be started and stopped remotely */
28
30
  EnergyAppModelFeatureEnum["ChargingStartStop"] = "charging-start-stop";
@@ -17,6 +17,8 @@ export declare enum EnergyAppModelFeatureEnum {
17
17
  PvFeedInLimitation = "pv-feed-in-limitation",
18
18
  /** The inverter active power output can be limited */
19
19
  InverterPowerLimitation = "inverter-power-limitation",
20
+ /** The inverter detects grid outages and reports on grid / off grid status */
21
+ InverterGridOutageDetection = "inverter-grid-outage-detection",
20
22
  /** Charging can be started and stopped remotely */
21
23
  ChargingStartStop = "charging-start-stop",
22
24
  /** The charging power (in Ampere or Watt) can be limited */
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_BATTERY_CHARGE_NOW_TARGET_SOC_PERCENT = void 0;
4
+ exports.validateBatteryChargeNowRequest = validateBatteryChargeNowRequest;
5
+ exports.resolveBatteryChargeNowTargetSoc = resolveBatteryChargeNowTargetSoc;
6
+ const enyo_data_bus_value_js_1 = require("../../types/enyo-data-bus-value.cjs");
7
+ const enyo_battery_appliance_js_1 = require("../../types/enyo-battery-appliance.cjs");
8
+ /** Target SoC in percent a `RequestBatteryChargeNowV1` charges to when it names none. */
9
+ exports.DEFAULT_BATTERY_CHARGE_NOW_TARGET_SOC_PERCENT = 100;
10
+ /**
11
+ * Validates a `RequestBatteryChargeNowV1` against the battery's metadata and
12
+ * current state of charge, and returns whether an energy manager should accept
13
+ * it — the answer to publish as the first `BatteryChargeNowStatusV1`.
14
+ *
15
+ * Rules, in order — the first that fails decides:
16
+ * 1. `targetSocPercent`, when given, is a finite number from 1 to 100, and
17
+ * `maxDurationMinutes`, when given, is a finite positive number
18
+ * (**InvalidRequest**).
19
+ * 2. The battery's metadata sets `controlAllowed: false`, or lists `features`
20
+ * without {@link EnyoBatteryFeature.ManualCharge} (**ControlNotAllowed**).
21
+ * A battery without a `features` list is not rejected, since the list is
22
+ * optional.
23
+ * 3. The current SoC is at or above the effective target (**AlreadyAtTarget**).
24
+ *
25
+ * Without metadata only rule 1 and, given the SoC, rule 3 are checked. Runtime
26
+ * conditions the metadata cannot tell — the battery being offline, battery
27
+ * control switched off in the energy manager settings, no PV surplus for a
28
+ * battery without grid charging — are left to the energy manager.
29
+ *
30
+ * @param message - The request to validate.
31
+ * @param metadata - The battery's metadata, if known.
32
+ * @param currentSocPercent - The battery's current state of charge in percent, if known.
33
+ * @returns `Accepted` with the effective target when every rule holds, otherwise `Rejected` with the reason.
34
+ */
35
+ function validateBatteryChargeNowRequest(message, metadata, currentSocPercent) {
36
+ const { targetSocPercent, maxDurationMinutes } = message.data;
37
+ const targetValid = targetSocPercent === undefined
38
+ || (Number.isFinite(targetSocPercent) && targetSocPercent >= 1 && targetSocPercent <= 100);
39
+ const durationValid = maxDurationMinutes === undefined
40
+ || (Number.isFinite(maxDurationMinutes) && maxDurationMinutes > 0);
41
+ if (!targetValid || !durationValid) {
42
+ return reject(enyo_data_bus_value_js_1.EnyoBatteryChargeNowStopReasonEnum.InvalidRequest);
43
+ }
44
+ const effectiveTargetSocPercent = resolveBatteryChargeNowTargetSoc(targetSocPercent, metadata);
45
+ if (metadata) {
46
+ const lacksManualCharge = metadata.features !== undefined
47
+ && !metadata.features.includes(enyo_battery_appliance_js_1.EnyoBatteryFeature.ManualCharge);
48
+ if (metadata.controlAllowed === false || lacksManualCharge) {
49
+ return reject(enyo_data_bus_value_js_1.EnyoBatteryChargeNowStopReasonEnum.ControlNotAllowed, effectiveTargetSocPercent);
50
+ }
51
+ }
52
+ if (currentSocPercent !== undefined && Number.isFinite(currentSocPercent)
53
+ && currentSocPercent >= effectiveTargetSocPercent) {
54
+ return reject(enyo_data_bus_value_js_1.EnyoBatteryChargeNowStopReasonEnum.AlreadyAtTarget, effectiveTargetSocPercent);
55
+ }
56
+ return { state: enyo_data_bus_value_js_1.EnyoBatteryChargeNowStateEnum.Accepted, effectiveTargetSocPercent };
57
+ }
58
+ /**
59
+ * The SoC in percent a `RequestBatteryChargeNowV1` actually charges to: the
60
+ * requested target (default {@link DEFAULT_BATTERY_CHARGE_NOW_TARGET_SOC_PERCENT}),
61
+ * lowered to the battery's `maxSoC` when that is lower.
62
+ *
63
+ * @param targetSocPercent - The request's `targetSocPercent`, if given.
64
+ * @param metadata - The battery's metadata, if known.
65
+ * @returns The effective target SoC in percent.
66
+ */
67
+ function resolveBatteryChargeNowTargetSoc(targetSocPercent, metadata) {
68
+ const requested = targetSocPercent ?? exports.DEFAULT_BATTERY_CHARGE_NOW_TARGET_SOC_PERCENT;
69
+ const maxSoC = metadata?.maxSoC;
70
+ return maxSoC !== undefined && Number.isFinite(maxSoC) ? Math.min(requested, maxSoC) : requested;
71
+ }
72
+ /**
73
+ * Builds a rejected {@link BatteryChargeNowValidationResult}.
74
+ *
75
+ * @param stopReason - Why the request is rejected.
76
+ * @param effectiveTargetSocPercent - The effective target, when it could be resolved.
77
+ * @returns The rejected result.
78
+ */
79
+ function reject(stopReason, effectiveTargetSocPercent) {
80
+ return { state: enyo_data_bus_value_js_1.EnyoBatteryChargeNowStateEnum.Rejected, stopReason, effectiveTargetSocPercent };
81
+ }
@@ -0,0 +1,57 @@
1
+ import { EnyoBatteryChargeNowStateEnum, EnyoBatteryChargeNowStopReasonEnum, EnyoDataBusRequestBatteryChargeNowV1 } from '../../types/enyo-data-bus-value.cjs';
2
+ import { EnyoBatteryApplianceMetadata } from '../../types/enyo-battery-appliance.cjs';
3
+ /** Target SoC in percent a `RequestBatteryChargeNowV1` charges to when it names none. */
4
+ export declare const DEFAULT_BATTERY_CHARGE_NOW_TARGET_SOC_PERCENT = 100;
5
+ /**
6
+ * Outcome of {@link validateBatteryChargeNowRequest}: whether an energy manager
7
+ * should take a `RequestBatteryChargeNowV1` on, and the target it charges to.
8
+ */
9
+ export interface BatteryChargeNowValidationResult {
10
+ /** {@link EnyoBatteryChargeNowStateEnum.Accepted} or {@link EnyoBatteryChargeNowStateEnum.Rejected}. */
11
+ state: EnyoBatteryChargeNowStateEnum.Accepted | EnyoBatteryChargeNowStateEnum.Rejected;
12
+ /** Why the request is rejected. Set exactly when {@link state} is `Rejected`. */
13
+ stopReason?: EnyoBatteryChargeNowStopReasonEnum;
14
+ /**
15
+ * The SoC in percent to charge to: the requested target (default
16
+ * {@link DEFAULT_BATTERY_CHARGE_NOW_TARGET_SOC_PERCENT}), lowered to the
17
+ * battery's `maxSoC` when that is lower. Absent when the request is
18
+ * malformed.
19
+ */
20
+ effectiveTargetSocPercent?: number;
21
+ }
22
+ /**
23
+ * Validates a `RequestBatteryChargeNowV1` against the battery's metadata and
24
+ * current state of charge, and returns whether an energy manager should accept
25
+ * it — the answer to publish as the first `BatteryChargeNowStatusV1`.
26
+ *
27
+ * Rules, in order — the first that fails decides:
28
+ * 1. `targetSocPercent`, when given, is a finite number from 1 to 100, and
29
+ * `maxDurationMinutes`, when given, is a finite positive number
30
+ * (**InvalidRequest**).
31
+ * 2. The battery's metadata sets `controlAllowed: false`, or lists `features`
32
+ * without {@link EnyoBatteryFeature.ManualCharge} (**ControlNotAllowed**).
33
+ * A battery without a `features` list is not rejected, since the list is
34
+ * optional.
35
+ * 3. The current SoC is at or above the effective target (**AlreadyAtTarget**).
36
+ *
37
+ * Without metadata only rule 1 and, given the SoC, rule 3 are checked. Runtime
38
+ * conditions the metadata cannot tell — the battery being offline, battery
39
+ * control switched off in the energy manager settings, no PV surplus for a
40
+ * battery without grid charging — are left to the energy manager.
41
+ *
42
+ * @param message - The request to validate.
43
+ * @param metadata - The battery's metadata, if known.
44
+ * @param currentSocPercent - The battery's current state of charge in percent, if known.
45
+ * @returns `Accepted` with the effective target when every rule holds, otherwise `Rejected` with the reason.
46
+ */
47
+ export declare function validateBatteryChargeNowRequest(message: EnyoDataBusRequestBatteryChargeNowV1, metadata?: EnyoBatteryApplianceMetadata, currentSocPercent?: number): BatteryChargeNowValidationResult;
48
+ /**
49
+ * The SoC in percent a `RequestBatteryChargeNowV1` actually charges to: the
50
+ * requested target (default {@link DEFAULT_BATTERY_CHARGE_NOW_TARGET_SOC_PERCENT}),
51
+ * lowered to the battery's `maxSoC` when that is lower.
52
+ *
53
+ * @param targetSocPercent - The request's `targetSocPercent`, if given.
54
+ * @param metadata - The battery's metadata, if known.
55
+ * @returns The effective target SoC in percent.
56
+ */
57
+ export declare function resolveBatteryChargeNowTargetSoc(targetSocPercent: number | undefined, metadata?: EnyoBatteryApplianceMetadata): number;
@@ -36,6 +36,7 @@ __exportStar(require("./implementations/appliances/identifier-strategies.cjs"),
36
36
  __exportStar(require("./implementations/network-devices/network-access-guard.cjs"), exports);
37
37
  __exportStar(require("./implementations/network-devices/network-device-manager.cjs"), exports);
38
38
  __exportStar(require("./implementations/storage/storage-schedule-handler.cjs"), exports);
39
+ __exportStar(require("./implementations/storage/battery-charge-now-validators.cjs"), exports);
39
40
  __exportStar(require("./enyo-package-channel.cjs"), exports);
40
41
  __exportStar(require("./enyo-energy-app-environment.cjs"), exports);
41
42
  __exportStar(require("./types/enyo-timeseries.cjs"), exports);
@@ -20,6 +20,7 @@ export * from './implementations/appliances/identifier-strategies.cjs';
20
20
  export * from './implementations/network-devices/network-access-guard.cjs';
21
21
  export * from './implementations/network-devices/network-device-manager.cjs';
22
22
  export * from './implementations/storage/storage-schedule-handler.cjs';
23
+ export * from './implementations/storage/battery-charge-now-validators.cjs';
23
24
  export * from './enyo-package-channel.cjs';
24
25
  export * from './enyo-energy-app-environment.cjs';
25
26
  export * from './types/enyo-timeseries.cjs';
@@ -40,5 +40,25 @@ class InverterIntegrationEnergyApp extends integration_energy_app_js_1.Integrati
40
40
  };
41
41
  this.useDataBus().sendMessage([msg]);
42
42
  }
43
+ /**
44
+ * Publishes a `GridStatusUpdateV1` message reporting whether the site is
45
+ * on grid or off grid (grid outage), as detected by the inverter.
46
+ *
47
+ * Only for inverters declaring the `GridOutageDetection` feature. Call it
48
+ * whenever the detected grid status changes, and once on startup.
49
+ */
50
+ publishGridStatusUpdate(applianceId, data) {
51
+ const msg = {
52
+ id: this.generateMessageId(),
53
+ type: 'message',
54
+ message: enyo_data_bus_value_js_1.EnyoDataBusMessageEnum.GridStatusUpdateV1,
55
+ source: this.source,
56
+ applianceId,
57
+ timestampIso: new Date().toISOString(),
58
+ resolution: 'dynamic',
59
+ data
60
+ };
61
+ this.useDataBus().sendMessage([msg]);
62
+ }
43
63
  }
44
64
  exports.InverterIntegrationEnergyApp = InverterIntegrationEnergyApp;
@@ -1,7 +1,7 @@
1
1
  import { IntegrationEnergyApp } from "./integration-energy-app.cjs";
2
2
  import { IntegrationCommandResponse, IntegrationEnergyAppOptions } from "./integration-types.cjs";
3
3
  import { EnyoApplianceTypeEnum } from "../types/enyo-appliance.cjs";
4
- import { EnyoDataBusGridOperatorPowerLimitationV1, EnyoDataBusInverterValuesV1, EnyoDataBusSetInverterFeedInLimitV1 } from "../types/enyo-data-bus-value.cjs";
4
+ import { EnyoDataBusGridOperatorPowerLimitationV1, EnyoDataBusGridStatusUpdateV1, EnyoDataBusInverterValuesV1, EnyoDataBusSetInverterFeedInLimitV1 } from "../types/enyo-data-bus-value.cjs";
5
5
  /**
6
6
  * Abstract base class for PV inverter integrations.
7
7
  *
@@ -31,4 +31,12 @@ export declare abstract class InverterIntegrationEnergyApp extends IntegrationEn
31
31
  * current state, PV power, voltages, and string values.
32
32
  */
33
33
  publishInverterValuesUpdate(applianceId: string, data: EnyoDataBusInverterValuesV1['data']): void;
34
+ /**
35
+ * Publishes a `GridStatusUpdateV1` message reporting whether the site is
36
+ * on grid or off grid (grid outage), as detected by the inverter.
37
+ *
38
+ * Only for inverters declaring the `GridOutageDetection` feature. Call it
39
+ * whenever the detected grid status changes, and once on startup.
40
+ */
41
+ publishGridStatusUpdate(applianceId: string, data: EnyoDataBusGridStatusUpdateV1['data']): void;
34
42
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EnyoHeatpumpControlActionStateEnum = exports.EnyoHeatpumpControlTargetEnum = exports.EnyoPowerSourceEnum = exports.EnyoHeatpumpHeatSourceEnum = exports.EnyoHeatpumpControlPurposeEnum = exports.EnyoChargingProfileTypeEnum = exports.EnyoCommandAcknowledgeAnswerEnum = exports.EnyoStorageControlDirectionEnum = exports.EnyoStorageControlModeEnum = exports.EnyoStorageScheduleDirectionEnum = exports.EnyoStorageScheduleModeEnum = exports.EnyoChargingLimitRequestResultEnum = exports.EnyoDataBusMessageEnum = exports.EnyoChargeInitiatorEnum = exports.EnyoPriceLimitModeEnum = exports.EnyoChargeModeEnum = exports.EnyoChargingStopReason = exports.EnyoChargingMeterValueContext = exports.EnyoStringStateEnum = exports.EnyoHeatingRodStateEnum = exports.EnyoInverterStateEnum = exports.EnyoBatteryStateEnum = exports.EnyoGridOperatorLimitTypeEnum = exports.EnyoSwitchingProtectionHoldEnum = exports.EnyoBatteryToEvHoldTriggerEnum = exports.EnyoInstallationLimitSourceEnum = exports.EnyoDataBusCommandReasonCategoryEnum = exports.EnyoDataBusCommandReasonTypeEnum = void 0;
3
+ exports.EnyoHeatpumpControlActionStateEnum = exports.EnyoHeatpumpControlTargetEnum = exports.EnyoPowerSourceEnum = exports.EnyoHeatpumpHeatSourceEnum = exports.EnyoHeatpumpControlPurposeEnum = exports.EnyoChargingProfileTypeEnum = exports.EnyoCommandAcknowledgeAnswerEnum = exports.EnyoBatteryChargeNowStopReasonEnum = exports.EnyoBatteryChargeNowStateEnum = exports.EnyoStorageControlDirectionEnum = exports.EnyoStorageControlModeEnum = exports.EnyoStorageScheduleDirectionEnum = exports.EnyoStorageScheduleModeEnum = exports.EnyoChargingLimitRequestResultEnum = exports.EnyoDataBusMessageEnum = exports.EnyoChargeInitiatorEnum = exports.EnyoPriceLimitModeEnum = exports.EnyoChargeModeEnum = exports.EnyoChargingStopReason = exports.EnyoChargingMeterValueContext = exports.EnyoStringStateEnum = exports.EnyoHeatingRodStateEnum = exports.EnyoGridStatusEnum = exports.EnyoInverterStateEnum = exports.EnyoBatteryStateEnum = exports.EnyoGridOperatorLimitTypeEnum = exports.EnyoSwitchingProtectionHoldEnum = exports.EnyoBatteryToEvHoldTriggerEnum = exports.EnyoInstallationLimitSourceEnum = exports.EnyoDataBusCommandReasonCategoryEnum = exports.EnyoDataBusCommandReasonTypeEnum = void 0;
4
4
  /**
5
5
  * Enum representing the reason type for why a data bus command was issued.
6
6
  * Used to attach context to commands for logging, debugging, and UI display.
@@ -593,6 +593,23 @@ var EnyoInverterStateEnum;
593
593
  EnyoInverterStateEnum["Fault"] = "fault";
594
594
  EnyoInverterStateEnum["Standby"] = "standby";
595
595
  })(EnyoInverterStateEnum || (exports.EnyoInverterStateEnum = EnyoInverterStateEnum = {}));
596
+ /**
597
+ * Whether the public grid is available at the site, as detected by an
598
+ * appliance declaring
599
+ * {@link EnyoInverterApplianceAvailableFeaturesEnum.GridOutageDetection}.
600
+ * Reported on the data bus via {@link EnyoDataBusGridStatusUpdateV1}.
601
+ */
602
+ var EnyoGridStatusEnum;
603
+ (function (EnyoGridStatusEnum) {
604
+ /** The public grid is available and the site is connected to it */
605
+ EnyoGridStatusEnum["OnGrid"] = "on-grid";
606
+ /**
607
+ * The public grid is not available (grid outage) — the site is
608
+ * disconnected from it and, where supported, running in backup / island
609
+ * operation
610
+ */
611
+ EnyoGridStatusEnum["OffGrid"] = "off-grid";
612
+ })(EnyoGridStatusEnum || (exports.EnyoGridStatusEnum = EnyoGridStatusEnum = {}));
596
613
  /**
597
614
  * Operating state of a heating rod as reported on the data bus via
598
615
  * {@link EnyoDataBusHeatingRodValuesV1}.
@@ -823,6 +840,8 @@ var EnyoDataBusMessageEnum;
823
840
  EnyoDataBusMessageEnum["SetStorageChargeLimitV1"] = "SetStorageChargeLimitV1";
824
841
  EnyoDataBusMessageEnum["SetStorageScheduleV1"] = "SetStorageScheduleV1";
825
842
  EnyoDataBusMessageEnum["SetInverterFeedInLimitV1"] = "SetInverterFeedInLimitV1";
843
+ /** An appliance capable of grid outage detection reports whether the site is on grid or off grid (grid outage). */
844
+ EnyoDataBusMessageEnum["GridStatusUpdateV1"] = "GridStatusUpdateV1";
826
845
  EnyoDataBusMessageEnum["CommandAcknowledgeV1"] = "CommandAcknowledgeV1";
827
846
  EnyoDataBusMessageEnum["TemperatureSensorValuesUpdateV1"] = "TemperatureSensorValuesUpdateV1";
828
847
  EnyoDataBusMessageEnum["HeatpumpTemperaturesUpdateV1"] = "HeatpumpTemperaturesUpdateV1";
@@ -868,6 +887,12 @@ var EnyoDataBusMessageEnum;
868
887
  EnyoDataBusMessageEnum["SetHeatingRodAvailablePowerV2"] = "SetHeatingRodAvailablePowerV2";
869
888
  /** V2 control command: prescribe a single-setpoint control (mode + direction + power) to a battery/storage appliance. */
870
889
  EnyoDataBusMessageEnum["SetStorageControlV2"] = "SetStorageControlV2";
890
+ /** One-time user request: charge a battery appliance to full (or a target SoC) now. Handled by the energy manager. */
891
+ EnyoDataBusMessageEnum["RequestBatteryChargeNowV1"] = "RequestBatteryChargeNowV1";
892
+ /** Cancel a running {@link EnyoDataBusMessageEnum.RequestBatteryChargeNowV1} request on a battery appliance. */
893
+ EnyoDataBusMessageEnum["CancelBatteryChargeNowV1"] = "CancelBatteryChargeNowV1";
894
+ /** The energy manager reports how a {@link EnyoDataBusMessageEnum.RequestBatteryChargeNowV1} request progresses. */
895
+ EnyoDataBusMessageEnum["BatteryChargeNowStatusV1"] = "BatteryChargeNowStatusV1";
871
896
  /** Live values of a smart plug: relay state, power draw and energy meter reading. */
872
897
  EnyoDataBusMessageEnum["SmartPlugValuesUpdateV1"] = "SmartPlugValuesUpdateV1";
873
898
  /** Control command: switch a smart plug / relay channel on or off. */
@@ -993,6 +1018,69 @@ var EnyoStorageControlDirectionEnum;
993
1018
  */
994
1019
  EnyoStorageControlDirectionEnum["Hold"] = "hold";
995
1020
  })(EnyoStorageControlDirectionEnum || (exports.EnyoStorageControlDirectionEnum = EnyoStorageControlDirectionEnum = {}));
1021
+ /**
1022
+ * Where a {@link EnyoDataBusRequestBatteryChargeNowV1} request stands.
1023
+ *
1024
+ * `Accepted` and `Running` are intermediate; `Completed`, `Cancelled`,
1025
+ * `Aborted` and `Rejected` are final — no further status follows for that
1026
+ * request.
1027
+ */
1028
+ var EnyoBatteryChargeNowStateEnum;
1029
+ (function (EnyoBatteryChargeNowStateEnum) {
1030
+ /** The energy manager took the request on but is not charging yet. */
1031
+ EnyoBatteryChargeNowStateEnum["Accepted"] = "accepted";
1032
+ /**
1033
+ * The battery is being charged for the request — or would be, but a grid
1034
+ * operator limitation or device protection is capping it right now.
1035
+ */
1036
+ EnyoBatteryChargeNowStateEnum["Running"] = "running";
1037
+ /** The battery reached the target SoC (or its `maxSoC`, or reported full). Final. */
1038
+ EnyoBatteryChargeNowStateEnum["Completed"] = "completed";
1039
+ /** The request was cancelled via {@link EnyoDataBusCancelBatteryChargeNowV1}. Final. */
1040
+ EnyoBatteryChargeNowStateEnum["Cancelled"] = "cancelled";
1041
+ /** The request started but ended before reaching the target. See the stop reason. Final. */
1042
+ EnyoBatteryChargeNowStateEnum["Aborted"] = "aborted";
1043
+ /** The request was refused and never started. See the stop reason. Final. */
1044
+ EnyoBatteryChargeNowStateEnum["Rejected"] = "rejected";
1045
+ })(EnyoBatteryChargeNowStateEnum || (exports.EnyoBatteryChargeNowStateEnum = EnyoBatteryChargeNowStateEnum = {}));
1046
+ /**
1047
+ * Why a {@link EnyoDataBusRequestBatteryChargeNowV1} request was
1048
+ * {@link EnyoBatteryChargeNowStateEnum.Rejected} or
1049
+ * {@link EnyoBatteryChargeNowStateEnum.Aborted}.
1050
+ */
1051
+ var EnyoBatteryChargeNowStopReasonEnum;
1052
+ (function (EnyoBatteryChargeNowStopReasonEnum) {
1053
+ /** The request itself is malformed — e.g. `targetSocPercent` outside 1–100 or a non-positive `maxDurationMinutes`. */
1054
+ EnyoBatteryChargeNowStopReasonEnum["InvalidRequest"] = "invalid-request";
1055
+ /** No battery appliance with the given `applianceId` exists. */
1056
+ EnyoBatteryChargeNowStopReasonEnum["ApplianceNotFound"] = "appliance-not-found";
1057
+ /** The battery is offline / unreachable. */
1058
+ EnyoBatteryChargeNowStopReasonEnum["ApplianceOffline"] = "appliance-offline";
1059
+ /**
1060
+ * The battery integration does not permit control (`controlAllowed` is
1061
+ * `false`) or does not declare {@link EnyoBatteryFeature.ManualCharge}.
1062
+ */
1063
+ EnyoBatteryChargeNowStopReasonEnum["ControlNotAllowed"] = "control-not-allowed";
1064
+ /**
1065
+ * The user switched battery control off in the energy manager settings
1066
+ * (`BatteryControl`). Actionable: point the user at the setting.
1067
+ */
1068
+ EnyoBatteryChargeNowStopReasonEnum["ControlDisabledByUser"] = "control-disabled-by-user";
1069
+ /**
1070
+ * Grid charging was allowed for the request but the battery does not
1071
+ * declare {@link EnyoBatteryFeature.GridCharging}, and there is no PV
1072
+ * surplus to charge from.
1073
+ */
1074
+ EnyoBatteryChargeNowStopReasonEnum["GridChargingNotSupported"] = "grid-charging-not-supported";
1075
+ /** The battery already is at or above the target SoC (or its `maxSoC`). */
1076
+ EnyoBatteryChargeNowStopReasonEnum["AlreadyAtTarget"] = "already-at-target";
1077
+ /** {@link EnyoDataBusRequestBatteryChargeNowV1.data.maxDurationMinutes} (or the energy manager's own limit) elapsed. */
1078
+ EnyoBatteryChargeNowStopReasonEnum["MaxDurationReached"] = "max-duration-reached";
1079
+ /** A newer request for the same battery replaced this one. */
1080
+ EnyoBatteryChargeNowStopReasonEnum["Superseded"] = "superseded";
1081
+ /** The battery stopped accepting charge below the target (e.g. a device-side limit or fault). */
1082
+ EnyoBatteryChargeNowStopReasonEnum["BatteryStoppedCharging"] = "battery-stopped-charging";
1083
+ })(EnyoBatteryChargeNowStopReasonEnum || (exports.EnyoBatteryChargeNowStopReasonEnum = EnyoBatteryChargeNowStopReasonEnum = {}));
996
1084
  /**
997
1085
  * Possible answers an appliance can give when acknowledging a command.
998
1086
  */