@enyo-energy/energy-app-sdk 0.0.60 → 0.0.62
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/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 +3 -0
- package/dist/cjs/index.cjs +9 -0
- package/dist/cjs/index.d.cts +8 -0
- 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.cjs +1 -0
- package/dist/cjs/types/enyo-data-bus-value.d.cts +23 -10
- package/dist/cjs/types/enyo-energy-manager.d.cts +2 -0
- package/dist/cjs/version.cjs +1 -1
- package/dist/cjs/version.d.cts +1 -1
- 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 +3 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +9 -0
- 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 +23 -10
- package/dist/types/enyo-data-bus-value.js +1 -0
- package/dist/types/enyo-energy-manager.d.ts +2 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -30,4 +30,7 @@ var EnergyAppPermissionTypeEnum;
|
|
|
30
30
|
EnergyAppPermissionTypeEnum["PvForecastUse"] = "PvForecastUse";
|
|
31
31
|
EnergyAppPermissionTypeEnum["PvSystemRegister"] = "PvSystemRegister";
|
|
32
32
|
EnergyAppPermissionTypeEnum["PvSystemUse"] = "PvSystemUse";
|
|
33
|
+
EnergyAppPermissionTypeEnum["InverterControlCommands"] = "InverterControlCommands";
|
|
34
|
+
EnergyAppPermissionTypeEnum["BatteryControlCommands"] = "BatteryControlCommands";
|
|
35
|
+
EnergyAppPermissionTypeEnum["ChargerControlCommands"] = "ChargerControlCommands";
|
|
33
36
|
})(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' | 'Timeseries' | 'EnergyManagerInfo' | 'ElectricityTariff' | 'WeatherForecastRegister' | 'WeatherForecastUse' | 'PvForecastRegister' | 'PvForecastUse' | 'PvSystemRegister' | 'PvSystemUse';
|
|
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' | 'WeatherForecastRegister' | 'WeatherForecastUse' | 'PvForecastRegister' | 'PvForecastUse' | 'PvSystemRegister' | 'PvSystemUse' | 'InverterControlCommands' | 'BatteryControlCommands' | 'ChargerControlCommands';
|
|
2
2
|
export declare enum EnergyAppPermissionTypeEnum {
|
|
3
3
|
RestrictedInternetAccess = "RestrictedInternetAccess",
|
|
4
4
|
NetworkDeviceDiscovery = "NetworkDeviceDiscovery",
|
|
@@ -26,5 +26,8 @@ export declare enum EnergyAppPermissionTypeEnum {
|
|
|
26
26
|
PvForecastRegister = "PvForecastRegister",
|
|
27
27
|
PvForecastUse = "PvForecastUse",
|
|
28
28
|
PvSystemRegister = "PvSystemRegister",
|
|
29
|
-
PvSystemUse = "PvSystemUse"
|
|
29
|
+
PvSystemUse = "PvSystemUse",
|
|
30
|
+
InverterControlCommands = "InverterControlCommands",
|
|
31
|
+
BatteryControlCommands = "BatteryControlCommands",
|
|
32
|
+
ChargerControlCommands = "ChargerControlCommands"
|
|
30
33
|
}
|
|
@@ -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",
|
|
@@ -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
|
@@ -43,6 +43,7 @@ __exportStar(require("./packages/energy-app-pv-forecasting.cjs"), exports);
|
|
|
43
43
|
__exportStar(require("./types/enyo-pv-system.cjs"), exports);
|
|
44
44
|
__exportStar(require("./packages/energy-app-pv-system.cjs"), exports);
|
|
45
45
|
__exportStar(require("./implementations/data-bus/data-bus-command-handler.cjs"), exports);
|
|
46
|
+
__exportStar(require("./packages/energy-app-sequence-generator.cjs"), exports);
|
|
46
47
|
class EnergyApp {
|
|
47
48
|
energyAppSdk;
|
|
48
49
|
constructor() {
|
|
@@ -191,6 +192,14 @@ class EnergyApp {
|
|
|
191
192
|
usePvSystem() {
|
|
192
193
|
return this.energyAppSdk.usePvSystem();
|
|
193
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* Gets the Sequence Generator API for generating unique sequential numbers per named sequence.
|
|
197
|
+
* Each sequence is identified by a string name and maintains its own independent counter.
|
|
198
|
+
* @returns The Sequence Generator API instance
|
|
199
|
+
*/
|
|
200
|
+
useSequenceGenerator() {
|
|
201
|
+
return this.energyAppSdk.useSequenceGenerator();
|
|
202
|
+
}
|
|
194
203
|
/**
|
|
195
204
|
* Gets the current SDK version.
|
|
196
205
|
* @returns The semantic version string of the SDK
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -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';
|
|
@@ -50,6 +51,7 @@ export * from './packages/energy-app-pv-forecasting.cjs';
|
|
|
50
51
|
export * from './types/enyo-pv-system.cjs';
|
|
51
52
|
export * from './packages/energy-app-pv-system.cjs';
|
|
52
53
|
export * from './implementations/data-bus/data-bus-command-handler.cjs';
|
|
54
|
+
export * from './packages/energy-app-sequence-generator.cjs';
|
|
53
55
|
export declare class EnergyApp implements EnyoEnergyAppSdk {
|
|
54
56
|
private readonly energyAppSdk;
|
|
55
57
|
constructor();
|
|
@@ -125,6 +127,12 @@ export declare class EnergyApp implements EnyoEnergyAppSdk {
|
|
|
125
127
|
* @returns The PV System API instance
|
|
126
128
|
*/
|
|
127
129
|
usePvSystem(): EnergyAppPvSystem;
|
|
130
|
+
/**
|
|
131
|
+
* Gets the Sequence Generator API for generating unique sequential numbers per named sequence.
|
|
132
|
+
* Each sequence is identified by a string name and maintains its own independent counter.
|
|
133
|
+
* @returns The Sequence Generator API instance
|
|
134
|
+
*/
|
|
135
|
+
useSequenceGenerator(): EnergyAppSequenceGenerator;
|
|
128
136
|
/**
|
|
129
137
|
* Gets the current SDK version.
|
|
130
138
|
* @returns The semantic version string of the SDK
|
|
@@ -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
|
+
}
|
|
@@ -111,6 +111,7 @@ var EnyoDataBusMessageEnum;
|
|
|
111
111
|
EnyoDataBusMessageEnum["StartStorageGridChargeV1"] = "StartStorageGridChargeV1";
|
|
112
112
|
EnyoDataBusMessageEnum["StopStorageGridChargeV1"] = "StopStorageGridChargeV1";
|
|
113
113
|
EnyoDataBusMessageEnum["SetStorageDischargeLimitV1"] = "SetStorageDischargeLimitV1";
|
|
114
|
+
EnyoDataBusMessageEnum["SetInverterFeedInLimitV1"] = "SetInverterFeedInLimitV1";
|
|
114
115
|
EnyoDataBusMessageEnum["CommandAcknowledgeV1"] = "CommandAcknowledgeV1";
|
|
115
116
|
})(EnyoDataBusMessageEnum || (exports.EnyoDataBusMessageEnum = EnyoDataBusMessageEnum = {}));
|
|
116
117
|
/**
|
|
@@ -146,6 +146,7 @@ export declare enum EnyoDataBusMessageEnum {
|
|
|
146
146
|
StartStorageGridChargeV1 = "StartStorageGridChargeV1",
|
|
147
147
|
StopStorageGridChargeV1 = "StopStorageGridChargeV1",
|
|
148
148
|
SetStorageDischargeLimitV1 = "SetStorageDischargeLimitV1",
|
|
149
|
+
SetInverterFeedInLimitV1 = "SetInverterFeedInLimitV1",
|
|
149
150
|
CommandAcknowledgeV1 = "CommandAcknowledgeV1"
|
|
150
151
|
}
|
|
151
152
|
export type EnyoDataBusMessageResolution = '10s' | '30s' | '1m' | '15m' | '1h' | '1d' | 'dynamic';
|
|
@@ -446,16 +447,16 @@ export interface EnyoDataBusResumeChargingV1 extends EnyoDataBusMessage {
|
|
|
446
447
|
export interface EnyoDataBusChangeChargingPowerV1 extends EnyoDataBusMessage {
|
|
447
448
|
type: 'message';
|
|
448
449
|
message: EnyoDataBusMessageEnum.ChangeChargingPowerV1;
|
|
450
|
+
applianceId: string;
|
|
449
451
|
data: {
|
|
450
|
-
applianceId: string;
|
|
451
452
|
maxChargingPowerKw: number;
|
|
452
453
|
};
|
|
453
454
|
}
|
|
454
455
|
export interface EnyoDataBusSetChargingScheduleV1 extends EnyoDataBusMessage {
|
|
455
456
|
type: 'message';
|
|
456
457
|
message: EnyoDataBusMessageEnum.SetChargingScheduleV1;
|
|
458
|
+
applianceId: string;
|
|
457
459
|
data: {
|
|
458
|
-
applianceId: string;
|
|
459
460
|
relativeSchedule: EnyoOcppRelativeSchedule[];
|
|
460
461
|
};
|
|
461
462
|
}
|
|
@@ -466,9 +467,8 @@ export interface EnyoDataBusSetChargingScheduleV1 extends EnyoDataBusMessage {
|
|
|
466
467
|
export interface EnyoDataBusStartChargeV1 extends EnyoDataBusMessage {
|
|
467
468
|
type: 'message';
|
|
468
469
|
message: EnyoDataBusMessageEnum.StartChargeV1;
|
|
470
|
+
applianceId: string;
|
|
469
471
|
data: {
|
|
470
|
-
/** ID of the appliance (charger) to start charging on */
|
|
471
|
-
applianceId: string;
|
|
472
472
|
/** OCPP idTag for authorization */
|
|
473
473
|
idTag: string;
|
|
474
474
|
/** Unique request identifier for tracking this start request */
|
|
@@ -490,9 +490,8 @@ export interface EnyoDataBusStartChargeV1 extends EnyoDataBusMessage {
|
|
|
490
490
|
export interface EnyoDataBusStopChargeV1 extends EnyoDataBusMessage {
|
|
491
491
|
type: 'message';
|
|
492
492
|
message: EnyoDataBusMessageEnum.StopChargeV1;
|
|
493
|
+
applianceId: string;
|
|
493
494
|
data: {
|
|
494
|
-
/** ID of the appliance (charger) to stop */
|
|
495
|
-
applianceId: string;
|
|
496
495
|
/** OCPP transaction identifier of the session to stop */
|
|
497
496
|
transactionId: string;
|
|
498
497
|
};
|
|
@@ -586,11 +585,10 @@ export interface EnyoDataBusRequestPreviewChargingScheduleV1 extends EnyoDataBus
|
|
|
586
585
|
export interface EnyoDataBusPreviewChargingScheduleResponseV1 extends EnyoDataBusMessage {
|
|
587
586
|
type: 'message';
|
|
588
587
|
message: EnyoDataBusMessageEnum.PreviewChargingScheduleResponseV1;
|
|
588
|
+
applianceId: string;
|
|
589
589
|
data: {
|
|
590
590
|
/** The request ID this response corresponds to */
|
|
591
591
|
requestId: string;
|
|
592
|
-
/** ID of the appliance this schedule is for */
|
|
593
|
-
applianceId: string;
|
|
594
592
|
/** Whether a preview charging schedule is available */
|
|
595
593
|
available: boolean;
|
|
596
594
|
/** The preview charging schedule (only present if available=true) */
|
|
@@ -650,8 +648,23 @@ export interface EnyoDataBusSetStorageDischargeLimitV1 extends EnyoDataBusMessag
|
|
|
650
648
|
/** ID of the battery/storage appliance to limit */
|
|
651
649
|
applianceId: string;
|
|
652
650
|
data: {
|
|
653
|
-
/** Discharge limit
|
|
654
|
-
|
|
651
|
+
/** Discharge limit in W to limit the battery's discharge power */
|
|
652
|
+
dischargeLimitW: number;
|
|
653
|
+
};
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* Command message to set or reset the inverter's grid feed-in power limit.
|
|
657
|
+
* When a limit is set, the inverter will not feed more than the specified power into the grid.
|
|
658
|
+
* When set to null, the feed-in limit is removed and the inverter returns to default behavior.
|
|
659
|
+
*/
|
|
660
|
+
export interface EnyoDataBusSetInverterFeedInLimitV1 extends EnyoDataBusMessage {
|
|
661
|
+
type: 'message';
|
|
662
|
+
message: EnyoDataBusMessageEnum.SetInverterFeedInLimitV1;
|
|
663
|
+
/** ID of the inverter appliance to limit */
|
|
664
|
+
applianceId: string;
|
|
665
|
+
data: {
|
|
666
|
+
/** Feed-in limit in watts, or null to reset to default (no limit) */
|
|
667
|
+
feedInLimitW: number | null;
|
|
655
668
|
};
|
|
656
669
|
}
|
|
657
670
|
/**
|
|
@@ -55,6 +55,8 @@ export interface PreviewChargingSchedule {
|
|
|
55
55
|
totalEnergyWh: number;
|
|
56
56
|
/** Estimated completion time as ISO timestamp */
|
|
57
57
|
estimatedCompletionIso: string;
|
|
58
|
+
estimatedKwhCharged?: number;
|
|
59
|
+
estimatedChargingCostCents?: number;
|
|
58
60
|
}
|
|
59
61
|
/**
|
|
60
62
|
* Cost comparison between optimized and immediate charging.
|
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.62';
|
|
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
|
@@ -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' | 'Timeseries' | 'EnergyManagerInfo' | 'ElectricityTariff' | 'WeatherForecastRegister' | 'WeatherForecastUse' | 'PvForecastRegister' | 'PvForecastUse' | 'PvSystemRegister' | 'PvSystemUse';
|
|
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' | 'WeatherForecastRegister' | 'WeatherForecastUse' | 'PvForecastRegister' | 'PvForecastUse' | 'PvSystemRegister' | 'PvSystemUse' | 'InverterControlCommands' | 'BatteryControlCommands' | 'ChargerControlCommands';
|
|
2
2
|
export declare enum EnergyAppPermissionTypeEnum {
|
|
3
3
|
RestrictedInternetAccess = "RestrictedInternetAccess",
|
|
4
4
|
NetworkDeviceDiscovery = "NetworkDeviceDiscovery",
|
|
@@ -26,5 +26,8 @@ export declare enum EnergyAppPermissionTypeEnum {
|
|
|
26
26
|
PvForecastRegister = "PvForecastRegister",
|
|
27
27
|
PvForecastUse = "PvForecastUse",
|
|
28
28
|
PvSystemRegister = "PvSystemRegister",
|
|
29
|
-
PvSystemUse = "PvSystemUse"
|
|
29
|
+
PvSystemUse = "PvSystemUse",
|
|
30
|
+
InverterControlCommands = "InverterControlCommands",
|
|
31
|
+
BatteryControlCommands = "BatteryControlCommands",
|
|
32
|
+
ChargerControlCommands = "ChargerControlCommands"
|
|
30
33
|
}
|
|
@@ -27,4 +27,7 @@ export var EnergyAppPermissionTypeEnum;
|
|
|
27
27
|
EnergyAppPermissionTypeEnum["PvForecastUse"] = "PvForecastUse";
|
|
28
28
|
EnergyAppPermissionTypeEnum["PvSystemRegister"] = "PvSystemRegister";
|
|
29
29
|
EnergyAppPermissionTypeEnum["PvSystemUse"] = "PvSystemUse";
|
|
30
|
+
EnergyAppPermissionTypeEnum["InverterControlCommands"] = "InverterControlCommands";
|
|
31
|
+
EnergyAppPermissionTypeEnum["BatteryControlCommands"] = "BatteryControlCommands";
|
|
32
|
+
EnergyAppPermissionTypeEnum["ChargerControlCommands"] = "ChargerControlCommands";
|
|
30
33
|
})(EnergyAppPermissionTypeEnum || (EnergyAppPermissionTypeEnum = {}));
|
|
@@ -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",
|
|
@@ -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
|
@@ -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';
|
|
@@ -50,6 +51,7 @@ export * from './packages/energy-app-pv-forecasting.js';
|
|
|
50
51
|
export * from './types/enyo-pv-system.js';
|
|
51
52
|
export * from './packages/energy-app-pv-system.js';
|
|
52
53
|
export * from './implementations/data-bus/data-bus-command-handler.js';
|
|
54
|
+
export * from './packages/energy-app-sequence-generator.js';
|
|
53
55
|
export declare class EnergyApp implements EnyoEnergyAppSdk {
|
|
54
56
|
private readonly energyAppSdk;
|
|
55
57
|
constructor();
|
|
@@ -125,6 +127,12 @@ export declare class EnergyApp implements EnyoEnergyAppSdk {
|
|
|
125
127
|
* @returns The PV System API instance
|
|
126
128
|
*/
|
|
127
129
|
usePvSystem(): EnergyAppPvSystem;
|
|
130
|
+
/**
|
|
131
|
+
* Gets the Sequence Generator API for generating unique sequential numbers per named sequence.
|
|
132
|
+
* Each sequence is identified by a string name and maintains its own independent counter.
|
|
133
|
+
* @returns The Sequence Generator API instance
|
|
134
|
+
*/
|
|
135
|
+
useSequenceGenerator(): EnergyAppSequenceGenerator;
|
|
128
136
|
/**
|
|
129
137
|
* Gets the current SDK version.
|
|
130
138
|
* @returns The semantic version string of the SDK
|
package/dist/index.js
CHANGED
|
@@ -26,6 +26,7 @@ export * from './packages/energy-app-pv-forecasting.js';
|
|
|
26
26
|
export * from './types/enyo-pv-system.js';
|
|
27
27
|
export * from './packages/energy-app-pv-system.js';
|
|
28
28
|
export * from './implementations/data-bus/data-bus-command-handler.js';
|
|
29
|
+
export * from './packages/energy-app-sequence-generator.js';
|
|
29
30
|
export class EnergyApp {
|
|
30
31
|
energyAppSdk;
|
|
31
32
|
constructor() {
|
|
@@ -174,6 +175,14 @@ export class EnergyApp {
|
|
|
174
175
|
usePvSystem() {
|
|
175
176
|
return this.energyAppSdk.usePvSystem();
|
|
176
177
|
}
|
|
178
|
+
/**
|
|
179
|
+
* Gets the Sequence Generator API for generating unique sequential numbers per named sequence.
|
|
180
|
+
* Each sequence is identified by a string name and maintains its own independent counter.
|
|
181
|
+
* @returns The Sequence Generator API instance
|
|
182
|
+
*/
|
|
183
|
+
useSequenceGenerator() {
|
|
184
|
+
return this.energyAppSdk.useSequenceGenerator();
|
|
185
|
+
}
|
|
177
186
|
/**
|
|
178
187
|
* Gets the current SDK version.
|
|
179
188
|
* @returns The semantic version string of the SDK
|
|
@@ -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 {};
|
|
@@ -146,6 +146,7 @@ export declare enum EnyoDataBusMessageEnum {
|
|
|
146
146
|
StartStorageGridChargeV1 = "StartStorageGridChargeV1",
|
|
147
147
|
StopStorageGridChargeV1 = "StopStorageGridChargeV1",
|
|
148
148
|
SetStorageDischargeLimitV1 = "SetStorageDischargeLimitV1",
|
|
149
|
+
SetInverterFeedInLimitV1 = "SetInverterFeedInLimitV1",
|
|
149
150
|
CommandAcknowledgeV1 = "CommandAcknowledgeV1"
|
|
150
151
|
}
|
|
151
152
|
export type EnyoDataBusMessageResolution = '10s' | '30s' | '1m' | '15m' | '1h' | '1d' | 'dynamic';
|
|
@@ -446,16 +447,16 @@ export interface EnyoDataBusResumeChargingV1 extends EnyoDataBusMessage {
|
|
|
446
447
|
export interface EnyoDataBusChangeChargingPowerV1 extends EnyoDataBusMessage {
|
|
447
448
|
type: 'message';
|
|
448
449
|
message: EnyoDataBusMessageEnum.ChangeChargingPowerV1;
|
|
450
|
+
applianceId: string;
|
|
449
451
|
data: {
|
|
450
|
-
applianceId: string;
|
|
451
452
|
maxChargingPowerKw: number;
|
|
452
453
|
};
|
|
453
454
|
}
|
|
454
455
|
export interface EnyoDataBusSetChargingScheduleV1 extends EnyoDataBusMessage {
|
|
455
456
|
type: 'message';
|
|
456
457
|
message: EnyoDataBusMessageEnum.SetChargingScheduleV1;
|
|
458
|
+
applianceId: string;
|
|
457
459
|
data: {
|
|
458
|
-
applianceId: string;
|
|
459
460
|
relativeSchedule: EnyoOcppRelativeSchedule[];
|
|
460
461
|
};
|
|
461
462
|
}
|
|
@@ -466,9 +467,8 @@ export interface EnyoDataBusSetChargingScheduleV1 extends EnyoDataBusMessage {
|
|
|
466
467
|
export interface EnyoDataBusStartChargeV1 extends EnyoDataBusMessage {
|
|
467
468
|
type: 'message';
|
|
468
469
|
message: EnyoDataBusMessageEnum.StartChargeV1;
|
|
470
|
+
applianceId: string;
|
|
469
471
|
data: {
|
|
470
|
-
/** ID of the appliance (charger) to start charging on */
|
|
471
|
-
applianceId: string;
|
|
472
472
|
/** OCPP idTag for authorization */
|
|
473
473
|
idTag: string;
|
|
474
474
|
/** Unique request identifier for tracking this start request */
|
|
@@ -490,9 +490,8 @@ export interface EnyoDataBusStartChargeV1 extends EnyoDataBusMessage {
|
|
|
490
490
|
export interface EnyoDataBusStopChargeV1 extends EnyoDataBusMessage {
|
|
491
491
|
type: 'message';
|
|
492
492
|
message: EnyoDataBusMessageEnum.StopChargeV1;
|
|
493
|
+
applianceId: string;
|
|
493
494
|
data: {
|
|
494
|
-
/** ID of the appliance (charger) to stop */
|
|
495
|
-
applianceId: string;
|
|
496
495
|
/** OCPP transaction identifier of the session to stop */
|
|
497
496
|
transactionId: string;
|
|
498
497
|
};
|
|
@@ -586,11 +585,10 @@ export interface EnyoDataBusRequestPreviewChargingScheduleV1 extends EnyoDataBus
|
|
|
586
585
|
export interface EnyoDataBusPreviewChargingScheduleResponseV1 extends EnyoDataBusMessage {
|
|
587
586
|
type: 'message';
|
|
588
587
|
message: EnyoDataBusMessageEnum.PreviewChargingScheduleResponseV1;
|
|
588
|
+
applianceId: string;
|
|
589
589
|
data: {
|
|
590
590
|
/** The request ID this response corresponds to */
|
|
591
591
|
requestId: string;
|
|
592
|
-
/** ID of the appliance this schedule is for */
|
|
593
|
-
applianceId: string;
|
|
594
592
|
/** Whether a preview charging schedule is available */
|
|
595
593
|
available: boolean;
|
|
596
594
|
/** The preview charging schedule (only present if available=true) */
|
|
@@ -650,8 +648,23 @@ export interface EnyoDataBusSetStorageDischargeLimitV1 extends EnyoDataBusMessag
|
|
|
650
648
|
/** ID of the battery/storage appliance to limit */
|
|
651
649
|
applianceId: string;
|
|
652
650
|
data: {
|
|
653
|
-
/** Discharge limit
|
|
654
|
-
|
|
651
|
+
/** Discharge limit in W to limit the battery's discharge power */
|
|
652
|
+
dischargeLimitW: number;
|
|
653
|
+
};
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* Command message to set or reset the inverter's grid feed-in power limit.
|
|
657
|
+
* When a limit is set, the inverter will not feed more than the specified power into the grid.
|
|
658
|
+
* When set to null, the feed-in limit is removed and the inverter returns to default behavior.
|
|
659
|
+
*/
|
|
660
|
+
export interface EnyoDataBusSetInverterFeedInLimitV1 extends EnyoDataBusMessage {
|
|
661
|
+
type: 'message';
|
|
662
|
+
message: EnyoDataBusMessageEnum.SetInverterFeedInLimitV1;
|
|
663
|
+
/** ID of the inverter appliance to limit */
|
|
664
|
+
applianceId: string;
|
|
665
|
+
data: {
|
|
666
|
+
/** Feed-in limit in watts, or null to reset to default (no limit) */
|
|
667
|
+
feedInLimitW: number | null;
|
|
655
668
|
};
|
|
656
669
|
}
|
|
657
670
|
/**
|
|
@@ -108,6 +108,7 @@ export var EnyoDataBusMessageEnum;
|
|
|
108
108
|
EnyoDataBusMessageEnum["StartStorageGridChargeV1"] = "StartStorageGridChargeV1";
|
|
109
109
|
EnyoDataBusMessageEnum["StopStorageGridChargeV1"] = "StopStorageGridChargeV1";
|
|
110
110
|
EnyoDataBusMessageEnum["SetStorageDischargeLimitV1"] = "SetStorageDischargeLimitV1";
|
|
111
|
+
EnyoDataBusMessageEnum["SetInverterFeedInLimitV1"] = "SetInverterFeedInLimitV1";
|
|
111
112
|
EnyoDataBusMessageEnum["CommandAcknowledgeV1"] = "CommandAcknowledgeV1";
|
|
112
113
|
})(EnyoDataBusMessageEnum || (EnyoDataBusMessageEnum = {}));
|
|
113
114
|
/**
|
|
@@ -55,6 +55,8 @@ export interface PreviewChargingSchedule {
|
|
|
55
55
|
totalEnergyWh: number;
|
|
56
56
|
/** Estimated completion time as ISO timestamp */
|
|
57
57
|
estimatedCompletionIso: string;
|
|
58
|
+
estimatedKwhCharged?: number;
|
|
59
|
+
estimatedChargingCostCents?: number;
|
|
58
60
|
}
|
|
59
61
|
/**
|
|
60
62
|
* Cost comparison between optimized and immediate charging.
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED