@enyo-energy/energy-app-sdk 0.0.61 → 0.0.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/enyo-energy-app-sdk.d.cts +5 -2
- package/dist/cjs/index.cjs +10 -2
- package/dist/cjs/index.d.cts +11 -4
- package/dist/cjs/packages/energy-app-electricity-tariff.d.cts +14 -3
- package/dist/cjs/packages/energy-app-energy-prices.cjs +2 -0
- package/dist/cjs/packages/energy-app-energy-prices.d.cts +35 -0
- package/dist/cjs/packages/energy-app-pv-system.d.cts +10 -9
- package/dist/cjs/packages/energy-app-sequence-generator.cjs +2 -0
- package/dist/cjs/packages/energy-app-sequence-generator.d.cts +20 -0
- package/dist/cjs/types/enyo-data-bus-value.d.cts +2 -2
- package/dist/cjs/types/enyo-electricity-tariff.d.cts +45 -3
- package/dist/cjs/types/enyo-energy-prices.cjs +2 -0
- package/dist/cjs/types/enyo-energy-prices.d.cts +22 -0
- package/dist/cjs/types/enyo-pv-system.cjs +15 -1
- package/dist/cjs/types/enyo-pv-system.d.cts +13 -11
- package/dist/cjs/version.cjs +1 -1
- package/dist/cjs/version.d.cts +1 -1
- package/dist/enyo-energy-app-sdk.d.ts +5 -2
- package/dist/index.d.ts +11 -4
- package/dist/index.js +10 -2
- package/dist/packages/energy-app-electricity-tariff.d.ts +14 -3
- package/dist/packages/energy-app-energy-prices.d.ts +35 -0
- package/dist/packages/energy-app-energy-prices.js +1 -0
- package/dist/packages/energy-app-pv-system.d.ts +10 -9
- package/dist/packages/energy-app-sequence-generator.d.ts +20 -0
- package/dist/packages/energy-app-sequence-generator.js +1 -0
- package/dist/types/enyo-data-bus-value.d.ts +2 -2
- package/dist/types/enyo-electricity-tariff.d.ts +45 -3
- package/dist/types/enyo-energy-prices.d.ts +22 -0
- package/dist/types/enyo-energy-prices.js +1 -0
- package/dist/types/enyo-pv-system.d.ts +13 -11
- package/dist/types/enyo-pv-system.js +14 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -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 {
|
|
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";
|
|
@@ -22,6 +22,7 @@ import { EnergyAppElectricityTariff } from "./packages/energy-app-electricity-ta
|
|
|
22
22
|
import { EnergyAppWeatherForecasting } from "./packages/energy-app-weather-forecasting.cjs";
|
|
23
23
|
import { EnergyAppPvForecasting } from "./packages/energy-app-pv-forecasting.cjs";
|
|
24
24
|
import { EnergyAppPvSystem } from "./packages/energy-app-pv-system.cjs";
|
|
25
|
+
import { EnergyAppSequenceGenerator } from "./packages/energy-app-sequence-generator.cjs";
|
|
25
26
|
export declare enum EnergyAppStateEnum {
|
|
26
27
|
Launching = "launching",
|
|
27
28
|
Running = "running",
|
|
@@ -71,7 +72,7 @@ export interface EnyoEnergyAppSdk {
|
|
|
71
72
|
/** Get the Settings API */
|
|
72
73
|
useSettings: () => EnergyAppSettings;
|
|
73
74
|
/** Get the Electricity Prices API */
|
|
74
|
-
useElectricityPrices: () =>
|
|
75
|
+
useElectricityPrices: () => EnergyAppEnergyPrices;
|
|
75
76
|
/** Get the Notification API */
|
|
76
77
|
useNotification: () => EnergyAppNotification;
|
|
77
78
|
/** Get the Secret Manager API */
|
|
@@ -92,4 +93,6 @@ export interface EnyoEnergyAppSdk {
|
|
|
92
93
|
usePvForecasting: () => EnergyAppPvForecasting;
|
|
93
94
|
/** Get the PV System API for managing PV system registrations and configurations */
|
|
94
95
|
usePvSystem: () => EnergyAppPvSystem;
|
|
96
|
+
/** Get the Sequence Generator API for generating unique sequential numbers per named sequence */
|
|
97
|
+
useSequenceGenerator: () => EnergyAppSequenceGenerator;
|
|
95
98
|
}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -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-
|
|
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);
|
|
@@ -43,6 +42,7 @@ __exportStar(require("./packages/energy-app-pv-forecasting.cjs"), exports);
|
|
|
43
42
|
__exportStar(require("./types/enyo-pv-system.cjs"), exports);
|
|
44
43
|
__exportStar(require("./packages/energy-app-pv-system.cjs"), exports);
|
|
45
44
|
__exportStar(require("./implementations/data-bus/data-bus-command-handler.cjs"), exports);
|
|
45
|
+
__exportStar(require("./packages/energy-app-sequence-generator.cjs"), exports);
|
|
46
46
|
class EnergyApp {
|
|
47
47
|
energyAppSdk;
|
|
48
48
|
constructor() {
|
|
@@ -191,6 +191,14 @@ class EnergyApp {
|
|
|
191
191
|
usePvSystem() {
|
|
192
192
|
return this.energyAppSdk.usePvSystem();
|
|
193
193
|
}
|
|
194
|
+
/**
|
|
195
|
+
* Gets the Sequence Generator API for generating unique sequential numbers per named sequence.
|
|
196
|
+
* Each sequence is identified by a string name and maintains its own independent counter.
|
|
197
|
+
* @returns The Sequence Generator API instance
|
|
198
|
+
*/
|
|
199
|
+
useSequenceGenerator() {
|
|
200
|
+
return this.energyAppSdk.useSequenceGenerator();
|
|
201
|
+
}
|
|
194
202
|
/**
|
|
195
203
|
* Gets the current SDK version.
|
|
196
204
|
* @returns The semantic version string of the SDK
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -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 {
|
|
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";
|
|
@@ -23,6 +23,7 @@ import { EnergyAppElectricityTariff } from "./packages/energy-app-electricity-ta
|
|
|
23
23
|
import { EnergyAppWeatherForecasting } from "./packages/energy-app-weather-forecasting.cjs";
|
|
24
24
|
import { EnergyAppPvForecasting } from "./packages/energy-app-pv-forecasting.cjs";
|
|
25
25
|
import { EnergyAppPvSystem } from "./packages/energy-app-pv-system.cjs";
|
|
26
|
+
import { EnergyAppSequenceGenerator } from "./packages/energy-app-sequence-generator.cjs";
|
|
26
27
|
export * from './energy-app-package-definition.cjs';
|
|
27
28
|
export * from './version.cjs';
|
|
28
29
|
export * from './implementations/ocpp/ocpp16.cjs';
|
|
@@ -30,8 +31,7 @@ export * from './implementations/ocpp/ocpp201.cjs';
|
|
|
30
31
|
export * from './implementations/ocpp/ocpp-common.cjs';
|
|
31
32
|
export * from './types/enyo-authentication.cjs';
|
|
32
33
|
export * from './types/enyo-settings.cjs';
|
|
33
|
-
export * from './types/enyo-energy-
|
|
34
|
-
export * from './types/enyo-electricity-prices.cjs';
|
|
34
|
+
export * from './types/enyo-energy-prices.cjs';
|
|
35
35
|
export * from './types/enyo-notification.cjs';
|
|
36
36
|
export * from './types/enyo-secret-manager.cjs';
|
|
37
37
|
export * from './types/enyo-location.cjs';
|
|
@@ -50,6 +50,7 @@ export * from './packages/energy-app-pv-forecasting.cjs';
|
|
|
50
50
|
export * from './types/enyo-pv-system.cjs';
|
|
51
51
|
export * from './packages/energy-app-pv-system.cjs';
|
|
52
52
|
export * from './implementations/data-bus/data-bus-command-handler.cjs';
|
|
53
|
+
export * from './packages/energy-app-sequence-generator.cjs';
|
|
53
54
|
export declare class EnergyApp implements EnyoEnergyAppSdk {
|
|
54
55
|
private readonly energyAppSdk;
|
|
55
56
|
constructor();
|
|
@@ -70,7 +71,7 @@ export declare class EnergyApp implements EnyoEnergyAppSdk {
|
|
|
70
71
|
useCharge(): EnergyAppCharge;
|
|
71
72
|
useAuthentication(): EnergyAppAuthentication;
|
|
72
73
|
useSettings(): EnergyAppSettings;
|
|
73
|
-
useElectricityPrices():
|
|
74
|
+
useElectricityPrices(): EnergyAppEnergyPrices;
|
|
74
75
|
useNotification(): EnergyAppNotification;
|
|
75
76
|
useOnboarding(): EnergyAppOnboarding;
|
|
76
77
|
/**
|
|
@@ -125,6 +126,12 @@ export declare class EnergyApp implements EnyoEnergyAppSdk {
|
|
|
125
126
|
* @returns The PV System API instance
|
|
126
127
|
*/
|
|
127
128
|
usePvSystem(): EnergyAppPvSystem;
|
|
129
|
+
/**
|
|
130
|
+
* Gets the Sequence Generator API for generating unique sequential numbers per named sequence.
|
|
131
|
+
* Each sequence is identified by a string name and maintains its own independent counter.
|
|
132
|
+
* @returns The Sequence Generator API instance
|
|
133
|
+
*/
|
|
134
|
+
useSequenceGenerator(): EnergyAppSequenceGenerator;
|
|
128
135
|
/**
|
|
129
136
|
* Gets the current SDK version.
|
|
130
137
|
* @returns The semantic version string of the SDK
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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:
|
|
16
|
+
registerTariff(tariff: EnyoElectricityTariff): Promise<void>;
|
|
17
17
|
/**
|
|
18
18
|
* Retrieves all registered electricity tariffs.
|
|
19
19
|
* Each tariff includes a defaultTariff boolean indicating whether
|
|
@@ -21,7 +21,7 @@ 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<
|
|
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.
|
|
@@ -30,4 +30,15 @@ export interface EnergyAppElectricityTariff {
|
|
|
30
30
|
* @returns Promise that resolves when the tariff has been removed
|
|
31
31
|
*/
|
|
32
32
|
removeTariff(tariffId: 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.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 {
|
|
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:
|
|
33
|
+
registerPvSystem(pvSystem: Omit<EnyoPvSystem, 'id'>): Promise<EnyoPvSystem>;
|
|
34
34
|
/**
|
|
35
35
|
* Retrieves a registered PV system by its ID.
|
|
36
36
|
*
|
|
37
|
-
* @param
|
|
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
|
-
|
|
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
|
|
47
|
-
* @param
|
|
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(
|
|
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
|
|
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(
|
|
69
|
+
removePvSystem(id: string): Promise<void>;
|
|
70
|
+
getPvSystems(): Promise<EnyoPvSystem[]>;
|
|
70
71
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for generating unique sequential numbers per named sequence.
|
|
3
|
+
* Each sequence is identified by a string name and maintains its own independent counter.
|
|
4
|
+
*/
|
|
5
|
+
export interface EnergyAppSequenceGenerator {
|
|
6
|
+
/**
|
|
7
|
+
* Returns the next unique number for the given sequence.
|
|
8
|
+
* Each sequence maintains its own independent counter.
|
|
9
|
+
*
|
|
10
|
+
* @param sequenceName - The name identifying the sequence
|
|
11
|
+
* @returns Promise resolving to the next unique number in the sequence
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* const sequenceGenerator = energyApp.useSequenceGenerator();
|
|
15
|
+
* const id1 = await sequenceGenerator.next("invoice"); // e.g. 1
|
|
16
|
+
* const id2 = await sequenceGenerator.next("invoice"); // e.g. 2
|
|
17
|
+
* const id3 = await sequenceGenerator.next("order"); // e.g. 1 (different sequence)
|
|
18
|
+
*/
|
|
19
|
+
next: (sequenceName: string) => Promise<number>;
|
|
20
|
+
}
|
|
@@ -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
|
-
|
|
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
|
|
51
|
+
export interface EnyoElectricityTariff {
|
|
16
52
|
/** Unique identifier for the tariff */
|
|
17
|
-
|
|
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
|
|
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.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
|
|
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
|
|
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
|
-
}
|
package/dist/cjs/version.cjs
CHANGED
|
@@ -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.
|
|
12
|
+
exports.SDK_VERSION = '0.0.63';
|
|
13
13
|
/**
|
|
14
14
|
* Gets the current SDK version.
|
|
15
15
|
* @returns The semantic version string of the SDK
|
package/dist/cjs/version.d.cts
CHANGED
|
@@ -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 {
|
|
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";
|
|
@@ -22,6 +22,7 @@ import { EnergyAppElectricityTariff } from "./packages/energy-app-electricity-ta
|
|
|
22
22
|
import { EnergyAppWeatherForecasting } from "./packages/energy-app-weather-forecasting.js";
|
|
23
23
|
import { EnergyAppPvForecasting } from "./packages/energy-app-pv-forecasting.js";
|
|
24
24
|
import { EnergyAppPvSystem } from "./packages/energy-app-pv-system.js";
|
|
25
|
+
import { EnergyAppSequenceGenerator } from "./packages/energy-app-sequence-generator.js";
|
|
25
26
|
export declare enum EnergyAppStateEnum {
|
|
26
27
|
Launching = "launching",
|
|
27
28
|
Running = "running",
|
|
@@ -71,7 +72,7 @@ export interface EnyoEnergyAppSdk {
|
|
|
71
72
|
/** Get the Settings API */
|
|
72
73
|
useSettings: () => EnergyAppSettings;
|
|
73
74
|
/** Get the Electricity Prices API */
|
|
74
|
-
useElectricityPrices: () =>
|
|
75
|
+
useElectricityPrices: () => EnergyAppEnergyPrices;
|
|
75
76
|
/** Get the Notification API */
|
|
76
77
|
useNotification: () => EnergyAppNotification;
|
|
77
78
|
/** Get the Secret Manager API */
|
|
@@ -92,4 +93,6 @@ export interface EnyoEnergyAppSdk {
|
|
|
92
93
|
usePvForecasting: () => EnergyAppPvForecasting;
|
|
93
94
|
/** Get the PV System API for managing PV system registrations and configurations */
|
|
94
95
|
usePvSystem: () => EnergyAppPvSystem;
|
|
96
|
+
/** Get the Sequence Generator API for generating unique sequential numbers per named sequence */
|
|
97
|
+
useSequenceGenerator: () => EnergyAppSequenceGenerator;
|
|
95
98
|
}
|
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 {
|
|
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";
|
|
@@ -23,6 +23,7 @@ import { EnergyAppElectricityTariff } from "./packages/energy-app-electricity-ta
|
|
|
23
23
|
import { EnergyAppWeatherForecasting } from "./packages/energy-app-weather-forecasting.js";
|
|
24
24
|
import { EnergyAppPvForecasting } from "./packages/energy-app-pv-forecasting.js";
|
|
25
25
|
import { EnergyAppPvSystem } from "./packages/energy-app-pv-system.js";
|
|
26
|
+
import { EnergyAppSequenceGenerator } from "./packages/energy-app-sequence-generator.js";
|
|
26
27
|
export * from './energy-app-package-definition.js';
|
|
27
28
|
export * from './version.js';
|
|
28
29
|
export * from './implementations/ocpp/ocpp16.js';
|
|
@@ -30,8 +31,7 @@ export * from './implementations/ocpp/ocpp201.js';
|
|
|
30
31
|
export * from './implementations/ocpp/ocpp-common.js';
|
|
31
32
|
export * from './types/enyo-authentication.js';
|
|
32
33
|
export * from './types/enyo-settings.js';
|
|
33
|
-
export * from './types/enyo-energy-
|
|
34
|
-
export * from './types/enyo-electricity-prices.js';
|
|
34
|
+
export * from './types/enyo-energy-prices.js';
|
|
35
35
|
export * from './types/enyo-notification.js';
|
|
36
36
|
export * from './types/enyo-secret-manager.js';
|
|
37
37
|
export * from './types/enyo-location.js';
|
|
@@ -50,6 +50,7 @@ export * from './packages/energy-app-pv-forecasting.js';
|
|
|
50
50
|
export * from './types/enyo-pv-system.js';
|
|
51
51
|
export * from './packages/energy-app-pv-system.js';
|
|
52
52
|
export * from './implementations/data-bus/data-bus-command-handler.js';
|
|
53
|
+
export * from './packages/energy-app-sequence-generator.js';
|
|
53
54
|
export declare class EnergyApp implements EnyoEnergyAppSdk {
|
|
54
55
|
private readonly energyAppSdk;
|
|
55
56
|
constructor();
|
|
@@ -70,7 +71,7 @@ export declare class EnergyApp implements EnyoEnergyAppSdk {
|
|
|
70
71
|
useCharge(): EnergyAppCharge;
|
|
71
72
|
useAuthentication(): EnergyAppAuthentication;
|
|
72
73
|
useSettings(): EnergyAppSettings;
|
|
73
|
-
useElectricityPrices():
|
|
74
|
+
useElectricityPrices(): EnergyAppEnergyPrices;
|
|
74
75
|
useNotification(): EnergyAppNotification;
|
|
75
76
|
useOnboarding(): EnergyAppOnboarding;
|
|
76
77
|
/**
|
|
@@ -125,6 +126,12 @@ export declare class EnergyApp implements EnyoEnergyAppSdk {
|
|
|
125
126
|
* @returns The PV System API instance
|
|
126
127
|
*/
|
|
127
128
|
usePvSystem(): EnergyAppPvSystem;
|
|
129
|
+
/**
|
|
130
|
+
* Gets the Sequence Generator API for generating unique sequential numbers per named sequence.
|
|
131
|
+
* Each sequence is identified by a string name and maintains its own independent counter.
|
|
132
|
+
* @returns The Sequence Generator API instance
|
|
133
|
+
*/
|
|
134
|
+
useSequenceGenerator(): EnergyAppSequenceGenerator;
|
|
128
135
|
/**
|
|
129
136
|
* Gets the current SDK version.
|
|
130
137
|
* @returns The semantic version string of the SDK
|
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-
|
|
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';
|
|
@@ -26,6 +25,7 @@ export * from './packages/energy-app-pv-forecasting.js';
|
|
|
26
25
|
export * from './types/enyo-pv-system.js';
|
|
27
26
|
export * from './packages/energy-app-pv-system.js';
|
|
28
27
|
export * from './implementations/data-bus/data-bus-command-handler.js';
|
|
28
|
+
export * from './packages/energy-app-sequence-generator.js';
|
|
29
29
|
export class EnergyApp {
|
|
30
30
|
energyAppSdk;
|
|
31
31
|
constructor() {
|
|
@@ -174,6 +174,14 @@ export class EnergyApp {
|
|
|
174
174
|
usePvSystem() {
|
|
175
175
|
return this.energyAppSdk.usePvSystem();
|
|
176
176
|
}
|
|
177
|
+
/**
|
|
178
|
+
* Gets the Sequence Generator API for generating unique sequential numbers per named sequence.
|
|
179
|
+
* Each sequence is identified by a string name and maintains its own independent counter.
|
|
180
|
+
* @returns The Sequence Generator API instance
|
|
181
|
+
*/
|
|
182
|
+
useSequenceGenerator() {
|
|
183
|
+
return this.energyAppSdk.useSequenceGenerator();
|
|
184
|
+
}
|
|
177
185
|
/**
|
|
178
186
|
* Gets the current SDK version.
|
|
179
187
|
* @returns The semantic version string of the SDK
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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:
|
|
16
|
+
registerTariff(tariff: EnyoElectricityTariff): Promise<void>;
|
|
17
17
|
/**
|
|
18
18
|
* Retrieves all registered electricity tariffs.
|
|
19
19
|
* Each tariff includes a defaultTariff boolean indicating whether
|
|
@@ -21,7 +21,7 @@ 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<
|
|
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.
|
|
@@ -30,4 +30,15 @@ export interface EnergyAppElectricityTariff {
|
|
|
30
30
|
* @returns Promise that resolves when the tariff has been removed
|
|
31
31
|
*/
|
|
32
32
|
removeTariff(tariffId: 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 {
|
|
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:
|
|
33
|
+
registerPvSystem(pvSystem: Omit<EnyoPvSystem, 'id'>): Promise<EnyoPvSystem>;
|
|
34
34
|
/**
|
|
35
35
|
* Retrieves a registered PV system by its ID.
|
|
36
36
|
*
|
|
37
|
-
* @param
|
|
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
|
-
|
|
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
|
|
47
|
-
* @param
|
|
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(
|
|
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
|
|
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(
|
|
69
|
+
removePvSystem(id: string): Promise<void>;
|
|
70
|
+
getPvSystems(): Promise<EnyoPvSystem[]>;
|
|
70
71
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for generating unique sequential numbers per named sequence.
|
|
3
|
+
* Each sequence is identified by a string name and maintains its own independent counter.
|
|
4
|
+
*/
|
|
5
|
+
export interface EnergyAppSequenceGenerator {
|
|
6
|
+
/**
|
|
7
|
+
* Returns the next unique number for the given sequence.
|
|
8
|
+
* Each sequence maintains its own independent counter.
|
|
9
|
+
*
|
|
10
|
+
* @param sequenceName - The name identifying the sequence
|
|
11
|
+
* @returns Promise resolving to the next unique number in the sequence
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* const sequenceGenerator = energyApp.useSequenceGenerator();
|
|
15
|
+
* const id1 = await sequenceGenerator.next("invoice"); // e.g. 1
|
|
16
|
+
* const id2 = await sequenceGenerator.next("invoice"); // e.g. 2
|
|
17
|
+
* const id3 = await sequenceGenerator.next("order"); // e.g. 1 (different sequence)
|
|
18
|
+
*/
|
|
19
|
+
next: (sequenceName: string) => Promise<number>;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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
|
-
|
|
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
|
|
51
|
+
export interface EnyoElectricityTariff {
|
|
16
52
|
/** Unique identifier for the tariff */
|
|
17
|
-
|
|
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
|
|
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
|
|
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
|
|
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
package/dist/version.js
CHANGED