@enyo-energy/energy-app-sdk 1.17.0 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -928,6 +928,24 @@ StartTransaction returns the running session instead of opening a second one.
928
928
  `save()` remains a whole-object update for a session that already exists; it
929
929
  offers no uniqueness guarantee, so do not open sessions with it.
930
930
 
931
+ **A session records the answers it ran under**, so a listener sees what the
932
+ customer actually chose rather than only what the charger measured:
933
+
934
+ | Field | Meaning |
935
+ |---|---|
936
+ | `startSocPercent` / `targetSocPercent` | The SoC the session started from and was to reach. Fixed for the session. |
937
+ | `priceLimitMode` | Which ceiling applied — `ct-per-kwh`, `cheapest-share`, or absent for none. |
938
+ | `priceLimitCtPerKwh` / `priceLimitSharePercent` | The ceiling itself, read according to the mode. |
939
+ | `maxChargingPowerW` | The power the user dialled, in **Watts**. `Immediate` only. |
940
+ | `vehicleAssignment` | `detected` \| `manual` \| `unknown` — how the session found its car. |
941
+
942
+ These mirror the fields on `StartChargeV1`: the command says what a session was
943
+ asked for, the charge says what it ran with. `maxChargingPowerW` is the opening
944
+ figure only — the energy manager's `SetChargerAvailablePowerV2` envelope still
945
+ bounds the session and overrides it. Watch the units: this one is watts, while
946
+ `EnyoChargeScheduleEntry.limitAmpere` is amperes and the superseded
947
+ `ChangeChargingPowerV1` is kW.
948
+
931
949
  React to charging sessions as they happen:
932
950
 
933
951
  ```typescript
@@ -1,6 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EnyoChargeStatus = void 0;
3
+ exports.EnyoChargeStatus = exports.EnyoChargeVehicleAssignmentEnum = void 0;
4
+ /**
5
+ * Where the vehicle on a charging session came from.
6
+ *
7
+ * Kept apart from "is {@link EnyoCharge.vehicleId} set" because the two answer
8
+ * different questions: a manually assigned session and a recognised one both
9
+ * carry an id, but only the recognised one says anything about the wallbox's
10
+ * ability to identify cars.
11
+ */
12
+ var EnyoChargeVehicleAssignmentEnum;
13
+ (function (EnyoChargeVehicleAssignmentEnum) {
14
+ /** The charger or an integration recognised the car on its own. */
15
+ EnyoChargeVehicleAssignmentEnum["Detected"] = "detected";
16
+ /** A user picked the car, either at plug-in or afterwards in the history. */
17
+ EnyoChargeVehicleAssignmentEnum["Manual"] = "manual";
18
+ /**
19
+ * No car is assigned. A normal outcome rather than a fault — plenty of
20
+ * wallboxes cannot identify a vehicle, and the history offers this as
21
+ * something to fix rather than reporting it as an error.
22
+ */
23
+ EnyoChargeVehicleAssignmentEnum["Unknown"] = "unknown";
24
+ })(EnyoChargeVehicleAssignmentEnum || (exports.EnyoChargeVehicleAssignmentEnum = EnyoChargeVehicleAssignmentEnum = {}));
4
25
  /**
5
26
  * Status of a charging session
6
27
  */
@@ -1,4 +1,24 @@
1
- import { EnyoChargeModeEnum } from "./enyo-data-bus-value.cjs";
1
+ import { EnyoChargeModeEnum, EnyoPriceLimitModeEnum } from "./enyo-data-bus-value.cjs";
2
+ /**
3
+ * Where the vehicle on a charging session came from.
4
+ *
5
+ * Kept apart from "is {@link EnyoCharge.vehicleId} set" because the two answer
6
+ * different questions: a manually assigned session and a recognised one both
7
+ * carry an id, but only the recognised one says anything about the wallbox's
8
+ * ability to identify cars.
9
+ */
10
+ export declare enum EnyoChargeVehicleAssignmentEnum {
11
+ /** The charger or an integration recognised the car on its own. */
12
+ Detected = "detected",
13
+ /** A user picked the car, either at plug-in or afterwards in the history. */
14
+ Manual = "manual",
15
+ /**
16
+ * No car is assigned. A normal outcome rather than a fault — plenty of
17
+ * wallboxes cannot identify a vehicle, and the history offers this as
18
+ * something to fix rather than reporting it as an error.
19
+ */
20
+ Unknown = "unknown"
21
+ }
2
22
  /**
3
23
  * Status of a charging session
4
24
  */
@@ -117,6 +137,77 @@ export interface EnyoCharge {
117
137
  chargeMode?: EnyoChargeModeEnum;
118
138
  /** Target completion time for the charging session as an ISO 8601 timestamp */
119
139
  completeAtIsoTimestamp?: string;
140
+ /**
141
+ * State of charge at plug-in, in percent (0-100) — the host's estimate as
142
+ * the user corrected it.
143
+ *
144
+ * Fixed for the session, because it describes a moment and not a
145
+ * preference. The charging screen draws its progress bar from here to
146
+ * {@link targetSocPercent}.
147
+ *
148
+ * This is the recorded counterpart of
149
+ * {@link EnyoDataBusStartChargeV1.data.startSocPercent}: the command says
150
+ * what the session was asked for, the charge says what it ran with.
151
+ */
152
+ startSocPercent?: number;
153
+ /**
154
+ * State of charge this session was to reach, in percent (0-100). The
155
+ * vehicle's standing charge limit unless the user overrode it for this one
156
+ * session.
157
+ */
158
+ targetSocPercent?: number;
159
+ /**
160
+ * How the grid price ceiling that governed this session was expressed, or
161
+ * omitted when there was **no ceiling** — recorded so the history can say
162
+ * why a session waited instead of charging.
163
+ *
164
+ * Decides which of {@link priceLimitCtPerKwh} and
165
+ * {@link priceLimitSharePercent} applied; the other was ignored.
166
+ */
167
+ priceLimitMode?: EnyoPriceLimitModeEnum;
168
+ /**
169
+ * The absolute ceiling that applied, in **cents per kWh** (`25` is
170
+ * 25 ct/kWh). Only meaningful while {@link priceLimitMode} is
171
+ * {@link EnyoPriceLimitModeEnum.CtPerKwh}.
172
+ */
173
+ priceLimitCtPerKwh?: number;
174
+ /**
175
+ * The relative ceiling that applied — the cheapest share of the day the
176
+ * session was allowed to import in, in percent. Only meaningful while
177
+ * {@link priceLimitMode} is {@link EnyoPriceLimitModeEnum.CheapestShare}.
178
+ *
179
+ * Note this records the *setting*, not the price threshold it resolved to:
180
+ * that threshold moved as prices published, so it is not a property of the
181
+ * session.
182
+ */
183
+ priceLimitSharePercent?: number;
184
+ /**
185
+ * How this session found its vehicle — see
186
+ * {@link EnyoChargeVehicleAssignmentEnum}. Absent on sessions recorded
187
+ * before the distinction existed; treat that as
188
+ * {@link EnyoChargeVehicleAssignmentEnum.Unknown} only when
189
+ * {@link vehicleId} is unset too.
190
+ */
191
+ vehicleAssignment?: EnyoChargeVehicleAssignmentEnum;
192
+ /**
193
+ * Charging power the user dialled for this session, in **Watts**.
194
+ *
195
+ * Only meaningful under {@link EnyoChargeModeEnum.Immediate}, where how
196
+ * fast to charge is the customer's call rather than the energy manager's.
197
+ * Recorded on the session so reopening it shows the figure actually in
198
+ * force.
199
+ *
200
+ * Watts, matching
201
+ * {@link EnyoAvailablePowerCommandData.powerW} — note the SDK's other
202
+ * charging ceilings do not agree on a unit:
203
+ * {@link EnyoChargeScheduleEntry.limitAmpere} is in Amperes and the
204
+ * superseded {@link EnyoDataBusChangeChargingPowerV1} is in kW.
205
+ *
206
+ * **Not a second limit.** The energy manager's power envelope
207
+ * ({@link EnyoDataBusSetChargerAvailablePowerV2}) still bounds the session;
208
+ * this is what the user asked for within it.
209
+ */
210
+ maxChargingPowerW?: number;
120
211
  }
121
212
  /**
122
213
  * Represents a single entry in a charging schedule.
@@ -166,4 +257,10 @@ export interface EnyoChargeFilter {
166
257
  chargingCardId?: string;
167
258
  /** Filter by vehicle */
168
259
  vehicleId?: string;
260
+ /**
261
+ * Filter by how the session found its vehicle. Mainly useful for
262
+ * {@link EnyoChargeVehicleAssignmentEnum.Unknown} — the sessions a user
263
+ * can still be asked to assign a car to.
264
+ */
265
+ vehicleAssignment?: EnyoChargeVehicleAssignmentEnum;
169
266
  }
@@ -1420,6 +1420,26 @@ export interface EnyoDataBusStartChargeV1 extends EnyoDataBusMessage {
1420
1420
  * start.
1421
1421
  */
1422
1422
  priceLimitSharePercent?: number;
1423
+ /**
1424
+ * Charging power the user asked for, in **Watts**.
1425
+ *
1426
+ * Only meaningful under {@link EnyoChargeModeEnum.Immediate}, where how
1427
+ * fast to charge is the customer's call rather than the energy
1428
+ * manager's; the optimised modes derive their own power from the plan.
1429
+ *
1430
+ * Watts, matching {@link EnyoAvailablePowerCommandData.powerW} — the
1431
+ * SDK's other charging ceilings disagree on units
1432
+ * ({@link EnyoChargeScheduleEntry.limitAmpere} is Amperes, the
1433
+ * superseded {@link EnyoDataBusChangeChargingPowerV1} is kW), so do not
1434
+ * assume.
1435
+ *
1436
+ * **The opening figure, not a standing one.** The energy manager's
1437
+ * envelope ({@link EnyoDataBusSetChargerAvailablePowerV2}) still bounds
1438
+ * the session and overrides this as soon as it arrives; this is what
1439
+ * the user asked for within it. Omitted means "as fast as the car and
1440
+ * the wallbox jointly allow".
1441
+ */
1442
+ maxChargingPowerW?: number;
1423
1443
  /** Optional reason why this command was issued */
1424
1444
  reason?: EnyoDataBusCommandReason;
1425
1445
  };
@@ -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 = '1.17.0';
12
+ exports.SDK_VERSION = '1.18.0';
13
13
  /**
14
14
  * Gets the current SDK version.
15
15
  * @returns The semantic version string of the SDK
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Current version of the enyo Energy App SDK.
7
7
  */
8
- export declare const SDK_VERSION = "1.17.0";
8
+ export declare const SDK_VERSION = "1.18.0";
9
9
  /**
10
10
  * Gets the current SDK version.
11
11
  * @returns The semantic version string of the SDK
@@ -1,4 +1,24 @@
1
- import { EnyoChargeModeEnum } from "./enyo-data-bus-value.js";
1
+ import { EnyoChargeModeEnum, EnyoPriceLimitModeEnum } from "./enyo-data-bus-value.js";
2
+ /**
3
+ * Where the vehicle on a charging session came from.
4
+ *
5
+ * Kept apart from "is {@link EnyoCharge.vehicleId} set" because the two answer
6
+ * different questions: a manually assigned session and a recognised one both
7
+ * carry an id, but only the recognised one says anything about the wallbox's
8
+ * ability to identify cars.
9
+ */
10
+ export declare enum EnyoChargeVehicleAssignmentEnum {
11
+ /** The charger or an integration recognised the car on its own. */
12
+ Detected = "detected",
13
+ /** A user picked the car, either at plug-in or afterwards in the history. */
14
+ Manual = "manual",
15
+ /**
16
+ * No car is assigned. A normal outcome rather than a fault — plenty of
17
+ * wallboxes cannot identify a vehicle, and the history offers this as
18
+ * something to fix rather than reporting it as an error.
19
+ */
20
+ Unknown = "unknown"
21
+ }
2
22
  /**
3
23
  * Status of a charging session
4
24
  */
@@ -117,6 +137,77 @@ export interface EnyoCharge {
117
137
  chargeMode?: EnyoChargeModeEnum;
118
138
  /** Target completion time for the charging session as an ISO 8601 timestamp */
119
139
  completeAtIsoTimestamp?: string;
140
+ /**
141
+ * State of charge at plug-in, in percent (0-100) — the host's estimate as
142
+ * the user corrected it.
143
+ *
144
+ * Fixed for the session, because it describes a moment and not a
145
+ * preference. The charging screen draws its progress bar from here to
146
+ * {@link targetSocPercent}.
147
+ *
148
+ * This is the recorded counterpart of
149
+ * {@link EnyoDataBusStartChargeV1.data.startSocPercent}: the command says
150
+ * what the session was asked for, the charge says what it ran with.
151
+ */
152
+ startSocPercent?: number;
153
+ /**
154
+ * State of charge this session was to reach, in percent (0-100). The
155
+ * vehicle's standing charge limit unless the user overrode it for this one
156
+ * session.
157
+ */
158
+ targetSocPercent?: number;
159
+ /**
160
+ * How the grid price ceiling that governed this session was expressed, or
161
+ * omitted when there was **no ceiling** — recorded so the history can say
162
+ * why a session waited instead of charging.
163
+ *
164
+ * Decides which of {@link priceLimitCtPerKwh} and
165
+ * {@link priceLimitSharePercent} applied; the other was ignored.
166
+ */
167
+ priceLimitMode?: EnyoPriceLimitModeEnum;
168
+ /**
169
+ * The absolute ceiling that applied, in **cents per kWh** (`25` is
170
+ * 25 ct/kWh). Only meaningful while {@link priceLimitMode} is
171
+ * {@link EnyoPriceLimitModeEnum.CtPerKwh}.
172
+ */
173
+ priceLimitCtPerKwh?: number;
174
+ /**
175
+ * The relative ceiling that applied — the cheapest share of the day the
176
+ * session was allowed to import in, in percent. Only meaningful while
177
+ * {@link priceLimitMode} is {@link EnyoPriceLimitModeEnum.CheapestShare}.
178
+ *
179
+ * Note this records the *setting*, not the price threshold it resolved to:
180
+ * that threshold moved as prices published, so it is not a property of the
181
+ * session.
182
+ */
183
+ priceLimitSharePercent?: number;
184
+ /**
185
+ * How this session found its vehicle — see
186
+ * {@link EnyoChargeVehicleAssignmentEnum}. Absent on sessions recorded
187
+ * before the distinction existed; treat that as
188
+ * {@link EnyoChargeVehicleAssignmentEnum.Unknown} only when
189
+ * {@link vehicleId} is unset too.
190
+ */
191
+ vehicleAssignment?: EnyoChargeVehicleAssignmentEnum;
192
+ /**
193
+ * Charging power the user dialled for this session, in **Watts**.
194
+ *
195
+ * Only meaningful under {@link EnyoChargeModeEnum.Immediate}, where how
196
+ * fast to charge is the customer's call rather than the energy manager's.
197
+ * Recorded on the session so reopening it shows the figure actually in
198
+ * force.
199
+ *
200
+ * Watts, matching
201
+ * {@link EnyoAvailablePowerCommandData.powerW} — note the SDK's other
202
+ * charging ceilings do not agree on a unit:
203
+ * {@link EnyoChargeScheduleEntry.limitAmpere} is in Amperes and the
204
+ * superseded {@link EnyoDataBusChangeChargingPowerV1} is in kW.
205
+ *
206
+ * **Not a second limit.** The energy manager's power envelope
207
+ * ({@link EnyoDataBusSetChargerAvailablePowerV2}) still bounds the session;
208
+ * this is what the user asked for within it.
209
+ */
210
+ maxChargingPowerW?: number;
120
211
  }
121
212
  /**
122
213
  * Represents a single entry in a charging schedule.
@@ -166,4 +257,10 @@ export interface EnyoChargeFilter {
166
257
  chargingCardId?: string;
167
258
  /** Filter by vehicle */
168
259
  vehicleId?: string;
260
+ /**
261
+ * Filter by how the session found its vehicle. Mainly useful for
262
+ * {@link EnyoChargeVehicleAssignmentEnum.Unknown} — the sessions a user
263
+ * can still be asked to assign a car to.
264
+ */
265
+ vehicleAssignment?: EnyoChargeVehicleAssignmentEnum;
169
266
  }
@@ -1,3 +1,24 @@
1
+ /**
2
+ * Where the vehicle on a charging session came from.
3
+ *
4
+ * Kept apart from "is {@link EnyoCharge.vehicleId} set" because the two answer
5
+ * different questions: a manually assigned session and a recognised one both
6
+ * carry an id, but only the recognised one says anything about the wallbox's
7
+ * ability to identify cars.
8
+ */
9
+ export var EnyoChargeVehicleAssignmentEnum;
10
+ (function (EnyoChargeVehicleAssignmentEnum) {
11
+ /** The charger or an integration recognised the car on its own. */
12
+ EnyoChargeVehicleAssignmentEnum["Detected"] = "detected";
13
+ /** A user picked the car, either at plug-in or afterwards in the history. */
14
+ EnyoChargeVehicleAssignmentEnum["Manual"] = "manual";
15
+ /**
16
+ * No car is assigned. A normal outcome rather than a fault — plenty of
17
+ * wallboxes cannot identify a vehicle, and the history offers this as
18
+ * something to fix rather than reporting it as an error.
19
+ */
20
+ EnyoChargeVehicleAssignmentEnum["Unknown"] = "unknown";
21
+ })(EnyoChargeVehicleAssignmentEnum || (EnyoChargeVehicleAssignmentEnum = {}));
1
22
  /**
2
23
  * Status of a charging session
3
24
  */
@@ -1420,6 +1420,26 @@ export interface EnyoDataBusStartChargeV1 extends EnyoDataBusMessage {
1420
1420
  * start.
1421
1421
  */
1422
1422
  priceLimitSharePercent?: number;
1423
+ /**
1424
+ * Charging power the user asked for, in **Watts**.
1425
+ *
1426
+ * Only meaningful under {@link EnyoChargeModeEnum.Immediate}, where how
1427
+ * fast to charge is the customer's call rather than the energy
1428
+ * manager's; the optimised modes derive their own power from the plan.
1429
+ *
1430
+ * Watts, matching {@link EnyoAvailablePowerCommandData.powerW} — the
1431
+ * SDK's other charging ceilings disagree on units
1432
+ * ({@link EnyoChargeScheduleEntry.limitAmpere} is Amperes, the
1433
+ * superseded {@link EnyoDataBusChangeChargingPowerV1} is kW), so do not
1434
+ * assume.
1435
+ *
1436
+ * **The opening figure, not a standing one.** The energy manager's
1437
+ * envelope ({@link EnyoDataBusSetChargerAvailablePowerV2}) still bounds
1438
+ * the session and overrides this as soon as it arrives; this is what
1439
+ * the user asked for within it. Omitted means "as fast as the car and
1440
+ * the wallbox jointly allow".
1441
+ */
1442
+ maxChargingPowerW?: number;
1423
1443
  /** Optional reason why this command was issued */
1424
1444
  reason?: EnyoDataBusCommandReason;
1425
1445
  };
package/dist/version.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Current version of the enyo Energy App SDK.
7
7
  */
8
- export declare const SDK_VERSION = "1.17.0";
8
+ export declare const SDK_VERSION = "1.18.0";
9
9
  /**
10
10
  * Gets the current SDK version.
11
11
  * @returns The semantic version string of the SDK
package/dist/version.js CHANGED
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Current version of the enyo Energy App SDK.
7
7
  */
8
- export const SDK_VERSION = '1.17.0';
8
+ export const SDK_VERSION = '1.18.0';
9
9
  /**
10
10
  * Gets the current SDK version.
11
11
  * @returns The semantic version string of the SDK
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enyo-energy/energy-app-sdk",
3
- "version": "1.17.0",
3
+ "version": "1.18.0",
4
4
  "description": "enyo Energy App SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",