@enyo-energy/energy-app-sdk 1.16.0 → 1.17.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/dist/cjs/types/enyo-data-bus-value.cjs +4 -0
- package/dist/cjs/types/enyo-data-bus-value.d.cts +175 -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-data-bus-value.d.ts +175 -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
|
@@ -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}. */
|
|
@@ -1661,6 +1666,25 @@ export interface EnyoDataBusEnergyManagementChargingStateV1 extends EnyoDataBusM
|
|
|
1661
1666
|
/**
|
|
1662
1667
|
* Request message to get a preview of the optimized charging schedule.
|
|
1663
1668
|
* Sent when user wants to see the charging plan before starting.
|
|
1669
|
+
*
|
|
1670
|
+
* **How much energy to plan for** can be said three ways, and the energy
|
|
1671
|
+
* manager resolves them in this order:
|
|
1672
|
+
*
|
|
1673
|
+
* 1. {@link data.targetEnergyWh} — an explicit figure, used as given.
|
|
1674
|
+
* 2. {@link data.startSocPercent} and {@link data.targetSocPercent} together
|
|
1675
|
+
* with the vehicle's `batterySizeKwh`, which is what the charging screen
|
|
1676
|
+
* draws its progress bar from.
|
|
1677
|
+
* 3. {@link data.vehicleId} alone — the host falls back to the vehicle's own
|
|
1678
|
+
* state of charge and standing charge limit.
|
|
1679
|
+
*
|
|
1680
|
+
* When none of them yields a figure the response carries
|
|
1681
|
+
* {@link PreviewChargingScheduleUnavailableReasonEnum.NoTargetEnergy}.
|
|
1682
|
+
*
|
|
1683
|
+
* **The price ceiling should match the one the session will actually run
|
|
1684
|
+
* under**, otherwise the preview shows a plan the real session will not follow.
|
|
1685
|
+
* It is spelled exactly as on {@link EnyoDataBusStartChargeV1}: a
|
|
1686
|
+
* {@link data.priceLimitMode} naming which of the two ceiling values is read,
|
|
1687
|
+
* or no mode at all for no ceiling.
|
|
1664
1688
|
*/
|
|
1665
1689
|
export interface EnyoDataBusRequestPreviewChargingScheduleV1 extends EnyoDataBusMessage {
|
|
1666
1690
|
type: 'message';
|
|
@@ -1674,6 +1698,53 @@ export interface EnyoDataBusRequestPreviewChargingScheduleV1 extends EnyoDataBus
|
|
|
1674
1698
|
targetEnergyWh?: number;
|
|
1675
1699
|
/** Alternative vehicle id instead of targetEnergyWh*/
|
|
1676
1700
|
vehicleId?: string;
|
|
1701
|
+
/**
|
|
1702
|
+
* State of charge to plan from, in percent (0-100) — the host's
|
|
1703
|
+
* estimate as the user corrected it on the charging screen.
|
|
1704
|
+
*
|
|
1705
|
+
* Only useful together with {@link targetSocPercent} and a
|
|
1706
|
+
* {@link vehicleId} whose `batterySizeKwh` is known: percent is not
|
|
1707
|
+
* energy until there is a battery size to multiply it by. A preview
|
|
1708
|
+
* asked with a start but no target cannot size the session and falls
|
|
1709
|
+
* back to the next resolution step.
|
|
1710
|
+
*/
|
|
1711
|
+
startSocPercent?: number;
|
|
1712
|
+
/**
|
|
1713
|
+
* State of charge the previewed session should reach, in percent
|
|
1714
|
+
* (0-100). Defaults to the vehicle's standing charge limit when
|
|
1715
|
+
* omitted.
|
|
1716
|
+
*/
|
|
1717
|
+
targetSocPercent?: number;
|
|
1718
|
+
/**
|
|
1719
|
+
* Which price ceiling to plan against, or omitted for **no ceiling**.
|
|
1720
|
+
* Same vocabulary as
|
|
1721
|
+
* {@link EnyoDataBusStartChargeV1.data.priceLimitMode}.
|
|
1722
|
+
*
|
|
1723
|
+
* Only affects the {@link EnyoChargeModeEnum.CostOptimized} result — it
|
|
1724
|
+
* is the only mode that imports, so it is the only one a ceiling can
|
|
1725
|
+
* change. The other modes' entries in
|
|
1726
|
+
* {@link PreviewChargingScheduleModeResult} are unaffected, which is
|
|
1727
|
+
* what makes the side-by-side comparison meaningful.
|
|
1728
|
+
*/
|
|
1729
|
+
priceLimitMode?: EnyoPriceLimitModeEnum;
|
|
1730
|
+
/**
|
|
1731
|
+
* Absolute ceiling in **cents per kWh** to plan against. Only read
|
|
1732
|
+
* while {@link priceLimitMode} is
|
|
1733
|
+
* {@link EnyoPriceLimitModeEnum.CtPerKwh}.
|
|
1734
|
+
*/
|
|
1735
|
+
priceLimitCtPerKwh?: number;
|
|
1736
|
+
/**
|
|
1737
|
+
* Relative ceiling — plan to import only during the cheapest share of
|
|
1738
|
+
* the day, in percent, integer 1 to 100. Only read while
|
|
1739
|
+
* {@link priceLimitMode} is
|
|
1740
|
+
* {@link EnyoPriceLimitModeEnum.CheapestShare}.
|
|
1741
|
+
*
|
|
1742
|
+
* A preview under a relative ceiling is a snapshot: the share is taken
|
|
1743
|
+
* over the prices known when the request is answered, so the plan
|
|
1744
|
+
* changes once the next day's prices publish. Do not cache it past the
|
|
1745
|
+
* price horizon.
|
|
1746
|
+
*/
|
|
1747
|
+
priceLimitSharePercent?: number;
|
|
1677
1748
|
/** Target completion time as ISO timestamp (optional) */
|
|
1678
1749
|
completeByIso?: string;
|
|
1679
1750
|
/** Charger max power setting in Watts for cost comparison (optional) */
|
|
@@ -2939,6 +3010,110 @@ export interface EnyoDataBusVehicleSocUpdateV1 extends EnyoDataBusMessage {
|
|
|
2939
3010
|
* the session against it.
|
|
2940
3011
|
*/
|
|
2941
3012
|
measuredAtIso?: string;
|
|
3013
|
+
/**
|
|
3014
|
+
* Where this reading came from. Set it when you know — a value the car
|
|
3015
|
+
* reported and one derived from energy delivered since plug-in are not
|
|
3016
|
+
* interchangeable, and the app tells the user which it is showing.
|
|
3017
|
+
*/
|
|
3018
|
+
source?: EnyoVehicleSocSourceEnum;
|
|
3019
|
+
};
|
|
3020
|
+
}
|
|
3021
|
+
/**
|
|
3022
|
+
* Request the current or estimated state of charge of a vehicle, by id.
|
|
3023
|
+
*
|
|
3024
|
+
* The pull counterpart to {@link EnyoDataBusVehicleSocUpdateV1}: that message
|
|
3025
|
+
* is published when a source happens to have a new reading, which is the wrong
|
|
3026
|
+
* shape for "the user just opened the charging screen and needs a number now".
|
|
3027
|
+
* Whoever can answer replies with a
|
|
3028
|
+
* {@link EnyoDataBusVehicleSocEstimateResponseV1} carrying the same
|
|
3029
|
+
* {@link data.requestId}.
|
|
3030
|
+
*
|
|
3031
|
+
* A responder may answer from a stored reading or go and fetch a fresh one —
|
|
3032
|
+
* the request says how old a value the caller will accept, not how to obtain
|
|
3033
|
+
* it.
|
|
3034
|
+
*
|
|
3035
|
+
* ```typescript
|
|
3036
|
+
* energyApp.useDataBus().sendMessage([{
|
|
3037
|
+
* type: 'message',
|
|
3038
|
+
* message: 'RequestVehicleSocEstimateV1',
|
|
3039
|
+
* data: {requestId, vehicleId, maxAgeMs: 15 * 60 * 1000},
|
|
3040
|
+
* }]);
|
|
3041
|
+
* ```
|
|
3042
|
+
*/
|
|
3043
|
+
export interface EnyoDataBusRequestVehicleSocEstimateV1 extends EnyoDataBusMessage {
|
|
3044
|
+
type: 'message';
|
|
3045
|
+
message: EnyoDataBusMessageEnum.RequestVehicleSocEstimateV1;
|
|
3046
|
+
data: {
|
|
3047
|
+
/** Unique request identifier the response must echo back. */
|
|
3048
|
+
requestId: string;
|
|
3049
|
+
/** ID of the vehicle whose state of charge is wanted. */
|
|
3050
|
+
vehicleId: string;
|
|
3051
|
+
/**
|
|
3052
|
+
* Oldest reading the caller will accept, in milliseconds. A stored
|
|
3053
|
+
* value older than this is not returned — the responder answers
|
|
3054
|
+
* {@link EnyoVehicleSocUnavailableReasonEnum.ReadingTooOld} instead, or
|
|
3055
|
+
* fetches a fresh one if it can.
|
|
3056
|
+
*
|
|
3057
|
+
* Omitted means any age is acceptable; the caller judges for itself
|
|
3058
|
+
* from {@link EnyoDataBusVehicleSocEstimateResponseV1.data.measuredAtIso}.
|
|
3059
|
+
* A planner sizing a session wants minutes; a screen showing a
|
|
3060
|
+
* last-known figure is happy with hours.
|
|
3061
|
+
*/
|
|
3062
|
+
maxAgeMs?: number;
|
|
3063
|
+
/**
|
|
3064
|
+
* ID of the charger the vehicle is plugged into, when known. Lets a
|
|
3065
|
+
* responder that can only read the car over the cable — a wallbox
|
|
3066
|
+
* speaking ISO 15118, a charge point reporting SoC in its meter
|
|
3067
|
+
* values — find the right one without guessing.
|
|
3068
|
+
*/
|
|
3069
|
+
applianceId?: string;
|
|
3070
|
+
};
|
|
3071
|
+
}
|
|
3072
|
+
/**
|
|
3073
|
+
* Answer to a {@link EnyoDataBusRequestVehicleSocEstimateV1}.
|
|
3074
|
+
*
|
|
3075
|
+
* Shaped like the preview response: {@link data.available} says whether there
|
|
3076
|
+
* is an answer at all, and the reading or the reason follows. **No answer is an
|
|
3077
|
+
* ordinary outcome**, not an error — plenty of vehicles have no source that can
|
|
3078
|
+
* report their charge, and a caller has to cope without one rather than assume
|
|
3079
|
+
* a number.
|
|
3080
|
+
*/
|
|
3081
|
+
export interface EnyoDataBusVehicleSocEstimateResponseV1 extends EnyoDataBusMessage {
|
|
3082
|
+
type: 'message';
|
|
3083
|
+
message: EnyoDataBusMessageEnum.VehicleSocEstimateResponseV1;
|
|
3084
|
+
data: {
|
|
3085
|
+
/** The {@link EnyoDataBusRequestVehicleSocEstimateV1.data.requestId} this answers. */
|
|
3086
|
+
requestId: string;
|
|
3087
|
+
/** ID of the vehicle the answer is about. */
|
|
3088
|
+
vehicleId: string;
|
|
3089
|
+
/** Whether a state of charge could be given. */
|
|
3090
|
+
available: boolean;
|
|
3091
|
+
/**
|
|
3092
|
+
* State of charge of the traction battery in percent (0-100). Only
|
|
3093
|
+
* present while {@link available} is `true`.
|
|
3094
|
+
*/
|
|
3095
|
+
socPercent?: number;
|
|
3096
|
+
/**
|
|
3097
|
+
* When {@link socPercent} was taken, ISO 8601 — not when this response
|
|
3098
|
+
* was sent. Always set alongside a value: a percentage without an age
|
|
3099
|
+
* cannot be aged out, and is shown to the user as current however old
|
|
3100
|
+
* it is.
|
|
3101
|
+
*/
|
|
3102
|
+
measuredAtIso?: string;
|
|
3103
|
+
/** Where the reading came from, when the responder can attribute it. */
|
|
3104
|
+
source?: EnyoVehicleSocSourceEnum;
|
|
3105
|
+
/**
|
|
3106
|
+
* Total usable capacity of the traction battery in kWh, if known.
|
|
3107
|
+
* Included because a percentage is not energy without it, and the
|
|
3108
|
+
* caller would otherwise need a second round trip to size a session.
|
|
3109
|
+
*/
|
|
3110
|
+
batterySizeKwh?: number;
|
|
3111
|
+
/**
|
|
3112
|
+
* Why no value could be given. Only present while {@link available} is
|
|
3113
|
+
* `false`; see {@link EnyoVehicleSocUnavailableReasonEnum} for which of
|
|
3114
|
+
* them are worth retrying.
|
|
3115
|
+
*/
|
|
3116
|
+
unavailableReason?: EnyoVehicleSocUnavailableReasonEnum;
|
|
2942
3117
|
};
|
|
2943
3118
|
}
|
|
2944
3119
|
/**
|
|
@@ -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.17.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
|
@@ -4,6 +4,7 @@ import { EnyoSourceEnum } from "./enyo-source.enum.js";
|
|
|
4
4
|
import { EnyoOcppRelativeSchedule } from "./enyo-ocpp.js";
|
|
5
5
|
import { EnyoChargerAppliancePhase, EnyoChargerApplianceStatusEnum, EnyoChargerApplianceSuspendedReasonEnum } from "./enyo-charger-appliance.js";
|
|
6
6
|
import { PreviewChargingSchedule, PreviewChargingScheduleCostComparison, PreviewChargingScheduleUnavailableReasonEnum } from "./enyo-energy-manager.js";
|
|
7
|
+
import { EnyoVehicleSocSourceEnum, EnyoVehicleSocUnavailableReasonEnum } from "./enyo-vehicle.js";
|
|
7
8
|
import { EnyoEnergyPrices } from "./enyo-energy-prices.js";
|
|
8
9
|
import { EnyoCurrencyEnum } from "./enyo-currency.js";
|
|
9
10
|
import { EnyoHeatpumpApplianceModeEnum } from "./enyo-heatpump-appliance.js";
|
|
@@ -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}. */
|
|
@@ -1661,6 +1666,25 @@ export interface EnyoDataBusEnergyManagementChargingStateV1 extends EnyoDataBusM
|
|
|
1661
1666
|
/**
|
|
1662
1667
|
* Request message to get a preview of the optimized charging schedule.
|
|
1663
1668
|
* Sent when user wants to see the charging plan before starting.
|
|
1669
|
+
*
|
|
1670
|
+
* **How much energy to plan for** can be said three ways, and the energy
|
|
1671
|
+
* manager resolves them in this order:
|
|
1672
|
+
*
|
|
1673
|
+
* 1. {@link data.targetEnergyWh} — an explicit figure, used as given.
|
|
1674
|
+
* 2. {@link data.startSocPercent} and {@link data.targetSocPercent} together
|
|
1675
|
+
* with the vehicle's `batterySizeKwh`, which is what the charging screen
|
|
1676
|
+
* draws its progress bar from.
|
|
1677
|
+
* 3. {@link data.vehicleId} alone — the host falls back to the vehicle's own
|
|
1678
|
+
* state of charge and standing charge limit.
|
|
1679
|
+
*
|
|
1680
|
+
* When none of them yields a figure the response carries
|
|
1681
|
+
* {@link PreviewChargingScheduleUnavailableReasonEnum.NoTargetEnergy}.
|
|
1682
|
+
*
|
|
1683
|
+
* **The price ceiling should match the one the session will actually run
|
|
1684
|
+
* under**, otherwise the preview shows a plan the real session will not follow.
|
|
1685
|
+
* It is spelled exactly as on {@link EnyoDataBusStartChargeV1}: a
|
|
1686
|
+
* {@link data.priceLimitMode} naming which of the two ceiling values is read,
|
|
1687
|
+
* or no mode at all for no ceiling.
|
|
1664
1688
|
*/
|
|
1665
1689
|
export interface EnyoDataBusRequestPreviewChargingScheduleV1 extends EnyoDataBusMessage {
|
|
1666
1690
|
type: 'message';
|
|
@@ -1674,6 +1698,53 @@ export interface EnyoDataBusRequestPreviewChargingScheduleV1 extends EnyoDataBus
|
|
|
1674
1698
|
targetEnergyWh?: number;
|
|
1675
1699
|
/** Alternative vehicle id instead of targetEnergyWh*/
|
|
1676
1700
|
vehicleId?: string;
|
|
1701
|
+
/**
|
|
1702
|
+
* State of charge to plan from, in percent (0-100) — the host's
|
|
1703
|
+
* estimate as the user corrected it on the charging screen.
|
|
1704
|
+
*
|
|
1705
|
+
* Only useful together with {@link targetSocPercent} and a
|
|
1706
|
+
* {@link vehicleId} whose `batterySizeKwh` is known: percent is not
|
|
1707
|
+
* energy until there is a battery size to multiply it by. A preview
|
|
1708
|
+
* asked with a start but no target cannot size the session and falls
|
|
1709
|
+
* back to the next resolution step.
|
|
1710
|
+
*/
|
|
1711
|
+
startSocPercent?: number;
|
|
1712
|
+
/**
|
|
1713
|
+
* State of charge the previewed session should reach, in percent
|
|
1714
|
+
* (0-100). Defaults to the vehicle's standing charge limit when
|
|
1715
|
+
* omitted.
|
|
1716
|
+
*/
|
|
1717
|
+
targetSocPercent?: number;
|
|
1718
|
+
/**
|
|
1719
|
+
* Which price ceiling to plan against, or omitted for **no ceiling**.
|
|
1720
|
+
* Same vocabulary as
|
|
1721
|
+
* {@link EnyoDataBusStartChargeV1.data.priceLimitMode}.
|
|
1722
|
+
*
|
|
1723
|
+
* Only affects the {@link EnyoChargeModeEnum.CostOptimized} result — it
|
|
1724
|
+
* is the only mode that imports, so it is the only one a ceiling can
|
|
1725
|
+
* change. The other modes' entries in
|
|
1726
|
+
* {@link PreviewChargingScheduleModeResult} are unaffected, which is
|
|
1727
|
+
* what makes the side-by-side comparison meaningful.
|
|
1728
|
+
*/
|
|
1729
|
+
priceLimitMode?: EnyoPriceLimitModeEnum;
|
|
1730
|
+
/**
|
|
1731
|
+
* Absolute ceiling in **cents per kWh** to plan against. Only read
|
|
1732
|
+
* while {@link priceLimitMode} is
|
|
1733
|
+
* {@link EnyoPriceLimitModeEnum.CtPerKwh}.
|
|
1734
|
+
*/
|
|
1735
|
+
priceLimitCtPerKwh?: number;
|
|
1736
|
+
/**
|
|
1737
|
+
* Relative ceiling — plan to import only during the cheapest share of
|
|
1738
|
+
* the day, in percent, integer 1 to 100. Only read while
|
|
1739
|
+
* {@link priceLimitMode} is
|
|
1740
|
+
* {@link EnyoPriceLimitModeEnum.CheapestShare}.
|
|
1741
|
+
*
|
|
1742
|
+
* A preview under a relative ceiling is a snapshot: the share is taken
|
|
1743
|
+
* over the prices known when the request is answered, so the plan
|
|
1744
|
+
* changes once the next day's prices publish. Do not cache it past the
|
|
1745
|
+
* price horizon.
|
|
1746
|
+
*/
|
|
1747
|
+
priceLimitSharePercent?: number;
|
|
1677
1748
|
/** Target completion time as ISO timestamp (optional) */
|
|
1678
1749
|
completeByIso?: string;
|
|
1679
1750
|
/** Charger max power setting in Watts for cost comparison (optional) */
|
|
@@ -2939,6 +3010,110 @@ export interface EnyoDataBusVehicleSocUpdateV1 extends EnyoDataBusMessage {
|
|
|
2939
3010
|
* the session against it.
|
|
2940
3011
|
*/
|
|
2941
3012
|
measuredAtIso?: string;
|
|
3013
|
+
/**
|
|
3014
|
+
* Where this reading came from. Set it when you know — a value the car
|
|
3015
|
+
* reported and one derived from energy delivered since plug-in are not
|
|
3016
|
+
* interchangeable, and the app tells the user which it is showing.
|
|
3017
|
+
*/
|
|
3018
|
+
source?: EnyoVehicleSocSourceEnum;
|
|
3019
|
+
};
|
|
3020
|
+
}
|
|
3021
|
+
/**
|
|
3022
|
+
* Request the current or estimated state of charge of a vehicle, by id.
|
|
3023
|
+
*
|
|
3024
|
+
* The pull counterpart to {@link EnyoDataBusVehicleSocUpdateV1}: that message
|
|
3025
|
+
* is published when a source happens to have a new reading, which is the wrong
|
|
3026
|
+
* shape for "the user just opened the charging screen and needs a number now".
|
|
3027
|
+
* Whoever can answer replies with a
|
|
3028
|
+
* {@link EnyoDataBusVehicleSocEstimateResponseV1} carrying the same
|
|
3029
|
+
* {@link data.requestId}.
|
|
3030
|
+
*
|
|
3031
|
+
* A responder may answer from a stored reading or go and fetch a fresh one —
|
|
3032
|
+
* the request says how old a value the caller will accept, not how to obtain
|
|
3033
|
+
* it.
|
|
3034
|
+
*
|
|
3035
|
+
* ```typescript
|
|
3036
|
+
* energyApp.useDataBus().sendMessage([{
|
|
3037
|
+
* type: 'message',
|
|
3038
|
+
* message: 'RequestVehicleSocEstimateV1',
|
|
3039
|
+
* data: {requestId, vehicleId, maxAgeMs: 15 * 60 * 1000},
|
|
3040
|
+
* }]);
|
|
3041
|
+
* ```
|
|
3042
|
+
*/
|
|
3043
|
+
export interface EnyoDataBusRequestVehicleSocEstimateV1 extends EnyoDataBusMessage {
|
|
3044
|
+
type: 'message';
|
|
3045
|
+
message: EnyoDataBusMessageEnum.RequestVehicleSocEstimateV1;
|
|
3046
|
+
data: {
|
|
3047
|
+
/** Unique request identifier the response must echo back. */
|
|
3048
|
+
requestId: string;
|
|
3049
|
+
/** ID of the vehicle whose state of charge is wanted. */
|
|
3050
|
+
vehicleId: string;
|
|
3051
|
+
/**
|
|
3052
|
+
* Oldest reading the caller will accept, in milliseconds. A stored
|
|
3053
|
+
* value older than this is not returned — the responder answers
|
|
3054
|
+
* {@link EnyoVehicleSocUnavailableReasonEnum.ReadingTooOld} instead, or
|
|
3055
|
+
* fetches a fresh one if it can.
|
|
3056
|
+
*
|
|
3057
|
+
* Omitted means any age is acceptable; the caller judges for itself
|
|
3058
|
+
* from {@link EnyoDataBusVehicleSocEstimateResponseV1.data.measuredAtIso}.
|
|
3059
|
+
* A planner sizing a session wants minutes; a screen showing a
|
|
3060
|
+
* last-known figure is happy with hours.
|
|
3061
|
+
*/
|
|
3062
|
+
maxAgeMs?: number;
|
|
3063
|
+
/**
|
|
3064
|
+
* ID of the charger the vehicle is plugged into, when known. Lets a
|
|
3065
|
+
* responder that can only read the car over the cable — a wallbox
|
|
3066
|
+
* speaking ISO 15118, a charge point reporting SoC in its meter
|
|
3067
|
+
* values — find the right one without guessing.
|
|
3068
|
+
*/
|
|
3069
|
+
applianceId?: string;
|
|
3070
|
+
};
|
|
3071
|
+
}
|
|
3072
|
+
/**
|
|
3073
|
+
* Answer to a {@link EnyoDataBusRequestVehicleSocEstimateV1}.
|
|
3074
|
+
*
|
|
3075
|
+
* Shaped like the preview response: {@link data.available} says whether there
|
|
3076
|
+
* is an answer at all, and the reading or the reason follows. **No answer is an
|
|
3077
|
+
* ordinary outcome**, not an error — plenty of vehicles have no source that can
|
|
3078
|
+
* report their charge, and a caller has to cope without one rather than assume
|
|
3079
|
+
* a number.
|
|
3080
|
+
*/
|
|
3081
|
+
export interface EnyoDataBusVehicleSocEstimateResponseV1 extends EnyoDataBusMessage {
|
|
3082
|
+
type: 'message';
|
|
3083
|
+
message: EnyoDataBusMessageEnum.VehicleSocEstimateResponseV1;
|
|
3084
|
+
data: {
|
|
3085
|
+
/** The {@link EnyoDataBusRequestVehicleSocEstimateV1.data.requestId} this answers. */
|
|
3086
|
+
requestId: string;
|
|
3087
|
+
/** ID of the vehicle the answer is about. */
|
|
3088
|
+
vehicleId: string;
|
|
3089
|
+
/** Whether a state of charge could be given. */
|
|
3090
|
+
available: boolean;
|
|
3091
|
+
/**
|
|
3092
|
+
* State of charge of the traction battery in percent (0-100). Only
|
|
3093
|
+
* present while {@link available} is `true`.
|
|
3094
|
+
*/
|
|
3095
|
+
socPercent?: number;
|
|
3096
|
+
/**
|
|
3097
|
+
* When {@link socPercent} was taken, ISO 8601 — not when this response
|
|
3098
|
+
* was sent. Always set alongside a value: a percentage without an age
|
|
3099
|
+
* cannot be aged out, and is shown to the user as current however old
|
|
3100
|
+
* it is.
|
|
3101
|
+
*/
|
|
3102
|
+
measuredAtIso?: string;
|
|
3103
|
+
/** Where the reading came from, when the responder can attribute it. */
|
|
3104
|
+
source?: EnyoVehicleSocSourceEnum;
|
|
3105
|
+
/**
|
|
3106
|
+
* Total usable capacity of the traction battery in kWh, if known.
|
|
3107
|
+
* Included because a percentage is not energy without it, and the
|
|
3108
|
+
* caller would otherwise need a second round trip to size a session.
|
|
3109
|
+
*/
|
|
3110
|
+
batterySizeKwh?: number;
|
|
3111
|
+
/**
|
|
3112
|
+
* Why no value could be given. Only present while {@link available} is
|
|
3113
|
+
* `false`; see {@link EnyoVehicleSocUnavailableReasonEnum} for which of
|
|
3114
|
+
* them are worth retrying.
|
|
3115
|
+
*/
|
|
3116
|
+
unavailableReason?: EnyoVehicleSocUnavailableReasonEnum;
|
|
2942
3117
|
};
|
|
2943
3118
|
}
|
|
2944
3119
|
/**
|
|
@@ -382,6 +382,10 @@ export var EnyoDataBusMessageEnum;
|
|
|
382
382
|
EnyoDataBusMessageEnum["StopAirConditioningV1"] = "StopAirConditioningV1";
|
|
383
383
|
EnyoDataBusMessageEnum["ChangeAirConditioningOptimizationModeV1"] = "ChangeAirConditioningOptimizationModeV1";
|
|
384
384
|
EnyoDataBusMessageEnum["VehicleSocUpdateV1"] = "VehicleSocUpdateV1";
|
|
385
|
+
/** Request the current or estimated state of charge of a vehicle, by vehicle id. */
|
|
386
|
+
EnyoDataBusMessageEnum["RequestVehicleSocEstimateV1"] = "RequestVehicleSocEstimateV1";
|
|
387
|
+
/** Answer to {@link RequestVehicleSocEstimateV1} — the estimate with its age and source, or why none could be given. */
|
|
388
|
+
EnyoDataBusMessageEnum["VehicleSocEstimateResponseV1"] = "VehicleSocEstimateResponseV1";
|
|
385
389
|
/** V2 control command: announce the available/max power (W) envelope to a charger. Supersedes {@link EnyoDataBusMessageEnum.ChangeChargingPowerV1}. */
|
|
386
390
|
EnyoDataBusMessageEnum["SetChargerAvailablePowerV2"] = "SetChargerAvailablePowerV2";
|
|
387
391
|
/** V2 control command: announce the available/max power (W) envelope to a heatpump, with purpose and power-source context. Supersedes {@link EnyoDataBusMessageEnum.HeatpumpAvailablePowerAnnouncementV1}. */
|
|
@@ -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
|
|
@@ -87,8 +87,9 @@ export var PreviewChargingScheduleUnavailableReasonEnum;
|
|
|
87
87
|
PreviewChargingScheduleUnavailableReasonEnum["VehicleNotFound"] = "vehicle-not-found";
|
|
88
88
|
/**
|
|
89
89
|
* The amount of energy to plan for could not be determined — the request
|
|
90
|
-
* carried
|
|
91
|
-
*
|
|
90
|
+
* carried no `targetEnergyWh`, no usable `startSocPercent` /
|
|
91
|
+
* `targetSocPercent` pair (which needs the vehicle's `batterySizeKwh` to
|
|
92
|
+
* become energy), and no `vehicleId` whose battery state yields one.
|
|
92
93
|
*/
|
|
93
94
|
PreviewChargingScheduleUnavailableReasonEnum["NoTargetEnergy"] = "no-target-energy";
|
|
94
95
|
/**
|
|
@@ -110,6 +111,19 @@ export var PreviewChargingScheduleUnavailableReasonEnum;
|
|
|
110
111
|
* preview for.
|
|
111
112
|
*/
|
|
112
113
|
PreviewChargingScheduleUnavailableReasonEnum["ChargeModeNotSupported"] = "charge-mode-not-supported";
|
|
114
|
+
/**
|
|
115
|
+
* A price ceiling was requested that no slot in the planning window meets,
|
|
116
|
+
* so a cost-optimized plan would import nothing at all.
|
|
117
|
+
*
|
|
118
|
+
* Actionable, which is why it is distinct from
|
|
119
|
+
* {@link DeadlineNotReachable}: the deadline is fine and the charger is
|
|
120
|
+
* fine — the user's limit is simply below every price on offer, and a
|
|
121
|
+
* consumer can say so and offer to raise it. Applies to both spellings of
|
|
122
|
+
* a ceiling: a `priceLimitCtPerKwh` under the cheapest slot, or a
|
|
123
|
+
* `priceLimitSharePercent` whose share contains no usable slot before the
|
|
124
|
+
* deadline.
|
|
125
|
+
*/
|
|
126
|
+
PreviewChargingScheduleUnavailableReasonEnum["PriceLimitNotReachable"] = "price-limit-not-reachable";
|
|
113
127
|
// ── Everything else ────────────────────────────────────────────────────
|
|
114
128
|
/**
|
|
115
129
|
* The energy manager could not produce a preview right now — it is still
|
|
@@ -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
|
}
|
|
@@ -1 +1,74 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Where a state-of-charge reading came from, and therefore how much it can be
|
|
3
|
+
* trusted.
|
|
4
|
+
*
|
|
5
|
+
* The app tells the user which it is — "Jetzt 60 % · von enyo geschätzt" reads
|
|
6
|
+
* very differently from a figure the car itself reported — and a planner may
|
|
7
|
+
* want to widen its margins on a derived value.
|
|
8
|
+
*/
|
|
9
|
+
export var EnyoVehicleSocSourceEnum;
|
|
10
|
+
(function (EnyoVehicleSocSourceEnum) {
|
|
11
|
+
/**
|
|
12
|
+
* The vehicle reported it: ISO 15118, a manufacturer cloud integration, or
|
|
13
|
+
* any other channel that asks the car directly. The most trustworthy
|
|
14
|
+
* source.
|
|
15
|
+
*/
|
|
16
|
+
EnyoVehicleSocSourceEnum["Vehicle"] = "vehicle";
|
|
17
|
+
/**
|
|
18
|
+
* The charge point reported it, typically in OCPP meter values. Comes from
|
|
19
|
+
* the car over the cable, so it is as current as the session.
|
|
20
|
+
*/
|
|
21
|
+
EnyoVehicleSocSourceEnum["Charger"] = "charger";
|
|
22
|
+
/**
|
|
23
|
+
* Derived rather than read — energy delivered since plug-in added to an
|
|
24
|
+
* earlier figure, or a model of the vehicle's usage. Drifts with every
|
|
25
|
+
* assumption it rests on, and is the reason a reading must carry
|
|
26
|
+
* {@link EnyoVehicleSoc.measuredAtIso}.
|
|
27
|
+
*/
|
|
28
|
+
EnyoVehicleSocSourceEnum["Estimated"] = "estimated";
|
|
29
|
+
/** The user typed or corrected it on the charging screen. */
|
|
30
|
+
EnyoVehicleSocSourceEnum["UserProvided"] = "user-provided";
|
|
31
|
+
})(EnyoVehicleSocSourceEnum || (EnyoVehicleSocSourceEnum = {}));
|
|
32
|
+
/**
|
|
33
|
+
* Why no state of charge could be given for a vehicle.
|
|
34
|
+
*
|
|
35
|
+
* Carried by the response to a request for an estimate. The members are
|
|
36
|
+
* deliberately separate so a consumer can say something useful instead of "not
|
|
37
|
+
* available": {@link NoSocSource} is permanent for this car,
|
|
38
|
+
* {@link VehicleNotConnected} resolves when it is plugged in, and
|
|
39
|
+
* {@link ReadingTooOld} means a value exists but the caller asked for a fresher
|
|
40
|
+
* one.
|
|
41
|
+
*/
|
|
42
|
+
export var EnyoVehicleSocUnavailableReasonEnum;
|
|
43
|
+
(function (EnyoVehicleSocUnavailableReasonEnum) {
|
|
44
|
+
/** No vehicle with the requested id exists. */
|
|
45
|
+
EnyoVehicleSocUnavailableReasonEnum["VehicleNotFound"] = "vehicle-not-found";
|
|
46
|
+
/**
|
|
47
|
+
* Nothing in the system can report this vehicle's charge — no integration
|
|
48
|
+
* reads the car and no charge point on site reports one. Permanent until
|
|
49
|
+
* the setup changes, so a consumer should stop asking rather than retry.
|
|
50
|
+
*/
|
|
51
|
+
EnyoVehicleSocUnavailableReasonEnum["NoSocSource"] = "no-soc-source";
|
|
52
|
+
/**
|
|
53
|
+
* A source exists but needs the car connected to read it, and it is not
|
|
54
|
+
* plugged in. Resolves on the next session.
|
|
55
|
+
*/
|
|
56
|
+
EnyoVehicleSocUnavailableReasonEnum["VehicleNotConnected"] = "vehicle-not-connected";
|
|
57
|
+
/**
|
|
58
|
+
* A reading exists but is older than the `maxAgeMs` the request asked for.
|
|
59
|
+
* Ask again without the constraint to take the stale value anyway — the
|
|
60
|
+
* responder does not decide for the caller what is too old.
|
|
61
|
+
*/
|
|
62
|
+
EnyoVehicleSocUnavailableReasonEnum["ReadingTooOld"] = "reading-too-old";
|
|
63
|
+
/**
|
|
64
|
+
* The source could not be reached right now — the vehicle's cloud API is
|
|
65
|
+
* down, the charge point is offline, the integration is still starting.
|
|
66
|
+
* Transient: a later request may succeed.
|
|
67
|
+
*/
|
|
68
|
+
EnyoVehicleSocUnavailableReasonEnum["TemporarilyUnavailable"] = "temporarily-unavailable";
|
|
69
|
+
/**
|
|
70
|
+
* No more specific reason applies. Prefer any of the members above; this
|
|
71
|
+
* exists so a sender never has to omit the field.
|
|
72
|
+
*/
|
|
73
|
+
EnyoVehicleSocUnavailableReasonEnum["Unknown"] = "unknown";
|
|
74
|
+
})(EnyoVehicleSocUnavailableReasonEnum || (EnyoVehicleSocUnavailableReasonEnum = {}));
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED