@enyo-energy/energy-app-sdk 0.0.126 → 0.0.127
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.d.cts +7 -2
- package/dist/cjs/energy-app.cjs +9 -3
- package/dist/cjs/energy-app.d.cts +9 -3
- package/dist/cjs/index.cjs +1 -0
- package/dist/cjs/index.d.cts +1 -0
- package/dist/cjs/packages/eebus/eebus-device-management.cjs +2 -0
- package/dist/cjs/packages/eebus/eebus-device-management.d.cts +78 -0
- package/dist/cjs/packages/eebus/eebus-identity-service.cjs +2 -0
- package/dist/cjs/packages/eebus/eebus-identity-service.d.cts +66 -0
- package/dist/cjs/packages/eebus/eebus-lpc-client.cjs +2 -0
- package/dist/cjs/packages/eebus/eebus-lpc-client.d.cts +55 -0
- package/dist/cjs/packages/eebus/eebus-lpp-client.cjs +2 -0
- package/dist/cjs/packages/eebus/eebus-lpp-client.d.cts +50 -0
- package/dist/cjs/packages/eebus/eebus-mgcp-client.cjs +2 -0
- package/dist/cjs/packages/eebus/eebus-mgcp-client.d.cts +35 -0
- package/dist/cjs/packages/eebus/eebus-mpc-client.cjs +2 -0
- package/dist/cjs/packages/eebus/eebus-mpc-client.d.cts +34 -0
- package/dist/cjs/packages/eebus/eebus-ohpcf-client.cjs +2 -0
- package/dist/cjs/packages/eebus/eebus-ohpcf-client.d.cts +64 -0
- package/dist/cjs/packages/eebus/eebus-spine-low-level.cjs +2 -0
- package/dist/cjs/packages/eebus/eebus-spine-low-level.d.cts +53 -0
- package/dist/cjs/packages/eebus/eebus-use-case-registry.cjs +2 -0
- package/dist/cjs/packages/eebus/eebus-use-case-registry.d.cts +72 -0
- package/dist/cjs/packages/eebus/energy-app-eebus.cjs +2 -0
- package/dist/cjs/packages/eebus/energy-app-eebus.d.cts +64 -0
- package/dist/cjs/packages/energy-app-eebus.cjs +23 -0
- package/dist/cjs/packages/energy-app-eebus.d.cts +7 -174
- package/dist/cjs/types/enyo-eebus-use-cases.cjs +19 -0
- package/dist/cjs/types/enyo-eebus-use-cases.d.cts +187 -0
- package/dist/cjs/types/enyo-eebus.cjs +36 -20
- package/dist/cjs/types/enyo-eebus.d.cts +132 -47
- package/dist/cjs/types/enyo-timeseries.d.cts +10 -0
- package/dist/cjs/version.cjs +1 -1
- package/dist/cjs/version.d.cts +1 -1
- package/dist/energy-app-package-definition.d.ts +7 -2
- package/dist/energy-app.d.ts +9 -3
- package/dist/energy-app.js +9 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/packages/eebus/eebus-device-management.d.ts +78 -0
- package/dist/packages/eebus/eebus-device-management.js +1 -0
- package/dist/packages/eebus/eebus-identity-service.d.ts +66 -0
- package/dist/packages/eebus/eebus-identity-service.js +1 -0
- package/dist/packages/eebus/eebus-lpc-client.d.ts +55 -0
- package/dist/packages/eebus/eebus-lpc-client.js +1 -0
- package/dist/packages/eebus/eebus-lpp-client.d.ts +50 -0
- package/dist/packages/eebus/eebus-lpp-client.js +1 -0
- package/dist/packages/eebus/eebus-mgcp-client.d.ts +35 -0
- package/dist/packages/eebus/eebus-mgcp-client.js +1 -0
- package/dist/packages/eebus/eebus-mpc-client.d.ts +34 -0
- package/dist/packages/eebus/eebus-mpc-client.js +1 -0
- package/dist/packages/eebus/eebus-ohpcf-client.d.ts +64 -0
- package/dist/packages/eebus/eebus-ohpcf-client.js +1 -0
- package/dist/packages/eebus/eebus-spine-low-level.d.ts +53 -0
- package/dist/packages/eebus/eebus-spine-low-level.js +1 -0
- package/dist/packages/eebus/eebus-use-case-registry.d.ts +72 -0
- package/dist/packages/eebus/eebus-use-case-registry.js +1 -0
- package/dist/packages/eebus/energy-app-eebus.d.ts +64 -0
- package/dist/packages/eebus/energy-app-eebus.js +1 -0
- package/dist/packages/energy-app-eebus.d.ts +7 -174
- package/dist/packages/energy-app-eebus.js +9 -1
- package/dist/types/enyo-eebus-use-cases.d.ts +187 -0
- package/dist/types/enyo-eebus-use-cases.js +18 -0
- package/dist/types/enyo-eebus.d.ts +132 -47
- package/dist/types/enyo-eebus.js +35 -19
- package/dist/types/enyo-timeseries.d.ts +10 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -61,8 +61,13 @@ export interface EnergyAppPackageOptionsDeviceDetectionOcpp {
|
|
|
61
61
|
matchingValues: string[];
|
|
62
62
|
}
|
|
63
63
|
export interface EnergyAppPackageOptionsDeviceDetectionEebus {
|
|
64
|
-
/**
|
|
65
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Field name to match against from the remote node's EEBUS Node
|
|
66
|
+
* Identification (NID) data. `'deviceCode'` and `'manufacturerNodeIdentification'`
|
|
67
|
+
* map to the corresponding fields on `EebusNodeIdentity` and allow
|
|
68
|
+
* stable identification across firmware upgrades.
|
|
69
|
+
*/
|
|
70
|
+
field: 'vendor' | 'brand' | 'model' | 'deviceCode' | 'manufacturerNodeIdentification';
|
|
66
71
|
/** matching values, for example the vendor names or model names */
|
|
67
72
|
matchingValues: string[];
|
|
68
73
|
}
|
package/dist/cjs/energy-app.cjs
CHANGED
|
@@ -195,9 +195,15 @@ class EnergyApp {
|
|
|
195
195
|
}
|
|
196
196
|
/**
|
|
197
197
|
* Gets the EEbus API for SHIP/SPINE device communication.
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
*
|
|
198
|
+
*
|
|
199
|
+
* The returned facade splits responsibilities across four sub-interfaces:
|
|
200
|
+
* - `devices` — SHIP-level device lifecycle (pairing, discovery, connection)
|
|
201
|
+
* - `identity` — EEBUS Node Identification (NID): observable identity, diagnosis, use-case discovery
|
|
202
|
+
* - `useCases` — typed use-case clients: LPC, LPP, MGCP, MPC, OHPCF
|
|
203
|
+
* - `spine` — low-level SPINE escape hatch for features not yet wrapped
|
|
204
|
+
*
|
|
205
|
+
* Use-case clients carry both Energy Management System and Controllable
|
|
206
|
+
* System methods; consumers act in whichever role(s) they need.
|
|
201
207
|
* @returns The EEbus API instance
|
|
202
208
|
*/
|
|
203
209
|
useEebus() {
|
|
@@ -147,9 +147,15 @@ export declare class EnergyApp implements EnyoEnergyAppSdk {
|
|
|
147
147
|
useModbusRtu(): EnergyAppModbusRtu;
|
|
148
148
|
/**
|
|
149
149
|
* Gets the EEbus API for SHIP/SPINE device communication.
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
150
|
+
*
|
|
151
|
+
* The returned facade splits responsibilities across four sub-interfaces:
|
|
152
|
+
* - `devices` — SHIP-level device lifecycle (pairing, discovery, connection)
|
|
153
|
+
* - `identity` — EEBUS Node Identification (NID): observable identity, diagnosis, use-case discovery
|
|
154
|
+
* - `useCases` — typed use-case clients: LPC, LPP, MGCP, MPC, OHPCF
|
|
155
|
+
* - `spine` — low-level SPINE escape hatch for features not yet wrapped
|
|
156
|
+
*
|
|
157
|
+
* Use-case clients carry both Energy Management System and Controllable
|
|
158
|
+
* System methods; consumers act in whichever role(s) they need.
|
|
153
159
|
* @returns The EEbus API instance
|
|
154
160
|
*/
|
|
155
161
|
useEebus(): EnergyAppEebus;
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -48,6 +48,7 @@ __exportStar(require("./packages/energy-app-sequence-generator.cjs"), exports);
|
|
|
48
48
|
__exportStar(require("./packages/energy-app-energy-prices.cjs"), exports);
|
|
49
49
|
__exportStar(require("./packages/energy-app-modbus-rtu.cjs"), exports);
|
|
50
50
|
__exportStar(require("./types/enyo-eebus.cjs"), exports);
|
|
51
|
+
__exportStar(require("./types/enyo-eebus-use-cases.cjs"), exports);
|
|
51
52
|
__exportStar(require("./packages/energy-app-eebus.cjs"), exports);
|
|
52
53
|
__exportStar(require("./types/enyo-mqtt.cjs"), exports);
|
|
53
54
|
__exportStar(require("./packages/energy-app-mqtt.cjs"), exports);
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -32,6 +32,7 @@ export * from './packages/energy-app-sequence-generator.cjs';
|
|
|
32
32
|
export * from './packages/energy-app-energy-prices.cjs';
|
|
33
33
|
export * from './packages/energy-app-modbus-rtu.cjs';
|
|
34
34
|
export * from './types/enyo-eebus.cjs';
|
|
35
|
+
export * from './types/enyo-eebus-use-cases.cjs';
|
|
35
36
|
export * from './packages/energy-app-eebus.cjs';
|
|
36
37
|
export * from './types/enyo-mqtt.cjs';
|
|
37
38
|
export * from './packages/energy-app-mqtt.cjs';
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { EebusConnectionStatusEnum, EebusDevice, EebusDiscoveredDevice } from '../../types/enyo-eebus.cjs';
|
|
2
|
+
/**
|
|
3
|
+
* SHIP-level device lifecycle management for EEbus devices.
|
|
4
|
+
*
|
|
5
|
+
* Handles discovery, pairing (trust establishment), connection control, and
|
|
6
|
+
* connection-status observation. This interface is concerned only with the
|
|
7
|
+
* underlying SHIP transport — application-level interactions (identity,
|
|
8
|
+
* use cases) live in {@link EebusIdentityService} and {@link EebusUseCaseRegistry}.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const eebus = energyApp.useEebus();
|
|
13
|
+
*
|
|
14
|
+
* const discovered = await eebus.devices.getDiscoveredDevices();
|
|
15
|
+
* const device = await eebus.devices.pairDevice(discovered[0].ski);
|
|
16
|
+
* await eebus.devices.connect(device.ski);
|
|
17
|
+
*
|
|
18
|
+
* const listenerId = eebus.devices.listenForConnectionStatusChange((ski, status) => {
|
|
19
|
+
* console.log(`${ski} → ${status}`);
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export interface EebusDeviceManagement {
|
|
24
|
+
/**
|
|
25
|
+
* Get all devices that have been successfully paired (trusted).
|
|
26
|
+
* @returns Array of paired EEbus devices with their current connection status
|
|
27
|
+
*/
|
|
28
|
+
getPairedDevices: () => Promise<EebusDevice[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Get devices currently visible on the network that have not yet been paired.
|
|
31
|
+
* Uses mDNS discovery to find EEbus-capable devices.
|
|
32
|
+
* @returns Array of discovered but unpaired EEbus devices
|
|
33
|
+
*/
|
|
34
|
+
getDiscoveredDevices: () => Promise<EebusDiscoveredDevice[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Initiate the EEbus pairing (trust) handshake with a device identified by its SKI.
|
|
37
|
+
* The device must have been previously discovered via {@link getDiscoveredDevices}.
|
|
38
|
+
* @param ski Subject Key Identifier of the device to pair with
|
|
39
|
+
* @returns The newly paired device
|
|
40
|
+
*/
|
|
41
|
+
pairDevice: (ski: string) => Promise<EebusDevice>;
|
|
42
|
+
/**
|
|
43
|
+
* Remove the trust relationship and delete stored connection information for a paired device.
|
|
44
|
+
* If the device is currently connected, it will be disconnected first.
|
|
45
|
+
* @param ski Subject Key Identifier of the device to unpair
|
|
46
|
+
*/
|
|
47
|
+
unpairDevice: (ski: string) => Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Establish an active SHIP connection to an already-paired device.
|
|
50
|
+
* The device must have been previously paired via {@link pairDevice}.
|
|
51
|
+
* @param ski Subject Key Identifier of the device to connect to
|
|
52
|
+
*/
|
|
53
|
+
connect: (ski: string) => Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Safely disconnect from a currently connected device.
|
|
56
|
+
* @param ski Subject Key Identifier of the device to disconnect from
|
|
57
|
+
*/
|
|
58
|
+
disconnect: (ski: string) => Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Check the current connection status of a device.
|
|
61
|
+
* @param ski Subject Key Identifier of the device to check
|
|
62
|
+
* @returns The current connection status (Connected, Disconnected, or Connecting)
|
|
63
|
+
*/
|
|
64
|
+
getConnectionStatus: (ski: string) => Promise<EebusConnectionStatusEnum>;
|
|
65
|
+
/**
|
|
66
|
+
* Register a listener for connection status changes of EEbus devices.
|
|
67
|
+
* The listener is invoked whenever any paired device's connection status changes.
|
|
68
|
+
* @param listener Callback invoked with the device SKI and its new connection status
|
|
69
|
+
* @returns Listener ID that can be passed to {@link removeListener} to stop listening
|
|
70
|
+
*/
|
|
71
|
+
listenForConnectionStatusChange: (listener: (ski: string, status: EebusConnectionStatusEnum) => void) => string;
|
|
72
|
+
/**
|
|
73
|
+
* Remove a connection-status listener previously registered via
|
|
74
|
+
* {@link listenForConnectionStatusChange}.
|
|
75
|
+
* @param listenerId The ID returned by the registration method
|
|
76
|
+
*/
|
|
77
|
+
removeListener: (listenerId: string) => void;
|
|
78
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { EebusNodeIdentity, EebusUseCaseSupport } from '../../types/enyo-eebus.cjs';
|
|
2
|
+
/**
|
|
3
|
+
* Identity service for the EEBUS Node Identification (NID) data of a remote node.
|
|
4
|
+
*
|
|
5
|
+
* NID is the SPINE-mandatory bootstrap exchange that every EEbus device performs
|
|
6
|
+
* after the SHIP handshake. It combines `NodeManagement.DetailedDiscoveryData` +
|
|
7
|
+
* `NodeManagement.UseCaseData` + `DeviceClassification.ManufacturerData`/`UserData`
|
|
8
|
+
* + `DeviceDiagnosis` (state + heartbeat).
|
|
9
|
+
*
|
|
10
|
+
* **Identity is observable, not one-shot.** The remote may reboot, update its
|
|
11
|
+
* firmware, change its `UserNodeIdentification`, or demote its operating state
|
|
12
|
+
* via a `DeviceDiagnosis` heartbeat at any time. Consumers that cache a
|
|
13
|
+
* Promise-resolved snapshot will ship UI bugs. Always pair {@link get} with
|
|
14
|
+
* {@link onIdentityChanged}.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const id = await eebus.identity.get(ski);
|
|
19
|
+
* console.log(`${id.brandName} ${id.deviceName} (${id.operatingState})`);
|
|
20
|
+
*
|
|
21
|
+
* eebus.identity.onIdentityChanged(ski, (next) => {
|
|
22
|
+
* if (next.operatingState === EebusOperatingStateEnum.Failure) alert();
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* const supported = await eebus.identity.getSupportedUseCases(ski);
|
|
26
|
+
* if (supported.some(u => u.name === 'limitationOfPowerConsumption' && u.available)) {
|
|
27
|
+
* await eebus.useCases.lpc(ski).setConsumptionLimit({ value: 11000, isActive: true });
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export interface EebusIdentityService {
|
|
32
|
+
/**
|
|
33
|
+
* Get the current identity snapshot for a remote node.
|
|
34
|
+
* The snapshot reflects the most recent SPINE state observed by the SDK;
|
|
35
|
+
* it does not trigger a re-fetch from the remote. To observe live changes
|
|
36
|
+
* (firmware updates, operating-state demotions, heartbeat losses) use
|
|
37
|
+
* {@link onIdentityChanged}.
|
|
38
|
+
* @param ski Subject Key Identifier of the remote node
|
|
39
|
+
* @returns The current identity snapshot
|
|
40
|
+
*/
|
|
41
|
+
get: (ski: string) => Promise<EebusNodeIdentity>;
|
|
42
|
+
/**
|
|
43
|
+
* Subscribe to identity changes for a remote node. The listener is invoked
|
|
44
|
+
* whenever any field of the node's identity changes — including firmware
|
|
45
|
+
* revisions, user node identification, operating state, and heartbeat.
|
|
46
|
+
* @param ski Subject Key Identifier of the remote node
|
|
47
|
+
* @param listener Callback invoked with the full updated identity snapshot
|
|
48
|
+
* @returns Listener ID that can be passed to {@link removeListener} to cancel
|
|
49
|
+
*/
|
|
50
|
+
onIdentityChanged: (ski: string, listener: (identity: EebusNodeIdentity) => void) => string;
|
|
51
|
+
/**
|
|
52
|
+
* Enumerate the EEBUS use cases the remote node advertises in
|
|
53
|
+
* `NodeManagement.UseCaseData`. Call this before invoking any
|
|
54
|
+
* {@link EebusUseCaseRegistry} client to verify the remote actually
|
|
55
|
+
* implements the use case in the actor role you intend to use.
|
|
56
|
+
* @param ski Subject Key Identifier of the remote node
|
|
57
|
+
* @returns Array of supported use cases with actor, name, version, scenarios
|
|
58
|
+
*/
|
|
59
|
+
getSupportedUseCases: (ski: string) => Promise<EebusUseCaseSupport[]>;
|
|
60
|
+
/**
|
|
61
|
+
* Remove an identity-change listener previously registered via
|
|
62
|
+
* {@link onIdentityChanged}.
|
|
63
|
+
* @param listenerId The ID returned by the registration method
|
|
64
|
+
*/
|
|
65
|
+
removeListener: (listenerId: string) => void;
|
|
66
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { EebusLpcAck, EebusLpcFailsafe, EebusLpcLimit } from '../../types/enyo-eebus-use-cases.cjs';
|
|
2
|
+
/**
|
|
3
|
+
* Client for the EEBUS **Limitation of Power Consumption (LPC)** use case.
|
|
4
|
+
*
|
|
5
|
+
* LPC is an *obligation*: when an Energy Management System (EMS) sends a limit,
|
|
6
|
+
* the receiving Controllable System (CS) MUST respect it. Compare with
|
|
7
|
+
* {@link EebusLppClient} which is a recommendation.
|
|
8
|
+
*
|
|
9
|
+
* The client exposes both actor roles on a single interface:
|
|
10
|
+
* - **EMS role (outbound):** {@link setConsumptionLimit}, {@link getActiveConsumptionLimit},
|
|
11
|
+
* {@link getFailsafeLimit}
|
|
12
|
+
* - **CS role (inbound):** {@link onConsumptionLimitReceived}, {@link provideFailsafeLimit}
|
|
13
|
+
*
|
|
14
|
+
* Consumers that only act in one role simply never call the other half — there is
|
|
15
|
+
* no `asManager` / `asAppliance` split.
|
|
16
|
+
*/
|
|
17
|
+
export interface EebusLpcClient {
|
|
18
|
+
/**
|
|
19
|
+
* Send a consumption limit to the controllable system. The remote is
|
|
20
|
+
* obligated to respect the limit until it expires, is replaced, or is
|
|
21
|
+
* cleared by sending a limit with `isActive: false`.
|
|
22
|
+
* @param limit The consumption limit to apply
|
|
23
|
+
*/
|
|
24
|
+
setConsumptionLimit: (limit: EebusLpcLimit) => Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Read the consumption limit currently active on the controllable system,
|
|
27
|
+
* if any. Useful for verifying that a previously-sent limit was applied,
|
|
28
|
+
* or for synchronising on reconnect.
|
|
29
|
+
* @returns The active limit, or `undefined` if no limit is currently active
|
|
30
|
+
*/
|
|
31
|
+
getActiveConsumptionLimit: () => Promise<EebusLpcLimit | undefined>;
|
|
32
|
+
/**
|
|
33
|
+
* Read the failsafe limit the controllable system will fall back to if
|
|
34
|
+
* it loses the connection to this EMS.
|
|
35
|
+
*/
|
|
36
|
+
getFailsafeLimit: () => Promise<EebusLpcFailsafe>;
|
|
37
|
+
/**
|
|
38
|
+
* Register a handler invoked when a remote EMS sends a consumption limit
|
|
39
|
+
* to this device. The handler MUST return an acknowledgement.
|
|
40
|
+
* @param handler Callback invoked with the incoming limit; returns the ack
|
|
41
|
+
* @returns Listener ID that can be passed to {@link removeListener} to deregister
|
|
42
|
+
*/
|
|
43
|
+
onConsumptionLimitReceived: (handler: (limit: EebusLpcLimit) => Promise<EebusLpcAck>) => string;
|
|
44
|
+
/**
|
|
45
|
+
* Register a provider that supplies this device's current failsafe limit
|
|
46
|
+
* when a remote EMS reads it.
|
|
47
|
+
* @param provider Async callback returning the current failsafe configuration
|
|
48
|
+
*/
|
|
49
|
+
provideFailsafeLimit: (provider: () => Promise<EebusLpcFailsafe>) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Remove a handler previously registered via {@link onConsumptionLimitReceived}.
|
|
52
|
+
* @param listenerId The ID returned by the registration method
|
|
53
|
+
*/
|
|
54
|
+
removeListener: (listenerId: string) => void;
|
|
55
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { EebusLppAck, EebusLppFailsafe, EebusLppLimit } from '../../types/enyo-eebus-use-cases.cjs';
|
|
2
|
+
/**
|
|
3
|
+
* Client for the EEBUS **Limitation of Power Production (LPP)** use case.
|
|
4
|
+
*
|
|
5
|
+
* LPP is a *recommendation*: when an Energy Management System (EMS) sends a
|
|
6
|
+
* production limit, the producing Controllable System (CS) SHOULD respect it
|
|
7
|
+
* but is not contractually obligated. Compare with {@link EebusLpcClient} which
|
|
8
|
+
* is an obligation.
|
|
9
|
+
*
|
|
10
|
+
* The client exposes both actor roles on a single interface:
|
|
11
|
+
* - **EMS role (outbound):** {@link setProductionLimit}, {@link getActiveProductionLimit},
|
|
12
|
+
* {@link getFailsafeLimit}
|
|
13
|
+
* - **CS role (inbound):** {@link onProductionLimitReceived}, {@link provideFailsafeLimit}
|
|
14
|
+
*/
|
|
15
|
+
export interface EebusLppClient {
|
|
16
|
+
/**
|
|
17
|
+
* Send a production limit recommendation to the producing controllable system.
|
|
18
|
+
* @param limit The production limit recommendation to apply
|
|
19
|
+
*/
|
|
20
|
+
setProductionLimit: (limit: EebusLppLimit) => Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Read the production limit currently active on the controllable system,
|
|
23
|
+
* if any.
|
|
24
|
+
* @returns The active limit, or `undefined` if no limit is currently active
|
|
25
|
+
*/
|
|
26
|
+
getActiveProductionLimit: () => Promise<EebusLppLimit | undefined>;
|
|
27
|
+
/**
|
|
28
|
+
* Read the failsafe limit the controllable system will fall back to if
|
|
29
|
+
* it loses the connection to this EMS.
|
|
30
|
+
*/
|
|
31
|
+
getFailsafeLimit: () => Promise<EebusLppFailsafe>;
|
|
32
|
+
/**
|
|
33
|
+
* Register a handler invoked when a remote EMS sends a production limit
|
|
34
|
+
* recommendation to this device.
|
|
35
|
+
* @param handler Callback invoked with the incoming limit; returns the ack
|
|
36
|
+
* @returns Listener ID that can be passed to {@link removeListener} to deregister
|
|
37
|
+
*/
|
|
38
|
+
onProductionLimitReceived: (handler: (limit: EebusLppLimit) => Promise<EebusLppAck>) => string;
|
|
39
|
+
/**
|
|
40
|
+
* Register a provider that supplies this device's current failsafe limit
|
|
41
|
+
* when a remote EMS reads it.
|
|
42
|
+
* @param provider Async callback returning the current failsafe configuration
|
|
43
|
+
*/
|
|
44
|
+
provideFailsafeLimit: (provider: () => Promise<EebusLppFailsafe>) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Remove a handler previously registered via {@link onProductionLimitReceived}.
|
|
47
|
+
* @param listenerId The ID returned by the registration method
|
|
48
|
+
*/
|
|
49
|
+
removeListener: (listenerId: string) => void;
|
|
50
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { EebusMgcpReading } from '../../types/enyo-eebus-use-cases.cjs';
|
|
2
|
+
/**
|
|
3
|
+
* Client for the EEBUS **Monitoring of Grid Connection Point (MGCP)** use case.
|
|
4
|
+
*
|
|
5
|
+
* MGCP is read-only telemetry from a smart meter / grid connection point.
|
|
6
|
+
* The CEM (Customer Energy Manager) actor consumes the readings; the GCP
|
|
7
|
+
* (Grid Connection Point) actor provides them.
|
|
8
|
+
*
|
|
9
|
+
* The client exposes both actor roles on a single interface:
|
|
10
|
+
* - **CEM role (consume):** {@link getReading}, {@link onReading}
|
|
11
|
+
* - **GCP role (provide):** {@link provideReading}
|
|
12
|
+
*/
|
|
13
|
+
export interface EebusMgcpClient {
|
|
14
|
+
/**
|
|
15
|
+
* Read the latest telemetry from the grid connection point.
|
|
16
|
+
*/
|
|
17
|
+
getReading: () => Promise<EebusMgcpReading>;
|
|
18
|
+
/**
|
|
19
|
+
* Subscribe to updates whenever the grid connection point publishes new telemetry.
|
|
20
|
+
* @param listener Callback invoked with each new reading
|
|
21
|
+
* @returns Listener ID that can be passed to {@link removeListener} to cancel
|
|
22
|
+
*/
|
|
23
|
+
onReading: (listener: (reading: EebusMgcpReading) => void) => string;
|
|
24
|
+
/**
|
|
25
|
+
* Register a provider that supplies the current grid connection point reading
|
|
26
|
+
* when a remote CEM reads it.
|
|
27
|
+
* @param provider Async callback returning the current reading
|
|
28
|
+
*/
|
|
29
|
+
provideReading: (provider: () => Promise<EebusMgcpReading>) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Remove a listener previously registered via {@link onReading}.
|
|
32
|
+
* @param listenerId The ID returned by the registration method
|
|
33
|
+
*/
|
|
34
|
+
removeListener: (listenerId: string) => void;
|
|
35
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { EebusMpcReading } from '../../types/enyo-eebus-use-cases.cjs';
|
|
2
|
+
/**
|
|
3
|
+
* Client for the EEBUS **Monitoring of Power Consumption (MPC)** use case.
|
|
4
|
+
*
|
|
5
|
+
* MPC is read-only telemetry from a controllable system reporting its own
|
|
6
|
+
* power consumption to the EMS.
|
|
7
|
+
*
|
|
8
|
+
* The client exposes both actor roles on a single interface:
|
|
9
|
+
* - **EMS role (consume):** {@link getReading}, {@link onReading}
|
|
10
|
+
* - **CS role (provide):** {@link provideReading}
|
|
11
|
+
*/
|
|
12
|
+
export interface EebusMpcClient {
|
|
13
|
+
/**
|
|
14
|
+
* Read the latest consumption telemetry from the controllable system.
|
|
15
|
+
*/
|
|
16
|
+
getReading: () => Promise<EebusMpcReading>;
|
|
17
|
+
/**
|
|
18
|
+
* Subscribe to updates whenever the controllable system publishes new telemetry.
|
|
19
|
+
* @param listener Callback invoked with each new reading
|
|
20
|
+
* @returns Listener ID that can be passed to {@link removeListener} to cancel
|
|
21
|
+
*/
|
|
22
|
+
onReading: (listener: (reading: EebusMpcReading) => void) => string;
|
|
23
|
+
/**
|
|
24
|
+
* Register a provider that supplies the current consumption reading
|
|
25
|
+
* when a remote EMS reads it.
|
|
26
|
+
* @param provider Async callback returning the current reading
|
|
27
|
+
*/
|
|
28
|
+
provideReading: (provider: () => Promise<EebusMpcReading>) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Remove a listener previously registered via {@link onReading}.
|
|
31
|
+
* @param listenerId The ID returned by the registration method
|
|
32
|
+
*/
|
|
33
|
+
removeListener: (listenerId: string) => void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { EebusOhpcfFlexibility, EebusOhpcfIncentiveTable, EebusOhpcfPlanState } from '../../types/enyo-eebus-use-cases.cjs';
|
|
2
|
+
/**
|
|
3
|
+
* Client for the EEBUS **Optimization of Self Consumption by Heat Pump
|
|
4
|
+
* Compressor Flexibility (OHPCF)** use case.
|
|
5
|
+
*
|
|
6
|
+
* OHPCF is an *incentive-driven* use case — the CEM (Customer Energy Manager)
|
|
7
|
+
* sends a time-varying price/cost table; the heat pump schedules its
|
|
8
|
+
* compressor to favour cheap or green windows without further coordination.
|
|
9
|
+
* This is structurally different from LPC/LPP (which use LoadControl). The
|
|
10
|
+
* CEM does not command the heat pump — it informs.
|
|
11
|
+
*
|
|
12
|
+
* The client exposes both actor roles on a single interface:
|
|
13
|
+
* - **CEM role:** {@link sendIncentiveTable}, {@link getCurrentPlanState},
|
|
14
|
+
* {@link onFlexibilityUpdate}
|
|
15
|
+
* - **Heat Pump role:** {@link provideFlexibility}, {@link providePlanState},
|
|
16
|
+
* {@link onIncentiveTableReceived}
|
|
17
|
+
*
|
|
18
|
+
* @see https://techdocs.wago.com/Software/EEBUS_Connector/en-US/3657311371.html
|
|
19
|
+
* @see https://github.com/enbility/eebus-go/pull/122
|
|
20
|
+
*/
|
|
21
|
+
export interface EebusOhpcfClient {
|
|
22
|
+
/**
|
|
23
|
+
* Send an incentive table to the heat pump. The heat pump will use
|
|
24
|
+
* the table to plan its compressor operation over the covered horizon.
|
|
25
|
+
* @param table The incentive table to send
|
|
26
|
+
*/
|
|
27
|
+
sendIncentiveTable: (table: EebusOhpcfIncentiveTable) => Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Read the heat pump's current operational plan, generated in response
|
|
30
|
+
* to the most recent incentive table.
|
|
31
|
+
*/
|
|
32
|
+
getCurrentPlanState: () => Promise<EebusOhpcfPlanState>;
|
|
33
|
+
/**
|
|
34
|
+
* Subscribe to compressor flexibility updates from the heat pump.
|
|
35
|
+
* Allows the CEM to track the operating band it can shift consumption within.
|
|
36
|
+
* @param listener Callback invoked with each new flexibility report
|
|
37
|
+
* @returns Listener ID that can be passed to {@link removeListener} to cancel
|
|
38
|
+
*/
|
|
39
|
+
onFlexibilityUpdate: (listener: (flexibility: EebusOhpcfFlexibility) => void) => string;
|
|
40
|
+
/**
|
|
41
|
+
* Register a provider that reports the heat pump's current compressor
|
|
42
|
+
* flexibility when a remote CEM reads it.
|
|
43
|
+
* @param provider Async callback returning the current flexibility report
|
|
44
|
+
*/
|
|
45
|
+
provideFlexibility: (provider: () => Promise<EebusOhpcfFlexibility>) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Register a provider that reports the heat pump's current operational
|
|
48
|
+
* plan state when a remote CEM reads it.
|
|
49
|
+
* @param provider Async callback returning the current plan state
|
|
50
|
+
*/
|
|
51
|
+
providePlanState: (provider: () => Promise<EebusOhpcfPlanState>) => void;
|
|
52
|
+
/**
|
|
53
|
+
* Register a handler invoked when a remote CEM sends a new incentive table
|
|
54
|
+
* to the heat pump.
|
|
55
|
+
* @param handler Async callback invoked with the incoming incentive table
|
|
56
|
+
* @returns Listener ID that can be passed to {@link removeListener} to deregister
|
|
57
|
+
*/
|
|
58
|
+
onIncentiveTableReceived: (handler: (table: EebusOhpcfIncentiveTable) => Promise<void>) => string;
|
|
59
|
+
/**
|
|
60
|
+
* Remove a listener or handler previously registered on this client.
|
|
61
|
+
* @param listenerId The ID returned by the registration method
|
|
62
|
+
*/
|
|
63
|
+
removeListener: (listenerId: string) => void;
|
|
64
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { EebusDataPoint } from '../../types/enyo-eebus.cjs';
|
|
2
|
+
/**
|
|
3
|
+
* Low-level SPINE escape hatch for direct feature data access.
|
|
4
|
+
*
|
|
5
|
+
* The typed use-case clients ({@link EebusUseCaseRegistry}) cover the
|
|
6
|
+
* common cases — prefer them when they exist. Reach for this interface
|
|
7
|
+
* only when:
|
|
8
|
+
* - the remote exposes a SPINE feature not yet wrapped by a typed client
|
|
9
|
+
* - you need to interact with a custom or vendor-specific feature
|
|
10
|
+
* - you are prototyping a new use-case wrapper
|
|
11
|
+
*
|
|
12
|
+
* **Feature types are strings, not an enum.** SPINE defines roughly 80
|
|
13
|
+
* feature types and the catalog grows. The previous closed enum was
|
|
14
|
+
* removed because it silently blocked consumers from anything outside
|
|
15
|
+
* its 7 entries. Canonical feature-type names include
|
|
16
|
+
* `'DeviceClassification'`, `'DeviceDiagnosis'`, `'ElectricalConnection'`,
|
|
17
|
+
* `'Measurement'`, `'LoadControl'`, `'DeviceConfiguration'`,
|
|
18
|
+
* `'Identification'`, `'IncentiveTable'`, `'TimeSeries'`, `'Hvac'`,
|
|
19
|
+
* `'SmartEnergyManagementPs'`, and many more — consult the SPINE spec.
|
|
20
|
+
*/
|
|
21
|
+
export interface EebusSpineLowLevel {
|
|
22
|
+
/**
|
|
23
|
+
* Read specific data points from a SPINE feature on a remote device.
|
|
24
|
+
* @param ski Subject Key Identifier of the target device
|
|
25
|
+
* @param featureType SPINE feature type name (e.g. `'Measurement'`)
|
|
26
|
+
* @param functionName Specific function or data set to read (e.g. `'measurementListData'`)
|
|
27
|
+
* @returns The data point containing the raw value, timestamp, and optional unit
|
|
28
|
+
*/
|
|
29
|
+
readData: (ski: string, featureType: string, functionName: string) => Promise<EebusDataPoint>;
|
|
30
|
+
/**
|
|
31
|
+
* Write data or send a command to a SPINE feature on a remote device.
|
|
32
|
+
* @param ski Subject Key Identifier of the target device
|
|
33
|
+
* @param featureType SPINE feature type name (e.g. `'LoadControl'`)
|
|
34
|
+
* @param functionName Specific function or command to invoke (e.g. `'loadControlLimitListData'`)
|
|
35
|
+
* @param payload The raw data payload to send — caller is responsible for matching the SPINE schema
|
|
36
|
+
*/
|
|
37
|
+
writeData: (ski: string, featureType: string, functionName: string, payload: unknown) => Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Subscribe to automatic notifications when a SPINE feature's data changes.
|
|
40
|
+
* Sets up a SPINE binding so the local device is notified whenever the
|
|
41
|
+
* subscribed data changes.
|
|
42
|
+
* @param ski Subject Key Identifier of the target device
|
|
43
|
+
* @param featureType SPINE feature type name to subscribe to
|
|
44
|
+
* @param listener Callback invoked with updated data whenever the value changes
|
|
45
|
+
* @returns Listener ID that can be passed to {@link removeListener} to cancel the subscription
|
|
46
|
+
*/
|
|
47
|
+
subscribe: (ski: string, featureType: string, listener: (data: EebusDataPoint) => void) => string;
|
|
48
|
+
/**
|
|
49
|
+
* Remove a subscription previously registered via {@link subscribe}.
|
|
50
|
+
* @param listenerId The ID returned by the registration method
|
|
51
|
+
*/
|
|
52
|
+
removeListener: (listenerId: string) => void;
|
|
53
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { EebusLpcClient } from './eebus-lpc-client.cjs';
|
|
2
|
+
import { EebusLppClient } from './eebus-lpp-client.cjs';
|
|
3
|
+
import { EebusMgcpClient } from './eebus-mgcp-client.cjs';
|
|
4
|
+
import { EebusMpcClient } from './eebus-mpc-client.cjs';
|
|
5
|
+
import { EebusOhpcfClient } from './eebus-ohpcf-client.cjs';
|
|
6
|
+
/**
|
|
7
|
+
* Registry of typed EEBUS use-case clients, scoped per remote device (SKI).
|
|
8
|
+
*
|
|
9
|
+
* Each accessor returns a client interface that knows how to talk to the named
|
|
10
|
+
* use case on the given remote node, in both actor roles. Adding a new use
|
|
11
|
+
* case in the future is a mechanical change: add one type group to
|
|
12
|
+
* `enyo-eebus-use-cases.ts`, one client interface file under `packages/eebus/`,
|
|
13
|
+
* and one accessor here.
|
|
14
|
+
*
|
|
15
|
+
* Before invoking a use-case client, consider verifying that the remote
|
|
16
|
+
* actually advertises support for it via
|
|
17
|
+
* {@link EebusIdentityService.getSupportedUseCases}.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* // Energy manager limits a wallbox to 11kW
|
|
22
|
+
* await eebus.useCases.lpc(wallboxSki).setConsumptionLimit({
|
|
23
|
+
* value: 11000,
|
|
24
|
+
* isActive: true,
|
|
25
|
+
* });
|
|
26
|
+
*
|
|
27
|
+
* // CEM streams grid-connection-point telemetry from the house meter
|
|
28
|
+
* eebus.useCases.mgcp(meterSki).onReading(r => {
|
|
29
|
+
* chart.push({ t: r.timestamp, p: r.activePowerW });
|
|
30
|
+
* });
|
|
31
|
+
*
|
|
32
|
+
* // CEM coordinates a heat pump via incentive table
|
|
33
|
+
* await eebus.useCases.ohpcf(heatPumpSki).sendIncentiveTable({
|
|
34
|
+
* currency: 'EUR',
|
|
35
|
+
* unit: 'kWh',
|
|
36
|
+
* tiers: hourlyPriceTiers,
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export interface EebusUseCaseRegistry {
|
|
41
|
+
/**
|
|
42
|
+
* Get the **Limitation of Power Consumption** client for a remote node.
|
|
43
|
+
* LPC limits are obligations the remote MUST respect.
|
|
44
|
+
* @param ski Subject Key Identifier of the remote node
|
|
45
|
+
*/
|
|
46
|
+
lpc: (ski: string) => EebusLpcClient;
|
|
47
|
+
/**
|
|
48
|
+
* Get the **Limitation of Power Production** client for a remote node.
|
|
49
|
+
* LPP limits are recommendations the remote SHOULD respect.
|
|
50
|
+
* @param ski Subject Key Identifier of the remote node
|
|
51
|
+
*/
|
|
52
|
+
lpp: (ski: string) => EebusLppClient;
|
|
53
|
+
/**
|
|
54
|
+
* Get the **Monitoring of Grid Connection Point** client for a remote node.
|
|
55
|
+
* Read-only telemetry from a smart meter / grid connection point.
|
|
56
|
+
* @param ski Subject Key Identifier of the remote node
|
|
57
|
+
*/
|
|
58
|
+
mgcp: (ski: string) => EebusMgcpClient;
|
|
59
|
+
/**
|
|
60
|
+
* Get the **Monitoring of Power Consumption** client for a remote node.
|
|
61
|
+
* Read-only telemetry from a controllable system reporting its own consumption.
|
|
62
|
+
* @param ski Subject Key Identifier of the remote node
|
|
63
|
+
*/
|
|
64
|
+
mpc: (ski: string) => EebusMpcClient;
|
|
65
|
+
/**
|
|
66
|
+
* Get the **Optimization of Self Consumption by Heat Pump Compressor
|
|
67
|
+
* Flexibility** client for a remote node. Incentive-table-driven heat
|
|
68
|
+
* pump coordination.
|
|
69
|
+
* @param ski Subject Key Identifier of the remote node
|
|
70
|
+
*/
|
|
71
|
+
ohpcf: (ski: string) => EebusOhpcfClient;
|
|
72
|
+
}
|