@enyo-energy/energy-app-sdk 0.0.68 → 0.0.70
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-package-definition.cjs +1 -0
- package/dist/cjs/energy-app-package-definition.d.cts +6 -1
- package/dist/cjs/energy-app-permission.type.cjs +1 -0
- package/dist/cjs/energy-app-permission.type.d.cts +2 -1
- package/dist/cjs/enyo-energy-app-sdk.d.cts +3 -0
- package/dist/cjs/index.cjs +10 -0
- package/dist/cjs/index.d.cts +9 -0
- package/dist/cjs/packages/energy-app-modbus-rtu.cjs +2 -0
- package/dist/cjs/packages/energy-app-modbus-rtu.d.cts +63 -0
- package/dist/cjs/types/enyo-forecasting.cjs +11 -1
- package/dist/cjs/types/enyo-forecasting.d.cts +9 -0
- package/dist/cjs/version.cjs +1 -1
- package/dist/cjs/version.d.cts +1 -1
- package/dist/energy-app-package-definition.d.ts +6 -1
- package/dist/energy-app-package-definition.js +1 -0
- package/dist/energy-app-permission.type.d.ts +2 -1
- package/dist/energy-app-permission.type.js +1 -0
- package/dist/enyo-energy-app-sdk.d.ts +3 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +10 -0
- package/dist/packages/energy-app-modbus-rtu.d.ts +63 -0
- package/dist/packages/energy-app-modbus-rtu.js +1 -0
- package/dist/types/enyo-forecasting.d.ts +9 -0
- package/dist/types/enyo-forecasting.js +10 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -14,6 +14,7 @@ var EnergyAppPackageCategory;
|
|
|
14
14
|
EnergyAppPackageCategory["ClimateControl"] = "climate-control";
|
|
15
15
|
EnergyAppPackageCategory["DynamicElectricityTariff"] = "dynamic-electricity-tariff";
|
|
16
16
|
EnergyAppPackageCategory["StaticElectricityTariff"] = "static-electricity-tariff";
|
|
17
|
+
EnergyAppPackageCategory["Other"] = "other";
|
|
17
18
|
})(EnergyAppPackageCategory || (exports.EnergyAppPackageCategory = EnergyAppPackageCategory = {}));
|
|
18
19
|
/**
|
|
19
20
|
* Defines an Energy App package with automatic SDK version injection.
|
|
@@ -9,7 +9,8 @@ export declare enum EnergyAppPackageCategory {
|
|
|
9
9
|
BatteryStorage = "battery-storage",
|
|
10
10
|
ClimateControl = "climate-control",
|
|
11
11
|
DynamicElectricityTariff = "dynamic-electricity-tariff",
|
|
12
|
-
StaticElectricityTariff = "static-electricity-tariff"
|
|
12
|
+
StaticElectricityTariff = "static-electricity-tariff",
|
|
13
|
+
Other = "other"
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
15
16
|
* Configuration options for restricting internet access in an Energy App package.
|
|
@@ -73,6 +74,8 @@ export interface EnergyAppPackageOptions {
|
|
|
73
74
|
restrictedInternetAccess?: EnergyAppPackageRestrictedInternetAccessOption;
|
|
74
75
|
/** device detection configuration to auto-suggest this energy app on onboarding */
|
|
75
76
|
deviceDetection?: EnergyAppPackageOptionsDeviceDetection;
|
|
77
|
+
/** If your Developer Org is allowed to auto install packages and the device is sold via your Distributor account, you can auto install packages*/
|
|
78
|
+
autoInstall?: boolean;
|
|
76
79
|
}
|
|
77
80
|
/**
|
|
78
81
|
* Localized store entry information for an Energy App package.
|
|
@@ -122,6 +125,8 @@ export interface EnergyAppPackageDefinition {
|
|
|
122
125
|
options?: EnergyAppPackageOptions;
|
|
123
126
|
/** The version of the enyo SDK used to build this package (automatically injected) */
|
|
124
127
|
sdkVersion: string;
|
|
128
|
+
/** If the energy app should be visible in the enyo store. Default is true*/
|
|
129
|
+
showInStore?: boolean;
|
|
125
130
|
}
|
|
126
131
|
/**
|
|
127
132
|
* Defines an Energy App package with automatic SDK version injection.
|
|
@@ -24,6 +24,7 @@ var EnergyAppPermissionTypeEnum;
|
|
|
24
24
|
EnergyAppPermissionTypeEnum["Timeseries"] = "Timeseries";
|
|
25
25
|
EnergyAppPermissionTypeEnum["EnergyManagerInfo"] = "EnergyManagerInfo";
|
|
26
26
|
EnergyAppPermissionTypeEnum["ElectricityTariff"] = "ElectricityTariff";
|
|
27
|
+
EnergyAppPermissionTypeEnum["ModbusRtu"] = "ModbusRtu";
|
|
27
28
|
EnergyAppPermissionTypeEnum["EnergyPrices"] = "EnergyPrices";
|
|
28
29
|
EnergyAppPermissionTypeEnum["WeatherForecastRegister"] = "WeatherForecastRegister";
|
|
29
30
|
EnergyAppPermissionTypeEnum["WeatherForecastUse"] = "WeatherForecastUse";
|
|
@@ -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' | 'InverterControlCommands' | 'BatteryControlCommands' | 'ChargerControlCommands';
|
|
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' | 'ModbusRtu' | 'EnergyPrices';
|
|
2
2
|
export declare enum EnergyAppPermissionTypeEnum {
|
|
3
3
|
RestrictedInternetAccess = "RestrictedInternetAccess",
|
|
4
4
|
NetworkDeviceDiscovery = "NetworkDeviceDiscovery",
|
|
@@ -21,6 +21,7 @@ export declare enum EnergyAppPermissionTypeEnum {
|
|
|
21
21
|
Timeseries = "Timeseries",
|
|
22
22
|
EnergyManagerInfo = "EnergyManagerInfo",
|
|
23
23
|
ElectricityTariff = "ElectricityTariff",
|
|
24
|
+
ModbusRtu = "ModbusRtu",
|
|
24
25
|
EnergyPrices = "EnergyPrices",
|
|
25
26
|
WeatherForecastRegister = "WeatherForecastRegister",
|
|
26
27
|
WeatherForecastUse = "WeatherForecastUse",
|
|
@@ -23,6 +23,7 @@ import { EnergyAppWeatherForecasting } from "./packages/energy-app-weather-forec
|
|
|
23
23
|
import { EnergyAppPvForecasting } from "./packages/energy-app-pv-forecasting.cjs";
|
|
24
24
|
import { EnergyAppPvSystem } from "./packages/energy-app-pv-system.cjs";
|
|
25
25
|
import { EnergyAppSequenceGenerator } from "./packages/energy-app-sequence-generator.cjs";
|
|
26
|
+
import { EnergyAppModbusRtu } from "./packages/energy-app-modbus-rtu.cjs";
|
|
26
27
|
export declare enum EnergyAppStateEnum {
|
|
27
28
|
Launching = "launching",
|
|
28
29
|
Running = "running",
|
|
@@ -95,4 +96,6 @@ export interface EnyoEnergyAppSdk {
|
|
|
95
96
|
usePvSystem: () => EnergyAppPvSystem;
|
|
96
97
|
/** Get the Sequence Generator API for generating unique sequential numbers per named sequence */
|
|
97
98
|
useSequenceGenerator: () => EnergyAppSequenceGenerator;
|
|
99
|
+
/** Get the Modbus RTU serial communication API */
|
|
100
|
+
useModbusRtu: () => EnergyAppModbusRtu;
|
|
98
101
|
}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -44,6 +44,7 @@ __exportStar(require("./packages/energy-app-pv-system.cjs"), exports);
|
|
|
44
44
|
__exportStar(require("./implementations/data-bus/data-bus-command-handler.cjs"), exports);
|
|
45
45
|
__exportStar(require("./packages/energy-app-sequence-generator.cjs"), exports);
|
|
46
46
|
__exportStar(require("./packages/energy-app-energy-prices.cjs"), exports);
|
|
47
|
+
__exportStar(require("./packages/energy-app-modbus-rtu.cjs"), exports);
|
|
47
48
|
class EnergyApp {
|
|
48
49
|
energyAppSdk;
|
|
49
50
|
constructor() {
|
|
@@ -200,6 +201,15 @@ class EnergyApp {
|
|
|
200
201
|
useSequenceGenerator() {
|
|
201
202
|
return this.energyAppSdk.useSequenceGenerator();
|
|
202
203
|
}
|
|
204
|
+
/**
|
|
205
|
+
* Gets the Modbus RTU serial communication API.
|
|
206
|
+
* Provides methods to connect to Modbus RTU devices over serial ports
|
|
207
|
+
* and read/write registers using slave IDs.
|
|
208
|
+
* @returns The Modbus RTU API instance
|
|
209
|
+
*/
|
|
210
|
+
useModbusRtu() {
|
|
211
|
+
return this.energyAppSdk.useModbusRtu();
|
|
212
|
+
}
|
|
203
213
|
/**
|
|
204
214
|
* Gets the current SDK version.
|
|
205
215
|
* @returns The semantic version string of the SDK
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -24,6 +24,7 @@ import { EnergyAppWeatherForecasting } from "./packages/energy-app-weather-forec
|
|
|
24
24
|
import { EnergyAppPvForecasting } from "./packages/energy-app-pv-forecasting.cjs";
|
|
25
25
|
import { EnergyAppPvSystem } from "./packages/energy-app-pv-system.cjs";
|
|
26
26
|
import { EnergyAppSequenceGenerator } from "./packages/energy-app-sequence-generator.cjs";
|
|
27
|
+
import { EnergyAppModbusRtu } from "./packages/energy-app-modbus-rtu.cjs";
|
|
27
28
|
export * from './energy-app-package-definition.cjs';
|
|
28
29
|
export * from './version.cjs';
|
|
29
30
|
export * from './implementations/ocpp/ocpp16.cjs';
|
|
@@ -52,6 +53,7 @@ export * from './packages/energy-app-pv-system.cjs';
|
|
|
52
53
|
export * from './implementations/data-bus/data-bus-command-handler.cjs';
|
|
53
54
|
export * from './packages/energy-app-sequence-generator.cjs';
|
|
54
55
|
export * from './packages/energy-app-energy-prices.cjs';
|
|
56
|
+
export * from './packages/energy-app-modbus-rtu.cjs';
|
|
55
57
|
export declare class EnergyApp implements EnyoEnergyAppSdk {
|
|
56
58
|
private readonly energyAppSdk;
|
|
57
59
|
constructor();
|
|
@@ -133,6 +135,13 @@ export declare class EnergyApp implements EnyoEnergyAppSdk {
|
|
|
133
135
|
* @returns The Sequence Generator API instance
|
|
134
136
|
*/
|
|
135
137
|
useSequenceGenerator(): EnergyAppSequenceGenerator;
|
|
138
|
+
/**
|
|
139
|
+
* Gets the Modbus RTU serial communication API.
|
|
140
|
+
* Provides methods to connect to Modbus RTU devices over serial ports
|
|
141
|
+
* and read/write registers using slave IDs.
|
|
142
|
+
* @returns The Modbus RTU API instance
|
|
143
|
+
*/
|
|
144
|
+
useModbusRtu(): EnergyAppModbusRtu;
|
|
136
145
|
/**
|
|
137
146
|
* Gets the current SDK version.
|
|
138
147
|
* @returns The semantic version string of the SDK
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration options for establishing a Modbus RTU serial connection.
|
|
3
|
+
*/
|
|
4
|
+
export interface ModbusRtuOptions {
|
|
5
|
+
/** Baud rate for serial communication (default: 9600) */
|
|
6
|
+
baudRate?: number;
|
|
7
|
+
/** Number of data bits per character (default: 8) */
|
|
8
|
+
dataBits?: number;
|
|
9
|
+
/** Number of stop bits (default: 1) */
|
|
10
|
+
stopBits?: number;
|
|
11
|
+
/** Parity mode for error detection (default: 'none') */
|
|
12
|
+
parity?: 'none' | 'even' | 'odd';
|
|
13
|
+
/** Connection timeout in milliseconds */
|
|
14
|
+
timeout?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Request parameters for reading Modbus RTU registers.
|
|
18
|
+
*/
|
|
19
|
+
export interface ModbusRtuReadRegistersRequest {
|
|
20
|
+
/** Slave ID of the target device on the serial bus */
|
|
21
|
+
slaveId: number;
|
|
22
|
+
/** Starting register address to read from */
|
|
23
|
+
startRegister: number;
|
|
24
|
+
/** Number of consecutive registers to read */
|
|
25
|
+
count: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Response containing register values read from a Modbus RTU device.
|
|
29
|
+
* Values are returned as a map of register address to value.
|
|
30
|
+
*/
|
|
31
|
+
export interface ModbusRtuReadRegistersResponse {
|
|
32
|
+
/** Map of register address to its numeric value */
|
|
33
|
+
values: Record<number, number>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Request parameters for writing values to Modbus RTU registers.
|
|
37
|
+
*/
|
|
38
|
+
export interface ModbusRtuWriteRegistersRequest {
|
|
39
|
+
/** Slave ID of the target device on the serial bus */
|
|
40
|
+
slaveId: number;
|
|
41
|
+
/** Starting register address to write to */
|
|
42
|
+
startRegister: number;
|
|
43
|
+
/** Array of values to write to consecutive registers */
|
|
44
|
+
values: number[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Interface representing an active Modbus RTU connection instance.
|
|
48
|
+
* Provides methods for reading and writing registers over a serial connection.
|
|
49
|
+
*/
|
|
50
|
+
export interface EnergyAppModbusRtuInstance {
|
|
51
|
+
/** Read register values from the connected Modbus RTU device */
|
|
52
|
+
readRegisters: (request: ModbusRtuReadRegistersRequest) => Promise<ModbusRtuReadRegistersResponse>;
|
|
53
|
+
/** Write register values to the connected Modbus RTU device */
|
|
54
|
+
writeRegisters: (request: ModbusRtuWriteRegistersRequest) => Promise<void>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Interface for Modbus RTU serial communication in enyo packages.
|
|
58
|
+
* Provides serial-based Modbus communication using slave IDs and register addressing.
|
|
59
|
+
*/
|
|
60
|
+
export interface EnergyAppModbusRtu {
|
|
61
|
+
/** Establish a Modbus RTU connection over a serial port */
|
|
62
|
+
connect: (options: ModbusRtuOptions) => Promise<EnergyAppModbusRtuInstance>;
|
|
63
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WeatherForecastLocationTypeEnum = exports.ForecastResolutionEnum = void 0;
|
|
3
|
+
exports.EnyoPvForecastProviderQualityLevelEnum = exports.WeatherForecastLocationTypeEnum = exports.ForecastResolutionEnum = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Resolution of forecast data entries
|
|
6
6
|
*/
|
|
@@ -23,3 +23,13 @@ var WeatherForecastLocationTypeEnum;
|
|
|
23
23
|
/** Forecast provider requires latitude and longitude coordinates */
|
|
24
24
|
WeatherForecastLocationTypeEnum["Coordinates"] = "coordinates";
|
|
25
25
|
})(WeatherForecastLocationTypeEnum || (exports.WeatherForecastLocationTypeEnum = WeatherForecastLocationTypeEnum = {}));
|
|
26
|
+
// ─── PV Forecasting Types ────────────────────────────────────────────────────
|
|
27
|
+
var EnyoPvForecastProviderQualityLevelEnum;
|
|
28
|
+
(function (EnyoPvForecastProviderQualityLevelEnum) {
|
|
29
|
+
/** High-quality forecast with low expected error margin */
|
|
30
|
+
EnyoPvForecastProviderQualityLevelEnum["High"] = "high";
|
|
31
|
+
/** Medium-quality forecast with moderate expected error margin */
|
|
32
|
+
EnyoPvForecastProviderQualityLevelEnum["Medium"] = "medium";
|
|
33
|
+
/** Low-quality forecast with high expected error margin */
|
|
34
|
+
EnyoPvForecastProviderQualityLevelEnum["Low"] = "low";
|
|
35
|
+
})(EnyoPvForecastProviderQualityLevelEnum || (exports.EnyoPvForecastProviderQualityLevelEnum = EnyoPvForecastProviderQualityLevelEnum = {}));
|
|
@@ -72,6 +72,14 @@ export interface WeatherForecastResponse {
|
|
|
72
72
|
/** Array of weather forecast entries ordered by timestamp */
|
|
73
73
|
entries: WeatherForecastEntry[];
|
|
74
74
|
}
|
|
75
|
+
export declare enum EnyoPvForecastProviderQualityLevelEnum {
|
|
76
|
+
/** High-quality forecast with low expected error margin */
|
|
77
|
+
High = "high",
|
|
78
|
+
/** Medium-quality forecast with moderate expected error margin */
|
|
79
|
+
Medium = "medium",
|
|
80
|
+
/** Low-quality forecast with high expected error margin */
|
|
81
|
+
Low = "low"
|
|
82
|
+
}
|
|
75
83
|
/**
|
|
76
84
|
* Registration data for a PV forecast provider
|
|
77
85
|
*/
|
|
@@ -82,6 +90,7 @@ export interface PvForecastProviderRegistration {
|
|
|
82
90
|
name: string;
|
|
83
91
|
/** Vendor or company providing the forecast */
|
|
84
92
|
vendor: string;
|
|
93
|
+
qualityLevel: EnyoPvForecastProviderQualityLevelEnum;
|
|
85
94
|
}
|
|
86
95
|
/**
|
|
87
96
|
* A registered PV forecast provider with metadata
|
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.70';
|
|
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
|
@@ -9,7 +9,8 @@ export declare enum EnergyAppPackageCategory {
|
|
|
9
9
|
BatteryStorage = "battery-storage",
|
|
10
10
|
ClimateControl = "climate-control",
|
|
11
11
|
DynamicElectricityTariff = "dynamic-electricity-tariff",
|
|
12
|
-
StaticElectricityTariff = "static-electricity-tariff"
|
|
12
|
+
StaticElectricityTariff = "static-electricity-tariff",
|
|
13
|
+
Other = "other"
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
15
16
|
* Configuration options for restricting internet access in an Energy App package.
|
|
@@ -73,6 +74,8 @@ export interface EnergyAppPackageOptions {
|
|
|
73
74
|
restrictedInternetAccess?: EnergyAppPackageRestrictedInternetAccessOption;
|
|
74
75
|
/** device detection configuration to auto-suggest this energy app on onboarding */
|
|
75
76
|
deviceDetection?: EnergyAppPackageOptionsDeviceDetection;
|
|
77
|
+
/** If your Developer Org is allowed to auto install packages and the device is sold via your Distributor account, you can auto install packages*/
|
|
78
|
+
autoInstall?: boolean;
|
|
76
79
|
}
|
|
77
80
|
/**
|
|
78
81
|
* Localized store entry information for an Energy App package.
|
|
@@ -122,6 +125,8 @@ export interface EnergyAppPackageDefinition {
|
|
|
122
125
|
options?: EnergyAppPackageOptions;
|
|
123
126
|
/** The version of the enyo SDK used to build this package (automatically injected) */
|
|
124
127
|
sdkVersion: string;
|
|
128
|
+
/** If the energy app should be visible in the enyo store. Default is true*/
|
|
129
|
+
showInStore?: boolean;
|
|
125
130
|
}
|
|
126
131
|
/**
|
|
127
132
|
* Defines an Energy App package with automatic SDK version injection.
|
|
@@ -10,6 +10,7 @@ export var EnergyAppPackageCategory;
|
|
|
10
10
|
EnergyAppPackageCategory["ClimateControl"] = "climate-control";
|
|
11
11
|
EnergyAppPackageCategory["DynamicElectricityTariff"] = "dynamic-electricity-tariff";
|
|
12
12
|
EnergyAppPackageCategory["StaticElectricityTariff"] = "static-electricity-tariff";
|
|
13
|
+
EnergyAppPackageCategory["Other"] = "other";
|
|
13
14
|
})(EnergyAppPackageCategory || (EnergyAppPackageCategory = {}));
|
|
14
15
|
/**
|
|
15
16
|
* Defines an Energy App package with automatic SDK version injection.
|
|
@@ -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' | 'InverterControlCommands' | 'BatteryControlCommands' | 'ChargerControlCommands';
|
|
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' | 'ModbusRtu' | 'EnergyPrices';
|
|
2
2
|
export declare enum EnergyAppPermissionTypeEnum {
|
|
3
3
|
RestrictedInternetAccess = "RestrictedInternetAccess",
|
|
4
4
|
NetworkDeviceDiscovery = "NetworkDeviceDiscovery",
|
|
@@ -21,6 +21,7 @@ export declare enum EnergyAppPermissionTypeEnum {
|
|
|
21
21
|
Timeseries = "Timeseries",
|
|
22
22
|
EnergyManagerInfo = "EnergyManagerInfo",
|
|
23
23
|
ElectricityTariff = "ElectricityTariff",
|
|
24
|
+
ModbusRtu = "ModbusRtu",
|
|
24
25
|
EnergyPrices = "EnergyPrices",
|
|
25
26
|
WeatherForecastRegister = "WeatherForecastRegister",
|
|
26
27
|
WeatherForecastUse = "WeatherForecastUse",
|
|
@@ -21,6 +21,7 @@ export var EnergyAppPermissionTypeEnum;
|
|
|
21
21
|
EnergyAppPermissionTypeEnum["Timeseries"] = "Timeseries";
|
|
22
22
|
EnergyAppPermissionTypeEnum["EnergyManagerInfo"] = "EnergyManagerInfo";
|
|
23
23
|
EnergyAppPermissionTypeEnum["ElectricityTariff"] = "ElectricityTariff";
|
|
24
|
+
EnergyAppPermissionTypeEnum["ModbusRtu"] = "ModbusRtu";
|
|
24
25
|
EnergyAppPermissionTypeEnum["EnergyPrices"] = "EnergyPrices";
|
|
25
26
|
EnergyAppPermissionTypeEnum["WeatherForecastRegister"] = "WeatherForecastRegister";
|
|
26
27
|
EnergyAppPermissionTypeEnum["WeatherForecastUse"] = "WeatherForecastUse";
|
|
@@ -23,6 +23,7 @@ import { EnergyAppWeatherForecasting } from "./packages/energy-app-weather-forec
|
|
|
23
23
|
import { EnergyAppPvForecasting } from "./packages/energy-app-pv-forecasting.js";
|
|
24
24
|
import { EnergyAppPvSystem } from "./packages/energy-app-pv-system.js";
|
|
25
25
|
import { EnergyAppSequenceGenerator } from "./packages/energy-app-sequence-generator.js";
|
|
26
|
+
import { EnergyAppModbusRtu } from "./packages/energy-app-modbus-rtu.js";
|
|
26
27
|
export declare enum EnergyAppStateEnum {
|
|
27
28
|
Launching = "launching",
|
|
28
29
|
Running = "running",
|
|
@@ -95,4 +96,6 @@ export interface EnyoEnergyAppSdk {
|
|
|
95
96
|
usePvSystem: () => EnergyAppPvSystem;
|
|
96
97
|
/** Get the Sequence Generator API for generating unique sequential numbers per named sequence */
|
|
97
98
|
useSequenceGenerator: () => EnergyAppSequenceGenerator;
|
|
99
|
+
/** Get the Modbus RTU serial communication API */
|
|
100
|
+
useModbusRtu: () => EnergyAppModbusRtu;
|
|
98
101
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ import { EnergyAppWeatherForecasting } from "./packages/energy-app-weather-forec
|
|
|
24
24
|
import { EnergyAppPvForecasting } from "./packages/energy-app-pv-forecasting.js";
|
|
25
25
|
import { EnergyAppPvSystem } from "./packages/energy-app-pv-system.js";
|
|
26
26
|
import { EnergyAppSequenceGenerator } from "./packages/energy-app-sequence-generator.js";
|
|
27
|
+
import { EnergyAppModbusRtu } from "./packages/energy-app-modbus-rtu.js";
|
|
27
28
|
export * from './energy-app-package-definition.js';
|
|
28
29
|
export * from './version.js';
|
|
29
30
|
export * from './implementations/ocpp/ocpp16.js';
|
|
@@ -52,6 +53,7 @@ export * from './packages/energy-app-pv-system.js';
|
|
|
52
53
|
export * from './implementations/data-bus/data-bus-command-handler.js';
|
|
53
54
|
export * from './packages/energy-app-sequence-generator.js';
|
|
54
55
|
export * from './packages/energy-app-energy-prices.js';
|
|
56
|
+
export * from './packages/energy-app-modbus-rtu.js';
|
|
55
57
|
export declare class EnergyApp implements EnyoEnergyAppSdk {
|
|
56
58
|
private readonly energyAppSdk;
|
|
57
59
|
constructor();
|
|
@@ -133,6 +135,13 @@ export declare class EnergyApp implements EnyoEnergyAppSdk {
|
|
|
133
135
|
* @returns The Sequence Generator API instance
|
|
134
136
|
*/
|
|
135
137
|
useSequenceGenerator(): EnergyAppSequenceGenerator;
|
|
138
|
+
/**
|
|
139
|
+
* Gets the Modbus RTU serial communication API.
|
|
140
|
+
* Provides methods to connect to Modbus RTU devices over serial ports
|
|
141
|
+
* and read/write registers using slave IDs.
|
|
142
|
+
* @returns The Modbus RTU API instance
|
|
143
|
+
*/
|
|
144
|
+
useModbusRtu(): EnergyAppModbusRtu;
|
|
136
145
|
/**
|
|
137
146
|
* Gets the current SDK version.
|
|
138
147
|
* @returns The semantic version string of the SDK
|
package/dist/index.js
CHANGED
|
@@ -27,6 +27,7 @@ export * from './packages/energy-app-pv-system.js';
|
|
|
27
27
|
export * from './implementations/data-bus/data-bus-command-handler.js';
|
|
28
28
|
export * from './packages/energy-app-sequence-generator.js';
|
|
29
29
|
export * from './packages/energy-app-energy-prices.js';
|
|
30
|
+
export * from './packages/energy-app-modbus-rtu.js';
|
|
30
31
|
export class EnergyApp {
|
|
31
32
|
energyAppSdk;
|
|
32
33
|
constructor() {
|
|
@@ -183,6 +184,15 @@ export class EnergyApp {
|
|
|
183
184
|
useSequenceGenerator() {
|
|
184
185
|
return this.energyAppSdk.useSequenceGenerator();
|
|
185
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* Gets the Modbus RTU serial communication API.
|
|
189
|
+
* Provides methods to connect to Modbus RTU devices over serial ports
|
|
190
|
+
* and read/write registers using slave IDs.
|
|
191
|
+
* @returns The Modbus RTU API instance
|
|
192
|
+
*/
|
|
193
|
+
useModbusRtu() {
|
|
194
|
+
return this.energyAppSdk.useModbusRtu();
|
|
195
|
+
}
|
|
186
196
|
/**
|
|
187
197
|
* Gets the current SDK version.
|
|
188
198
|
* @returns The semantic version string of the SDK
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration options for establishing a Modbus RTU serial connection.
|
|
3
|
+
*/
|
|
4
|
+
export interface ModbusRtuOptions {
|
|
5
|
+
/** Baud rate for serial communication (default: 9600) */
|
|
6
|
+
baudRate?: number;
|
|
7
|
+
/** Number of data bits per character (default: 8) */
|
|
8
|
+
dataBits?: number;
|
|
9
|
+
/** Number of stop bits (default: 1) */
|
|
10
|
+
stopBits?: number;
|
|
11
|
+
/** Parity mode for error detection (default: 'none') */
|
|
12
|
+
parity?: 'none' | 'even' | 'odd';
|
|
13
|
+
/** Connection timeout in milliseconds */
|
|
14
|
+
timeout?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Request parameters for reading Modbus RTU registers.
|
|
18
|
+
*/
|
|
19
|
+
export interface ModbusRtuReadRegistersRequest {
|
|
20
|
+
/** Slave ID of the target device on the serial bus */
|
|
21
|
+
slaveId: number;
|
|
22
|
+
/** Starting register address to read from */
|
|
23
|
+
startRegister: number;
|
|
24
|
+
/** Number of consecutive registers to read */
|
|
25
|
+
count: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Response containing register values read from a Modbus RTU device.
|
|
29
|
+
* Values are returned as a map of register address to value.
|
|
30
|
+
*/
|
|
31
|
+
export interface ModbusRtuReadRegistersResponse {
|
|
32
|
+
/** Map of register address to its numeric value */
|
|
33
|
+
values: Record<number, number>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Request parameters for writing values to Modbus RTU registers.
|
|
37
|
+
*/
|
|
38
|
+
export interface ModbusRtuWriteRegistersRequest {
|
|
39
|
+
/** Slave ID of the target device on the serial bus */
|
|
40
|
+
slaveId: number;
|
|
41
|
+
/** Starting register address to write to */
|
|
42
|
+
startRegister: number;
|
|
43
|
+
/** Array of values to write to consecutive registers */
|
|
44
|
+
values: number[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Interface representing an active Modbus RTU connection instance.
|
|
48
|
+
* Provides methods for reading and writing registers over a serial connection.
|
|
49
|
+
*/
|
|
50
|
+
export interface EnergyAppModbusRtuInstance {
|
|
51
|
+
/** Read register values from the connected Modbus RTU device */
|
|
52
|
+
readRegisters: (request: ModbusRtuReadRegistersRequest) => Promise<ModbusRtuReadRegistersResponse>;
|
|
53
|
+
/** Write register values to the connected Modbus RTU device */
|
|
54
|
+
writeRegisters: (request: ModbusRtuWriteRegistersRequest) => Promise<void>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Interface for Modbus RTU serial communication in enyo packages.
|
|
58
|
+
* Provides serial-based Modbus communication using slave IDs and register addressing.
|
|
59
|
+
*/
|
|
60
|
+
export interface EnergyAppModbusRtu {
|
|
61
|
+
/** Establish a Modbus RTU connection over a serial port */
|
|
62
|
+
connect: (options: ModbusRtuOptions) => Promise<EnergyAppModbusRtuInstance>;
|
|
63
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -72,6 +72,14 @@ export interface WeatherForecastResponse {
|
|
|
72
72
|
/** Array of weather forecast entries ordered by timestamp */
|
|
73
73
|
entries: WeatherForecastEntry[];
|
|
74
74
|
}
|
|
75
|
+
export declare enum EnyoPvForecastProviderQualityLevelEnum {
|
|
76
|
+
/** High-quality forecast with low expected error margin */
|
|
77
|
+
High = "high",
|
|
78
|
+
/** Medium-quality forecast with moderate expected error margin */
|
|
79
|
+
Medium = "medium",
|
|
80
|
+
/** Low-quality forecast with high expected error margin */
|
|
81
|
+
Low = "low"
|
|
82
|
+
}
|
|
75
83
|
/**
|
|
76
84
|
* Registration data for a PV forecast provider
|
|
77
85
|
*/
|
|
@@ -82,6 +90,7 @@ export interface PvForecastProviderRegistration {
|
|
|
82
90
|
name: string;
|
|
83
91
|
/** Vendor or company providing the forecast */
|
|
84
92
|
vendor: string;
|
|
93
|
+
qualityLevel: EnyoPvForecastProviderQualityLevelEnum;
|
|
85
94
|
}
|
|
86
95
|
/**
|
|
87
96
|
* A registered PV forecast provider with metadata
|
|
@@ -20,3 +20,13 @@ export var WeatherForecastLocationTypeEnum;
|
|
|
20
20
|
/** Forecast provider requires latitude and longitude coordinates */
|
|
21
21
|
WeatherForecastLocationTypeEnum["Coordinates"] = "coordinates";
|
|
22
22
|
})(WeatherForecastLocationTypeEnum || (WeatherForecastLocationTypeEnum = {}));
|
|
23
|
+
// ─── PV Forecasting Types ────────────────────────────────────────────────────
|
|
24
|
+
export var EnyoPvForecastProviderQualityLevelEnum;
|
|
25
|
+
(function (EnyoPvForecastProviderQualityLevelEnum) {
|
|
26
|
+
/** High-quality forecast with low expected error margin */
|
|
27
|
+
EnyoPvForecastProviderQualityLevelEnum["High"] = "high";
|
|
28
|
+
/** Medium-quality forecast with moderate expected error margin */
|
|
29
|
+
EnyoPvForecastProviderQualityLevelEnum["Medium"] = "medium";
|
|
30
|
+
/** Low-quality forecast with high expected error margin */
|
|
31
|
+
EnyoPvForecastProviderQualityLevelEnum["Low"] = "low";
|
|
32
|
+
})(EnyoPvForecastProviderQualityLevelEnum || (EnyoPvForecastProviderQualityLevelEnum = {}));
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED