@enyo-energy/energy-app-sdk 0.0.124 → 0.0.126

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 (35) hide show
  1. package/dist/cjs/energy-app.cjs +9 -0
  2. package/dist/cjs/energy-app.d.cts +8 -0
  3. package/dist/cjs/enyo-energy-app-sdk.d.cts +3 -0
  4. package/dist/cjs/implementations/appliances/appliance-manager.cjs +1 -0
  5. package/dist/cjs/implementations/appliances/appliance-manager.d.cts +11 -0
  6. package/dist/cjs/index.cjs +2 -0
  7. package/dist/cjs/index.d.cts +2 -0
  8. package/dist/cjs/packages/energy-app-grid-connection-point.cjs +2 -0
  9. package/dist/cjs/packages/energy-app-grid-connection-point.d.cts +34 -0
  10. package/dist/cjs/types/enyo-appliance.cjs +14 -1
  11. package/dist/cjs/types/enyo-appliance.d.cts +26 -0
  12. package/dist/cjs/types/enyo-data-bus-value.cjs +1 -0
  13. package/dist/cjs/types/enyo-data-bus-value.d.cts +51 -0
  14. package/dist/cjs/types/enyo-grid-connection-point.cjs +2 -0
  15. package/dist/cjs/types/enyo-grid-connection-point.d.cts +35 -0
  16. package/dist/cjs/version.cjs +1 -1
  17. package/dist/cjs/version.d.cts +1 -1
  18. package/dist/energy-app.d.ts +8 -0
  19. package/dist/energy-app.js +9 -0
  20. package/dist/enyo-energy-app-sdk.d.ts +3 -0
  21. package/dist/implementations/appliances/appliance-manager.d.ts +11 -0
  22. package/dist/implementations/appliances/appliance-manager.js +1 -0
  23. package/dist/index.d.ts +2 -0
  24. package/dist/index.js +2 -0
  25. package/dist/packages/energy-app-grid-connection-point.d.ts +34 -0
  26. package/dist/packages/energy-app-grid-connection-point.js +1 -0
  27. package/dist/types/enyo-appliance.d.ts +26 -0
  28. package/dist/types/enyo-appliance.js +13 -0
  29. package/dist/types/enyo-data-bus-value.d.ts +51 -0
  30. package/dist/types/enyo-data-bus-value.js +1 -0
  31. package/dist/types/enyo-grid-connection-point.d.ts +35 -0
  32. package/dist/types/enyo-grid-connection-point.js +1 -0
  33. package/dist/version.d.ts +1 -1
  34. package/dist/version.js +1 -1
  35. package/package.json +1 -1
@@ -263,6 +263,15 @@ class EnergyApp {
263
263
  useUdp() {
264
264
  return this.energyAppSdk.useUdp();
265
265
  }
266
+ /**
267
+ * Gets the Grid Connection Point API for retrieving details about the
268
+ * site's grid connection (main fuse rating in amperes, number of phases,
269
+ * and maximum allowed grid power in watts).
270
+ * @returns The Grid Connection Point API instance
271
+ */
272
+ useGridConnectionPoint() {
273
+ return this.energyAppSdk.useGridConnectionPoint();
274
+ }
266
275
  /**
267
276
  * Gets the current SDK version.
268
277
  * @returns The semantic version string of the SDK
@@ -32,6 +32,7 @@ import { EnergyAppDiagnostics } from "./packages/energy-app-diagnostics.cjs";
32
32
  import { EnergyAppLearningPhase } from "./packages/energy-app-learning-phase.cjs";
33
33
  import { EnergyAppWifi } from "./packages/energy-app-wifi.cjs";
34
34
  import { EnergyAppUdp } from "./packages/energy-app-udp.cjs";
35
+ import { EnergyAppGridConnectionPoint } from "./packages/energy-app-grid-connection-point.cjs";
35
36
  /**
36
37
  * Concrete implementation of {@link EnyoEnergyAppSdk} that delegates every call
37
38
  * to the runtime-provided `energyAppSdkInstance` global.
@@ -200,6 +201,13 @@ export declare class EnergyApp implements EnyoEnergyAppSdk {
200
201
  * is not granted.
201
202
  */
202
203
  useUdp(): EnergyAppUdp;
204
+ /**
205
+ * Gets the Grid Connection Point API for retrieving details about the
206
+ * site's grid connection (main fuse rating in amperes, number of phases,
207
+ * and maximum allowed grid power in watts).
208
+ * @returns The Grid Connection Point API instance
209
+ */
210
+ useGridConnectionPoint(): EnergyAppGridConnectionPoint;
203
211
  /**
204
212
  * Gets the current SDK version.
205
213
  * @returns The semantic version string of the SDK
@@ -31,6 +31,7 @@ import { EnergyAppDiagnostics } from "./packages/energy-app-diagnostics.cjs";
31
31
  import { EnergyAppLearningPhase } from "./packages/energy-app-learning-phase.cjs";
32
32
  import { EnergyAppWifi } from "./packages/energy-app-wifi.cjs";
33
33
  import { EnergyAppUdp } from "./packages/energy-app-udp.cjs";
34
+ import { EnergyAppGridConnectionPoint } from "./packages/energy-app-grid-connection-point.cjs";
34
35
  export declare enum EnergyAppStateEnum {
35
36
  Launching = "launching",
36
37
  Running = "running",
@@ -121,4 +122,6 @@ export interface EnyoEnergyAppSdk {
121
122
  useWifi: () => EnergyAppWifi;
122
123
  /** Get the UDP communication API for binding sockets and exchanging datagrams */
123
124
  useUdp: () => EnergyAppUdp;
125
+ /** Get the Grid Connection Point API for retrieving fuse rating, phase count, and power limit of the site's grid connection */
126
+ useGridConnectionPoint: () => EnergyAppGridConnectionPoint;
124
127
  }
@@ -127,6 +127,7 @@ class ApplianceManager {
127
127
  inverter: appliance.inverter,
128
128
  temperatureSensor: appliance.temperatureSensor,
129
129
  airConditioning: appliance.airConditioning,
130
+ cloudPackageId: appliance.cloudPackageId,
130
131
  };
131
132
  // When updating an existing appliance, merge metadata to preserve existing keys
132
133
  let applianceData = newApplianceData;
@@ -31,6 +31,12 @@ export interface ApplianceConfig {
31
31
  battery?: EnyoBatteryApplianceMetadata;
32
32
  temperatureSensor?: EnyoTemperatureSensorApplianceMetadata;
33
33
  airConditioning?: EnyoAirConditioningApplianceMetadata;
34
+ /**
35
+ * Optional identifier of the cloud-deployed energy app package that manages
36
+ * this appliance. Forwarded to {@link EnyoAppliance.cloudPackageId} when the
37
+ * appliance is created or updated.
38
+ */
39
+ cloudPackageId?: string;
34
40
  }
35
41
  /**
36
42
  * Configuration options for the ApplianceManager.
@@ -249,4 +255,9 @@ export interface PartialEnyoAppliance {
249
255
  airConditioning?: Partial<EnyoAirConditioningApplianceMetadata>;
250
256
  /** Optional custom name for the appliance, defined by the user */
251
257
  customName?: string;
258
+ /**
259
+ * Optional identifier of the cloud-deployed energy app package that manages
260
+ * this appliance. Mirrors {@link EnyoAppliance.cloudPackageId}.
261
+ */
262
+ cloudPackageId?: string;
252
263
  }
@@ -60,6 +60,8 @@ __exportStar(require("./packages/energy-app-learning-phase.cjs"), exports);
60
60
  __exportStar(require("./types/enyo-wifi.cjs"), exports);
61
61
  __exportStar(require("./packages/energy-app-wifi.cjs"), exports);
62
62
  __exportStar(require("./packages/energy-app-udp.cjs"), exports);
63
+ __exportStar(require("./types/enyo-grid-connection-point.cjs"), exports);
64
+ __exportStar(require("./packages/energy-app-grid-connection-point.cjs"), exports);
63
65
  __exportStar(require("./types/enyo-air-conditioning-appliance.cjs"), exports);
64
66
  __exportStar(require("./types/enyo-onboarding.cjs"), exports);
65
67
  __exportStar(require("./packages/energy-app-onboarding.cjs"), exports);
@@ -44,6 +44,8 @@ export * from './packages/energy-app-learning-phase.cjs';
44
44
  export * from './types/enyo-wifi.cjs';
45
45
  export * from './packages/energy-app-wifi.cjs';
46
46
  export * from './packages/energy-app-udp.cjs';
47
+ export * from './types/enyo-grid-connection-point.cjs';
48
+ export * from './packages/energy-app-grid-connection-point.cjs';
47
49
  export * from './types/enyo-air-conditioning-appliance.cjs';
48
50
  export * from './types/enyo-onboarding.cjs';
49
51
  export * from './packages/energy-app-onboarding.cjs';
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,34 @@
1
+ import { EnyoGridConnectionPoint } from "../types/enyo-grid-connection-point.cjs";
2
+ /**
3
+ * Interface for retrieving information about the site's grid connection point.
4
+ *
5
+ * The grid connection point describes the physical interface between the
6
+ * local electrical installation and the public grid, including the main
7
+ * fuse rating, the number of phases, and the maximum allowed grid power.
8
+ * Energy apps consume this information to size grid-import/export budgets,
9
+ * enforce per-phase current limits, and respect contractual or regulatory
10
+ * power caps.
11
+ */
12
+ export interface EnergyAppGridConnectionPoint {
13
+ /**
14
+ * Retrieves the configured grid connection point details.
15
+ *
16
+ * Returns `null` when no grid connection point has been configured for
17
+ * the site yet (e.g. during initial onboarding).
18
+ *
19
+ * @returns Promise resolving to the grid connection point details, or
20
+ * `null` if none is configured.
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * const gridConnectionPoint = energyApp.useGridConnectionPoint();
25
+ * const details = await gridConnectionPoint.getGridConnectionPoint();
26
+ * if (details) {
27
+ * console.log(`Fuse: ${details.fuseAmpere} A`);
28
+ * console.log(`Phases: ${details.numberOfPhases}`);
29
+ * console.log(`Power limit: ${details.powerLimitW} W`);
30
+ * }
31
+ * ```
32
+ */
33
+ getGridConnectionPoint(): Promise<EnyoGridConnectionPoint | null>;
34
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EnyoApplianceTopologyFeatureEnum = exports.EnyoApplianceConnectionType = exports.EnyoApplianceStatusEnum = exports.EnyoApplianceStateEnum = exports.EnyoApplianceTypeEnum = void 0;
3
+ exports.EnyoApplianceTopologyFeatureEnum = exports.EnyoApplianceAvailableFeaturesEnum = exports.EnyoApplianceConnectionType = exports.EnyoApplianceStatusEnum = exports.EnyoApplianceStateEnum = exports.EnyoApplianceTypeEnum = void 0;
4
4
  var EnyoApplianceTypeEnum;
5
5
  (function (EnyoApplianceTypeEnum) {
6
6
  EnyoApplianceTypeEnum["Inverter"] = "Inverter";
@@ -40,6 +40,19 @@ var EnyoApplianceConnectionType;
40
40
  EnyoApplianceConnectionType["Connector"] = "Connector";
41
41
  EnyoApplianceConnectionType["Cloud"] = "Cloud";
42
42
  })(EnyoApplianceConnectionType || (exports.EnyoApplianceConnectionType = EnyoApplianceConnectionType = {}));
43
+ /**
44
+ * General-purpose capability flags that apply to any {@link EnyoAppliance}
45
+ * regardless of its {@link EnyoApplianceTypeEnum}. Appliance-type-specific
46
+ * capabilities (e.g. charger or heatpump features) are expressed via the
47
+ * dedicated `availableFeatures` enums on the respective metadata interfaces.
48
+ */
49
+ var EnyoApplianceAvailableFeaturesEnum;
50
+ (function (EnyoApplianceAvailableFeaturesEnum) {
51
+ /** If the appliance can limit its power consumption (active power drawn from the grid/site) */
52
+ EnyoApplianceAvailableFeaturesEnum["LimitPowerConsumption"] = "LimitPowerConsumption";
53
+ /** If the appliance can limit its power production (active power fed into the grid/site) */
54
+ EnyoApplianceAvailableFeaturesEnum["LimitPowerProduction"] = "LimitPowerProduction";
55
+ })(EnyoApplianceAvailableFeaturesEnum || (exports.EnyoApplianceAvailableFeaturesEnum = EnyoApplianceAvailableFeaturesEnum = {}));
43
56
  var EnyoApplianceTopologyFeatureEnum;
44
57
  (function (EnyoApplianceTopologyFeatureEnum) {
45
58
  /** If the meter is the real Primary Meter collecting feed in and consumption in Wh */
@@ -118,6 +118,18 @@ export interface EnyoApplianceMetadata {
118
118
  mqtt?: EnyoApplianceMqttConfig;
119
119
  connectionType: EnyoApplianceConnectionType;
120
120
  }
121
+ /**
122
+ * General-purpose capability flags that apply to any {@link EnyoAppliance}
123
+ * regardless of its {@link EnyoApplianceTypeEnum}. Appliance-type-specific
124
+ * capabilities (e.g. charger or heatpump features) are expressed via the
125
+ * dedicated `availableFeatures` enums on the respective metadata interfaces.
126
+ */
127
+ export declare enum EnyoApplianceAvailableFeaturesEnum {
128
+ /** If the appliance can limit its power consumption (active power drawn from the grid/site) */
129
+ LimitPowerConsumption = "LimitPowerConsumption",
130
+ /** If the appliance can limit its power production (active power fed into the grid/site) */
131
+ LimitPowerProduction = "LimitPowerProduction"
132
+ }
121
133
  export declare enum EnyoApplianceTopologyFeatureEnum {
122
134
  /** If the meter is the real Primary Meter collecting feed in and consumption in Wh */
123
135
  PrimaryMeter = "PrimaryMeter",
@@ -145,6 +157,13 @@ export interface EnyoAppliance {
145
157
  type: EnyoApplianceTypeEnum;
146
158
  /** network device IDs associated with the appliance */
147
159
  networkDeviceIds: string[];
160
+ /**
161
+ * General-purpose capabilities supported by the appliance, independent of
162
+ * its {@link EnyoApplianceTypeEnum}. Appliance-type-specific capabilities
163
+ * are exposed via the `availableFeatures` field on the type-specific
164
+ * metadata (e.g. `charger.availableFeatures`).
165
+ */
166
+ availableFeatures?: EnyoApplianceAvailableFeaturesEnum[];
148
167
  /** Optional Metadata of the Appliance */
149
168
  metadata?: EnyoApplianceMetadata;
150
169
  /** Topology Information of the appliance */
@@ -165,4 +184,11 @@ export interface EnyoAppliance {
165
184
  airConditioning?: EnyoAirConditioningApplianceMetadata;
166
185
  /** Optional custom name for the appliance, defined by the user */
167
186
  customName?: string;
187
+ /**
188
+ * Optional identifier of the cloud-deployed energy app package that manages
189
+ * this appliance. Set when the appliance is provisioned and operated by a
190
+ * cloud package (e.g. {@link EnyoApplianceConnectionType.Cloud}), so that
191
+ * downstream consumers can correlate the appliance with its owning package.
192
+ */
193
+ cloudPackageId?: string;
168
194
  }
@@ -147,6 +147,7 @@ var EnyoDataBusMessageEnum;
147
147
  EnyoDataBusMessageEnum["MaxChargingPowerChangedV1"] = "MaxChargingPowerChangedV1";
148
148
  EnyoDataBusMessageEnum["MaxDischargePowerChangedV1"] = "MaxDischargePowerChangedV1";
149
149
  EnyoDataBusMessageEnum["GridOperatorPowerLimitationV1"] = "GridOperatorPowerLimitationV1";
150
+ EnyoDataBusMessageEnum["GridOperatorPowerProductionLimitationV1"] = "GridOperatorPowerProductionLimitationV1";
150
151
  EnyoDataBusMessageEnum["ResetChargerV1"] = "ResetChargerV1";
151
152
  EnyoDataBusMessageEnum["RebootChargerV1"] = "RebootChargerV1";
152
153
  EnyoDataBusMessageEnum["RequestChargerLogsV1"] = "RequestChargerLogsV1";
@@ -7,6 +7,7 @@ import { EnyoEnergyPrices } from "./enyo-energy-prices.cjs";
7
7
  import { EnyoCurrencyEnum } from "./enyo-currency.cjs";
8
8
  import { EnyoHeatpumpApplianceModeEnum } from "./enyo-heatpump-appliance.cjs";
9
9
  import { EnyoAirConditioningApplianceModeEnum } from "./enyo-air-conditioning-appliance.cjs";
10
+ import { EnergyAppPackageCategory } from "../energy-app-package-definition.cjs";
10
11
  /**
11
12
  * Enum representing the reason type for why a data bus command was issued.
12
13
  * Used to attach context to commands for logging, debugging, and UI display.
@@ -186,6 +187,7 @@ export declare enum EnyoDataBusMessageEnum {
186
187
  MaxChargingPowerChangedV1 = "MaxChargingPowerChangedV1",
187
188
  MaxDischargePowerChangedV1 = "MaxDischargePowerChangedV1",
188
189
  GridOperatorPowerLimitationV1 = "GridOperatorPowerLimitationV1",
190
+ GridOperatorPowerProductionLimitationV1 = "GridOperatorPowerProductionLimitationV1",
189
191
  ResetChargerV1 = "ResetChargerV1",
190
192
  RebootChargerV1 = "RebootChargerV1",
191
193
  RequestChargerLogsV1 = "RequestChargerLogsV1",
@@ -198,6 +200,29 @@ export declare enum EnyoDataBusMessageEnum {
198
200
  StopAirConditioningV1 = "StopAirConditioningV1"
199
201
  }
200
202
  export type EnyoDataBusMessageResolution = '10s' | '30s' | '1m' | '15m' | '1h' | '1d' | 'dynamic';
203
+ /**
204
+ * Optional addressing information for a {@link EnyoDataBusMessage}. When omitted
205
+ * the message is broadcast to all subscribers; when set, the message is only
206
+ * delivered to packages that match the specified target.
207
+ *
208
+ * Exactly one of {@link cloudPackageId} or {@link categories} should be provided.
209
+ * When both are set, consumers should treat them as an AND (the receiving package
210
+ * must match the cloud package id **and** belong to at least one of the listed
211
+ * categories). When neither is set, the target is treated as "all packages".
212
+ */
213
+ export interface EnyoDataBusMessageTarget {
214
+ /**
215
+ * Target a single cloud-deployed energy app package by its package identifier.
216
+ * Use this when a message is intended for one specific package instance.
217
+ */
218
+ cloudPackageId?: string;
219
+ /**
220
+ * Target every energy app package whose definition declares at least one of
221
+ * the listed categories. Use this for category-scoped fan-out (e.g. send a
222
+ * grid operator limitation only to inverter and battery-storage packages).
223
+ */
224
+ categories?: EnergyAppPackageCategory[];
225
+ }
201
226
  export interface EnyoDataBusMessage {
202
227
  id: string;
203
228
  message: EnyoDataBusMessageEnum;
@@ -208,6 +233,13 @@ export interface EnyoDataBusMessage {
208
233
  timestampIso: string;
209
234
  /** If you just forward events that occur, use dynamic as resolution */
210
235
  resolution?: EnyoDataBusMessageResolution;
236
+ /**
237
+ * Optional delivery target. When omitted the message is broadcast to all
238
+ * subscribers. Use this to restrict delivery to a specific cloud package or
239
+ * to packages matching one or more energy app categories. See
240
+ * {@link EnyoDataBusMessageTarget} for matching semantics.
241
+ */
242
+ target?: EnyoDataBusMessageTarget;
211
243
  data: object;
212
244
  }
213
245
  export interface EnyoDataBusMessageAnswer extends EnyoDataBusMessage {
@@ -1068,6 +1100,25 @@ export interface EnyoDataBusGridOperatorPowerLimitationV1 extends EnyoDataBusMes
1068
1100
  endTimestampIso: string;
1069
1101
  };
1070
1102
  }
1103
+ /**
1104
+ * Command message for grid operator power production limitations directed at the energy manager.
1105
+ * Communicates whether a production-side power limitation (i.e. how much power may be fed into
1106
+ * the grid) is active, the power limit, and when it ends. The energy manager should adjust its
1107
+ * optimization strategy accordingly (e.g. curtail PV feed-in, prefer self-consumption, charge
1108
+ * batteries from surplus).
1109
+ */
1110
+ export interface EnyoDataBusGridOperatorPowerProductionLimitationV1 extends EnyoDataBusMessage {
1111
+ type: 'message';
1112
+ message: EnyoDataBusMessageEnum.GridOperatorPowerProductionLimitationV1;
1113
+ data: {
1114
+ /** Whether the grid operator power production limitation is currently active */
1115
+ active: boolean;
1116
+ /** The power production limitation in watts (maximum allowed feed-in power) */
1117
+ powerLimitationW: number;
1118
+ /** ISO 8601 timestamp when the limitation ends */
1119
+ endTimestampIso: string;
1120
+ };
1121
+ }
1071
1122
  /**
1072
1123
  * Command message to reset a charger appliance.
1073
1124
  * Sends a reset command to the specified charger, which performs a soft reset
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Number of electrical phases provided by a grid connection.
3
+ * Most residential connections in Europe are single-phase (1) or three-phase (3);
4
+ * two-phase (split-phase, 2) connections also exist in some markets.
5
+ */
6
+ export type EnyoGridConnectionPointPhaseCount = 1 | 2 | 3;
7
+ /**
8
+ * Details about the site's grid connection point (the physical interface
9
+ * between the local electrical installation and the public grid).
10
+ *
11
+ * These values are typically defined by the grid operator (DSO) at
12
+ * installation time and are used by energy managers and integrations
13
+ * to plan grid-import/export budgets, derive per-phase current limits,
14
+ * and enforce regulatory or contractual power caps.
15
+ */
16
+ export interface EnyoGridConnectionPoint {
17
+ /**
18
+ * Rated current of the main fuse protecting the grid connection point,
19
+ * in amperes (A). This is the per-phase fuse rating as installed by the
20
+ * grid operator (e.g. 25, 35, 63).
21
+ */
22
+ fuseAmpere: number;
23
+ /**
24
+ * Number of electrical phases provided by the grid connection
25
+ * (1 = single-phase, 2 = split-phase, 3 = three-phase).
26
+ */
27
+ numberOfPhases: EnyoGridConnectionPointPhaseCount;
28
+ /**
29
+ * Maximum active power, in watts (W), that may be drawn from or fed into
30
+ * the grid at the connection point. Derived from the fuse rating, phase
31
+ * count, and any contractual or regulatory limits imposed by the grid
32
+ * operator.
33
+ */
34
+ powerLimitW: number;
35
+ }
@@ -9,7 +9,7 @@ exports.getSdkVersion = getSdkVersion;
9
9
  /**
10
10
  * Current version of the enyo Energy App SDK.
11
11
  */
12
- exports.SDK_VERSION = '0.0.124';
12
+ exports.SDK_VERSION = '0.0.126';
13
13
  /**
14
14
  * Gets the current SDK version.
15
15
  * @returns The semantic version string of the SDK
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Current version of the enyo Energy App SDK.
7
7
  */
8
- export declare const SDK_VERSION = "0.0.124";
8
+ export declare const SDK_VERSION = "0.0.126";
9
9
  /**
10
10
  * Gets the current SDK version.
11
11
  * @returns The semantic version string of the SDK
@@ -32,6 +32,7 @@ import { EnergyAppDiagnostics } from "./packages/energy-app-diagnostics.js";
32
32
  import { EnergyAppLearningPhase } from "./packages/energy-app-learning-phase.js";
33
33
  import { EnergyAppWifi } from "./packages/energy-app-wifi.js";
34
34
  import { EnergyAppUdp } from "./packages/energy-app-udp.js";
35
+ import { EnergyAppGridConnectionPoint } from "./packages/energy-app-grid-connection-point.js";
35
36
  /**
36
37
  * Concrete implementation of {@link EnyoEnergyAppSdk} that delegates every call
37
38
  * to the runtime-provided `energyAppSdkInstance` global.
@@ -200,6 +201,13 @@ export declare class EnergyApp implements EnyoEnergyAppSdk {
200
201
  * is not granted.
201
202
  */
202
203
  useUdp(): EnergyAppUdp;
204
+ /**
205
+ * Gets the Grid Connection Point API for retrieving details about the
206
+ * site's grid connection (main fuse rating in amperes, number of phases,
207
+ * and maximum allowed grid power in watts).
208
+ * @returns The Grid Connection Point API instance
209
+ */
210
+ useGridConnectionPoint(): EnergyAppGridConnectionPoint;
203
211
  /**
204
212
  * Gets the current SDK version.
205
213
  * @returns The semantic version string of the SDK
@@ -260,6 +260,15 @@ export class EnergyApp {
260
260
  useUdp() {
261
261
  return this.energyAppSdk.useUdp();
262
262
  }
263
+ /**
264
+ * Gets the Grid Connection Point API for retrieving details about the
265
+ * site's grid connection (main fuse rating in amperes, number of phases,
266
+ * and maximum allowed grid power in watts).
267
+ * @returns The Grid Connection Point API instance
268
+ */
269
+ useGridConnectionPoint() {
270
+ return this.energyAppSdk.useGridConnectionPoint();
271
+ }
263
272
  /**
264
273
  * Gets the current SDK version.
265
274
  * @returns The semantic version string of the SDK
@@ -31,6 +31,7 @@ import { EnergyAppDiagnostics } from "./packages/energy-app-diagnostics.js";
31
31
  import { EnergyAppLearningPhase } from "./packages/energy-app-learning-phase.js";
32
32
  import { EnergyAppWifi } from "./packages/energy-app-wifi.js";
33
33
  import { EnergyAppUdp } from "./packages/energy-app-udp.js";
34
+ import { EnergyAppGridConnectionPoint } from "./packages/energy-app-grid-connection-point.js";
34
35
  export declare enum EnergyAppStateEnum {
35
36
  Launching = "launching",
36
37
  Running = "running",
@@ -121,4 +122,6 @@ export interface EnyoEnergyAppSdk {
121
122
  useWifi: () => EnergyAppWifi;
122
123
  /** Get the UDP communication API for binding sockets and exchanging datagrams */
123
124
  useUdp: () => EnergyAppUdp;
125
+ /** Get the Grid Connection Point API for retrieving fuse rating, phase count, and power limit of the site's grid connection */
126
+ useGridConnectionPoint: () => EnergyAppGridConnectionPoint;
124
127
  }
@@ -31,6 +31,12 @@ export interface ApplianceConfig {
31
31
  battery?: EnyoBatteryApplianceMetadata;
32
32
  temperatureSensor?: EnyoTemperatureSensorApplianceMetadata;
33
33
  airConditioning?: EnyoAirConditioningApplianceMetadata;
34
+ /**
35
+ * Optional identifier of the cloud-deployed energy app package that manages
36
+ * this appliance. Forwarded to {@link EnyoAppliance.cloudPackageId} when the
37
+ * appliance is created or updated.
38
+ */
39
+ cloudPackageId?: string;
34
40
  }
35
41
  /**
36
42
  * Configuration options for the ApplianceManager.
@@ -249,4 +255,9 @@ export interface PartialEnyoAppliance {
249
255
  airConditioning?: Partial<EnyoAirConditioningApplianceMetadata>;
250
256
  /** Optional custom name for the appliance, defined by the user */
251
257
  customName?: string;
258
+ /**
259
+ * Optional identifier of the cloud-deployed energy app package that manages
260
+ * this appliance. Mirrors {@link EnyoAppliance.cloudPackageId}.
261
+ */
262
+ cloudPackageId?: string;
252
263
  }
@@ -124,6 +124,7 @@ export class ApplianceManager {
124
124
  inverter: appliance.inverter,
125
125
  temperatureSensor: appliance.temperatureSensor,
126
126
  airConditioning: appliance.airConditioning,
127
+ cloudPackageId: appliance.cloudPackageId,
127
128
  };
128
129
  // When updating an existing appliance, merge metadata to preserve existing keys
129
130
  let applianceData = newApplianceData;
package/dist/index.d.ts CHANGED
@@ -44,6 +44,8 @@ export * from './packages/energy-app-learning-phase.js';
44
44
  export * from './types/enyo-wifi.js';
45
45
  export * from './packages/energy-app-wifi.js';
46
46
  export * from './packages/energy-app-udp.js';
47
+ export * from './types/enyo-grid-connection-point.js';
48
+ export * from './packages/energy-app-grid-connection-point.js';
47
49
  export * from './types/enyo-air-conditioning-appliance.js';
48
50
  export * from './types/enyo-onboarding.js';
49
51
  export * from './packages/energy-app-onboarding.js';
package/dist/index.js CHANGED
@@ -44,6 +44,8 @@ export * from './packages/energy-app-learning-phase.js';
44
44
  export * from './types/enyo-wifi.js';
45
45
  export * from './packages/energy-app-wifi.js';
46
46
  export * from './packages/energy-app-udp.js';
47
+ export * from './types/enyo-grid-connection-point.js';
48
+ export * from './packages/energy-app-grid-connection-point.js';
47
49
  export * from './types/enyo-air-conditioning-appliance.js';
48
50
  export * from './types/enyo-onboarding.js';
49
51
  export * from './packages/energy-app-onboarding.js';
@@ -0,0 +1,34 @@
1
+ import { EnyoGridConnectionPoint } from "../types/enyo-grid-connection-point.js";
2
+ /**
3
+ * Interface for retrieving information about the site's grid connection point.
4
+ *
5
+ * The grid connection point describes the physical interface between the
6
+ * local electrical installation and the public grid, including the main
7
+ * fuse rating, the number of phases, and the maximum allowed grid power.
8
+ * Energy apps consume this information to size grid-import/export budgets,
9
+ * enforce per-phase current limits, and respect contractual or regulatory
10
+ * power caps.
11
+ */
12
+ export interface EnergyAppGridConnectionPoint {
13
+ /**
14
+ * Retrieves the configured grid connection point details.
15
+ *
16
+ * Returns `null` when no grid connection point has been configured for
17
+ * the site yet (e.g. during initial onboarding).
18
+ *
19
+ * @returns Promise resolving to the grid connection point details, or
20
+ * `null` if none is configured.
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * const gridConnectionPoint = energyApp.useGridConnectionPoint();
25
+ * const details = await gridConnectionPoint.getGridConnectionPoint();
26
+ * if (details) {
27
+ * console.log(`Fuse: ${details.fuseAmpere} A`);
28
+ * console.log(`Phases: ${details.numberOfPhases}`);
29
+ * console.log(`Power limit: ${details.powerLimitW} W`);
30
+ * }
31
+ * ```
32
+ */
33
+ getGridConnectionPoint(): Promise<EnyoGridConnectionPoint | null>;
34
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -118,6 +118,18 @@ export interface EnyoApplianceMetadata {
118
118
  mqtt?: EnyoApplianceMqttConfig;
119
119
  connectionType: EnyoApplianceConnectionType;
120
120
  }
121
+ /**
122
+ * General-purpose capability flags that apply to any {@link EnyoAppliance}
123
+ * regardless of its {@link EnyoApplianceTypeEnum}. Appliance-type-specific
124
+ * capabilities (e.g. charger or heatpump features) are expressed via the
125
+ * dedicated `availableFeatures` enums on the respective metadata interfaces.
126
+ */
127
+ export declare enum EnyoApplianceAvailableFeaturesEnum {
128
+ /** If the appliance can limit its power consumption (active power drawn from the grid/site) */
129
+ LimitPowerConsumption = "LimitPowerConsumption",
130
+ /** If the appliance can limit its power production (active power fed into the grid/site) */
131
+ LimitPowerProduction = "LimitPowerProduction"
132
+ }
121
133
  export declare enum EnyoApplianceTopologyFeatureEnum {
122
134
  /** If the meter is the real Primary Meter collecting feed in and consumption in Wh */
123
135
  PrimaryMeter = "PrimaryMeter",
@@ -145,6 +157,13 @@ export interface EnyoAppliance {
145
157
  type: EnyoApplianceTypeEnum;
146
158
  /** network device IDs associated with the appliance */
147
159
  networkDeviceIds: string[];
160
+ /**
161
+ * General-purpose capabilities supported by the appliance, independent of
162
+ * its {@link EnyoApplianceTypeEnum}. Appliance-type-specific capabilities
163
+ * are exposed via the `availableFeatures` field on the type-specific
164
+ * metadata (e.g. `charger.availableFeatures`).
165
+ */
166
+ availableFeatures?: EnyoApplianceAvailableFeaturesEnum[];
148
167
  /** Optional Metadata of the Appliance */
149
168
  metadata?: EnyoApplianceMetadata;
150
169
  /** Topology Information of the appliance */
@@ -165,4 +184,11 @@ export interface EnyoAppliance {
165
184
  airConditioning?: EnyoAirConditioningApplianceMetadata;
166
185
  /** Optional custom name for the appliance, defined by the user */
167
186
  customName?: string;
187
+ /**
188
+ * Optional identifier of the cloud-deployed energy app package that manages
189
+ * this appliance. Set when the appliance is provisioned and operated by a
190
+ * cloud package (e.g. {@link EnyoApplianceConnectionType.Cloud}), so that
191
+ * downstream consumers can correlate the appliance with its owning package.
192
+ */
193
+ cloudPackageId?: string;
168
194
  }
@@ -37,6 +37,19 @@ export var EnyoApplianceConnectionType;
37
37
  EnyoApplianceConnectionType["Connector"] = "Connector";
38
38
  EnyoApplianceConnectionType["Cloud"] = "Cloud";
39
39
  })(EnyoApplianceConnectionType || (EnyoApplianceConnectionType = {}));
40
+ /**
41
+ * General-purpose capability flags that apply to any {@link EnyoAppliance}
42
+ * regardless of its {@link EnyoApplianceTypeEnum}. Appliance-type-specific
43
+ * capabilities (e.g. charger or heatpump features) are expressed via the
44
+ * dedicated `availableFeatures` enums on the respective metadata interfaces.
45
+ */
46
+ export var EnyoApplianceAvailableFeaturesEnum;
47
+ (function (EnyoApplianceAvailableFeaturesEnum) {
48
+ /** If the appliance can limit its power consumption (active power drawn from the grid/site) */
49
+ EnyoApplianceAvailableFeaturesEnum["LimitPowerConsumption"] = "LimitPowerConsumption";
50
+ /** If the appliance can limit its power production (active power fed into the grid/site) */
51
+ EnyoApplianceAvailableFeaturesEnum["LimitPowerProduction"] = "LimitPowerProduction";
52
+ })(EnyoApplianceAvailableFeaturesEnum || (EnyoApplianceAvailableFeaturesEnum = {}));
40
53
  export var EnyoApplianceTopologyFeatureEnum;
41
54
  (function (EnyoApplianceTopologyFeatureEnum) {
42
55
  /** If the meter is the real Primary Meter collecting feed in and consumption in Wh */
@@ -7,6 +7,7 @@ import { EnyoEnergyPrices } from "./enyo-energy-prices.js";
7
7
  import { EnyoCurrencyEnum } from "./enyo-currency.js";
8
8
  import { EnyoHeatpumpApplianceModeEnum } from "./enyo-heatpump-appliance.js";
9
9
  import { EnyoAirConditioningApplianceModeEnum } from "./enyo-air-conditioning-appliance.js";
10
+ import { EnergyAppPackageCategory } from "../energy-app-package-definition.js";
10
11
  /**
11
12
  * Enum representing the reason type for why a data bus command was issued.
12
13
  * Used to attach context to commands for logging, debugging, and UI display.
@@ -186,6 +187,7 @@ export declare enum EnyoDataBusMessageEnum {
186
187
  MaxChargingPowerChangedV1 = "MaxChargingPowerChangedV1",
187
188
  MaxDischargePowerChangedV1 = "MaxDischargePowerChangedV1",
188
189
  GridOperatorPowerLimitationV1 = "GridOperatorPowerLimitationV1",
190
+ GridOperatorPowerProductionLimitationV1 = "GridOperatorPowerProductionLimitationV1",
189
191
  ResetChargerV1 = "ResetChargerV1",
190
192
  RebootChargerV1 = "RebootChargerV1",
191
193
  RequestChargerLogsV1 = "RequestChargerLogsV1",
@@ -198,6 +200,29 @@ export declare enum EnyoDataBusMessageEnum {
198
200
  StopAirConditioningV1 = "StopAirConditioningV1"
199
201
  }
200
202
  export type EnyoDataBusMessageResolution = '10s' | '30s' | '1m' | '15m' | '1h' | '1d' | 'dynamic';
203
+ /**
204
+ * Optional addressing information for a {@link EnyoDataBusMessage}. When omitted
205
+ * the message is broadcast to all subscribers; when set, the message is only
206
+ * delivered to packages that match the specified target.
207
+ *
208
+ * Exactly one of {@link cloudPackageId} or {@link categories} should be provided.
209
+ * When both are set, consumers should treat them as an AND (the receiving package
210
+ * must match the cloud package id **and** belong to at least one of the listed
211
+ * categories). When neither is set, the target is treated as "all packages".
212
+ */
213
+ export interface EnyoDataBusMessageTarget {
214
+ /**
215
+ * Target a single cloud-deployed energy app package by its package identifier.
216
+ * Use this when a message is intended for one specific package instance.
217
+ */
218
+ cloudPackageId?: string;
219
+ /**
220
+ * Target every energy app package whose definition declares at least one of
221
+ * the listed categories. Use this for category-scoped fan-out (e.g. send a
222
+ * grid operator limitation only to inverter and battery-storage packages).
223
+ */
224
+ categories?: EnergyAppPackageCategory[];
225
+ }
201
226
  export interface EnyoDataBusMessage {
202
227
  id: string;
203
228
  message: EnyoDataBusMessageEnum;
@@ -208,6 +233,13 @@ export interface EnyoDataBusMessage {
208
233
  timestampIso: string;
209
234
  /** If you just forward events that occur, use dynamic as resolution */
210
235
  resolution?: EnyoDataBusMessageResolution;
236
+ /**
237
+ * Optional delivery target. When omitted the message is broadcast to all
238
+ * subscribers. Use this to restrict delivery to a specific cloud package or
239
+ * to packages matching one or more energy app categories. See
240
+ * {@link EnyoDataBusMessageTarget} for matching semantics.
241
+ */
242
+ target?: EnyoDataBusMessageTarget;
211
243
  data: object;
212
244
  }
213
245
  export interface EnyoDataBusMessageAnswer extends EnyoDataBusMessage {
@@ -1068,6 +1100,25 @@ export interface EnyoDataBusGridOperatorPowerLimitationV1 extends EnyoDataBusMes
1068
1100
  endTimestampIso: string;
1069
1101
  };
1070
1102
  }
1103
+ /**
1104
+ * Command message for grid operator power production limitations directed at the energy manager.
1105
+ * Communicates whether a production-side power limitation (i.e. how much power may be fed into
1106
+ * the grid) is active, the power limit, and when it ends. The energy manager should adjust its
1107
+ * optimization strategy accordingly (e.g. curtail PV feed-in, prefer self-consumption, charge
1108
+ * batteries from surplus).
1109
+ */
1110
+ export interface EnyoDataBusGridOperatorPowerProductionLimitationV1 extends EnyoDataBusMessage {
1111
+ type: 'message';
1112
+ message: EnyoDataBusMessageEnum.GridOperatorPowerProductionLimitationV1;
1113
+ data: {
1114
+ /** Whether the grid operator power production limitation is currently active */
1115
+ active: boolean;
1116
+ /** The power production limitation in watts (maximum allowed feed-in power) */
1117
+ powerLimitationW: number;
1118
+ /** ISO 8601 timestamp when the limitation ends */
1119
+ endTimestampIso: string;
1120
+ };
1121
+ }
1071
1122
  /**
1072
1123
  * Command message to reset a charger appliance.
1073
1124
  * Sends a reset command to the specified charger, which performs a soft reset
@@ -144,6 +144,7 @@ export var EnyoDataBusMessageEnum;
144
144
  EnyoDataBusMessageEnum["MaxChargingPowerChangedV1"] = "MaxChargingPowerChangedV1";
145
145
  EnyoDataBusMessageEnum["MaxDischargePowerChangedV1"] = "MaxDischargePowerChangedV1";
146
146
  EnyoDataBusMessageEnum["GridOperatorPowerLimitationV1"] = "GridOperatorPowerLimitationV1";
147
+ EnyoDataBusMessageEnum["GridOperatorPowerProductionLimitationV1"] = "GridOperatorPowerProductionLimitationV1";
147
148
  EnyoDataBusMessageEnum["ResetChargerV1"] = "ResetChargerV1";
148
149
  EnyoDataBusMessageEnum["RebootChargerV1"] = "RebootChargerV1";
149
150
  EnyoDataBusMessageEnum["RequestChargerLogsV1"] = "RequestChargerLogsV1";
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Number of electrical phases provided by a grid connection.
3
+ * Most residential connections in Europe are single-phase (1) or three-phase (3);
4
+ * two-phase (split-phase, 2) connections also exist in some markets.
5
+ */
6
+ export type EnyoGridConnectionPointPhaseCount = 1 | 2 | 3;
7
+ /**
8
+ * Details about the site's grid connection point (the physical interface
9
+ * between the local electrical installation and the public grid).
10
+ *
11
+ * These values are typically defined by the grid operator (DSO) at
12
+ * installation time and are used by energy managers and integrations
13
+ * to plan grid-import/export budgets, derive per-phase current limits,
14
+ * and enforce regulatory or contractual power caps.
15
+ */
16
+ export interface EnyoGridConnectionPoint {
17
+ /**
18
+ * Rated current of the main fuse protecting the grid connection point,
19
+ * in amperes (A). This is the per-phase fuse rating as installed by the
20
+ * grid operator (e.g. 25, 35, 63).
21
+ */
22
+ fuseAmpere: number;
23
+ /**
24
+ * Number of electrical phases provided by the grid connection
25
+ * (1 = single-phase, 2 = split-phase, 3 = three-phase).
26
+ */
27
+ numberOfPhases: EnyoGridConnectionPointPhaseCount;
28
+ /**
29
+ * Maximum active power, in watts (W), that may be drawn from or fed into
30
+ * the grid at the connection point. Derived from the fuse rating, phase
31
+ * count, and any contractual or regulatory limits imposed by the grid
32
+ * operator.
33
+ */
34
+ powerLimitW: number;
35
+ }
@@ -0,0 +1 @@
1
+ export {};
package/dist/version.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Current version of the enyo Energy App SDK.
7
7
  */
8
- export declare const SDK_VERSION = "0.0.124";
8
+ export declare const SDK_VERSION = "0.0.126";
9
9
  /**
10
10
  * Gets the current SDK version.
11
11
  * @returns The semantic version string of the SDK
package/dist/version.js CHANGED
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Current version of the enyo Energy App SDK.
7
7
  */
8
- export const SDK_VERSION = '0.0.124';
8
+ export const SDK_VERSION = '0.0.126';
9
9
  /**
10
10
  * Gets the current SDK version.
11
11
  * @returns The semantic version string of the SDK
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enyo-energy/energy-app-sdk",
3
- "version": "0.0.124",
3
+ "version": "0.0.126",
4
4
  "description": "enyo Energy App SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",