@enyo-energy/energy-app-sdk 1.16.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 +18 -0
- package/dist/cjs/types/enyo-charge.cjs +22 -1
- package/dist/cjs/types/enyo-charge.d.cts +98 -1
- package/dist/cjs/types/enyo-data-bus-value.cjs +4 -0
- package/dist/cjs/types/enyo-data-bus-value.d.cts +195 -0
- package/dist/cjs/types/enyo-energy-manager.cjs +16 -2
- package/dist/cjs/types/enyo-energy-manager.d.cts +16 -2
- package/dist/cjs/types/enyo-vehicle.cjs +75 -0
- package/dist/cjs/types/enyo-vehicle.d.cts +79 -0
- package/dist/cjs/version.cjs +1 -1
- package/dist/cjs/version.d.cts +1 -1
- package/dist/types/enyo-charge.d.ts +98 -1
- package/dist/types/enyo-charge.js +21 -0
- package/dist/types/enyo-data-bus-value.d.ts +195 -0
- package/dist/types/enyo-data-bus-value.js +4 -0
- package/dist/types/enyo-energy-manager.d.ts +16 -2
- package/dist/types/enyo-energy-manager.js +16 -2
- package/dist/types/enyo-vehicle.d.ts +79 -0
- package/dist/types/enyo-vehicle.js +74 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
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
|
}
|
|
@@ -385,6 +385,10 @@ var EnyoDataBusMessageEnum;
|
|
|
385
385
|
EnyoDataBusMessageEnum["StopAirConditioningV1"] = "StopAirConditioningV1";
|
|
386
386
|
EnyoDataBusMessageEnum["ChangeAirConditioningOptimizationModeV1"] = "ChangeAirConditioningOptimizationModeV1";
|
|
387
387
|
EnyoDataBusMessageEnum["VehicleSocUpdateV1"] = "VehicleSocUpdateV1";
|
|
388
|
+
/** Request the current or estimated state of charge of a vehicle, by vehicle id. */
|
|
389
|
+
EnyoDataBusMessageEnum["RequestVehicleSocEstimateV1"] = "RequestVehicleSocEstimateV1";
|
|
390
|
+
/** Answer to {@link RequestVehicleSocEstimateV1} — the estimate with its age and source, or why none could be given. */
|
|
391
|
+
EnyoDataBusMessageEnum["VehicleSocEstimateResponseV1"] = "VehicleSocEstimateResponseV1";
|
|
388
392
|
/** V2 control command: announce the available/max power (W) envelope to a charger. Supersedes {@link EnyoDataBusMessageEnum.ChangeChargingPowerV1}. */
|
|
389
393
|
EnyoDataBusMessageEnum["SetChargerAvailablePowerV2"] = "SetChargerAvailablePowerV2";
|
|
390
394
|
/** V2 control command: announce the available/max power (W) envelope to a heatpump, with purpose and power-source context. Supersedes {@link EnyoDataBusMessageEnum.HeatpumpAvailablePowerAnnouncementV1}. */
|
|
@@ -4,6 +4,7 @@ import { EnyoSourceEnum } from "./enyo-source.enum.cjs";
|
|
|
4
4
|
import { EnyoOcppRelativeSchedule } from "./enyo-ocpp.cjs";
|
|
5
5
|
import { EnyoChargerAppliancePhase, EnyoChargerApplianceStatusEnum, EnyoChargerApplianceSuspendedReasonEnum } from "./enyo-charger-appliance.cjs";
|
|
6
6
|
import { PreviewChargingSchedule, PreviewChargingScheduleCostComparison, PreviewChargingScheduleUnavailableReasonEnum } from "./enyo-energy-manager.cjs";
|
|
7
|
+
import { EnyoVehicleSocSourceEnum, EnyoVehicleSocUnavailableReasonEnum } from "./enyo-vehicle.cjs";
|
|
7
8
|
import { EnyoEnergyPrices } from "./enyo-energy-prices.cjs";
|
|
8
9
|
import { EnyoCurrencyEnum } from "./enyo-currency.cjs";
|
|
9
10
|
import { EnyoHeatpumpApplianceModeEnum } from "./enyo-heatpump-appliance.cjs";
|
|
@@ -653,6 +654,10 @@ export declare enum EnyoDataBusMessageEnum {
|
|
|
653
654
|
StopAirConditioningV1 = "StopAirConditioningV1",
|
|
654
655
|
ChangeAirConditioningOptimizationModeV1 = "ChangeAirConditioningOptimizationModeV1",
|
|
655
656
|
VehicleSocUpdateV1 = "VehicleSocUpdateV1",
|
|
657
|
+
/** Request the current or estimated state of charge of a vehicle, by vehicle id. */
|
|
658
|
+
RequestVehicleSocEstimateV1 = "RequestVehicleSocEstimateV1",
|
|
659
|
+
/** Answer to {@link RequestVehicleSocEstimateV1} — the estimate with its age and source, or why none could be given. */
|
|
660
|
+
VehicleSocEstimateResponseV1 = "VehicleSocEstimateResponseV1",
|
|
656
661
|
/** V2 control command: announce the available/max power (W) envelope to a charger. Supersedes {@link EnyoDataBusMessageEnum.ChangeChargingPowerV1}. */
|
|
657
662
|
SetChargerAvailablePowerV2 = "SetChargerAvailablePowerV2",
|
|
658
663
|
/** V2 control command: announce the available/max power (W) envelope to a heatpump, with purpose and power-source context. Supersedes {@link EnyoDataBusMessageEnum.HeatpumpAvailablePowerAnnouncementV1}. */
|
|
@@ -1415,6 +1420,26 @@ export interface EnyoDataBusStartChargeV1 extends EnyoDataBusMessage {
|
|
|
1415
1420
|
* start.
|
|
1416
1421
|
*/
|
|
1417
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;
|
|
1418
1443
|
/** Optional reason why this command was issued */
|
|
1419
1444
|
reason?: EnyoDataBusCommandReason;
|
|
1420
1445
|
};
|
|
@@ -1661,6 +1686,25 @@ export interface EnyoDataBusEnergyManagementChargingStateV1 extends EnyoDataBusM
|
|
|
1661
1686
|
/**
|
|
1662
1687
|
* Request message to get a preview of the optimized charging schedule.
|
|
1663
1688
|
* Sent when user wants to see the charging plan before starting.
|
|
1689
|
+
*
|
|
1690
|
+
* **How much energy to plan for** can be said three ways, and the energy
|
|
1691
|
+
* manager resolves them in this order:
|
|
1692
|
+
*
|
|
1693
|
+
* 1. {@link data.targetEnergyWh} — an explicit figure, used as given.
|
|
1694
|
+
* 2. {@link data.startSocPercent} and {@link data.targetSocPercent} together
|
|
1695
|
+
* with the vehicle's `batterySizeKwh`, which is what the charging screen
|
|
1696
|
+
* draws its progress bar from.
|
|
1697
|
+
* 3. {@link data.vehicleId} alone — the host falls back to the vehicle's own
|
|
1698
|
+
* state of charge and standing charge limit.
|
|
1699
|
+
*
|
|
1700
|
+
* When none of them yields a figure the response carries
|
|
1701
|
+
* {@link PreviewChargingScheduleUnavailableReasonEnum.NoTargetEnergy}.
|
|
1702
|
+
*
|
|
1703
|
+
* **The price ceiling should match the one the session will actually run
|
|
1704
|
+
* under**, otherwise the preview shows a plan the real session will not follow.
|
|
1705
|
+
* It is spelled exactly as on {@link EnyoDataBusStartChargeV1}: a
|
|
1706
|
+
* {@link data.priceLimitMode} naming which of the two ceiling values is read,
|
|
1707
|
+
* or no mode at all for no ceiling.
|
|
1664
1708
|
*/
|
|
1665
1709
|
export interface EnyoDataBusRequestPreviewChargingScheduleV1 extends EnyoDataBusMessage {
|
|
1666
1710
|
type: 'message';
|
|
@@ -1674,6 +1718,53 @@ export interface EnyoDataBusRequestPreviewChargingScheduleV1 extends EnyoDataBus
|
|
|
1674
1718
|
targetEnergyWh?: number;
|
|
1675
1719
|
/** Alternative vehicle id instead of targetEnergyWh*/
|
|
1676
1720
|
vehicleId?: string;
|
|
1721
|
+
/**
|
|
1722
|
+
* State of charge to plan from, in percent (0-100) — the host's
|
|
1723
|
+
* estimate as the user corrected it on the charging screen.
|
|
1724
|
+
*
|
|
1725
|
+
* Only useful together with {@link targetSocPercent} and a
|
|
1726
|
+
* {@link vehicleId} whose `batterySizeKwh` is known: percent is not
|
|
1727
|
+
* energy until there is a battery size to multiply it by. A preview
|
|
1728
|
+
* asked with a start but no target cannot size the session and falls
|
|
1729
|
+
* back to the next resolution step.
|
|
1730
|
+
*/
|
|
1731
|
+
startSocPercent?: number;
|
|
1732
|
+
/**
|
|
1733
|
+
* State of charge the previewed session should reach, in percent
|
|
1734
|
+
* (0-100). Defaults to the vehicle's standing charge limit when
|
|
1735
|
+
* omitted.
|
|
1736
|
+
*/
|
|
1737
|
+
targetSocPercent?: number;
|
|
1738
|
+
/**
|
|
1739
|
+
* Which price ceiling to plan against, or omitted for **no ceiling**.
|
|
1740
|
+
* Same vocabulary as
|
|
1741
|
+
* {@link EnyoDataBusStartChargeV1.data.priceLimitMode}.
|
|
1742
|
+
*
|
|
1743
|
+
* Only affects the {@link EnyoChargeModeEnum.CostOptimized} result — it
|
|
1744
|
+
* is the only mode that imports, so it is the only one a ceiling can
|
|
1745
|
+
* change. The other modes' entries in
|
|
1746
|
+
* {@link PreviewChargingScheduleModeResult} are unaffected, which is
|
|
1747
|
+
* what makes the side-by-side comparison meaningful.
|
|
1748
|
+
*/
|
|
1749
|
+
priceLimitMode?: EnyoPriceLimitModeEnum;
|
|
1750
|
+
/**
|
|
1751
|
+
* Absolute ceiling in **cents per kWh** to plan against. Only read
|
|
1752
|
+
* while {@link priceLimitMode} is
|
|
1753
|
+
* {@link EnyoPriceLimitModeEnum.CtPerKwh}.
|
|
1754
|
+
*/
|
|
1755
|
+
priceLimitCtPerKwh?: number;
|
|
1756
|
+
/**
|
|
1757
|
+
* Relative ceiling — plan to import only during the cheapest share of
|
|
1758
|
+
* the day, in percent, integer 1 to 100. Only read while
|
|
1759
|
+
* {@link priceLimitMode} is
|
|
1760
|
+
* {@link EnyoPriceLimitModeEnum.CheapestShare}.
|
|
1761
|
+
*
|
|
1762
|
+
* A preview under a relative ceiling is a snapshot: the share is taken
|
|
1763
|
+
* over the prices known when the request is answered, so the plan
|
|
1764
|
+
* changes once the next day's prices publish. Do not cache it past the
|
|
1765
|
+
* price horizon.
|
|
1766
|
+
*/
|
|
1767
|
+
priceLimitSharePercent?: number;
|
|
1677
1768
|
/** Target completion time as ISO timestamp (optional) */
|
|
1678
1769
|
completeByIso?: string;
|
|
1679
1770
|
/** Charger max power setting in Watts for cost comparison (optional) */
|
|
@@ -2939,6 +3030,110 @@ export interface EnyoDataBusVehicleSocUpdateV1 extends EnyoDataBusMessage {
|
|
|
2939
3030
|
* the session against it.
|
|
2940
3031
|
*/
|
|
2941
3032
|
measuredAtIso?: string;
|
|
3033
|
+
/**
|
|
3034
|
+
* Where this reading came from. Set it when you know — a value the car
|
|
3035
|
+
* reported and one derived from energy delivered since plug-in are not
|
|
3036
|
+
* interchangeable, and the app tells the user which it is showing.
|
|
3037
|
+
*/
|
|
3038
|
+
source?: EnyoVehicleSocSourceEnum;
|
|
3039
|
+
};
|
|
3040
|
+
}
|
|
3041
|
+
/**
|
|
3042
|
+
* Request the current or estimated state of charge of a vehicle, by id.
|
|
3043
|
+
*
|
|
3044
|
+
* The pull counterpart to {@link EnyoDataBusVehicleSocUpdateV1}: that message
|
|
3045
|
+
* is published when a source happens to have a new reading, which is the wrong
|
|
3046
|
+
* shape for "the user just opened the charging screen and needs a number now".
|
|
3047
|
+
* Whoever can answer replies with a
|
|
3048
|
+
* {@link EnyoDataBusVehicleSocEstimateResponseV1} carrying the same
|
|
3049
|
+
* {@link data.requestId}.
|
|
3050
|
+
*
|
|
3051
|
+
* A responder may answer from a stored reading or go and fetch a fresh one —
|
|
3052
|
+
* the request says how old a value the caller will accept, not how to obtain
|
|
3053
|
+
* it.
|
|
3054
|
+
*
|
|
3055
|
+
* ```typescript
|
|
3056
|
+
* energyApp.useDataBus().sendMessage([{
|
|
3057
|
+
* type: 'message',
|
|
3058
|
+
* message: 'RequestVehicleSocEstimateV1',
|
|
3059
|
+
* data: {requestId, vehicleId, maxAgeMs: 15 * 60 * 1000},
|
|
3060
|
+
* }]);
|
|
3061
|
+
* ```
|
|
3062
|
+
*/
|
|
3063
|
+
export interface EnyoDataBusRequestVehicleSocEstimateV1 extends EnyoDataBusMessage {
|
|
3064
|
+
type: 'message';
|
|
3065
|
+
message: EnyoDataBusMessageEnum.RequestVehicleSocEstimateV1;
|
|
3066
|
+
data: {
|
|
3067
|
+
/** Unique request identifier the response must echo back. */
|
|
3068
|
+
requestId: string;
|
|
3069
|
+
/** ID of the vehicle whose state of charge is wanted. */
|
|
3070
|
+
vehicleId: string;
|
|
3071
|
+
/**
|
|
3072
|
+
* Oldest reading the caller will accept, in milliseconds. A stored
|
|
3073
|
+
* value older than this is not returned — the responder answers
|
|
3074
|
+
* {@link EnyoVehicleSocUnavailableReasonEnum.ReadingTooOld} instead, or
|
|
3075
|
+
* fetches a fresh one if it can.
|
|
3076
|
+
*
|
|
3077
|
+
* Omitted means any age is acceptable; the caller judges for itself
|
|
3078
|
+
* from {@link EnyoDataBusVehicleSocEstimateResponseV1.data.measuredAtIso}.
|
|
3079
|
+
* A planner sizing a session wants minutes; a screen showing a
|
|
3080
|
+
* last-known figure is happy with hours.
|
|
3081
|
+
*/
|
|
3082
|
+
maxAgeMs?: number;
|
|
3083
|
+
/**
|
|
3084
|
+
* ID of the charger the vehicle is plugged into, when known. Lets a
|
|
3085
|
+
* responder that can only read the car over the cable — a wallbox
|
|
3086
|
+
* speaking ISO 15118, a charge point reporting SoC in its meter
|
|
3087
|
+
* values — find the right one without guessing.
|
|
3088
|
+
*/
|
|
3089
|
+
applianceId?: string;
|
|
3090
|
+
};
|
|
3091
|
+
}
|
|
3092
|
+
/**
|
|
3093
|
+
* Answer to a {@link EnyoDataBusRequestVehicleSocEstimateV1}.
|
|
3094
|
+
*
|
|
3095
|
+
* Shaped like the preview response: {@link data.available} says whether there
|
|
3096
|
+
* is an answer at all, and the reading or the reason follows. **No answer is an
|
|
3097
|
+
* ordinary outcome**, not an error — plenty of vehicles have no source that can
|
|
3098
|
+
* report their charge, and a caller has to cope without one rather than assume
|
|
3099
|
+
* a number.
|
|
3100
|
+
*/
|
|
3101
|
+
export interface EnyoDataBusVehicleSocEstimateResponseV1 extends EnyoDataBusMessage {
|
|
3102
|
+
type: 'message';
|
|
3103
|
+
message: EnyoDataBusMessageEnum.VehicleSocEstimateResponseV1;
|
|
3104
|
+
data: {
|
|
3105
|
+
/** The {@link EnyoDataBusRequestVehicleSocEstimateV1.data.requestId} this answers. */
|
|
3106
|
+
requestId: string;
|
|
3107
|
+
/** ID of the vehicle the answer is about. */
|
|
3108
|
+
vehicleId: string;
|
|
3109
|
+
/** Whether a state of charge could be given. */
|
|
3110
|
+
available: boolean;
|
|
3111
|
+
/**
|
|
3112
|
+
* State of charge of the traction battery in percent (0-100). Only
|
|
3113
|
+
* present while {@link available} is `true`.
|
|
3114
|
+
*/
|
|
3115
|
+
socPercent?: number;
|
|
3116
|
+
/**
|
|
3117
|
+
* When {@link socPercent} was taken, ISO 8601 — not when this response
|
|
3118
|
+
* was sent. Always set alongside a value: a percentage without an age
|
|
3119
|
+
* cannot be aged out, and is shown to the user as current however old
|
|
3120
|
+
* it is.
|
|
3121
|
+
*/
|
|
3122
|
+
measuredAtIso?: string;
|
|
3123
|
+
/** Where the reading came from, when the responder can attribute it. */
|
|
3124
|
+
source?: EnyoVehicleSocSourceEnum;
|
|
3125
|
+
/**
|
|
3126
|
+
* Total usable capacity of the traction battery in kWh, if known.
|
|
3127
|
+
* Included because a percentage is not energy without it, and the
|
|
3128
|
+
* caller would otherwise need a second round trip to size a session.
|
|
3129
|
+
*/
|
|
3130
|
+
batterySizeKwh?: number;
|
|
3131
|
+
/**
|
|
3132
|
+
* Why no value could be given. Only present while {@link available} is
|
|
3133
|
+
* `false`; see {@link EnyoVehicleSocUnavailableReasonEnum} for which of
|
|
3134
|
+
* them are worth retrying.
|
|
3135
|
+
*/
|
|
3136
|
+
unavailableReason?: EnyoVehicleSocUnavailableReasonEnum;
|
|
2942
3137
|
};
|
|
2943
3138
|
}
|
|
2944
3139
|
/**
|
|
@@ -90,8 +90,9 @@ var PreviewChargingScheduleUnavailableReasonEnum;
|
|
|
90
90
|
PreviewChargingScheduleUnavailableReasonEnum["VehicleNotFound"] = "vehicle-not-found";
|
|
91
91
|
/**
|
|
92
92
|
* The amount of energy to plan for could not be determined — the request
|
|
93
|
-
* carried
|
|
94
|
-
*
|
|
93
|
+
* carried no `targetEnergyWh`, no usable `startSocPercent` /
|
|
94
|
+
* `targetSocPercent` pair (which needs the vehicle's `batterySizeKwh` to
|
|
95
|
+
* become energy), and no `vehicleId` whose battery state yields one.
|
|
95
96
|
*/
|
|
96
97
|
PreviewChargingScheduleUnavailableReasonEnum["NoTargetEnergy"] = "no-target-energy";
|
|
97
98
|
/**
|
|
@@ -113,6 +114,19 @@ var PreviewChargingScheduleUnavailableReasonEnum;
|
|
|
113
114
|
* preview for.
|
|
114
115
|
*/
|
|
115
116
|
PreviewChargingScheduleUnavailableReasonEnum["ChargeModeNotSupported"] = "charge-mode-not-supported";
|
|
117
|
+
/**
|
|
118
|
+
* A price ceiling was requested that no slot in the planning window meets,
|
|
119
|
+
* so a cost-optimized plan would import nothing at all.
|
|
120
|
+
*
|
|
121
|
+
* Actionable, which is why it is distinct from
|
|
122
|
+
* {@link DeadlineNotReachable}: the deadline is fine and the charger is
|
|
123
|
+
* fine — the user's limit is simply below every price on offer, and a
|
|
124
|
+
* consumer can say so and offer to raise it. Applies to both spellings of
|
|
125
|
+
* a ceiling: a `priceLimitCtPerKwh` under the cheapest slot, or a
|
|
126
|
+
* `priceLimitSharePercent` whose share contains no usable slot before the
|
|
127
|
+
* deadline.
|
|
128
|
+
*/
|
|
129
|
+
PreviewChargingScheduleUnavailableReasonEnum["PriceLimitNotReachable"] = "price-limit-not-reachable";
|
|
116
130
|
// ── Everything else ────────────────────────────────────────────────────
|
|
117
131
|
/**
|
|
118
132
|
* The energy manager could not produce a preview right now — it is still
|
|
@@ -78,8 +78,9 @@ export declare enum PreviewChargingScheduleUnavailableReasonEnum {
|
|
|
78
78
|
VehicleNotFound = "vehicle-not-found",
|
|
79
79
|
/**
|
|
80
80
|
* The amount of energy to plan for could not be determined — the request
|
|
81
|
-
* carried
|
|
82
|
-
*
|
|
81
|
+
* carried no `targetEnergyWh`, no usable `startSocPercent` /
|
|
82
|
+
* `targetSocPercent` pair (which needs the vehicle's `batterySizeKwh` to
|
|
83
|
+
* become energy), and no `vehicleId` whose battery state yields one.
|
|
83
84
|
*/
|
|
84
85
|
NoTargetEnergy = "no-target-energy",
|
|
85
86
|
/**
|
|
@@ -100,6 +101,19 @@ export declare enum PreviewChargingScheduleUnavailableReasonEnum {
|
|
|
100
101
|
* preview for.
|
|
101
102
|
*/
|
|
102
103
|
ChargeModeNotSupported = "charge-mode-not-supported",
|
|
104
|
+
/**
|
|
105
|
+
* A price ceiling was requested that no slot in the planning window meets,
|
|
106
|
+
* so a cost-optimized plan would import nothing at all.
|
|
107
|
+
*
|
|
108
|
+
* Actionable, which is why it is distinct from
|
|
109
|
+
* {@link DeadlineNotReachable}: the deadline is fine and the charger is
|
|
110
|
+
* fine — the user's limit is simply below every price on offer, and a
|
|
111
|
+
* consumer can say so and offer to raise it. Applies to both spellings of
|
|
112
|
+
* a ceiling: a `priceLimitCtPerKwh` under the cheapest slot, or a
|
|
113
|
+
* `priceLimitSharePercent` whose share contains no usable slot before the
|
|
114
|
+
* deadline.
|
|
115
|
+
*/
|
|
116
|
+
PriceLimitNotReachable = "price-limit-not-reachable",
|
|
103
117
|
/**
|
|
104
118
|
* The energy manager could not produce a preview right now — it is still
|
|
105
119
|
* starting up, busy, or in a temporary error state. Transient: a later
|
|
@@ -1,2 +1,77 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EnyoVehicleSocUnavailableReasonEnum = exports.EnyoVehicleSocSourceEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Where a state-of-charge reading came from, and therefore how much it can be
|
|
6
|
+
* trusted.
|
|
7
|
+
*
|
|
8
|
+
* The app tells the user which it is — "Jetzt 60 % · von enyo geschätzt" reads
|
|
9
|
+
* very differently from a figure the car itself reported — and a planner may
|
|
10
|
+
* want to widen its margins on a derived value.
|
|
11
|
+
*/
|
|
12
|
+
var EnyoVehicleSocSourceEnum;
|
|
13
|
+
(function (EnyoVehicleSocSourceEnum) {
|
|
14
|
+
/**
|
|
15
|
+
* The vehicle reported it: ISO 15118, a manufacturer cloud integration, or
|
|
16
|
+
* any other channel that asks the car directly. The most trustworthy
|
|
17
|
+
* source.
|
|
18
|
+
*/
|
|
19
|
+
EnyoVehicleSocSourceEnum["Vehicle"] = "vehicle";
|
|
20
|
+
/**
|
|
21
|
+
* The charge point reported it, typically in OCPP meter values. Comes from
|
|
22
|
+
* the car over the cable, so it is as current as the session.
|
|
23
|
+
*/
|
|
24
|
+
EnyoVehicleSocSourceEnum["Charger"] = "charger";
|
|
25
|
+
/**
|
|
26
|
+
* Derived rather than read — energy delivered since plug-in added to an
|
|
27
|
+
* earlier figure, or a model of the vehicle's usage. Drifts with every
|
|
28
|
+
* assumption it rests on, and is the reason a reading must carry
|
|
29
|
+
* {@link EnyoVehicleSoc.measuredAtIso}.
|
|
30
|
+
*/
|
|
31
|
+
EnyoVehicleSocSourceEnum["Estimated"] = "estimated";
|
|
32
|
+
/** The user typed or corrected it on the charging screen. */
|
|
33
|
+
EnyoVehicleSocSourceEnum["UserProvided"] = "user-provided";
|
|
34
|
+
})(EnyoVehicleSocSourceEnum || (exports.EnyoVehicleSocSourceEnum = EnyoVehicleSocSourceEnum = {}));
|
|
35
|
+
/**
|
|
36
|
+
* Why no state of charge could be given for a vehicle.
|
|
37
|
+
*
|
|
38
|
+
* Carried by the response to a request for an estimate. The members are
|
|
39
|
+
* deliberately separate so a consumer can say something useful instead of "not
|
|
40
|
+
* available": {@link NoSocSource} is permanent for this car,
|
|
41
|
+
* {@link VehicleNotConnected} resolves when it is plugged in, and
|
|
42
|
+
* {@link ReadingTooOld} means a value exists but the caller asked for a fresher
|
|
43
|
+
* one.
|
|
44
|
+
*/
|
|
45
|
+
var EnyoVehicleSocUnavailableReasonEnum;
|
|
46
|
+
(function (EnyoVehicleSocUnavailableReasonEnum) {
|
|
47
|
+
/** No vehicle with the requested id exists. */
|
|
48
|
+
EnyoVehicleSocUnavailableReasonEnum["VehicleNotFound"] = "vehicle-not-found";
|
|
49
|
+
/**
|
|
50
|
+
* Nothing in the system can report this vehicle's charge — no integration
|
|
51
|
+
* reads the car and no charge point on site reports one. Permanent until
|
|
52
|
+
* the setup changes, so a consumer should stop asking rather than retry.
|
|
53
|
+
*/
|
|
54
|
+
EnyoVehicleSocUnavailableReasonEnum["NoSocSource"] = "no-soc-source";
|
|
55
|
+
/**
|
|
56
|
+
* A source exists but needs the car connected to read it, and it is not
|
|
57
|
+
* plugged in. Resolves on the next session.
|
|
58
|
+
*/
|
|
59
|
+
EnyoVehicleSocUnavailableReasonEnum["VehicleNotConnected"] = "vehicle-not-connected";
|
|
60
|
+
/**
|
|
61
|
+
* A reading exists but is older than the `maxAgeMs` the request asked for.
|
|
62
|
+
* Ask again without the constraint to take the stale value anyway — the
|
|
63
|
+
* responder does not decide for the caller what is too old.
|
|
64
|
+
*/
|
|
65
|
+
EnyoVehicleSocUnavailableReasonEnum["ReadingTooOld"] = "reading-too-old";
|
|
66
|
+
/**
|
|
67
|
+
* The source could not be reached right now — the vehicle's cloud API is
|
|
68
|
+
* down, the charge point is offline, the integration is still starting.
|
|
69
|
+
* Transient: a later request may succeed.
|
|
70
|
+
*/
|
|
71
|
+
EnyoVehicleSocUnavailableReasonEnum["TemporarilyUnavailable"] = "temporarily-unavailable";
|
|
72
|
+
/**
|
|
73
|
+
* No more specific reason applies. Prefer any of the members above; this
|
|
74
|
+
* exists so a sender never has to omit the field.
|
|
75
|
+
*/
|
|
76
|
+
EnyoVehicleSocUnavailableReasonEnum["Unknown"] = "unknown";
|
|
77
|
+
})(EnyoVehicleSocUnavailableReasonEnum || (exports.EnyoVehicleSocUnavailableReasonEnum = EnyoVehicleSocUnavailableReasonEnum = {}));
|
|
@@ -117,6 +117,78 @@ export interface EnyoVehicle {
|
|
|
117
117
|
*/
|
|
118
118
|
departureTimezone?: string;
|
|
119
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* Where a state-of-charge reading came from, and therefore how much it can be
|
|
122
|
+
* trusted.
|
|
123
|
+
*
|
|
124
|
+
* The app tells the user which it is — "Jetzt 60 % · von enyo geschätzt" reads
|
|
125
|
+
* very differently from a figure the car itself reported — and a planner may
|
|
126
|
+
* want to widen its margins on a derived value.
|
|
127
|
+
*/
|
|
128
|
+
export declare enum EnyoVehicleSocSourceEnum {
|
|
129
|
+
/**
|
|
130
|
+
* The vehicle reported it: ISO 15118, a manufacturer cloud integration, or
|
|
131
|
+
* any other channel that asks the car directly. The most trustworthy
|
|
132
|
+
* source.
|
|
133
|
+
*/
|
|
134
|
+
Vehicle = "vehicle",
|
|
135
|
+
/**
|
|
136
|
+
* The charge point reported it, typically in OCPP meter values. Comes from
|
|
137
|
+
* the car over the cable, so it is as current as the session.
|
|
138
|
+
*/
|
|
139
|
+
Charger = "charger",
|
|
140
|
+
/**
|
|
141
|
+
* Derived rather than read — energy delivered since plug-in added to an
|
|
142
|
+
* earlier figure, or a model of the vehicle's usage. Drifts with every
|
|
143
|
+
* assumption it rests on, and is the reason a reading must carry
|
|
144
|
+
* {@link EnyoVehicleSoc.measuredAtIso}.
|
|
145
|
+
*/
|
|
146
|
+
Estimated = "estimated",
|
|
147
|
+
/** The user typed or corrected it on the charging screen. */
|
|
148
|
+
UserProvided = "user-provided"
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Why no state of charge could be given for a vehicle.
|
|
152
|
+
*
|
|
153
|
+
* Carried by the response to a request for an estimate. The members are
|
|
154
|
+
* deliberately separate so a consumer can say something useful instead of "not
|
|
155
|
+
* available": {@link NoSocSource} is permanent for this car,
|
|
156
|
+
* {@link VehicleNotConnected} resolves when it is plugged in, and
|
|
157
|
+
* {@link ReadingTooOld} means a value exists but the caller asked for a fresher
|
|
158
|
+
* one.
|
|
159
|
+
*/
|
|
160
|
+
export declare enum EnyoVehicleSocUnavailableReasonEnum {
|
|
161
|
+
/** No vehicle with the requested id exists. */
|
|
162
|
+
VehicleNotFound = "vehicle-not-found",
|
|
163
|
+
/**
|
|
164
|
+
* Nothing in the system can report this vehicle's charge — no integration
|
|
165
|
+
* reads the car and no charge point on site reports one. Permanent until
|
|
166
|
+
* the setup changes, so a consumer should stop asking rather than retry.
|
|
167
|
+
*/
|
|
168
|
+
NoSocSource = "no-soc-source",
|
|
169
|
+
/**
|
|
170
|
+
* A source exists but needs the car connected to read it, and it is not
|
|
171
|
+
* plugged in. Resolves on the next session.
|
|
172
|
+
*/
|
|
173
|
+
VehicleNotConnected = "vehicle-not-connected",
|
|
174
|
+
/**
|
|
175
|
+
* A reading exists but is older than the `maxAgeMs` the request asked for.
|
|
176
|
+
* Ask again without the constraint to take the stale value anyway — the
|
|
177
|
+
* responder does not decide for the caller what is too old.
|
|
178
|
+
*/
|
|
179
|
+
ReadingTooOld = "reading-too-old",
|
|
180
|
+
/**
|
|
181
|
+
* The source could not be reached right now — the vehicle's cloud API is
|
|
182
|
+
* down, the charge point is offline, the integration is still starting.
|
|
183
|
+
* Transient: a later request may succeed.
|
|
184
|
+
*/
|
|
185
|
+
TemporarilyUnavailable = "temporarily-unavailable",
|
|
186
|
+
/**
|
|
187
|
+
* No more specific reason applies. Prefer any of the members above; this
|
|
188
|
+
* exists so a sender never has to omit the field.
|
|
189
|
+
*/
|
|
190
|
+
Unknown = "unknown"
|
|
191
|
+
}
|
|
120
192
|
/**
|
|
121
193
|
* A state-of-charge reading for a vehicle, together with the age that makes it
|
|
122
194
|
* usable.
|
|
@@ -136,4 +208,11 @@ export interface EnyoVehicleSoc {
|
|
|
136
208
|
measuredAtIso: string;
|
|
137
209
|
/** Total usable capacity of the traction battery in kWh, if the reporting source knew it. */
|
|
138
210
|
batterySizeKwh?: number;
|
|
211
|
+
/**
|
|
212
|
+
* Where the reading came from. Omitted when the host cannot attribute it.
|
|
213
|
+
*
|
|
214
|
+
* Worth surfacing: a user shown a percentage wants to know whether the car
|
|
215
|
+
* said so or enyo worked it out.
|
|
216
|
+
*/
|
|
217
|
+
source?: EnyoVehicleSocSourceEnum;
|
|
139
218
|
}
|
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 = '1.
|
|
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
|
package/dist/cjs/version.d.cts
CHANGED