@enyo-energy/energy-app-sdk 0.0.155 → 0.0.157

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.
@@ -38,6 +38,7 @@ var EnergyAppPermissionTypeEnum;
38
38
  EnergyAppPermissionTypeEnum["PvSystemUse"] = "PvSystemUse";
39
39
  EnergyAppPermissionTypeEnum["InverterControlCommands"] = "InverterControlCommands";
40
40
  EnergyAppPermissionTypeEnum["BatteryControlCommands"] = "BatteryControlCommands";
41
+ EnergyAppPermissionTypeEnum["BatteryStorageState"] = "BatteryStorageState";
41
42
  EnergyAppPermissionTypeEnum["ChargerControlCommands"] = "ChargerControlCommands";
42
43
  EnergyAppPermissionTypeEnum["EebusDeviceManagement"] = "EebusDeviceManagement";
43
44
  EnergyAppPermissionTypeEnum["EebusDataAccess"] = "EebusDataAccess";
@@ -1,4 +1,4 @@
1
- export type EnergyAppPermissionType = 'RestrictedInternetAccess' | 'NetworkDeviceDiscovery' | 'NetworkDeviceSearch' | 'NetworkDeviceAccess' | 'AllNetworkDeviceAccess' | 'Modbus' | 'Storage' | 'Appliance' | 'AllAppliances' | 'SendDataBusValues' | 'SubscribeDataBus' | 'SendDataBusCommands' | 'OcppServer' | 'ChargingCard' | 'Vehicle' | 'Charge' | 'SecretManager' | 'LocationZipCode' | 'LocationCoordinates' | 'Timeseries' | 'EnergyManagerInfo' | 'ElectricityTariff' | 'WeatherForecastRegister' | 'WeatherForecastUse' | 'PvForecastRegister' | 'PvForecastUse' | 'DynamicPriceForecastRegister' | 'DynamicPriceForecastUse' | 'PvSystemRegister' | 'PvSystemUse' | 'InverterControlCommands' | 'BatteryControlCommands' | 'ChargerControlCommands' | 'ModbusRtu' | 'EnergyPrices' | 'EnergyManager' | 'EebusDeviceManagement' | 'EebusDataAccess' | 'EebusControl' | 'Mqtt' | 'Bluetooth' | 'Wifi' | 'ChildProcess' | 'Udp';
1
+ export type EnergyAppPermissionType = 'RestrictedInternetAccess' | 'NetworkDeviceDiscovery' | 'NetworkDeviceSearch' | 'NetworkDeviceAccess' | 'AllNetworkDeviceAccess' | 'Modbus' | 'Storage' | 'Appliance' | 'AllAppliances' | 'SendDataBusValues' | 'SubscribeDataBus' | 'SendDataBusCommands' | 'OcppServer' | 'ChargingCard' | 'Vehicle' | 'Charge' | 'SecretManager' | 'LocationZipCode' | 'LocationCoordinates' | 'Timeseries' | 'EnergyManagerInfo' | 'ElectricityTariff' | 'WeatherForecastRegister' | 'WeatherForecastUse' | 'PvForecastRegister' | 'PvForecastUse' | 'DynamicPriceForecastRegister' | 'DynamicPriceForecastUse' | 'PvSystemRegister' | 'PvSystemUse' | 'InverterControlCommands' | 'BatteryControlCommands' | 'BatteryStorageState' | 'ChargerControlCommands' | 'ModbusRtu' | 'EnergyPrices' | 'EnergyManager' | 'EebusDeviceManagement' | 'EebusDataAccess' | 'EebusControl' | 'Mqtt' | 'Bluetooth' | 'Wifi' | 'ChildProcess' | 'Udp';
2
2
  export declare enum EnergyAppPermissionTypeEnum {
3
3
  RestrictedInternetAccess = "RestrictedInternetAccess",
4
4
  NetworkDeviceDiscovery = "NetworkDeviceDiscovery",
@@ -35,6 +35,7 @@ export declare enum EnergyAppPermissionTypeEnum {
35
35
  PvSystemUse = "PvSystemUse",
36
36
  InverterControlCommands = "InverterControlCommands",
37
37
  BatteryControlCommands = "BatteryControlCommands",
38
+ BatteryStorageState = "BatteryStorageState",
38
39
  ChargerControlCommands = "ChargerControlCommands",
39
40
  EebusDeviceManagement = "EebusDeviceManagement",
40
41
  EebusDataAccess = "EebusDataAccess",
@@ -307,6 +307,16 @@ class EnergyApp {
307
307
  useApplianceEnergyManagerForecast() {
308
308
  return this.energyAppSdk.useApplianceEnergyManagerForecast();
309
309
  }
310
+ /**
311
+ * Gets the Battery API for retrieving the current runtime state of each
312
+ * battery storage (state of charge, stored kWh, average price per kWh,
313
+ * optional solar share). Read-only; query by appliance ID or list all
314
+ * storages.
315
+ * @returns The Battery API instance
316
+ */
317
+ useBatteries() {
318
+ return this.energyAppSdk.useBatteries();
319
+ }
310
320
  /**
311
321
  * Gets the current SDK version.
312
322
  * @returns The semantic version string of the SDK
@@ -36,6 +36,7 @@ import { EnergyAppUdp } from "./packages/energy-app-udp.cjs";
36
36
  import { EnergyAppGridConnectionPoint } from "./packages/energy-app-grid-connection-point.cjs";
37
37
  import { EnergyAppConfigurationManager } from "./packages/energy-app-configuration-manager.cjs";
38
38
  import { EnergyAppApplianceEnergyManagerForecast } from "./packages/energy-app-appliance-energy-manager-forecast.cjs";
39
+ import { EnergyAppBattery } from "./packages/energy-app-battery.cjs";
39
40
  /**
40
41
  * Concrete implementation of {@link EnyoEnergyAppSdk} that delegates every call
41
42
  * to the runtime-provided `energyAppSdkInstance` global.
@@ -240,6 +241,14 @@ export declare class EnergyApp implements EnyoEnergyAppSdk {
240
241
  * @returns The Appliance Energy-Manager Forecast API instance
241
242
  */
242
243
  useApplianceEnergyManagerForecast(): EnergyAppApplianceEnergyManagerForecast;
244
+ /**
245
+ * Gets the Battery API for retrieving the current runtime state of each
246
+ * battery storage (state of charge, stored kWh, average price per kWh,
247
+ * optional solar share). Read-only; query by appliance ID or list all
248
+ * storages.
249
+ * @returns The Battery API instance
250
+ */
251
+ useBatteries(): EnergyAppBattery;
243
252
  /**
244
253
  * Gets the current SDK version.
245
254
  * @returns The semantic version string of the SDK
@@ -35,6 +35,7 @@ import { EnergyAppUdp } from "./packages/energy-app-udp.cjs";
35
35
  import { EnergyAppGridConnectionPoint } from "./packages/energy-app-grid-connection-point.cjs";
36
36
  import { EnergyAppConfigurationManager } from "./packages/energy-app-configuration-manager.cjs";
37
37
  import { EnergyAppApplianceEnergyManagerForecast } from "./packages/energy-app-appliance-energy-manager-forecast.cjs";
38
+ import { EnergyAppBattery } from "./packages/energy-app-battery.cjs";
38
39
  export declare enum EnergyAppStateEnum {
39
40
  Launching = "launching",
40
41
  Running = "running",
@@ -133,4 +134,6 @@ export interface EnyoEnergyAppSdk {
133
134
  useConfigurationManager: () => EnergyAppConfigurationManager;
134
135
  /** Get the Appliance Energy-Manager Forecast API for publishing forecasted command plans per appliance (charger, battery, heatpump) */
135
136
  useApplianceEnergyManagerForecast: () => EnergyAppApplianceEnergyManagerForecast;
137
+ /** Get the Battery API for retrieving the current runtime state of each battery storage (SoC, stored kWh, average price per kWh, optional solar share) */
138
+ useBatteries: () => EnergyAppBattery;
136
139
  }
@@ -99,3 +99,5 @@ __exportStar(require("./types/enyo-appliance-command-forecast.cjs"), exports);
99
99
  __exportStar(require("./packages/energy-app-appliance-energy-manager-forecast.cjs"), exports);
100
100
  __exportStar(require("./implementations/appliance-command-forecast/appliance-command-forecast-validators.cjs"), exports);
101
101
  __exportStar(require("./implementations/energy-manager-diagnostics/energy-manager-diagnostics-validators.cjs"), exports);
102
+ __exportStar(require("./types/enyo-battery-state.cjs"), exports);
103
+ __exportStar(require("./packages/energy-app-battery.cjs"), exports);
@@ -83,3 +83,5 @@ export * from './types/enyo-appliance-command-forecast.cjs';
83
83
  export * from './packages/energy-app-appliance-energy-manager-forecast.cjs';
84
84
  export * from './implementations/appliance-command-forecast/appliance-command-forecast-validators.cjs';
85
85
  export * from './implementations/energy-manager-diagnostics/energy-manager-diagnostics-validators.cjs';
86
+ export * from './types/enyo-battery-state.cjs';
87
+ export * from './packages/energy-app-battery.cjs';
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,31 @@
1
+ import { EnyoBatteryState } from "../types/enyo-battery-state.cjs";
2
+ /**
3
+ * Interface for retrieving the current runtime state of battery storages
4
+ * managed by the enyo system. Read-only snapshots keyed by appliance ID.
5
+ *
6
+ * Static battery configuration (capacity, mode, features, …) remains on
7
+ * `EnyoBatteryApplianceMetadata` via the Appliance API; this package is
8
+ * intentionally limited to volatile runtime values (SoC, stored kWh,
9
+ * price per kWh, optional solar share).
10
+ *
11
+ * Requires the `BatteryStorageState` permission.
12
+ */
13
+ export interface EnergyAppBattery {
14
+ /**
15
+ * Returns the current state for every known battery storage.
16
+ * Batteries without a reported state are omitted from the result.
17
+ *
18
+ * @returns Promise resolving to the list of current battery states
19
+ */
20
+ list: () => Promise<EnyoBatteryState[]>;
21
+ /**
22
+ * Returns the current state of a single battery storage by its
23
+ * appliance ID, or `null` if no state is known for that ID (e.g.
24
+ * the appliance is not a battery, is unknown, or has not yet
25
+ * reported a value).
26
+ *
27
+ * @param applianceId - The ID of the battery appliance (`EnyoAppliance.id`)
28
+ * @returns Promise resolving to the current battery state, or `null` if unknown
29
+ */
30
+ getByApplianceId: (applianceId: string) => Promise<EnyoBatteryState | null>;
31
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,28 @@
1
+ import { EnyoCurrencyEnum } from "./enyo-currency.cjs";
2
+ /**
3
+ * Current runtime state of a single battery storage, keyed by the
4
+ * battery's appliance ID. Returned by {@link EnergyAppBattery.getByApplianceId}
5
+ * and {@link EnergyAppBattery.list}.
6
+ *
7
+ * Static battery configuration (capacity, mode, features, …) lives on
8
+ * `EnyoBatteryApplianceMetadata` (accessible via the Appliance API); this
9
+ * type intentionally only carries volatile runtime values.
10
+ */
11
+ export interface EnyoBatteryState {
12
+ /** Appliance ID of the battery (matches `EnyoAppliance.id` where `type === Storage`) */
13
+ applianceId: string;
14
+ /** Current state of charge in percent (0–100) */
15
+ socPercent: number;
16
+ /** Currently stored energy in kWh */
17
+ energyKwh: number;
18
+ /** Average price per kWh of the energy currently stored in the battery */
19
+ pricePerKwh: number;
20
+ /** Currency of {@link pricePerKwh} */
21
+ currency: EnyoCurrencyEnum;
22
+ /**
23
+ * Optional share of the currently stored energy that originated from
24
+ * solar production, in percent (0–100). Omitted when the runtime cannot
25
+ * attribute energy provenance (e.g. no PV system or insufficient data).
26
+ */
27
+ solarSharePercent?: number;
28
+ }
@@ -170,6 +170,7 @@ var EnyoDataBusMessageEnum;
170
170
  EnyoDataBusMessageEnum["StartAirConditioningV1"] = "StartAirConditioningV1";
171
171
  EnyoDataBusMessageEnum["StopAirConditioningV1"] = "StopAirConditioningV1";
172
172
  EnyoDataBusMessageEnum["VehicleSocUpdateV1"] = "VehicleSocUpdateV1";
173
+ EnyoDataBusMessageEnum["EnergyAppStartedV1"] = "EnergyAppStartedV1";
173
174
  })(EnyoDataBusMessageEnum || (exports.EnyoDataBusMessageEnum = EnyoDataBusMessageEnum = {}));
174
175
  /**
175
176
  * Storage control mode carried by {@link EnyoDataBusSetStorageScheduleV1}.
@@ -194,7 +194,8 @@ export declare enum EnyoDataBusMessageEnum {
194
194
  AirConditioningTemperaturesUpdateV1 = "AirConditioningTemperaturesUpdateV1",
195
195
  StartAirConditioningV1 = "StartAirConditioningV1",
196
196
  StopAirConditioningV1 = "StopAirConditioningV1",
197
- VehicleSocUpdateV1 = "VehicleSocUpdateV1"
197
+ VehicleSocUpdateV1 = "VehicleSocUpdateV1",
198
+ EnergyAppStartedV1 = "EnergyAppStartedV1"
198
199
  }
199
200
  export type EnyoDataBusMessageResolution = '1s' | '10s' | '30s' | '1m' | '15m' | '1h' | '1d' | 'dynamic';
200
201
  /**
@@ -389,6 +390,44 @@ export interface EnyoDataBusApplianceStateUpdateV1 extends EnyoDataBusMessage {
389
390
  errorCodes?: EnyoApplianceErrorCode[];
390
391
  };
391
392
  }
393
+ /**
394
+ * Message emitted when an energy app package finishes startup and is now
395
+ * actively driving its appliances. Carries the running package's identity
396
+ * plus the full set of appliance ids it has registered against, so
397
+ * consumers can correlate subsequent activity to this package instance
398
+ * and learn which appliances are now under its influence.
399
+ *
400
+ * Broadcast (no `target`) — anyone observing the data bus may listen.
401
+ * The base {@link EnyoDataBusMessage.applianceId} field is intentionally
402
+ * left unset; this message scopes to *all* affected appliances via
403
+ * `data.applianceIds` rather than a single one.
404
+ */
405
+ export interface EnyoDataBusEnergyAppStartedV1 extends EnyoDataBusMessage {
406
+ type: 'message';
407
+ message: EnyoDataBusMessageEnum.EnergyAppStartedV1;
408
+ data: {
409
+ /**
410
+ * Cloud-deployment id of the started package. Matches
411
+ * {@link EnyoDataBusMessageTarget.cloudPackageId} so consumers
412
+ * can address replies back at this package instance.
413
+ */
414
+ cloudPackageId: string;
415
+ /**
416
+ * Package slug from the started package's
417
+ * {@link EnergyAppPackageDefinition.packageName}. Stable across
418
+ * deployments of the same package, suitable for grouping
419
+ * activity by package implementation rather than by instance.
420
+ */
421
+ packageName: string;
422
+ /**
423
+ * Ids of every appliance this package has registered against —
424
+ * the appliances whose lifecycle is now influenced by the
425
+ * running app. Empty array is legal (the package started but
426
+ * has not yet resolved any appliances).
427
+ */
428
+ applianceIds: string[];
429
+ };
430
+ }
392
431
  export interface EnyoDataBusChargingStartedV1 extends EnyoDataBusMessage {
393
432
  type: 'message';
394
433
  message: EnyoDataBusMessageEnum.ChargingStartedV1;
@@ -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.155';
12
+ exports.SDK_VERSION = '0.0.157';
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.155";
8
+ export declare const SDK_VERSION = "0.0.157";
9
9
  /**
10
10
  * Gets the current SDK version.
11
11
  * @returns The semantic version string of the SDK
@@ -1,4 +1,4 @@
1
- export type EnergyAppPermissionType = 'RestrictedInternetAccess' | 'NetworkDeviceDiscovery' | 'NetworkDeviceSearch' | 'NetworkDeviceAccess' | 'AllNetworkDeviceAccess' | 'Modbus' | 'Storage' | 'Appliance' | 'AllAppliances' | 'SendDataBusValues' | 'SubscribeDataBus' | 'SendDataBusCommands' | 'OcppServer' | 'ChargingCard' | 'Vehicle' | 'Charge' | 'SecretManager' | 'LocationZipCode' | 'LocationCoordinates' | 'Timeseries' | 'EnergyManagerInfo' | 'ElectricityTariff' | 'WeatherForecastRegister' | 'WeatherForecastUse' | 'PvForecastRegister' | 'PvForecastUse' | 'DynamicPriceForecastRegister' | 'DynamicPriceForecastUse' | 'PvSystemRegister' | 'PvSystemUse' | 'InverterControlCommands' | 'BatteryControlCommands' | 'ChargerControlCommands' | 'ModbusRtu' | 'EnergyPrices' | 'EnergyManager' | 'EebusDeviceManagement' | 'EebusDataAccess' | 'EebusControl' | 'Mqtt' | 'Bluetooth' | 'Wifi' | 'ChildProcess' | 'Udp';
1
+ export type EnergyAppPermissionType = 'RestrictedInternetAccess' | 'NetworkDeviceDiscovery' | 'NetworkDeviceSearch' | 'NetworkDeviceAccess' | 'AllNetworkDeviceAccess' | 'Modbus' | 'Storage' | 'Appliance' | 'AllAppliances' | 'SendDataBusValues' | 'SubscribeDataBus' | 'SendDataBusCommands' | 'OcppServer' | 'ChargingCard' | 'Vehicle' | 'Charge' | 'SecretManager' | 'LocationZipCode' | 'LocationCoordinates' | 'Timeseries' | 'EnergyManagerInfo' | 'ElectricityTariff' | 'WeatherForecastRegister' | 'WeatherForecastUse' | 'PvForecastRegister' | 'PvForecastUse' | 'DynamicPriceForecastRegister' | 'DynamicPriceForecastUse' | 'PvSystemRegister' | 'PvSystemUse' | 'InverterControlCommands' | 'BatteryControlCommands' | 'BatteryStorageState' | 'ChargerControlCommands' | 'ModbusRtu' | 'EnergyPrices' | 'EnergyManager' | 'EebusDeviceManagement' | 'EebusDataAccess' | 'EebusControl' | 'Mqtt' | 'Bluetooth' | 'Wifi' | 'ChildProcess' | 'Udp';
2
2
  export declare enum EnergyAppPermissionTypeEnum {
3
3
  RestrictedInternetAccess = "RestrictedInternetAccess",
4
4
  NetworkDeviceDiscovery = "NetworkDeviceDiscovery",
@@ -35,6 +35,7 @@ export declare enum EnergyAppPermissionTypeEnum {
35
35
  PvSystemUse = "PvSystemUse",
36
36
  InverterControlCommands = "InverterControlCommands",
37
37
  BatteryControlCommands = "BatteryControlCommands",
38
+ BatteryStorageState = "BatteryStorageState",
38
39
  ChargerControlCommands = "ChargerControlCommands",
39
40
  EebusDeviceManagement = "EebusDeviceManagement",
40
41
  EebusDataAccess = "EebusDataAccess",
@@ -35,6 +35,7 @@ export var EnergyAppPermissionTypeEnum;
35
35
  EnergyAppPermissionTypeEnum["PvSystemUse"] = "PvSystemUse";
36
36
  EnergyAppPermissionTypeEnum["InverterControlCommands"] = "InverterControlCommands";
37
37
  EnergyAppPermissionTypeEnum["BatteryControlCommands"] = "BatteryControlCommands";
38
+ EnergyAppPermissionTypeEnum["BatteryStorageState"] = "BatteryStorageState";
38
39
  EnergyAppPermissionTypeEnum["ChargerControlCommands"] = "ChargerControlCommands";
39
40
  EnergyAppPermissionTypeEnum["EebusDeviceManagement"] = "EebusDeviceManagement";
40
41
  EnergyAppPermissionTypeEnum["EebusDataAccess"] = "EebusDataAccess";
@@ -36,6 +36,7 @@ import { EnergyAppUdp } from "./packages/energy-app-udp.js";
36
36
  import { EnergyAppGridConnectionPoint } from "./packages/energy-app-grid-connection-point.js";
37
37
  import { EnergyAppConfigurationManager } from "./packages/energy-app-configuration-manager.js";
38
38
  import { EnergyAppApplianceEnergyManagerForecast } from "./packages/energy-app-appliance-energy-manager-forecast.js";
39
+ import { EnergyAppBattery } from "./packages/energy-app-battery.js";
39
40
  /**
40
41
  * Concrete implementation of {@link EnyoEnergyAppSdk} that delegates every call
41
42
  * to the runtime-provided `energyAppSdkInstance` global.
@@ -240,6 +241,14 @@ export declare class EnergyApp implements EnyoEnergyAppSdk {
240
241
  * @returns The Appliance Energy-Manager Forecast API instance
241
242
  */
242
243
  useApplianceEnergyManagerForecast(): EnergyAppApplianceEnergyManagerForecast;
244
+ /**
245
+ * Gets the Battery API for retrieving the current runtime state of each
246
+ * battery storage (state of charge, stored kWh, average price per kWh,
247
+ * optional solar share). Read-only; query by appliance ID or list all
248
+ * storages.
249
+ * @returns The Battery API instance
250
+ */
251
+ useBatteries(): EnergyAppBattery;
243
252
  /**
244
253
  * Gets the current SDK version.
245
254
  * @returns The semantic version string of the SDK
@@ -304,6 +304,16 @@ export class EnergyApp {
304
304
  useApplianceEnergyManagerForecast() {
305
305
  return this.energyAppSdk.useApplianceEnergyManagerForecast();
306
306
  }
307
+ /**
308
+ * Gets the Battery API for retrieving the current runtime state of each
309
+ * battery storage (state of charge, stored kWh, average price per kWh,
310
+ * optional solar share). Read-only; query by appliance ID or list all
311
+ * storages.
312
+ * @returns The Battery API instance
313
+ */
314
+ useBatteries() {
315
+ return this.energyAppSdk.useBatteries();
316
+ }
307
317
  /**
308
318
  * Gets the current SDK version.
309
319
  * @returns The semantic version string of the SDK
@@ -35,6 +35,7 @@ import { EnergyAppUdp } from "./packages/energy-app-udp.js";
35
35
  import { EnergyAppGridConnectionPoint } from "./packages/energy-app-grid-connection-point.js";
36
36
  import { EnergyAppConfigurationManager } from "./packages/energy-app-configuration-manager.js";
37
37
  import { EnergyAppApplianceEnergyManagerForecast } from "./packages/energy-app-appliance-energy-manager-forecast.js";
38
+ import { EnergyAppBattery } from "./packages/energy-app-battery.js";
38
39
  export declare enum EnergyAppStateEnum {
39
40
  Launching = "launching",
40
41
  Running = "running",
@@ -133,4 +134,6 @@ export interface EnyoEnergyAppSdk {
133
134
  useConfigurationManager: () => EnergyAppConfigurationManager;
134
135
  /** Get the Appliance Energy-Manager Forecast API for publishing forecasted command plans per appliance (charger, battery, heatpump) */
135
136
  useApplianceEnergyManagerForecast: () => EnergyAppApplianceEnergyManagerForecast;
137
+ /** Get the Battery API for retrieving the current runtime state of each battery storage (SoC, stored kWh, average price per kWh, optional solar share) */
138
+ useBatteries: () => EnergyAppBattery;
136
139
  }
package/dist/index.d.ts CHANGED
@@ -83,3 +83,5 @@ export * from './types/enyo-appliance-command-forecast.js';
83
83
  export * from './packages/energy-app-appliance-energy-manager-forecast.js';
84
84
  export * from './implementations/appliance-command-forecast/appliance-command-forecast-validators.js';
85
85
  export * from './implementations/energy-manager-diagnostics/energy-manager-diagnostics-validators.js';
86
+ export * from './types/enyo-battery-state.js';
87
+ export * from './packages/energy-app-battery.js';
package/dist/index.js CHANGED
@@ -83,3 +83,5 @@ export * from './types/enyo-appliance-command-forecast.js';
83
83
  export * from './packages/energy-app-appliance-energy-manager-forecast.js';
84
84
  export * from './implementations/appliance-command-forecast/appliance-command-forecast-validators.js';
85
85
  export * from './implementations/energy-manager-diagnostics/energy-manager-diagnostics-validators.js';
86
+ export * from './types/enyo-battery-state.js';
87
+ export * from './packages/energy-app-battery.js';
@@ -0,0 +1,31 @@
1
+ import { EnyoBatteryState } from "../types/enyo-battery-state.js";
2
+ /**
3
+ * Interface for retrieving the current runtime state of battery storages
4
+ * managed by the enyo system. Read-only snapshots keyed by appliance ID.
5
+ *
6
+ * Static battery configuration (capacity, mode, features, …) remains on
7
+ * `EnyoBatteryApplianceMetadata` via the Appliance API; this package is
8
+ * intentionally limited to volatile runtime values (SoC, stored kWh,
9
+ * price per kWh, optional solar share).
10
+ *
11
+ * Requires the `BatteryStorageState` permission.
12
+ */
13
+ export interface EnergyAppBattery {
14
+ /**
15
+ * Returns the current state for every known battery storage.
16
+ * Batteries without a reported state are omitted from the result.
17
+ *
18
+ * @returns Promise resolving to the list of current battery states
19
+ */
20
+ list: () => Promise<EnyoBatteryState[]>;
21
+ /**
22
+ * Returns the current state of a single battery storage by its
23
+ * appliance ID, or `null` if no state is known for that ID (e.g.
24
+ * the appliance is not a battery, is unknown, or has not yet
25
+ * reported a value).
26
+ *
27
+ * @param applianceId - The ID of the battery appliance (`EnyoAppliance.id`)
28
+ * @returns Promise resolving to the current battery state, or `null` if unknown
29
+ */
30
+ getByApplianceId: (applianceId: string) => Promise<EnyoBatteryState | null>;
31
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,28 @@
1
+ import { EnyoCurrencyEnum } from "./enyo-currency.js";
2
+ /**
3
+ * Current runtime state of a single battery storage, keyed by the
4
+ * battery's appliance ID. Returned by {@link EnergyAppBattery.getByApplianceId}
5
+ * and {@link EnergyAppBattery.list}.
6
+ *
7
+ * Static battery configuration (capacity, mode, features, …) lives on
8
+ * `EnyoBatteryApplianceMetadata` (accessible via the Appliance API); this
9
+ * type intentionally only carries volatile runtime values.
10
+ */
11
+ export interface EnyoBatteryState {
12
+ /** Appliance ID of the battery (matches `EnyoAppliance.id` where `type === Storage`) */
13
+ applianceId: string;
14
+ /** Current state of charge in percent (0–100) */
15
+ socPercent: number;
16
+ /** Currently stored energy in kWh */
17
+ energyKwh: number;
18
+ /** Average price per kWh of the energy currently stored in the battery */
19
+ pricePerKwh: number;
20
+ /** Currency of {@link pricePerKwh} */
21
+ currency: EnyoCurrencyEnum;
22
+ /**
23
+ * Optional share of the currently stored energy that originated from
24
+ * solar production, in percent (0–100). Omitted when the runtime cannot
25
+ * attribute energy provenance (e.g. no PV system or insufficient data).
26
+ */
27
+ solarSharePercent?: number;
28
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -194,7 +194,8 @@ export declare enum EnyoDataBusMessageEnum {
194
194
  AirConditioningTemperaturesUpdateV1 = "AirConditioningTemperaturesUpdateV1",
195
195
  StartAirConditioningV1 = "StartAirConditioningV1",
196
196
  StopAirConditioningV1 = "StopAirConditioningV1",
197
- VehicleSocUpdateV1 = "VehicleSocUpdateV1"
197
+ VehicleSocUpdateV1 = "VehicleSocUpdateV1",
198
+ EnergyAppStartedV1 = "EnergyAppStartedV1"
198
199
  }
199
200
  export type EnyoDataBusMessageResolution = '1s' | '10s' | '30s' | '1m' | '15m' | '1h' | '1d' | 'dynamic';
200
201
  /**
@@ -389,6 +390,44 @@ export interface EnyoDataBusApplianceStateUpdateV1 extends EnyoDataBusMessage {
389
390
  errorCodes?: EnyoApplianceErrorCode[];
390
391
  };
391
392
  }
393
+ /**
394
+ * Message emitted when an energy app package finishes startup and is now
395
+ * actively driving its appliances. Carries the running package's identity
396
+ * plus the full set of appliance ids it has registered against, so
397
+ * consumers can correlate subsequent activity to this package instance
398
+ * and learn which appliances are now under its influence.
399
+ *
400
+ * Broadcast (no `target`) — anyone observing the data bus may listen.
401
+ * The base {@link EnyoDataBusMessage.applianceId} field is intentionally
402
+ * left unset; this message scopes to *all* affected appliances via
403
+ * `data.applianceIds` rather than a single one.
404
+ */
405
+ export interface EnyoDataBusEnergyAppStartedV1 extends EnyoDataBusMessage {
406
+ type: 'message';
407
+ message: EnyoDataBusMessageEnum.EnergyAppStartedV1;
408
+ data: {
409
+ /**
410
+ * Cloud-deployment id of the started package. Matches
411
+ * {@link EnyoDataBusMessageTarget.cloudPackageId} so consumers
412
+ * can address replies back at this package instance.
413
+ */
414
+ cloudPackageId: string;
415
+ /**
416
+ * Package slug from the started package's
417
+ * {@link EnergyAppPackageDefinition.packageName}. Stable across
418
+ * deployments of the same package, suitable for grouping
419
+ * activity by package implementation rather than by instance.
420
+ */
421
+ packageName: string;
422
+ /**
423
+ * Ids of every appliance this package has registered against —
424
+ * the appliances whose lifecycle is now influenced by the
425
+ * running app. Empty array is legal (the package started but
426
+ * has not yet resolved any appliances).
427
+ */
428
+ applianceIds: string[];
429
+ };
430
+ }
392
431
  export interface EnyoDataBusChargingStartedV1 extends EnyoDataBusMessage {
393
432
  type: 'message';
394
433
  message: EnyoDataBusMessageEnum.ChargingStartedV1;
@@ -167,6 +167,7 @@ export var EnyoDataBusMessageEnum;
167
167
  EnyoDataBusMessageEnum["StartAirConditioningV1"] = "StartAirConditioningV1";
168
168
  EnyoDataBusMessageEnum["StopAirConditioningV1"] = "StopAirConditioningV1";
169
169
  EnyoDataBusMessageEnum["VehicleSocUpdateV1"] = "VehicleSocUpdateV1";
170
+ EnyoDataBusMessageEnum["EnergyAppStartedV1"] = "EnergyAppStartedV1";
170
171
  })(EnyoDataBusMessageEnum || (EnyoDataBusMessageEnum = {}));
171
172
  /**
172
173
  * Storage control mode carried by {@link EnyoDataBusSetStorageScheduleV1}.
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.155";
8
+ export declare const SDK_VERSION = "0.0.157";
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.155';
8
+ export const SDK_VERSION = '0.0.157';
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.155",
3
+ "version": "0.0.157",
4
4
  "description": "enyo Energy App SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",