@enyo-energy/energy-app-sdk 0.0.57 → 0.0.58
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/README.md +9 -4
- package/dist/cjs/energy-app-package-definition.d.cts +14 -2
- package/dist/cjs/energy-app-permission.type.cjs +2 -0
- package/dist/cjs/energy-app-permission.type.d.cts +4 -2
- package/dist/cjs/enyo-energy-app-sdk.d.cts +6 -0
- package/dist/cjs/index.cjs +20 -0
- package/dist/cjs/index.d.cts +18 -0
- package/dist/cjs/packages/energy-app-energy-manager.cjs +2 -0
- package/dist/cjs/packages/energy-app-energy-manager.d.cts +24 -0
- package/dist/cjs/packages/energy-app-timeseries.cjs +2 -0
- package/dist/cjs/packages/energy-app-timeseries.d.cts +124 -0
- package/dist/cjs/types/enyo-charger-appliance.cjs +1 -0
- package/dist/cjs/types/enyo-charger-appliance.d.cts +1 -0
- package/dist/cjs/types/enyo-data-bus-value.cjs +2 -0
- package/dist/cjs/types/enyo-data-bus-value.d.cts +55 -3
- package/dist/cjs/types/enyo-energy-manager.cjs +27 -0
- package/dist/cjs/types/enyo-energy-manager.d.cts +72 -0
- package/dist/cjs/types/enyo-timeseries.cjs +2 -0
- package/dist/cjs/types/enyo-timeseries.d.cts +211 -0
- package/dist/cjs/version.cjs +1 -1
- package/dist/cjs/version.d.cts +1 -1
- package/dist/energy-app-package-definition.d.ts +14 -2
- package/dist/energy-app-permission.type.d.ts +4 -2
- package/dist/energy-app-permission.type.js +2 -0
- package/dist/enyo-energy-app-sdk.d.ts +6 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +20 -0
- package/dist/packages/energy-app-energy-manager.d.ts +24 -0
- package/dist/packages/energy-app-energy-manager.js +1 -0
- package/dist/packages/energy-app-timeseries.d.ts +124 -0
- package/dist/packages/energy-app-timeseries.js +1 -0
- package/dist/types/enyo-charger-appliance.d.ts +1 -0
- package/dist/types/enyo-charger-appliance.js +1 -0
- package/dist/types/enyo-data-bus-value.d.ts +55 -3
- package/dist/types/enyo-data-bus-value.js +2 -0
- package/dist/types/enyo-energy-manager.d.ts +72 -0
- package/dist/types/enyo-energy-manager.js +24 -0
- package/dist/types/enyo-timeseries.d.ts +211 -0
- package/dist/types/enyo-timeseries.js +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -123,6 +123,8 @@ import {
|
|
|
123
123
|
const packageDef = defineEnergyAppPackage({
|
|
124
124
|
version: '1',
|
|
125
125
|
packageName: 'solar-optimizer',
|
|
126
|
+
// Optional: Internal documentation for developers (not shown to users)
|
|
127
|
+
internalDescription: 'This app optimizes solar energy production using weather forecasts and AI predictions.',
|
|
126
128
|
logo: './assets/logo.png',
|
|
127
129
|
categories: [
|
|
128
130
|
EnergyAppPackageCategory.Inverter,
|
|
@@ -142,12 +144,15 @@ const packageDef = defineEnergyAppPackage({
|
|
|
142
144
|
description: 'Erweiterte Solarenergie-Optimierung mit KI-gesteuerten Vorhersagen und Echtzeitanpassungen.'
|
|
143
145
|
}
|
|
144
146
|
],
|
|
147
|
+
// Permissions can be objects with internal comments (recommended for documentation)
|
|
145
148
|
permissions: [
|
|
146
|
-
EnergyAppPermissionTypeEnum.Modbus,
|
|
147
|
-
EnergyAppPermissionTypeEnum.SendDataBusValues,
|
|
148
|
-
EnergyAppPermissionTypeEnum.SubscribeDataBus,
|
|
149
|
-
EnergyAppPermissionTypeEnum.Storage
|
|
149
|
+
{ permission: EnergyAppPermissionTypeEnum.Modbus, internalComment: 'Required to read inverter registers via Modbus TCP' },
|
|
150
|
+
{ permission: EnergyAppPermissionTypeEnum.SendDataBusValues, internalComment: 'Used to publish inverter power values to the data bus' },
|
|
151
|
+
{ permission: EnergyAppPermissionTypeEnum.SubscribeDataBus, internalComment: 'Listens for battery state updates' },
|
|
152
|
+
{ permission: EnergyAppPermissionTypeEnum.Storage, internalComment: 'Stores configuration and historical optimization data' }
|
|
150
153
|
],
|
|
154
|
+
// Note: Simple permission types are also supported for backwards compatibility:
|
|
155
|
+
// permissions: [EnergyAppPermissionTypeEnum.Modbus, EnergyAppPermissionTypeEnum.Storage]
|
|
151
156
|
options: {
|
|
152
157
|
restrictedInternetAccess: {
|
|
153
158
|
origins: ['api.weather.com', 'solar-forecasting.com']
|
|
@@ -89,6 +89,16 @@ export interface EnergyAppPackageStoreEntry {
|
|
|
89
89
|
/** Detailed description of the package functionality */
|
|
90
90
|
description: string;
|
|
91
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Defines a permission entry for an Energy App package.
|
|
94
|
+
* Contains the permission type and an internal comment explaining its usage.
|
|
95
|
+
*/
|
|
96
|
+
export interface EnergyAppPackagePermission {
|
|
97
|
+
/** The permission type required by the package */
|
|
98
|
+
permission: EnergyAppPermissionType;
|
|
99
|
+
/** Internal documentation describing what this permission is used for */
|
|
100
|
+
internalComment: string;
|
|
101
|
+
}
|
|
92
102
|
/**
|
|
93
103
|
* Complete definition for a enyo Energy App package.
|
|
94
104
|
* This interface defines all the metadata, permissions, and configuration
|
|
@@ -99,14 +109,16 @@ export interface EnergyAppPackageDefinition {
|
|
|
99
109
|
version: '1';
|
|
100
110
|
/** Unique identifier for the package */
|
|
101
111
|
packageName: string;
|
|
112
|
+
/** Internal documentation describing the concept and purpose of this energy app (optional) */
|
|
113
|
+
internalDescription?: string;
|
|
102
114
|
/** Optional path to the logo */
|
|
103
115
|
logo?: string;
|
|
104
116
|
/** Categories that this package belongs to */
|
|
105
117
|
categories: EnergyAppPackageCategory[];
|
|
106
118
|
/** Localized store information for different languages */
|
|
107
119
|
storeEntry: EnergyAppPackageStoreEntry[];
|
|
108
|
-
/** Required permissions for this package to function */
|
|
109
|
-
permissions: EnergyAppPermissionType[];
|
|
120
|
+
/** Required permissions for this package to function. Can be simple permission types or objects with internal comments */
|
|
121
|
+
permissions: (EnergyAppPermissionType | EnergyAppPackagePermission)[];
|
|
110
122
|
/** Optional configuration settings */
|
|
111
123
|
options?: EnergyAppPackageOptions;
|
|
112
124
|
/** The version of the enyo SDK used to build this package (automatically injected) */
|
|
@@ -21,4 +21,6 @@ var EnergyAppPermissionTypeEnum;
|
|
|
21
21
|
EnergyAppPermissionTypeEnum["SecretManager"] = "SecretManager";
|
|
22
22
|
EnergyAppPermissionTypeEnum["LocationZipCode"] = "LocationZipCode";
|
|
23
23
|
EnergyAppPermissionTypeEnum["LocationCoordinates"] = "LocationCoordinates";
|
|
24
|
+
EnergyAppPermissionTypeEnum["Timeseries"] = "Timeseries";
|
|
25
|
+
EnergyAppPermissionTypeEnum["EnergyManagerInfo"] = "EnergyManagerInfo";
|
|
24
26
|
})(EnergyAppPermissionTypeEnum || (exports.EnergyAppPermissionTypeEnum = EnergyAppPermissionTypeEnum = {}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type EnergyAppPermissionType = 'RestrictedInternetAccess' | 'NetworkDeviceDiscovery' | 'NetworkDeviceSearch' | 'NetworkDeviceAccess' | 'Modbus' | 'Storage' | 'Appliance' | 'AllAppliances' | 'SendDataBusValues' | 'SubscribeDataBus' | 'SendDataBusCommands' | 'OcppServer' | 'ChargingCard' | 'Vehicle' | 'Charge' | 'SecretManager' | 'LocationZipCode' | 'LocationCoordinates';
|
|
1
|
+
export type EnergyAppPermissionType = 'RestrictedInternetAccess' | 'NetworkDeviceDiscovery' | 'NetworkDeviceSearch' | 'NetworkDeviceAccess' | 'Modbus' | 'Storage' | 'Appliance' | 'AllAppliances' | 'SendDataBusValues' | 'SubscribeDataBus' | 'SendDataBusCommands' | 'OcppServer' | 'ChargingCard' | 'Vehicle' | 'Charge' | 'SecretManager' | 'LocationZipCode' | 'LocationCoordinates' | 'Timeseries' | 'EnergyManagerInfo';
|
|
2
2
|
export declare enum EnergyAppPermissionTypeEnum {
|
|
3
3
|
RestrictedInternetAccess = "RestrictedInternetAccess",
|
|
4
4
|
NetworkDeviceDiscovery = "NetworkDeviceDiscovery",
|
|
@@ -17,5 +17,7 @@ export declare enum EnergyAppPermissionTypeEnum {
|
|
|
17
17
|
Charge = "Charge",
|
|
18
18
|
SecretManager = "SecretManager",
|
|
19
19
|
LocationZipCode = "LocationZipCode",
|
|
20
|
-
LocationCoordinates = "LocationCoordinates"
|
|
20
|
+
LocationCoordinates = "LocationCoordinates",
|
|
21
|
+
Timeseries = "Timeseries",
|
|
22
|
+
EnergyManagerInfo = "EnergyManagerInfo"
|
|
21
23
|
}
|
|
@@ -15,7 +15,9 @@ 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";
|
|
17
17
|
import { EnergyAppOnboarding } from "./packages/energy-app-onboarding.cjs";
|
|
18
|
+
import { EnergyAppTimeseries } from "./packages/energy-app-timeseries.cjs";
|
|
18
19
|
import { EnyoPackageChannel } from "./enyo-package-channel.cjs";
|
|
20
|
+
import { EnergyAppEnergyManager } from "./packages/energy-app-energy-manager.cjs";
|
|
19
21
|
export declare enum EnergyAppStateEnum {
|
|
20
22
|
Launching = "launching",
|
|
21
23
|
Running = "running",
|
|
@@ -74,4 +76,8 @@ export interface EnyoEnergyAppSdk {
|
|
|
74
76
|
useLocation: () => EnergyAppLocation;
|
|
75
77
|
/** Get the Onboarding API */
|
|
76
78
|
useOnboarding: () => EnergyAppOnboarding;
|
|
79
|
+
/** Get the Timeseries API for querying historical energy data */
|
|
80
|
+
useTimeseries: () => EnergyAppTimeseries;
|
|
81
|
+
/** Get the Energy Manager API for retrieving energy manager info and capabilities */
|
|
82
|
+
useEnergyManager: () => EnergyAppEnergyManager;
|
|
77
83
|
}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -31,6 +31,9 @@ __exportStar(require("./types/enyo-location.cjs"), exports);
|
|
|
31
31
|
__exportStar(require("./implementations/appliances/appliance-manager.cjs"), exports);
|
|
32
32
|
__exportStar(require("./implementations/appliances/identifier-strategies.cjs"), exports);
|
|
33
33
|
__exportStar(require("./enyo-package-channel.cjs"), exports);
|
|
34
|
+
__exportStar(require("./types/enyo-timeseries.cjs"), exports);
|
|
35
|
+
__exportStar(require("./types/enyo-energy-manager.cjs"), exports);
|
|
36
|
+
__exportStar(require("./packages/energy-app-energy-manager.cjs"), exports);
|
|
34
37
|
class EnergyApp {
|
|
35
38
|
energyAppSdk;
|
|
36
39
|
constructor() {
|
|
@@ -127,6 +130,23 @@ class EnergyApp {
|
|
|
127
130
|
useLocation() {
|
|
128
131
|
return this.energyAppSdk.useLocation();
|
|
129
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Gets the Timeseries API for querying historical energy data.
|
|
135
|
+
* Provides methods to retrieve aggregated timeseries data with 15-minute bucket granularity
|
|
136
|
+
* for various energy metrics including PV production, battery state, meter values, and grid power.
|
|
137
|
+
* @returns The Timeseries API instance
|
|
138
|
+
*/
|
|
139
|
+
useTimeseries() {
|
|
140
|
+
return this.energyAppSdk.useTimeseries();
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Gets the Energy Manager API for retrieving information about the active energy manager.
|
|
144
|
+
* Provides methods to check the current energy manager and its supported features.
|
|
145
|
+
* @returns The Energy Manager API instance
|
|
146
|
+
*/
|
|
147
|
+
useEnergyManager() {
|
|
148
|
+
return this.energyAppSdk.useEnergyManager();
|
|
149
|
+
}
|
|
130
150
|
/**
|
|
131
151
|
* Gets the current SDK version.
|
|
132
152
|
* @returns The semantic version string of the SDK
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -16,7 +16,9 @@ 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";
|
|
18
18
|
import { EnergyAppOnboarding } from "./packages/energy-app-onboarding.cjs";
|
|
19
|
+
import { EnergyAppTimeseries } from "./packages/energy-app-timeseries.cjs";
|
|
19
20
|
import { EnyoPackageChannel } from "./enyo-package-channel.cjs";
|
|
21
|
+
import { EnergyAppEnergyManager } from "./packages/energy-app-energy-manager.cjs";
|
|
20
22
|
export * from './energy-app-package-definition.cjs';
|
|
21
23
|
export * from './version.cjs';
|
|
22
24
|
export * from './implementations/ocpp/ocpp16.cjs';
|
|
@@ -32,6 +34,9 @@ export * from './types/enyo-location.cjs';
|
|
|
32
34
|
export * from './implementations/appliances/appliance-manager.cjs';
|
|
33
35
|
export * from './implementations/appliances/identifier-strategies.cjs';
|
|
34
36
|
export * from './enyo-package-channel.cjs';
|
|
37
|
+
export * from './types/enyo-timeseries.cjs';
|
|
38
|
+
export * from './types/enyo-energy-manager.cjs';
|
|
39
|
+
export * from './packages/energy-app-energy-manager.cjs';
|
|
35
40
|
export declare class EnergyApp implements EnyoEnergyAppSdk {
|
|
36
41
|
private readonly energyAppSdk;
|
|
37
42
|
constructor();
|
|
@@ -67,6 +72,19 @@ export declare class EnergyApp implements EnyoEnergyAppSdk {
|
|
|
67
72
|
* @returns The Location API instance
|
|
68
73
|
*/
|
|
69
74
|
useLocation(): EnergyAppLocation;
|
|
75
|
+
/**
|
|
76
|
+
* Gets the Timeseries API for querying historical energy data.
|
|
77
|
+
* Provides methods to retrieve aggregated timeseries data with 15-minute bucket granularity
|
|
78
|
+
* for various energy metrics including PV production, battery state, meter values, and grid power.
|
|
79
|
+
* @returns The Timeseries API instance
|
|
80
|
+
*/
|
|
81
|
+
useTimeseries(): EnergyAppTimeseries;
|
|
82
|
+
/**
|
|
83
|
+
* Gets the Energy Manager API for retrieving information about the active energy manager.
|
|
84
|
+
* Provides methods to check the current energy manager and its supported features.
|
|
85
|
+
* @returns The Energy Manager API instance
|
|
86
|
+
*/
|
|
87
|
+
useEnergyManager(): EnergyAppEnergyManager;
|
|
70
88
|
/**
|
|
71
89
|
* Gets the current SDK version.
|
|
72
90
|
* @returns The semantic version string of the SDK
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { EnergyManagerInfo } from "../types/enyo-energy-manager.cjs";
|
|
2
|
+
/**
|
|
3
|
+
* Interface for retrieving energy manager information and capabilities.
|
|
4
|
+
* The energy manager is responsible for optimizing energy usage across appliances.
|
|
5
|
+
*/
|
|
6
|
+
export interface EnergyAppEnergyManager {
|
|
7
|
+
/**
|
|
8
|
+
* Gets information about the currently active energy manager.
|
|
9
|
+
* Returns null if no energy manager is configured.
|
|
10
|
+
*
|
|
11
|
+
* @returns Promise resolving to energy manager info or null if no energy manager is configured
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const energyManager = energyApp.useEnergyManager();
|
|
16
|
+
* const info = await energyManager.getEnergyManagerInfo();
|
|
17
|
+
* if (info) {
|
|
18
|
+
* console.log(`Energy Manager: ${info.name}`);
|
|
19
|
+
* console.log(`Features: ${info.features.join(', ')}`);
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
getEnergyManagerInfo(): Promise<EnergyManagerInfo | null>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { DataBusMessageQueryRequest, DataBusMessageQueryResponse, PvProductionTimeseriesRequest, PvProductionTimeseriesResponse, BatterySocTimeseriesRequest, BatterySocTimeseriesResponse, BatteryPowerTimeseriesRequest, BatteryPowerTimeseriesResponse, MeterValuesTimeseriesRequest, MeterValuesTimeseriesResponse, GridPowerTimeseriesRequest, GridPowerTimeseriesResponse } from "../types/enyo-timeseries.cjs";
|
|
2
|
+
/**
|
|
3
|
+
* Interface for querying historical energy data with 15-minute bucket granularity.
|
|
4
|
+
* Provides methods to retrieve aggregated timeseries data for various energy metrics
|
|
5
|
+
* including PV production, battery state, meter values, and grid power.
|
|
6
|
+
*
|
|
7
|
+
* All aggregated methods return data in 15-minute buckets aligned to clock time
|
|
8
|
+
* (:00, :15, :30, :45). Power values (W) represent time-weighted averages within
|
|
9
|
+
* each bucket, while energy values (Wh) represent cumulative sums.
|
|
10
|
+
*
|
|
11
|
+
* Date ranges use inclusive start and exclusive end timestamps.
|
|
12
|
+
*/
|
|
13
|
+
export interface EnergyAppTimeseries {
|
|
14
|
+
/**
|
|
15
|
+
* Queries raw data bus messages for a specific appliance.
|
|
16
|
+
* Supports pagination and filtering by message type.
|
|
17
|
+
*
|
|
18
|
+
* @param request - The query parameters including appliance ID, date range, and optional filters
|
|
19
|
+
* @returns Promise resolving to the matching messages with pagination metadata
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const response = await timeseries.queryDataBusMessages({
|
|
24
|
+
* applianceId: 'inverter-001',
|
|
25
|
+
* startDateIso: '2024-01-01T00:00:00Z',
|
|
26
|
+
* endDateIso: '2024-01-02T00:00:00Z',
|
|
27
|
+
* messageTypes: [EnyoDataBusMessageEnum.InverterValuesUpdateV1],
|
|
28
|
+
* limit: 100
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
queryDataBusMessages(request: DataBusMessageQueryRequest): Promise<DataBusMessageQueryResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Retrieves PV production timeseries data aggregated in 15-minute buckets.
|
|
35
|
+
* Returns both instantaneous power (W) and cumulative energy (Wh) values.
|
|
36
|
+
*
|
|
37
|
+
* @param request - The query parameters including date range and optional appliance filter
|
|
38
|
+
* @returns Promise resolving to PV production entries and total production
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```typescript
|
|
42
|
+
* const response = await timeseries.getPvProductionTimeseries({
|
|
43
|
+
* startDateIso: '2024-01-01T00:00:00Z',
|
|
44
|
+
* endDateIso: '2024-01-02T00:00:00Z'
|
|
45
|
+
* });
|
|
46
|
+
* console.log(`Total production: ${response.totalPvProductionWh} Wh`);
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
getPvProductionTimeseries(request: PvProductionTimeseriesRequest): Promise<PvProductionTimeseriesResponse>;
|
|
50
|
+
/**
|
|
51
|
+
* Retrieves battery state of charge (SOC) timeseries data aggregated in 15-minute buckets.
|
|
52
|
+
* Returns average, minimum, and maximum SOC values for each bucket.
|
|
53
|
+
*
|
|
54
|
+
* @param request - The query parameters including date range and optional appliance filter
|
|
55
|
+
* @returns Promise resolving to battery SOC entries and overall average SOC
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* const response = await timeseries.getBatterySocTimeseries({
|
|
60
|
+
* startDateIso: '2024-01-01T00:00:00Z',
|
|
61
|
+
* endDateIso: '2024-01-02T00:00:00Z',
|
|
62
|
+
* applianceIds: ['battery-001']
|
|
63
|
+
* });
|
|
64
|
+
* console.log(`Average SOC: ${response.averageSoC}%`);
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
getBatterySocTimeseries(request: BatterySocTimeseriesRequest): Promise<BatterySocTimeseriesResponse>;
|
|
68
|
+
/**
|
|
69
|
+
* Retrieves battery power timeseries data aggregated in 15-minute buckets.
|
|
70
|
+
* Positive values indicate discharge (consumption from battery),
|
|
71
|
+
* negative values indicate charge (energy into battery).
|
|
72
|
+
*
|
|
73
|
+
* @param request - The query parameters including date range and optional appliance filter
|
|
74
|
+
* @returns Promise resolving to battery power entries with total charge and discharge amounts
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* const response = await timeseries.getBatteryPowerTimeseries({
|
|
79
|
+
* startDateIso: '2024-01-01T00:00:00Z',
|
|
80
|
+
* endDateIso: '2024-01-02T00:00:00Z'
|
|
81
|
+
* });
|
|
82
|
+
* console.log(`Total discharged: ${response.totalDischargeWh} Wh`);
|
|
83
|
+
* console.log(`Total charged: ${response.totalChargeWh} Wh`);
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
getBatteryPowerTimeseries(request: BatteryPowerTimeseriesRequest): Promise<BatteryPowerTimeseriesResponse>;
|
|
87
|
+
/**
|
|
88
|
+
* Retrieves meter values timeseries data aggregated in 15-minute buckets.
|
|
89
|
+
* Returns grid consumption and feed-in energy values.
|
|
90
|
+
*
|
|
91
|
+
* @param request - The query parameters including date range and optional appliance filter
|
|
92
|
+
* @returns Promise resolving to meter value entries with total consumption and feed-in
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```typescript
|
|
96
|
+
* const response = await timeseries.getMeterValuesTimeseries({
|
|
97
|
+
* startDateIso: '2024-01-01T00:00:00Z',
|
|
98
|
+
* endDateIso: '2024-01-02T00:00:00Z'
|
|
99
|
+
* });
|
|
100
|
+
* console.log(`Grid consumption: ${response.totalGridConsumptionWh} Wh`);
|
|
101
|
+
* console.log(`Grid feed-in: ${response.totalGridFeedInWh} Wh`);
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
getMeterValuesTimeseries(request: MeterValuesTimeseriesRequest): Promise<MeterValuesTimeseriesResponse>;
|
|
105
|
+
/**
|
|
106
|
+
* Retrieves grid power timeseries data aggregated in 15-minute buckets.
|
|
107
|
+
* Positive values indicate import (consumption from grid),
|
|
108
|
+
* negative values indicate export (feed-in to grid).
|
|
109
|
+
*
|
|
110
|
+
* @param request - The query parameters including date range and optional appliance filter
|
|
111
|
+
* @returns Promise resolving to grid power entries with total import and export amounts
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```typescript
|
|
115
|
+
* const response = await timeseries.getGridPowerTimeseries({
|
|
116
|
+
* startDateIso: '2024-01-01T00:00:00Z',
|
|
117
|
+
* endDateIso: '2024-01-02T00:00:00Z'
|
|
118
|
+
* });
|
|
119
|
+
* console.log(`Total imported: ${response.totalImportWh} Wh`);
|
|
120
|
+
* console.log(`Total exported: ${response.totalExportWh} Wh`);
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
getGridPowerTimeseries(request: GridPowerTimeseriesRequest): Promise<GridPowerTimeseriesResponse>;
|
|
124
|
+
}
|
|
@@ -5,6 +5,7 @@ var EnyoChargerApplianceStatusEnum;
|
|
|
5
5
|
(function (EnyoChargerApplianceStatusEnum) {
|
|
6
6
|
EnyoChargerApplianceStatusEnum["Available"] = "Available";
|
|
7
7
|
EnyoChargerApplianceStatusEnum["Occupied"] = "Occupied";
|
|
8
|
+
EnyoChargerApplianceStatusEnum["Charging"] = "Charging";
|
|
8
9
|
EnyoChargerApplianceStatusEnum["Suspended"] = "Suspended";
|
|
9
10
|
EnyoChargerApplianceStatusEnum["Finishing"] = "Finishing";
|
|
10
11
|
EnyoChargerApplianceStatusEnum["Reserved"] = "Reserved";
|
|
@@ -103,4 +103,6 @@ var EnyoDataBusMessageEnum;
|
|
|
103
103
|
EnyoDataBusMessageEnum["EnergyTariffUpdateV1"] = "EnergyTariffUpdateV1";
|
|
104
104
|
EnyoDataBusMessageEnum["ChargeFinishedV1"] = "ChargeFinishedV1";
|
|
105
105
|
EnyoDataBusMessageEnum["ChargerStatusChangedV1"] = "ChargerStatusChangedV1";
|
|
106
|
+
EnyoDataBusMessageEnum["RequestPreviewChargingScheduleV1"] = "RequestPreviewChargingScheduleV1";
|
|
107
|
+
EnyoDataBusMessageEnum["PreviewChargingScheduleResponseV1"] = "PreviewChargingScheduleResponseV1";
|
|
106
108
|
})(EnyoDataBusMessageEnum || (exports.EnyoDataBusMessageEnum = EnyoDataBusMessageEnum = {}));
|
|
@@ -2,7 +2,8 @@ import { EnyoApplianceStateEnum, EnyoApplianceTypeEnum } from "./enyo-appliance.
|
|
|
2
2
|
import { EnyoSourceEnum } from "./enyo-source.enum.cjs";
|
|
3
3
|
import { EnergyTariffInfo } from "./enyo-energy-tariff.cjs";
|
|
4
4
|
import { EnyoOcppRelativeSchedule } from "./enyo-ocpp.cjs";
|
|
5
|
-
import {
|
|
5
|
+
import { EnyoChargerApplianceStatusEnum } from "./enyo-charger-appliance.cjs";
|
|
6
|
+
import { PreviewChargingSchedule, PreviewChargingScheduleCostComparison, PreviewChargingScheduleUnavailableReasonEnum } from "./enyo-energy-manager.cjs";
|
|
6
7
|
export declare enum EnyoBatteryStateEnum {
|
|
7
8
|
Off = "off",
|
|
8
9
|
Empty = "empty",
|
|
@@ -135,7 +136,9 @@ export declare enum EnyoDataBusMessageEnum {
|
|
|
135
136
|
AggregatedStateUpdateV1 = "AggregatedStateUpdateV1",
|
|
136
137
|
EnergyTariffUpdateV1 = "EnergyTariffUpdateV1",
|
|
137
138
|
ChargeFinishedV1 = "ChargeFinishedV1",
|
|
138
|
-
ChargerStatusChangedV1 = "ChargerStatusChangedV1"
|
|
139
|
+
ChargerStatusChangedV1 = "ChargerStatusChangedV1",
|
|
140
|
+
RequestPreviewChargingScheduleV1 = "RequestPreviewChargingScheduleV1",
|
|
141
|
+
PreviewChargingScheduleResponseV1 = "PreviewChargingScheduleResponseV1"
|
|
139
142
|
}
|
|
140
143
|
export type EnyoDataBusMessageResolution = '10s' | '30s' | '1m' | '15m' | '1h' | '1d' | 'dynamic';
|
|
141
144
|
export interface EnyoDataBusMessage {
|
|
@@ -287,6 +290,10 @@ export interface EnyoDataBusChargingStartedV1 extends EnyoDataBusMessage {
|
|
|
287
290
|
transactionId: string;
|
|
288
291
|
/** used charging card */
|
|
289
292
|
chargingCardId?: string;
|
|
293
|
+
/** The charge mode of the started charge. If initiated by wallbox, use either user settings or immediate as default */
|
|
294
|
+
chargeMode: EnyoChargeModeEnum;
|
|
295
|
+
/** ISO timestamp for target completion time (optional) */
|
|
296
|
+
completeChargeAtIso?: string;
|
|
290
297
|
/** vehicle that's charging */
|
|
291
298
|
vehicleId?: string;
|
|
292
299
|
/** Meter reading at session start in Watt hours */
|
|
@@ -497,6 +504,7 @@ export interface EnyoDataBusChargeFinishedV1 extends EnyoDataBusMessage {
|
|
|
497
504
|
chargeId: string;
|
|
498
505
|
/** OCPP transaction identifier for the charging session */
|
|
499
506
|
transactionId: string;
|
|
507
|
+
numberOfPhases?: number;
|
|
500
508
|
/** ID of the vehicle that was charged (optional) */
|
|
501
509
|
vehicleId?: string;
|
|
502
510
|
/** ID of the charging card used for this session (optional) */
|
|
@@ -520,8 +528,52 @@ export interface EnyoDataBusChargerStatusChangedV1 extends EnyoDataBusMessage {
|
|
|
520
528
|
applianceId: string;
|
|
521
529
|
data: {
|
|
522
530
|
/** Current OCPP status of the charger */
|
|
523
|
-
status:
|
|
531
|
+
status: EnyoChargerApplianceStatusEnum;
|
|
524
532
|
/** Connector ID on the charge point (optional, for multi-connector chargers) */
|
|
525
533
|
connectorId?: number;
|
|
526
534
|
};
|
|
527
535
|
}
|
|
536
|
+
/**
|
|
537
|
+
* Request message to get a preview of the optimized charging schedule.
|
|
538
|
+
* Sent when user wants to see the charging plan before starting.
|
|
539
|
+
*/
|
|
540
|
+
export interface EnyoDataBusRequestPreviewChargingScheduleV1 extends EnyoDataBusMessage {
|
|
541
|
+
type: 'message';
|
|
542
|
+
message: EnyoDataBusMessageEnum.RequestPreviewChargingScheduleV1;
|
|
543
|
+
data: {
|
|
544
|
+
/** ID of the appliance (charger) to get preview for */
|
|
545
|
+
applianceId: string;
|
|
546
|
+
/** Unique request identifier for correlating the response */
|
|
547
|
+
requestId: string;
|
|
548
|
+
/** Target energy to be delivered in Wh (optional) */
|
|
549
|
+
targetEnergyWh?: number;
|
|
550
|
+
/** Target completion time as ISO timestamp (optional) */
|
|
551
|
+
completeByIso?: string;
|
|
552
|
+
/** Charger max power setting in Watts for cost comparison (optional) */
|
|
553
|
+
chargerMaxPowerW?: number;
|
|
554
|
+
/** Whether to include cost comparison in response */
|
|
555
|
+
includeCostComparison?: boolean;
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* Response message containing the preview charging schedule or indicating unavailability.
|
|
560
|
+
* Sent by energy manager if available, or by device core if not.
|
|
561
|
+
*/
|
|
562
|
+
export interface EnyoDataBusPreviewChargingScheduleResponseV1 extends EnyoDataBusMessage {
|
|
563
|
+
type: 'message';
|
|
564
|
+
message: EnyoDataBusMessageEnum.PreviewChargingScheduleResponseV1;
|
|
565
|
+
data: {
|
|
566
|
+
/** The request ID this response corresponds to */
|
|
567
|
+
requestId: string;
|
|
568
|
+
/** ID of the appliance this schedule is for */
|
|
569
|
+
applianceId: string;
|
|
570
|
+
/** Whether a preview charging schedule is available */
|
|
571
|
+
available: boolean;
|
|
572
|
+
/** The preview charging schedule (only present if available=true) */
|
|
573
|
+
schedule?: PreviewChargingSchedule;
|
|
574
|
+
/** Cost comparison data (only present if requested and available) */
|
|
575
|
+
costComparison?: PreviewChargingScheduleCostComparison;
|
|
576
|
+
/** Reason why preview is not available (only present if available=false) */
|
|
577
|
+
unavailableReason?: PreviewChargingScheduleUnavailableReasonEnum;
|
|
578
|
+
};
|
|
579
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PreviewChargingScheduleUnavailableReasonEnum = exports.EnergyManagerFeatureEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Enum of available energy manager features.
|
|
6
|
+
* Used to check if a specific feature is supported by the current energy manager.
|
|
7
|
+
*/
|
|
8
|
+
var EnergyManagerFeatureEnum;
|
|
9
|
+
(function (EnergyManagerFeatureEnum) {
|
|
10
|
+
/** The energy manager supports generating preview charge schedules */
|
|
11
|
+
EnergyManagerFeatureEnum["PreviewChargeSchedule"] = "preview-charge-schedule";
|
|
12
|
+
})(EnergyManagerFeatureEnum || (exports.EnergyManagerFeatureEnum = EnergyManagerFeatureEnum = {}));
|
|
13
|
+
/**
|
|
14
|
+
* Reason why a preview charging schedule is not available.
|
|
15
|
+
* Returned when a preview charging schedule request cannot be fulfilled.
|
|
16
|
+
*/
|
|
17
|
+
var PreviewChargingScheduleUnavailableReasonEnum;
|
|
18
|
+
(function (PreviewChargingScheduleUnavailableReasonEnum) {
|
|
19
|
+
/** No energy manager is configured in the system */
|
|
20
|
+
PreviewChargingScheduleUnavailableReasonEnum["NoEnergyManager"] = "no-energy-manager";
|
|
21
|
+
/** No electricity tariff data available for cost optimization */
|
|
22
|
+
PreviewChargingScheduleUnavailableReasonEnum["NoTariffData"] = "no-tariff-data";
|
|
23
|
+
/** The requested appliance was not found */
|
|
24
|
+
PreviewChargingScheduleUnavailableReasonEnum["ApplianceNotFound"] = "appliance-not-found";
|
|
25
|
+
/** The energy manager does not support the preview schedule feature */
|
|
26
|
+
PreviewChargingScheduleUnavailableReasonEnum["FeatureNotSupported"] = "feature-not-supported";
|
|
27
|
+
})(PreviewChargingScheduleUnavailableReasonEnum || (exports.PreviewChargingScheduleUnavailableReasonEnum = PreviewChargingScheduleUnavailableReasonEnum = {}));
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum of available energy manager features.
|
|
3
|
+
* Used to check if a specific feature is supported by the current energy manager.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum EnergyManagerFeatureEnum {
|
|
6
|
+
/** The energy manager supports generating preview charge schedules */
|
|
7
|
+
PreviewChargeSchedule = "preview-charge-schedule"
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Reason why a preview charging schedule is not available.
|
|
11
|
+
* Returned when a preview charging schedule request cannot be fulfilled.
|
|
12
|
+
*/
|
|
13
|
+
export declare enum PreviewChargingScheduleUnavailableReasonEnum {
|
|
14
|
+
/** No energy manager is configured in the system */
|
|
15
|
+
NoEnergyManager = "no-energy-manager",
|
|
16
|
+
/** No electricity tariff data available for cost optimization */
|
|
17
|
+
NoTariffData = "no-tariff-data",
|
|
18
|
+
/** The requested appliance was not found */
|
|
19
|
+
ApplianceNotFound = "appliance-not-found",
|
|
20
|
+
/** The energy manager does not support the preview schedule feature */
|
|
21
|
+
FeatureNotSupported = "feature-not-supported"
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Information about the current energy manager.
|
|
25
|
+
* Describes the active energy manager and its capabilities.
|
|
26
|
+
*/
|
|
27
|
+
export interface EnergyManagerInfo {
|
|
28
|
+
/** Unique identifier of the energy manager package */
|
|
29
|
+
packageId: string;
|
|
30
|
+
/** Display name of the energy manager */
|
|
31
|
+
name: string;
|
|
32
|
+
/** Array of supported features */
|
|
33
|
+
features: EnergyManagerFeatureEnum[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A single entry in the charging schedule.
|
|
37
|
+
* Defines a time period with a specific charging power limit.
|
|
38
|
+
*/
|
|
39
|
+
export interface PreviewChargingScheduleEntry {
|
|
40
|
+
/** ISO timestamp for when this schedule entry starts */
|
|
41
|
+
startIso: string;
|
|
42
|
+
/** ISO timestamp for when this schedule entry ends */
|
|
43
|
+
endIso: string;
|
|
44
|
+
/** Charging power limit in Watts for this period */
|
|
45
|
+
chargingPowerW: number;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Complete preview charging schedule with timing information.
|
|
49
|
+
* Represents an optimized charging plan with detailed time slots.
|
|
50
|
+
*/
|
|
51
|
+
export interface PreviewChargingSchedule {
|
|
52
|
+
/** Array of schedule entries defining the optimized charging plan */
|
|
53
|
+
entries: PreviewChargingScheduleEntry[];
|
|
54
|
+
/** Total energy to be delivered in Wh */
|
|
55
|
+
totalEnergyWh: number;
|
|
56
|
+
/** Estimated completion time as ISO timestamp */
|
|
57
|
+
estimatedCompletionIso: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Cost comparison between optimized and immediate charging.
|
|
61
|
+
* Shows potential savings from using an optimized charging schedule.
|
|
62
|
+
*/
|
|
63
|
+
export interface PreviewChargingScheduleCostComparison {
|
|
64
|
+
/** Estimated cost for the optimized schedule in cents */
|
|
65
|
+
optimizedCostCents: number;
|
|
66
|
+
/** Estimated cost for immediate charging at max power in cents */
|
|
67
|
+
immediateCostCents: number;
|
|
68
|
+
/** Savings achieved by using the optimized schedule in cents */
|
|
69
|
+
savingsCents: number;
|
|
70
|
+
/** Currency code (e.g., 'EUR') */
|
|
71
|
+
currency: string;
|
|
72
|
+
}
|