@enyo-energy/energy-app-sdk 0.0.62 → 0.0.64

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-permission.type.cjs +1 -0
  2. package/dist/cjs/energy-app-permission.type.d.cts +1 -0
  3. package/dist/cjs/enyo-energy-app-sdk.d.cts +2 -2
  4. package/dist/cjs/index.cjs +1 -2
  5. package/dist/cjs/index.d.cts +3 -4
  6. package/dist/cjs/packages/energy-app-electricity-tariff.d.cts +16 -5
  7. package/dist/cjs/packages/energy-app-energy-prices.cjs +2 -0
  8. package/dist/cjs/packages/energy-app-energy-prices.d.cts +35 -0
  9. package/dist/cjs/packages/energy-app-pv-system.d.cts +10 -9
  10. package/dist/cjs/types/enyo-data-bus-value.d.cts +2 -2
  11. package/dist/cjs/types/enyo-electricity-tariff.d.cts +45 -3
  12. package/dist/cjs/types/enyo-energy-prices.cjs +2 -0
  13. package/dist/cjs/types/enyo-energy-prices.d.cts +22 -0
  14. package/dist/cjs/types/enyo-pv-system.cjs +15 -1
  15. package/dist/cjs/types/enyo-pv-system.d.cts +13 -11
  16. package/dist/cjs/version.cjs +1 -1
  17. package/dist/cjs/version.d.cts +1 -1
  18. package/dist/energy-app-permission.type.d.ts +1 -0
  19. package/dist/energy-app-permission.type.js +1 -0
  20. package/dist/enyo-energy-app-sdk.d.ts +2 -2
  21. package/dist/index.d.ts +3 -4
  22. package/dist/index.js +1 -2
  23. package/dist/packages/energy-app-electricity-tariff.d.ts +16 -5
  24. package/dist/packages/energy-app-energy-prices.d.ts +35 -0
  25. package/dist/packages/energy-app-energy-prices.js +1 -0
  26. package/dist/packages/energy-app-pv-system.d.ts +10 -9
  27. package/dist/types/enyo-data-bus-value.d.ts +2 -2
  28. package/dist/types/enyo-electricity-tariff.d.ts +45 -3
  29. package/dist/types/enyo-energy-prices.d.ts +22 -0
  30. package/dist/types/enyo-energy-prices.js +1 -0
  31. package/dist/types/enyo-pv-system.d.ts +13 -11
  32. package/dist/types/enyo-pv-system.js +14 -0
  33. package/dist/version.d.ts +1 -1
  34. package/dist/version.js +1 -1
  35. package/package.json +1 -1
@@ -24,6 +24,7 @@ var EnergyAppPermissionTypeEnum;
24
24
  EnergyAppPermissionTypeEnum["Timeseries"] = "Timeseries";
25
25
  EnergyAppPermissionTypeEnum["EnergyManagerInfo"] = "EnergyManagerInfo";
26
26
  EnergyAppPermissionTypeEnum["ElectricityTariff"] = "ElectricityTariff";
27
+ EnergyAppPermissionTypeEnum["EnergyPrices"] = "EnergyPrices";
27
28
  EnergyAppPermissionTypeEnum["WeatherForecastRegister"] = "WeatherForecastRegister";
28
29
  EnergyAppPermissionTypeEnum["WeatherForecastUse"] = "WeatherForecastUse";
29
30
  EnergyAppPermissionTypeEnum["PvForecastRegister"] = "PvForecastRegister";
@@ -21,6 +21,7 @@ export declare enum EnergyAppPermissionTypeEnum {
21
21
  Timeseries = "Timeseries",
22
22
  EnergyManagerInfo = "EnergyManagerInfo",
23
23
  ElectricityTariff = "ElectricityTariff",
24
+ EnergyPrices = "EnergyPrices",
24
25
  WeatherForecastRegister = "WeatherForecastRegister",
25
26
  WeatherForecastUse = "WeatherForecastUse",
26
27
  PvForecastRegister = "PvForecastRegister",
@@ -10,7 +10,7 @@ import { EnergyAppVehicle } from "./packages/energy-app-vehicle.cjs";
10
10
  import { EnergyAppChargingCard } from "./packages/energy-app-charging-card.cjs";
11
11
  import { EnergyAppAuthentication } from "./packages/energy-app-authentication.cjs";
12
12
  import { EnergyAppSettings } from "./packages/energy-app-settings.cjs";
13
- import { EnergyAppElectricityPrices } from "./packages/energy-app-electricity-prices.cjs";
13
+ import { EnergyAppEnergyPrices } from "./packages/energy-app-energy-prices.cjs";
14
14
  import { EnergyAppNotification } from "./packages/energy-app-notification.cjs";
15
15
  import { EnergyAppSecretManager } from "./packages/energy-app-secret-manager.cjs";
16
16
  import { EnergyAppLocation } from "./packages/energy-app-location.cjs";
@@ -72,7 +72,7 @@ export interface EnyoEnergyAppSdk {
72
72
  /** Get the Settings API */
73
73
  useSettings: () => EnergyAppSettings;
74
74
  /** Get the Electricity Prices API */
75
- useElectricityPrices: () => EnergyAppElectricityPrices;
75
+ useElectricityPrices: () => EnergyAppEnergyPrices;
76
76
  /** Get the Notification API */
77
77
  useNotification: () => EnergyAppNotification;
78
78
  /** Get the Secret Manager API */
@@ -23,8 +23,7 @@ __exportStar(require("./implementations/ocpp/ocpp201.cjs"), exports);
23
23
  __exportStar(require("./implementations/ocpp/ocpp-common.cjs"), exports);
24
24
  __exportStar(require("./types/enyo-authentication.cjs"), exports);
25
25
  __exportStar(require("./types/enyo-settings.cjs"), exports);
26
- __exportStar(require("./types/enyo-energy-tariff.cjs"), exports);
27
- __exportStar(require("./types/enyo-electricity-prices.cjs"), exports);
26
+ __exportStar(require("./types/enyo-energy-prices.cjs"), exports);
28
27
  __exportStar(require("./types/enyo-notification.cjs"), exports);
29
28
  __exportStar(require("./types/enyo-secret-manager.cjs"), exports);
30
29
  __exportStar(require("./types/enyo-location.cjs"), exports);
@@ -11,7 +11,7 @@ import { EnergyAppChargingCard } from "./packages/energy-app-charging-card.cjs";
11
11
  import { EnergyAppCharge } from "./packages/energy-app-charge.cjs";
12
12
  import { EnergyAppAuthentication } from "./packages/energy-app-authentication.cjs";
13
13
  import { EnergyAppSettings } from "./packages/energy-app-settings.cjs";
14
- import { EnergyAppElectricityPrices } from "./packages/energy-app-electricity-prices.cjs";
14
+ import { EnergyAppEnergyPrices } from "./packages/energy-app-energy-prices.cjs";
15
15
  import { EnergyAppNotification } from "./packages/energy-app-notification.cjs";
16
16
  import { EnergyAppSecretManager } from "./packages/energy-app-secret-manager.cjs";
17
17
  import { EnergyAppLocation } from "./packages/energy-app-location.cjs";
@@ -31,8 +31,7 @@ export * from './implementations/ocpp/ocpp201.cjs';
31
31
  export * from './implementations/ocpp/ocpp-common.cjs';
32
32
  export * from './types/enyo-authentication.cjs';
33
33
  export * from './types/enyo-settings.cjs';
34
- export * from './types/enyo-energy-tariff.cjs';
35
- export * from './types/enyo-electricity-prices.cjs';
34
+ export * from './types/enyo-energy-prices.cjs';
36
35
  export * from './types/enyo-notification.cjs';
37
36
  export * from './types/enyo-secret-manager.cjs';
38
37
  export * from './types/enyo-location.cjs';
@@ -72,7 +71,7 @@ export declare class EnergyApp implements EnyoEnergyAppSdk {
72
71
  useCharge(): EnergyAppCharge;
73
72
  useAuthentication(): EnergyAppAuthentication;
74
73
  useSettings(): EnergyAppSettings;
75
- useElectricityPrices(): EnergyAppElectricityPrices;
74
+ useElectricityPrices(): EnergyAppEnergyPrices;
76
75
  useNotification(): EnergyAppNotification;
77
76
  useOnboarding(): EnergyAppOnboarding;
78
77
  /**
@@ -1,4 +1,4 @@
1
- import { ElectricityTariffRegistration, ElectricityTariffWithDefault } from "../types/enyo-electricity-tariff.cjs";
1
+ import { EnyoElectricityTariff, EnyoElectricityTariffWithDefault } from "../types/enyo-electricity-tariff.cjs";
2
2
  /**
3
3
  * Interface for managing electricity tariffs.
4
4
  * Provides methods to register, retrieve, and remove electricity tariffs
@@ -13,7 +13,7 @@ export interface EnergyAppElectricityTariff {
13
13
  * @param tariff - The tariff registration data including ID, type, name, and vendor
14
14
  * @returns Promise that resolves when the tariff has been registered
15
15
  */
16
- registerTariff(tariff: ElectricityTariffRegistration): Promise<void>;
16
+ registerTariff(tariff: Omit<EnyoElectricityTariff, 'id'>): Promise<EnyoElectricityTariffWithDefault>;
17
17
  /**
18
18
  * Retrieves all registered electricity tariffs.
19
19
  * Each tariff includes a defaultTariff boolean indicating whether
@@ -21,13 +21,24 @@ export interface EnergyAppElectricityTariff {
21
21
  *
22
22
  * @returns Promise that resolves to an array of all registered tariffs with default indicators
23
23
  */
24
- getAllTariffs(): Promise<ElectricityTariffWithDefault[]>;
24
+ getAllTariffs(): Promise<EnyoElectricityTariffWithDefault[]>;
25
25
  /**
26
26
  * Removes an electricity tariff by its ID.
27
27
  * If the tariff does not exist, this operation is a no-op.
28
28
  *
29
- * @param tariffId - The unique identifier of the tariff to remove
29
+ * @param id - The unique identifier of the tariff to remove
30
30
  * @returns Promise that resolves when the tariff has been removed
31
31
  */
32
- removeTariff(tariffId: string): Promise<void>;
32
+ removeTariff(id: string): Promise<void>;
33
+ /**
34
+ * Retrieves the system default tariff information.
35
+ * Returns the full tariff including pricing data.
36
+ *
37
+ * @returns Promise that resolves to the default tariff info, or null if none is configured
38
+ */
39
+ getDefaultTariff(): Promise<EnyoElectricityTariff | null>;
40
+ findTariff(filter: {
41
+ applianceId?: string;
42
+ tariffId?: string;
43
+ }): Promise<EnyoElectricityTariff | null>;
33
44
  }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,35 @@
1
+ import { EnyoEnergyPriceEntry, EnyoEnergyPrices } from "../types/enyo-energy-prices.cjs";
2
+ /**
3
+ * Interface for retrieving electricity price information.
4
+ * Provides methods to get current and forecast electricity prices,
5
+ * always normalized to 15-minute intervals regardless of source data resolution.
6
+ */
7
+ export interface EnergyAppEnergyPrices {
8
+ /**
9
+ * Retrieves electricity prices for a specified time range.
10
+ * The response always contains prices in 15-minute intervals,
11
+ * interpolated from the original data source (constant, 15min, or 1hr intervals).
12
+ *
13
+ * @param request - The price request parameters including time range and optional appliance ID
14
+ * @returns Promise that resolves to electricity prices for the requested time range
15
+ */
16
+ getPrices(request: EnergyAppEnergyPricesFilter): Promise<EnyoEnergyPrices>;
17
+ /**
18
+ * Retrieves the current electricity price for the current 15-minute interval.
19
+ * This is a convenience method that gets the price for "now".
20
+ *
21
+ * @param applianceId - Optional appliance ID to get appliance-specific pricing
22
+ * @returns Promise that resolves to current price information, or null if no pricing data is available
23
+ */
24
+ getCurrentPrice(applianceId?: string): Promise<EnyoEnergyPriceEntry | null>;
25
+ }
26
+ export interface EnergyAppEnergyPricesFilter {
27
+ /** Start time for price data in ISO format */
28
+ fromIso: string;
29
+ /** End time for price data in ISO format */
30
+ untilIso: string;
31
+ /** Optional appliance ID to get appliance-specific pricing */
32
+ applianceId?: string;
33
+ /** Optional tariff ID to use for pricing. If omitted, uses the default tariff */
34
+ tariffId?: string;
35
+ }
@@ -1,4 +1,4 @@
1
- import { PvSystemRegistration, PvSystemInfo } from "../types/enyo-pv-system.cjs";
1
+ import { EnyoPvSystem } from "../types/enyo-pv-system.cjs";
2
2
  /**
3
3
  * Interface for managing PV systems.
4
4
  * Allows energy apps to register, retrieve, update, and remove PV system configurations
@@ -30,21 +30,21 @@ export interface EnergyAppPvSystem {
30
30
  * console.log(`Registered PV system: ${pvSystem.pvSystemId}`);
31
31
  * ```
32
32
  */
33
- registerPvSystem(pvSystem: PvSystemRegistration): Promise<PvSystemInfo>;
33
+ registerPvSystem(pvSystem: Omit<EnyoPvSystem, 'id'>): Promise<EnyoPvSystem>;
34
34
  /**
35
35
  * Retrieves a registered PV system by its ID.
36
36
  *
37
- * @param pvSystemId - The unique identifier of the PV system
37
+ * @param id - The unique identifier of the PV system
38
38
  * @returns Promise that resolves to the PV system info, or null if not found
39
39
  */
40
- getPvSystem(pvSystemId: string): Promise<PvSystemInfo | null>;
40
+ findPvSystem(id: string): Promise<EnyoPvSystem | null>;
41
41
  /**
42
42
  * Updates an existing PV system configuration.
43
43
  * Allows changing the kWp, DC string configurations, appliances, and features
44
44
  * of a registered PV system.
45
45
  *
46
- * @param pvSystemId - The unique identifier of the PV system to update
47
- * @param pvSystem - The updated PV system registration data
46
+ * @param id - The unique identifier of the PV system to update
47
+ * @param attributes - The updated PV system registration data
48
48
  * @returns Promise that resolves to the updated PV system info
49
49
  *
50
50
  * @example
@@ -58,13 +58,14 @@ export interface EnergyAppPvSystem {
58
58
  * });
59
59
  * ```
60
60
  */
61
- updatePvSystem(pvSystemId: string, pvSystem: PvSystemRegistration): Promise<PvSystemInfo>;
61
+ updatePvSystem(id: string, attributes: Partial<Omit<EnyoPvSystem, 'id'>>): Promise<EnyoPvSystem>;
62
62
  /**
63
63
  * Removes a registered PV system by its ID.
64
64
  * If the PV system does not exist, this operation is a no-op.
65
65
  *
66
- * @param pvSystemId - The unique identifier of the PV system to remove
66
+ * @param id - The unique identifier of the PV system to remove
67
67
  * @returns Promise that resolves when the PV system has been removed
68
68
  */
69
- removePvSystem(pvSystemId: string): Promise<void>;
69
+ removePvSystem(id: string): Promise<void>;
70
+ getPvSystems(): Promise<EnyoPvSystem[]>;
70
71
  }
@@ -1,10 +1,10 @@
1
1
  import { EnyoApplianceStateEnum, EnyoApplianceTypeEnum } from "./enyo-appliance.cjs";
2
2
  import { EnyoSourceEnum } from "./enyo-source.enum.cjs";
3
- import { EnergyTariffInfo } from "./enyo-energy-tariff.cjs";
4
3
  import { EnyoOcppRelativeSchedule } from "./enyo-ocpp.cjs";
5
4
  import { EnyoChargerApplianceStatusEnum } from "./enyo-charger-appliance.cjs";
6
5
  import { PreviewChargingSchedule, PreviewChargingScheduleCostComparison, PreviewChargingScheduleUnavailableReasonEnum } from "./enyo-energy-manager.cjs";
7
6
  import { PvForecast } from "./enyo-pv-forecast.cjs";
7
+ import { EnyoEnergyPrices } from "./enyo-energy-prices.cjs";
8
8
  export declare enum EnyoBatteryStateEnum {
9
9
  Off = "off",
10
10
  Empty = "empty",
@@ -507,7 +507,7 @@ export interface EnyoDataBusEnergyTariffUpdateV1 extends EnyoDataBusMessage {
507
507
  applianceId?: string;
508
508
  data: {
509
509
  /** Complete energy tariff information including pricing structure and validity */
510
- tariffInfo: EnergyTariffInfo;
510
+ energyPrices: EnyoEnergyPrices;
511
511
  };
512
512
  }
513
513
  /**
@@ -9,12 +9,48 @@ export declare enum ElectricityTariffTypeEnum {
9
9
  /** Price changes dynamically based on market conditions */
10
10
  Dynamic = "dynamic"
11
11
  }
12
+ /**
13
+ * Pricing data for a static (fixed-price) electricity tariff
14
+ */
15
+ export interface StaticTariffData {
16
+ /** Price per kWh for consumption */
17
+ pricePerKwh: number;
18
+ /** Currency code (ISO 4217, e.g., 'EUR', 'USD') */
19
+ currency: string;
20
+ }
21
+ /**
22
+ * Pricing data for a dynamic electricity tariff
23
+ */
24
+ export interface DynamicTariffData {
25
+ /** Price per kWh for grid fees */
26
+ gridFeePerKwh?: number;
27
+ /** Currency code (ISO 4217, e.g., 'EUR', 'USD') */
28
+ currency: string;
29
+ }
30
+ /**
31
+ * A single entry in a time-variable tariff schedule
32
+ */
33
+ export interface TimeVariableScheduleEntry {
34
+ /** Relative start offset (e.g., minutes from start of day) */
35
+ start: number;
36
+ /** Price per kWh during this period */
37
+ pricePerKwh: number;
38
+ }
39
+ /**
40
+ * Pricing data for a time-variable electricity tariff
41
+ */
42
+ export interface TimeVariableTariffData {
43
+ /** Schedule of time-based price entries */
44
+ schedule: TimeVariableScheduleEntry[];
45
+ /** Currency code (ISO 4217, e.g., 'EUR', 'USD') */
46
+ currency: string;
47
+ }
12
48
  /**
13
49
  * Input data for registering or updating an electricity tariff
14
50
  */
15
- export interface ElectricityTariffRegistration {
51
+ export interface EnyoElectricityTariff {
16
52
  /** Unique identifier for the tariff */
17
- tariffId: string;
53
+ id: string;
18
54
  /** The pricing model type of this tariff */
19
55
  tariffType: ElectricityTariffTypeEnum;
20
56
  /** Human-readable name of the tariff */
@@ -23,12 +59,18 @@ export interface ElectricityTariffRegistration {
23
59
  vendorName: string;
24
60
  /** Optional ID of the primary meter appliance associated with this tariff */
25
61
  primaryMeterApplianceId?: string;
62
+ /** Optional static pricing data (relevant when tariffType is Static) */
63
+ staticTariffData?: StaticTariffData;
64
+ /** Optional time-variable pricing data (relevant when tariffType is TimeVariable) */
65
+ timeVariableTariffData?: TimeVariableTariffData;
66
+ /** Optional dynamic pricing data*/
67
+ dynamicTariffData?: DynamicTariffData;
26
68
  }
27
69
  /**
28
70
  * Tariff registration data extended with default indicator.
29
71
  * Used in list responses to indicate which tariff is the system default.
30
72
  */
31
- export interface ElectricityTariffWithDefault extends ElectricityTariffRegistration {
73
+ export interface EnyoElectricityTariffWithDefault extends EnyoElectricityTariff {
32
74
  /** Indicates whether this tariff is the system default */
33
75
  defaultTariff: boolean;
34
76
  }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,22 @@
1
+ import { ElectricityTariffTypeEnum } from "./enyo-electricity-tariff.cjs";
2
+ /**
3
+ * Represents complete energy tariff information
4
+ */
5
+ export interface EnyoEnergyPrices {
6
+ /** Unique identifier for this tariff */
7
+ tariffId: string;
8
+ type: ElectricityTariffTypeEnum;
9
+ /** Pricing data structure */
10
+ prices: EnyoEnergyPriceEntry[];
11
+ /** Timestamp when this tariff information was last updated */
12
+ lastUpdatedIso: string;
13
+ }
14
+ export interface EnyoEnergyPriceEntry {
15
+ /** Start time of this 15-minute interval in ISO format */
16
+ timestampIso: string;
17
+ /** Price per kWh for electricity consumption during this interval */
18
+ consumptionPricePerKwh: number;
19
+ /** Optional price per kWh for grid feed-in during this interval */
20
+ feedInPricePerKwh?: number;
21
+ currency: string;
22
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PvSystemFeatureEnum = exports.PvOrientationEnum = void 0;
3
+ exports.PvSystemFeatureEnum = exports.PvSystemCreatedBy = exports.PvSystemOrientationSourceEnum = exports.PvOrientationEnum = void 0;
4
4
  /**
5
5
  * Compass orientation for PV panel mounting direction.
6
6
  * Used to describe the azimuth orientation of DC strings.
@@ -16,6 +16,20 @@ var PvOrientationEnum;
16
16
  PvOrientationEnum["West"] = "west";
17
17
  PvOrientationEnum["NorthWest"] = "north-west";
18
18
  })(PvOrientationEnum || (exports.PvOrientationEnum = PvOrientationEnum = {}));
19
+ /**
20
+ * Source of the orientation information for a DC string.
21
+ * Indicates whether the orientation was provided by the user or estimated automatically.
22
+ */
23
+ var PvSystemOrientationSourceEnum;
24
+ (function (PvSystemOrientationSourceEnum) {
25
+ PvSystemOrientationSourceEnum["UserProvided"] = "user";
26
+ PvSystemOrientationSourceEnum["Estimated"] = "estimated";
27
+ })(PvSystemOrientationSourceEnum || (exports.PvSystemOrientationSourceEnum = PvSystemOrientationSourceEnum = {}));
28
+ var PvSystemCreatedBy;
29
+ (function (PvSystemCreatedBy) {
30
+ PvSystemCreatedBy["User"] = "user";
31
+ PvSystemCreatedBy["EnergyApp"] = "energy-app";
32
+ })(PvSystemCreatedBy || (exports.PvSystemCreatedBy = PvSystemCreatedBy = {}));
19
33
  /**
20
34
  * Feature flags for a PV system.
21
35
  * Used to indicate special configurations or capabilities.
@@ -17,7 +17,14 @@ export declare enum PvOrientationEnum {
17
17
  * Source of the orientation information for a DC string.
18
18
  * Indicates whether the orientation was provided by the user or estimated automatically.
19
19
  */
20
- export type PvSystemOrientationSourceEnum = 'user' | 'estimated';
20
+ export declare enum PvSystemOrientationSourceEnum {
21
+ UserProvided = "user",
22
+ Estimated = "estimated"
23
+ }
24
+ export declare enum PvSystemCreatedBy {
25
+ User = "user",
26
+ EnergyApp = "energy-app"
27
+ }
21
28
  /**
22
29
  * Feature flags for a PV system.
23
30
  * Used to indicate special configurations or capabilities.
@@ -49,9 +56,13 @@ export interface PvSystemDcString {
49
56
  /**
50
57
  * Registration data for a PV system.
51
58
  */
52
- export interface PvSystemRegistration {
59
+ export interface EnyoPvSystem {
60
+ /** Unique identifier of the registered PV system */
61
+ id: string;
53
62
  /** Peak power capacity of the entire PV system in kilowatts peak */
54
63
  kWp: number;
64
+ /** Indicates who created the PV system entry (user or energy app) */
65
+ createdBy: PvSystemCreatedBy;
55
66
  /** Array of DC strings describing the panel groups and their orientations */
56
67
  dcStrings: PvSystemDcString[];
57
68
  /** Optional list of appliances associated with this PV system */
@@ -59,12 +70,3 @@ export interface PvSystemRegistration {
59
70
  /** Optional feature flags for this PV system */
60
71
  features?: PvSystemFeatureEnum[];
61
72
  }
62
- /**
63
- * A registered PV system with its identifier and metadata.
64
- */
65
- export interface PvSystemInfo extends PvSystemRegistration {
66
- /** Unique identifier of the registered PV system */
67
- pvSystemId: string;
68
- /** Timestamp when this PV system was registered in ISO format */
69
- registeredAtIso: string;
70
- }
@@ -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.62';
12
+ exports.SDK_VERSION = '0.0.64';
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.62";
8
+ export declare const SDK_VERSION = "0.0.64";
9
9
  /**
10
10
  * Gets the current SDK version.
11
11
  * @returns The semantic version string of the SDK
@@ -21,6 +21,7 @@ export declare enum EnergyAppPermissionTypeEnum {
21
21
  Timeseries = "Timeseries",
22
22
  EnergyManagerInfo = "EnergyManagerInfo",
23
23
  ElectricityTariff = "ElectricityTariff",
24
+ EnergyPrices = "EnergyPrices",
24
25
  WeatherForecastRegister = "WeatherForecastRegister",
25
26
  WeatherForecastUse = "WeatherForecastUse",
26
27
  PvForecastRegister = "PvForecastRegister",
@@ -21,6 +21,7 @@ export var EnergyAppPermissionTypeEnum;
21
21
  EnergyAppPermissionTypeEnum["Timeseries"] = "Timeseries";
22
22
  EnergyAppPermissionTypeEnum["EnergyManagerInfo"] = "EnergyManagerInfo";
23
23
  EnergyAppPermissionTypeEnum["ElectricityTariff"] = "ElectricityTariff";
24
+ EnergyAppPermissionTypeEnum["EnergyPrices"] = "EnergyPrices";
24
25
  EnergyAppPermissionTypeEnum["WeatherForecastRegister"] = "WeatherForecastRegister";
25
26
  EnergyAppPermissionTypeEnum["WeatherForecastUse"] = "WeatherForecastUse";
26
27
  EnergyAppPermissionTypeEnum["PvForecastRegister"] = "PvForecastRegister";
@@ -10,7 +10,7 @@ import { EnergyAppVehicle } from "./packages/energy-app-vehicle.js";
10
10
  import { EnergyAppChargingCard } from "./packages/energy-app-charging-card.js";
11
11
  import { EnergyAppAuthentication } from "./packages/energy-app-authentication.js";
12
12
  import { EnergyAppSettings } from "./packages/energy-app-settings.js";
13
- import { EnergyAppElectricityPrices } from "./packages/energy-app-electricity-prices.js";
13
+ import { EnergyAppEnergyPrices } from "./packages/energy-app-energy-prices.js";
14
14
  import { EnergyAppNotification } from "./packages/energy-app-notification.js";
15
15
  import { EnergyAppSecretManager } from "./packages/energy-app-secret-manager.js";
16
16
  import { EnergyAppLocation } from "./packages/energy-app-location.js";
@@ -72,7 +72,7 @@ export interface EnyoEnergyAppSdk {
72
72
  /** Get the Settings API */
73
73
  useSettings: () => EnergyAppSettings;
74
74
  /** Get the Electricity Prices API */
75
- useElectricityPrices: () => EnergyAppElectricityPrices;
75
+ useElectricityPrices: () => EnergyAppEnergyPrices;
76
76
  /** Get the Notification API */
77
77
  useNotification: () => EnergyAppNotification;
78
78
  /** Get the Secret Manager API */
package/dist/index.d.ts CHANGED
@@ -11,7 +11,7 @@ import { EnergyAppChargingCard } from "./packages/energy-app-charging-card.js";
11
11
  import { EnergyAppCharge } from "./packages/energy-app-charge.js";
12
12
  import { EnergyAppAuthentication } from "./packages/energy-app-authentication.js";
13
13
  import { EnergyAppSettings } from "./packages/energy-app-settings.js";
14
- import { EnergyAppElectricityPrices } from "./packages/energy-app-electricity-prices.js";
14
+ import { EnergyAppEnergyPrices } from "./packages/energy-app-energy-prices.js";
15
15
  import { EnergyAppNotification } from "./packages/energy-app-notification.js";
16
16
  import { EnergyAppSecretManager } from "./packages/energy-app-secret-manager.js";
17
17
  import { EnergyAppLocation } from "./packages/energy-app-location.js";
@@ -31,8 +31,7 @@ export * from './implementations/ocpp/ocpp201.js';
31
31
  export * from './implementations/ocpp/ocpp-common.js';
32
32
  export * from './types/enyo-authentication.js';
33
33
  export * from './types/enyo-settings.js';
34
- export * from './types/enyo-energy-tariff.js';
35
- export * from './types/enyo-electricity-prices.js';
34
+ export * from './types/enyo-energy-prices.js';
36
35
  export * from './types/enyo-notification.js';
37
36
  export * from './types/enyo-secret-manager.js';
38
37
  export * from './types/enyo-location.js';
@@ -72,7 +71,7 @@ export declare class EnergyApp implements EnyoEnergyAppSdk {
72
71
  useCharge(): EnergyAppCharge;
73
72
  useAuthentication(): EnergyAppAuthentication;
74
73
  useSettings(): EnergyAppSettings;
75
- useElectricityPrices(): EnergyAppElectricityPrices;
74
+ useElectricityPrices(): EnergyAppEnergyPrices;
76
75
  useNotification(): EnergyAppNotification;
77
76
  useOnboarding(): EnergyAppOnboarding;
78
77
  /**
package/dist/index.js CHANGED
@@ -6,8 +6,7 @@ export * from './implementations/ocpp/ocpp201.js';
6
6
  export * from './implementations/ocpp/ocpp-common.js';
7
7
  export * from './types/enyo-authentication.js';
8
8
  export * from './types/enyo-settings.js';
9
- export * from './types/enyo-energy-tariff.js';
10
- export * from './types/enyo-electricity-prices.js';
9
+ export * from './types/enyo-energy-prices.js';
11
10
  export * from './types/enyo-notification.js';
12
11
  export * from './types/enyo-secret-manager.js';
13
12
  export * from './types/enyo-location.js';
@@ -1,4 +1,4 @@
1
- import { ElectricityTariffRegistration, ElectricityTariffWithDefault } from "../types/enyo-electricity-tariff.js";
1
+ import { EnyoElectricityTariff, EnyoElectricityTariffWithDefault } from "../types/enyo-electricity-tariff.js";
2
2
  /**
3
3
  * Interface for managing electricity tariffs.
4
4
  * Provides methods to register, retrieve, and remove electricity tariffs
@@ -13,7 +13,7 @@ export interface EnergyAppElectricityTariff {
13
13
  * @param tariff - The tariff registration data including ID, type, name, and vendor
14
14
  * @returns Promise that resolves when the tariff has been registered
15
15
  */
16
- registerTariff(tariff: ElectricityTariffRegistration): Promise<void>;
16
+ registerTariff(tariff: Omit<EnyoElectricityTariff, 'id'>): Promise<EnyoElectricityTariffWithDefault>;
17
17
  /**
18
18
  * Retrieves all registered electricity tariffs.
19
19
  * Each tariff includes a defaultTariff boolean indicating whether
@@ -21,13 +21,24 @@ export interface EnergyAppElectricityTariff {
21
21
  *
22
22
  * @returns Promise that resolves to an array of all registered tariffs with default indicators
23
23
  */
24
- getAllTariffs(): Promise<ElectricityTariffWithDefault[]>;
24
+ getAllTariffs(): Promise<EnyoElectricityTariffWithDefault[]>;
25
25
  /**
26
26
  * Removes an electricity tariff by its ID.
27
27
  * If the tariff does not exist, this operation is a no-op.
28
28
  *
29
- * @param tariffId - The unique identifier of the tariff to remove
29
+ * @param id - The unique identifier of the tariff to remove
30
30
  * @returns Promise that resolves when the tariff has been removed
31
31
  */
32
- removeTariff(tariffId: string): Promise<void>;
32
+ removeTariff(id: string): Promise<void>;
33
+ /**
34
+ * Retrieves the system default tariff information.
35
+ * Returns the full tariff including pricing data.
36
+ *
37
+ * @returns Promise that resolves to the default tariff info, or null if none is configured
38
+ */
39
+ getDefaultTariff(): Promise<EnyoElectricityTariff | null>;
40
+ findTariff(filter: {
41
+ applianceId?: string;
42
+ tariffId?: string;
43
+ }): Promise<EnyoElectricityTariff | null>;
33
44
  }
@@ -0,0 +1,35 @@
1
+ import { EnyoEnergyPriceEntry, EnyoEnergyPrices } from "../types/enyo-energy-prices.js";
2
+ /**
3
+ * Interface for retrieving electricity price information.
4
+ * Provides methods to get current and forecast electricity prices,
5
+ * always normalized to 15-minute intervals regardless of source data resolution.
6
+ */
7
+ export interface EnergyAppEnergyPrices {
8
+ /**
9
+ * Retrieves electricity prices for a specified time range.
10
+ * The response always contains prices in 15-minute intervals,
11
+ * interpolated from the original data source (constant, 15min, or 1hr intervals).
12
+ *
13
+ * @param request - The price request parameters including time range and optional appliance ID
14
+ * @returns Promise that resolves to electricity prices for the requested time range
15
+ */
16
+ getPrices(request: EnergyAppEnergyPricesFilter): Promise<EnyoEnergyPrices>;
17
+ /**
18
+ * Retrieves the current electricity price for the current 15-minute interval.
19
+ * This is a convenience method that gets the price for "now".
20
+ *
21
+ * @param applianceId - Optional appliance ID to get appliance-specific pricing
22
+ * @returns Promise that resolves to current price information, or null if no pricing data is available
23
+ */
24
+ getCurrentPrice(applianceId?: string): Promise<EnyoEnergyPriceEntry | null>;
25
+ }
26
+ export interface EnergyAppEnergyPricesFilter {
27
+ /** Start time for price data in ISO format */
28
+ fromIso: string;
29
+ /** End time for price data in ISO format */
30
+ untilIso: string;
31
+ /** Optional appliance ID to get appliance-specific pricing */
32
+ applianceId?: string;
33
+ /** Optional tariff ID to use for pricing. If omitted, uses the default tariff */
34
+ tariffId?: string;
35
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- import { PvSystemRegistration, PvSystemInfo } from "../types/enyo-pv-system.js";
1
+ import { EnyoPvSystem } from "../types/enyo-pv-system.js";
2
2
  /**
3
3
  * Interface for managing PV systems.
4
4
  * Allows energy apps to register, retrieve, update, and remove PV system configurations
@@ -30,21 +30,21 @@ export interface EnergyAppPvSystem {
30
30
  * console.log(`Registered PV system: ${pvSystem.pvSystemId}`);
31
31
  * ```
32
32
  */
33
- registerPvSystem(pvSystem: PvSystemRegistration): Promise<PvSystemInfo>;
33
+ registerPvSystem(pvSystem: Omit<EnyoPvSystem, 'id'>): Promise<EnyoPvSystem>;
34
34
  /**
35
35
  * Retrieves a registered PV system by its ID.
36
36
  *
37
- * @param pvSystemId - The unique identifier of the PV system
37
+ * @param id - The unique identifier of the PV system
38
38
  * @returns Promise that resolves to the PV system info, or null if not found
39
39
  */
40
- getPvSystem(pvSystemId: string): Promise<PvSystemInfo | null>;
40
+ findPvSystem(id: string): Promise<EnyoPvSystem | null>;
41
41
  /**
42
42
  * Updates an existing PV system configuration.
43
43
  * Allows changing the kWp, DC string configurations, appliances, and features
44
44
  * of a registered PV system.
45
45
  *
46
- * @param pvSystemId - The unique identifier of the PV system to update
47
- * @param pvSystem - The updated PV system registration data
46
+ * @param id - The unique identifier of the PV system to update
47
+ * @param attributes - The updated PV system registration data
48
48
  * @returns Promise that resolves to the updated PV system info
49
49
  *
50
50
  * @example
@@ -58,13 +58,14 @@ export interface EnergyAppPvSystem {
58
58
  * });
59
59
  * ```
60
60
  */
61
- updatePvSystem(pvSystemId: string, pvSystem: PvSystemRegistration): Promise<PvSystemInfo>;
61
+ updatePvSystem(id: string, attributes: Partial<Omit<EnyoPvSystem, 'id'>>): Promise<EnyoPvSystem>;
62
62
  /**
63
63
  * Removes a registered PV system by its ID.
64
64
  * If the PV system does not exist, this operation is a no-op.
65
65
  *
66
- * @param pvSystemId - The unique identifier of the PV system to remove
66
+ * @param id - The unique identifier of the PV system to remove
67
67
  * @returns Promise that resolves when the PV system has been removed
68
68
  */
69
- removePvSystem(pvSystemId: string): Promise<void>;
69
+ removePvSystem(id: string): Promise<void>;
70
+ getPvSystems(): Promise<EnyoPvSystem[]>;
70
71
  }
@@ -1,10 +1,10 @@
1
1
  import { EnyoApplianceStateEnum, EnyoApplianceTypeEnum } from "./enyo-appliance.js";
2
2
  import { EnyoSourceEnum } from "./enyo-source.enum.js";
3
- import { EnergyTariffInfo } from "./enyo-energy-tariff.js";
4
3
  import { EnyoOcppRelativeSchedule } from "./enyo-ocpp.js";
5
4
  import { EnyoChargerApplianceStatusEnum } from "./enyo-charger-appliance.js";
6
5
  import { PreviewChargingSchedule, PreviewChargingScheduleCostComparison, PreviewChargingScheduleUnavailableReasonEnum } from "./enyo-energy-manager.js";
7
6
  import { PvForecast } from "./enyo-pv-forecast.js";
7
+ import { EnyoEnergyPrices } from "./enyo-energy-prices.js";
8
8
  export declare enum EnyoBatteryStateEnum {
9
9
  Off = "off",
10
10
  Empty = "empty",
@@ -507,7 +507,7 @@ export interface EnyoDataBusEnergyTariffUpdateV1 extends EnyoDataBusMessage {
507
507
  applianceId?: string;
508
508
  data: {
509
509
  /** Complete energy tariff information including pricing structure and validity */
510
- tariffInfo: EnergyTariffInfo;
510
+ energyPrices: EnyoEnergyPrices;
511
511
  };
512
512
  }
513
513
  /**
@@ -9,12 +9,48 @@ export declare enum ElectricityTariffTypeEnum {
9
9
  /** Price changes dynamically based on market conditions */
10
10
  Dynamic = "dynamic"
11
11
  }
12
+ /**
13
+ * Pricing data for a static (fixed-price) electricity tariff
14
+ */
15
+ export interface StaticTariffData {
16
+ /** Price per kWh for consumption */
17
+ pricePerKwh: number;
18
+ /** Currency code (ISO 4217, e.g., 'EUR', 'USD') */
19
+ currency: string;
20
+ }
21
+ /**
22
+ * Pricing data for a dynamic electricity tariff
23
+ */
24
+ export interface DynamicTariffData {
25
+ /** Price per kWh for grid fees */
26
+ gridFeePerKwh?: number;
27
+ /** Currency code (ISO 4217, e.g., 'EUR', 'USD') */
28
+ currency: string;
29
+ }
30
+ /**
31
+ * A single entry in a time-variable tariff schedule
32
+ */
33
+ export interface TimeVariableScheduleEntry {
34
+ /** Relative start offset (e.g., minutes from start of day) */
35
+ start: number;
36
+ /** Price per kWh during this period */
37
+ pricePerKwh: number;
38
+ }
39
+ /**
40
+ * Pricing data for a time-variable electricity tariff
41
+ */
42
+ export interface TimeVariableTariffData {
43
+ /** Schedule of time-based price entries */
44
+ schedule: TimeVariableScheduleEntry[];
45
+ /** Currency code (ISO 4217, e.g., 'EUR', 'USD') */
46
+ currency: string;
47
+ }
12
48
  /**
13
49
  * Input data for registering or updating an electricity tariff
14
50
  */
15
- export interface ElectricityTariffRegistration {
51
+ export interface EnyoElectricityTariff {
16
52
  /** Unique identifier for the tariff */
17
- tariffId: string;
53
+ id: string;
18
54
  /** The pricing model type of this tariff */
19
55
  tariffType: ElectricityTariffTypeEnum;
20
56
  /** Human-readable name of the tariff */
@@ -23,12 +59,18 @@ export interface ElectricityTariffRegistration {
23
59
  vendorName: string;
24
60
  /** Optional ID of the primary meter appliance associated with this tariff */
25
61
  primaryMeterApplianceId?: string;
62
+ /** Optional static pricing data (relevant when tariffType is Static) */
63
+ staticTariffData?: StaticTariffData;
64
+ /** Optional time-variable pricing data (relevant when tariffType is TimeVariable) */
65
+ timeVariableTariffData?: TimeVariableTariffData;
66
+ /** Optional dynamic pricing data*/
67
+ dynamicTariffData?: DynamicTariffData;
26
68
  }
27
69
  /**
28
70
  * Tariff registration data extended with default indicator.
29
71
  * Used in list responses to indicate which tariff is the system default.
30
72
  */
31
- export interface ElectricityTariffWithDefault extends ElectricityTariffRegistration {
73
+ export interface EnyoElectricityTariffWithDefault extends EnyoElectricityTariff {
32
74
  /** Indicates whether this tariff is the system default */
33
75
  defaultTariff: boolean;
34
76
  }
@@ -0,0 +1,22 @@
1
+ import { ElectricityTariffTypeEnum } from "./enyo-electricity-tariff.js";
2
+ /**
3
+ * Represents complete energy tariff information
4
+ */
5
+ export interface EnyoEnergyPrices {
6
+ /** Unique identifier for this tariff */
7
+ tariffId: string;
8
+ type: ElectricityTariffTypeEnum;
9
+ /** Pricing data structure */
10
+ prices: EnyoEnergyPriceEntry[];
11
+ /** Timestamp when this tariff information was last updated */
12
+ lastUpdatedIso: string;
13
+ }
14
+ export interface EnyoEnergyPriceEntry {
15
+ /** Start time of this 15-minute interval in ISO format */
16
+ timestampIso: string;
17
+ /** Price per kWh for electricity consumption during this interval */
18
+ consumptionPricePerKwh: number;
19
+ /** Optional price per kWh for grid feed-in during this interval */
20
+ feedInPricePerKwh?: number;
21
+ currency: string;
22
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -17,7 +17,14 @@ export declare enum PvOrientationEnum {
17
17
  * Source of the orientation information for a DC string.
18
18
  * Indicates whether the orientation was provided by the user or estimated automatically.
19
19
  */
20
- export type PvSystemOrientationSourceEnum = 'user' | 'estimated';
20
+ export declare enum PvSystemOrientationSourceEnum {
21
+ UserProvided = "user",
22
+ Estimated = "estimated"
23
+ }
24
+ export declare enum PvSystemCreatedBy {
25
+ User = "user",
26
+ EnergyApp = "energy-app"
27
+ }
21
28
  /**
22
29
  * Feature flags for a PV system.
23
30
  * Used to indicate special configurations or capabilities.
@@ -49,9 +56,13 @@ export interface PvSystemDcString {
49
56
  /**
50
57
  * Registration data for a PV system.
51
58
  */
52
- export interface PvSystemRegistration {
59
+ export interface EnyoPvSystem {
60
+ /** Unique identifier of the registered PV system */
61
+ id: string;
53
62
  /** Peak power capacity of the entire PV system in kilowatts peak */
54
63
  kWp: number;
64
+ /** Indicates who created the PV system entry (user or energy app) */
65
+ createdBy: PvSystemCreatedBy;
55
66
  /** Array of DC strings describing the panel groups and their orientations */
56
67
  dcStrings: PvSystemDcString[];
57
68
  /** Optional list of appliances associated with this PV system */
@@ -59,12 +70,3 @@ export interface PvSystemRegistration {
59
70
  /** Optional feature flags for this PV system */
60
71
  features?: PvSystemFeatureEnum[];
61
72
  }
62
- /**
63
- * A registered PV system with its identifier and metadata.
64
- */
65
- export interface PvSystemInfo extends PvSystemRegistration {
66
- /** Unique identifier of the registered PV system */
67
- pvSystemId: string;
68
- /** Timestamp when this PV system was registered in ISO format */
69
- registeredAtIso: string;
70
- }
@@ -13,6 +13,20 @@ export var PvOrientationEnum;
13
13
  PvOrientationEnum["West"] = "west";
14
14
  PvOrientationEnum["NorthWest"] = "north-west";
15
15
  })(PvOrientationEnum || (PvOrientationEnum = {}));
16
+ /**
17
+ * Source of the orientation information for a DC string.
18
+ * Indicates whether the orientation was provided by the user or estimated automatically.
19
+ */
20
+ export var PvSystemOrientationSourceEnum;
21
+ (function (PvSystemOrientationSourceEnum) {
22
+ PvSystemOrientationSourceEnum["UserProvided"] = "user";
23
+ PvSystemOrientationSourceEnum["Estimated"] = "estimated";
24
+ })(PvSystemOrientationSourceEnum || (PvSystemOrientationSourceEnum = {}));
25
+ export var PvSystemCreatedBy;
26
+ (function (PvSystemCreatedBy) {
27
+ PvSystemCreatedBy["User"] = "user";
28
+ PvSystemCreatedBy["EnergyApp"] = "energy-app";
29
+ })(PvSystemCreatedBy || (PvSystemCreatedBy = {}));
16
30
  /**
17
31
  * Feature flags for a PV system.
18
32
  * Used to indicate special configurations or capabilities.
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.62";
8
+ export declare const SDK_VERSION = "0.0.64";
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.62';
8
+ export const SDK_VERSION = '0.0.64';
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.62",
3
+ "version": "0.0.64",
4
4
  "description": "enyo Energy App SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",