@enyo-energy/energy-app-sdk 0.0.57 → 0.0.59
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 -4
- package/dist/cjs/energy-app-permission.type.cjs +3 -0
- package/dist/cjs/energy-app-permission.type.d.cts +5 -2
- package/dist/cjs/enyo-energy-app-sdk.d.cts +9 -0
- package/dist/cjs/implementations/ocpp/ocpp16.cjs +2 -1
- package/dist/cjs/implementations/ocpp/ocpp16.d.cts +6 -7
- package/dist/cjs/implementations/ocpp/ocpp201.cjs +2 -1
- package/dist/cjs/implementations/ocpp/ocpp201.d.cts +5 -9
- package/dist/cjs/index.cjs +32 -0
- package/dist/cjs/index.d.cts +29 -0
- package/dist/cjs/packages/energy-app-electricity-prices.d.cts +15 -0
- package/dist/cjs/packages/energy-app-electricity-tariff.cjs +2 -0
- package/dist/cjs/packages/energy-app-electricity-tariff.d.cts +33 -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 +3 -0
- package/dist/cjs/types/enyo-data-bus-value.d.cts +73 -3
- package/dist/cjs/types/enyo-electricity-prices.d.cts +2 -0
- package/dist/cjs/types/enyo-electricity-tariff.cjs +15 -0
- package/dist/cjs/types/enyo-electricity-tariff.d.cts +34 -0
- 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-pv-forecast.cjs +2 -0
- package/dist/cjs/types/enyo-pv-forecast.d.cts +22 -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 -4
- package/dist/energy-app-permission.type.d.ts +5 -2
- package/dist/energy-app-permission.type.js +3 -0
- package/dist/enyo-energy-app-sdk.d.ts +9 -0
- package/dist/implementations/ocpp/ocpp16.d.ts +6 -7
- package/dist/implementations/ocpp/ocpp16.js +2 -1
- package/dist/implementations/ocpp/ocpp201.d.ts +5 -9
- package/dist/implementations/ocpp/ocpp201.js +2 -1
- package/dist/index.d.ts +29 -0
- package/dist/index.js +32 -0
- package/dist/packages/energy-app-electricity-prices.d.ts +15 -0
- package/dist/packages/energy-app-electricity-tariff.d.ts +33 -0
- package/dist/packages/energy-app-electricity-tariff.js +1 -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 +73 -3
- package/dist/types/enyo-data-bus-value.js +3 -0
- package/dist/types/enyo-electricity-prices.d.ts +2 -0
- package/dist/types/enyo-electricity-tariff.d.ts +34 -0
- package/dist/types/enyo-electricity-tariff.js +12 -0
- package/dist/types/enyo-energy-manager.d.ts +72 -0
- package/dist/types/enyo-energy-manager.js +24 -0
- package/dist/types/enyo-pv-forecast.d.ts +22 -0
- package/dist/types/enyo-pv-forecast.js +1 -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']
|
|
@@ -50,8 +50,6 @@ export interface EnergyAppPackageOptionsDeviceDetectionHttp {
|
|
|
50
50
|
matchingValues: string[];
|
|
51
51
|
}
|
|
52
52
|
export interface EnergyAppPackageOptionsDeviceDetectionOcpp {
|
|
53
|
-
/** ocpp message name, for example BootNotification */
|
|
54
|
-
message: string;
|
|
55
53
|
/** field name in the boot notification */
|
|
56
54
|
field: string;
|
|
57
55
|
/** matching values, for example the vendor names or model names */
|
|
@@ -89,6 +87,16 @@ export interface EnergyAppPackageStoreEntry {
|
|
|
89
87
|
/** Detailed description of the package functionality */
|
|
90
88
|
description: string;
|
|
91
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Defines a permission entry for an Energy App package.
|
|
92
|
+
* Contains the permission type and an internal comment explaining its usage.
|
|
93
|
+
*/
|
|
94
|
+
export interface EnergyAppPackagePermission {
|
|
95
|
+
/** The permission type required by the package */
|
|
96
|
+
permission: EnergyAppPermissionType;
|
|
97
|
+
/** Internal documentation describing what this permission is used for */
|
|
98
|
+
internalComment: string;
|
|
99
|
+
}
|
|
92
100
|
/**
|
|
93
101
|
* Complete definition for a enyo Energy App package.
|
|
94
102
|
* This interface defines all the metadata, permissions, and configuration
|
|
@@ -99,14 +107,16 @@ export interface EnergyAppPackageDefinition {
|
|
|
99
107
|
version: '1';
|
|
100
108
|
/** Unique identifier for the package */
|
|
101
109
|
packageName: string;
|
|
110
|
+
/** Internal documentation describing the concept and purpose of this energy app (optional) */
|
|
111
|
+
internalDescription?: string;
|
|
102
112
|
/** Optional path to the logo */
|
|
103
113
|
logo?: string;
|
|
104
114
|
/** Categories that this package belongs to */
|
|
105
115
|
categories: EnergyAppPackageCategory[];
|
|
106
116
|
/** Localized store information for different languages */
|
|
107
117
|
storeEntry: EnergyAppPackageStoreEntry[];
|
|
108
|
-
/** Required permissions for this package to function */
|
|
109
|
-
permissions: EnergyAppPermissionType[];
|
|
118
|
+
/** Required permissions for this package to function. Can be simple permission types or objects with internal comments */
|
|
119
|
+
permissions: (EnergyAppPermissionType | EnergyAppPackagePermission)[];
|
|
110
120
|
/** Optional configuration settings */
|
|
111
121
|
options?: EnergyAppPackageOptions;
|
|
112
122
|
/** The version of the enyo SDK used to build this package (automatically injected) */
|
|
@@ -21,4 +21,7 @@ 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";
|
|
26
|
+
EnergyAppPermissionTypeEnum["ElectricityTariff"] = "ElectricityTariff";
|
|
24
27
|
})(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' | 'ElectricityTariff';
|
|
2
2
|
export declare enum EnergyAppPermissionTypeEnum {
|
|
3
3
|
RestrictedInternetAccess = "RestrictedInternetAccess",
|
|
4
4
|
NetworkDeviceDiscovery = "NetworkDeviceDiscovery",
|
|
@@ -17,5 +17,8 @@ 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",
|
|
23
|
+
ElectricityTariff = "ElectricityTariff"
|
|
21
24
|
}
|
|
@@ -15,7 +15,10 @@ 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";
|
|
21
|
+
import { EnergyAppElectricityTariff } from "./packages/energy-app-electricity-tariff.cjs";
|
|
19
22
|
export declare enum EnergyAppStateEnum {
|
|
20
23
|
Launching = "launching",
|
|
21
24
|
Running = "running",
|
|
@@ -74,4 +77,10 @@ export interface EnyoEnergyAppSdk {
|
|
|
74
77
|
useLocation: () => EnergyAppLocation;
|
|
75
78
|
/** Get the Onboarding API */
|
|
76
79
|
useOnboarding: () => EnergyAppOnboarding;
|
|
80
|
+
/** Get the Timeseries API for querying historical energy data */
|
|
81
|
+
useTimeseries: () => EnergyAppTimeseries;
|
|
82
|
+
/** Get the Energy Manager API for retrieving energy manager info and capabilities */
|
|
83
|
+
useEnergyManager: () => EnergyAppEnergyManager;
|
|
84
|
+
/** Get the Electricity Tariff API for managing electricity tariffs */
|
|
85
|
+
useElectricityTariff: () => EnergyAppElectricityTariff;
|
|
77
86
|
}
|
|
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ChargePointStatus = exports.RegistrationStatus = exports.OCPP16Action = void 0;
|
|
4
4
|
var OCPP16Action;
|
|
5
5
|
(function (OCPP16Action) {
|
|
6
|
-
|
|
6
|
+
/** The authorization is handled by the core and you will get an info if authorized */
|
|
7
|
+
OCPP16Action["AuthorizationInfo"] = "AuthorizationInfo";
|
|
7
8
|
OCPP16Action["BootNotification"] = "BootNotification";
|
|
8
9
|
OCPP16Action["CancelReservation"] = "CancelReservation";
|
|
9
10
|
OCPP16Action["ChangeAvailability"] = "ChangeAvailability";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare enum OCPP16Action {
|
|
2
|
-
|
|
2
|
+
/** The authorization is handled by the core and you will get an info if authorized */
|
|
3
|
+
AuthorizationInfo = "AuthorizationInfo",
|
|
3
4
|
BootNotification = "BootNotification",
|
|
4
5
|
CancelReservation = "CancelReservation",
|
|
5
6
|
ChangeAvailability = "ChangeAvailability",
|
|
@@ -78,12 +79,10 @@ export interface OCPP16StatusNotificationResponse {
|
|
|
78
79
|
export interface OCPP16AuthorizeRequest {
|
|
79
80
|
idTag: string;
|
|
80
81
|
}
|
|
81
|
-
export interface
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
parentIdTag?: string;
|
|
86
|
-
};
|
|
82
|
+
export interface OCPP16AuthorizationInfoResponse {
|
|
83
|
+
idTag: string;
|
|
84
|
+
chargingCardId?: string;
|
|
85
|
+
vehicleId?: string;
|
|
87
86
|
}
|
|
88
87
|
export interface OCPP16StartTransactionRequest {
|
|
89
88
|
connectorId: number;
|
|
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ConnectorStatusEnumType = exports.RegistrationStatusEnumType = exports.OCPP201Action = void 0;
|
|
4
4
|
var OCPP201Action;
|
|
5
5
|
(function (OCPP201Action) {
|
|
6
|
-
|
|
6
|
+
/** The authorization is handled by the core and you will get an info if authorized */
|
|
7
|
+
OCPP201Action["AuthorizationInfo"] = "AuthorizationInfo";
|
|
7
8
|
OCPP201Action["BootNotification"] = "BootNotification";
|
|
8
9
|
OCPP201Action["CancelReservation"] = "CancelReservation";
|
|
9
10
|
OCPP201Action["CertificateSigned"] = "CertificateSigned";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare enum OCPP201Action {
|
|
2
|
-
|
|
2
|
+
/** The authorization is handled by the core and you will get an info if authorized */
|
|
3
|
+
AuthorizationInfo = "AuthorizationInfo",
|
|
3
4
|
BootNotification = "BootNotification",
|
|
4
5
|
CancelReservation = "CancelReservation",
|
|
5
6
|
CertificateSigned = "CertificateSigned",
|
|
@@ -112,7 +113,9 @@ export interface OCPP201StatusNotificationRequest {
|
|
|
112
113
|
}
|
|
113
114
|
export interface OCPP201StatusNotificationResponse {
|
|
114
115
|
}
|
|
115
|
-
export interface
|
|
116
|
+
export interface OCPP201AuthorizationInfoRequest {
|
|
117
|
+
chargingCardId?: string;
|
|
118
|
+
vehicleId?: string;
|
|
116
119
|
idToken: {
|
|
117
120
|
idToken: string;
|
|
118
121
|
type: 'Central' | 'eMAID' | 'ISO14443' | 'ISO15693' | 'KeyCode' | 'Local' | 'MacAddress' | 'NoAuthorization';
|
|
@@ -121,13 +124,6 @@ export interface OCPP201AuthorizeRequest {
|
|
|
121
124
|
type: string;
|
|
122
125
|
}>;
|
|
123
126
|
};
|
|
124
|
-
certificate?: string;
|
|
125
|
-
iso15118CertificateHashData?: Array<{
|
|
126
|
-
hashAlgorithm: 'SHA256' | 'SHA384' | 'SHA512';
|
|
127
|
-
issuerNameHash: string;
|
|
128
|
-
issuerKeyHash: string;
|
|
129
|
-
serialNumber: string;
|
|
130
|
-
}>;
|
|
131
127
|
}
|
|
132
128
|
export interface OCPP201AuthorizeResponse {
|
|
133
129
|
idTokenInfo: {
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -31,6 +31,12 @@ __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);
|
|
37
|
+
__exportStar(require("./types/enyo-electricity-tariff.cjs"), exports);
|
|
38
|
+
__exportStar(require("./packages/energy-app-electricity-tariff.cjs"), exports);
|
|
39
|
+
__exportStar(require("./types/enyo-pv-forecast.cjs"), exports);
|
|
34
40
|
class EnergyApp {
|
|
35
41
|
energyAppSdk;
|
|
36
42
|
constructor() {
|
|
@@ -127,6 +133,32 @@ class EnergyApp {
|
|
|
127
133
|
useLocation() {
|
|
128
134
|
return this.energyAppSdk.useLocation();
|
|
129
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Gets the Timeseries API for querying historical energy data.
|
|
138
|
+
* Provides methods to retrieve aggregated timeseries data with 15-minute bucket granularity
|
|
139
|
+
* for various energy metrics including PV production, battery state, meter values, and grid power.
|
|
140
|
+
* @returns The Timeseries API instance
|
|
141
|
+
*/
|
|
142
|
+
useTimeseries() {
|
|
143
|
+
return this.energyAppSdk.useTimeseries();
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Gets the Energy Manager API for retrieving information about the active energy manager.
|
|
147
|
+
* Provides methods to check the current energy manager and its supported features.
|
|
148
|
+
* @returns The Energy Manager API instance
|
|
149
|
+
*/
|
|
150
|
+
useEnergyManager() {
|
|
151
|
+
return this.energyAppSdk.useEnergyManager();
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Gets the Electricity Tariff API for managing electricity tariffs.
|
|
155
|
+
* Provides methods to register, retrieve, and remove electricity tariffs
|
|
156
|
+
* used for energy pricing and consumption calculations.
|
|
157
|
+
* @returns The Electricity Tariff API instance
|
|
158
|
+
*/
|
|
159
|
+
useElectricityTariff() {
|
|
160
|
+
return this.energyAppSdk.useElectricityTariff();
|
|
161
|
+
}
|
|
130
162
|
/**
|
|
131
163
|
* Gets the current SDK version.
|
|
132
164
|
* @returns The semantic version string of the SDK
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -16,7 +16,10 @@ 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";
|
|
22
|
+
import { EnergyAppElectricityTariff } from "./packages/energy-app-electricity-tariff.cjs";
|
|
20
23
|
export * from './energy-app-package-definition.cjs';
|
|
21
24
|
export * from './version.cjs';
|
|
22
25
|
export * from './implementations/ocpp/ocpp16.cjs';
|
|
@@ -32,6 +35,12 @@ export * from './types/enyo-location.cjs';
|
|
|
32
35
|
export * from './implementations/appliances/appliance-manager.cjs';
|
|
33
36
|
export * from './implementations/appliances/identifier-strategies.cjs';
|
|
34
37
|
export * from './enyo-package-channel.cjs';
|
|
38
|
+
export * from './types/enyo-timeseries.cjs';
|
|
39
|
+
export * from './types/enyo-energy-manager.cjs';
|
|
40
|
+
export * from './packages/energy-app-energy-manager.cjs';
|
|
41
|
+
export * from './types/enyo-electricity-tariff.cjs';
|
|
42
|
+
export * from './packages/energy-app-electricity-tariff.cjs';
|
|
43
|
+
export * from './types/enyo-pv-forecast.cjs';
|
|
35
44
|
export declare class EnergyApp implements EnyoEnergyAppSdk {
|
|
36
45
|
private readonly energyAppSdk;
|
|
37
46
|
constructor();
|
|
@@ -67,6 +76,26 @@ export declare class EnergyApp implements EnyoEnergyAppSdk {
|
|
|
67
76
|
* @returns The Location API instance
|
|
68
77
|
*/
|
|
69
78
|
useLocation(): EnergyAppLocation;
|
|
79
|
+
/**
|
|
80
|
+
* Gets the Timeseries API for querying historical energy data.
|
|
81
|
+
* Provides methods to retrieve aggregated timeseries data with 15-minute bucket granularity
|
|
82
|
+
* for various energy metrics including PV production, battery state, meter values, and grid power.
|
|
83
|
+
* @returns The Timeseries API instance
|
|
84
|
+
*/
|
|
85
|
+
useTimeseries(): EnergyAppTimeseries;
|
|
86
|
+
/**
|
|
87
|
+
* Gets the Energy Manager API for retrieving information about the active energy manager.
|
|
88
|
+
* Provides methods to check the current energy manager and its supported features.
|
|
89
|
+
* @returns The Energy Manager API instance
|
|
90
|
+
*/
|
|
91
|
+
useEnergyManager(): EnergyAppEnergyManager;
|
|
92
|
+
/**
|
|
93
|
+
* Gets the Electricity Tariff API for managing electricity tariffs.
|
|
94
|
+
* Provides methods to register, retrieve, and remove electricity tariffs
|
|
95
|
+
* used for energy pricing and consumption calculations.
|
|
96
|
+
* @returns The Electricity Tariff API instance
|
|
97
|
+
*/
|
|
98
|
+
useElectricityTariff(): EnergyAppElectricityTariff;
|
|
70
99
|
/**
|
|
71
100
|
* Gets the current SDK version.
|
|
72
101
|
* @returns The semantic version string of the SDK
|
|
@@ -45,6 +45,21 @@ export interface EnergyAppElectricityPrices {
|
|
|
45
45
|
* @returns Promise that resolves to current price information, or null if no pricing data is available
|
|
46
46
|
*/
|
|
47
47
|
getCurrentPrice(applianceId?: string): Promise<ElectricityPriceEntry | null>;
|
|
48
|
+
/**
|
|
49
|
+
* Retrieves the system default tariff information.
|
|
50
|
+
* Returns the full tariff including pricing data.
|
|
51
|
+
*
|
|
52
|
+
* @returns Promise that resolves to the default tariff info, or null if none is configured
|
|
53
|
+
*/
|
|
54
|
+
getDefaultTariff(): Promise<EnergyTariffInfo | null>;
|
|
55
|
+
/**
|
|
56
|
+
* Retrieves tariff information by tariff ID.
|
|
57
|
+
* Returns the full tariff including pricing data.
|
|
58
|
+
*
|
|
59
|
+
* @param tariffId - The unique identifier of the tariff
|
|
60
|
+
* @returns Promise that resolves to the tariff info, or null if not found
|
|
61
|
+
*/
|
|
62
|
+
getTariffById(tariffId: string): Promise<EnergyTariffInfo | null>;
|
|
48
63
|
}
|
|
49
64
|
/**
|
|
50
65
|
* Represents a single electricity price entry for convenience methods
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ElectricityTariffRegistration, ElectricityTariffWithDefault } from "../types/enyo-electricity-tariff.cjs";
|
|
2
|
+
/**
|
|
3
|
+
* Interface for managing electricity tariffs.
|
|
4
|
+
* Provides methods to register, retrieve, and remove electricity tariffs
|
|
5
|
+
* used for energy pricing and consumption calculations.
|
|
6
|
+
*/
|
|
7
|
+
export interface EnergyAppElectricityTariff {
|
|
8
|
+
/**
|
|
9
|
+
* Registers a new electricity tariff or updates an existing one.
|
|
10
|
+
* Uses upsert logic based on tariffId - if a tariff with the same ID exists,
|
|
11
|
+
* it will be updated; otherwise, a new tariff will be created.
|
|
12
|
+
*
|
|
13
|
+
* @param tariff - The tariff registration data including ID, type, name, and vendor
|
|
14
|
+
* @returns Promise that resolves when the tariff has been registered
|
|
15
|
+
*/
|
|
16
|
+
registerTariff(tariff: ElectricityTariffRegistration): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Retrieves all registered electricity tariffs.
|
|
19
|
+
* Each tariff includes a defaultTariff boolean indicating whether
|
|
20
|
+
* it is the system default tariff.
|
|
21
|
+
*
|
|
22
|
+
* @returns Promise that resolves to an array of all registered tariffs with default indicators
|
|
23
|
+
*/
|
|
24
|
+
getAllTariffs(): Promise<ElectricityTariffWithDefault[]>;
|
|
25
|
+
/**
|
|
26
|
+
* Removes an electricity tariff by its ID.
|
|
27
|
+
* If the tariff does not exist, this operation is a no-op.
|
|
28
|
+
*
|
|
29
|
+
* @param tariffId - The unique identifier of the tariff to remove
|
|
30
|
+
* @returns Promise that resolves when the tariff has been removed
|
|
31
|
+
*/
|
|
32
|
+
removeTariff(tariffId: string): Promise<void>;
|
|
33
|
+
}
|
|
@@ -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,7 @@ 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";
|
|
108
|
+
EnyoDataBusMessageEnum["PvForecastV1"] = "PvForecastV1";
|
|
106
109
|
})(EnyoDataBusMessageEnum || (exports.EnyoDataBusMessageEnum = EnyoDataBusMessageEnum = {}));
|