@enyo-energy/energy-app-sdk 1.9.0 → 1.10.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/implementations/appliances/appliance-manager.cjs +2 -0
- package/dist/cjs/implementations/appliances/appliance-manager.d.cts +4 -0
- package/dist/cjs/index.cjs +1 -0
- package/dist/cjs/index.d.cts +1 -0
- package/dist/cjs/types/enyo-appliance.cjs +2 -0
- package/dist/cjs/types/enyo-appliance.d.cts +6 -1
- package/dist/cjs/types/enyo-data-bus-value.cjs +4 -0
- package/dist/cjs/types/enyo-data-bus-value.d.cts +70 -0
- package/dist/cjs/types/enyo-smart-plug-appliance.cjs +74 -0
- package/dist/cjs/types/enyo-smart-plug-appliance.d.cts +173 -0
- package/dist/cjs/version.cjs +1 -1
- package/dist/cjs/version.d.cts +1 -1
- package/dist/implementations/appliances/appliance-manager.d.ts +4 -0
- package/dist/implementations/appliances/appliance-manager.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/types/enyo-appliance.d.ts +6 -1
- package/dist/types/enyo-appliance.js +2 -0
- package/dist/types/enyo-data-bus-value.d.ts +70 -0
- package/dist/types/enyo-data-bus-value.js +4 -0
- package/dist/types/enyo-smart-plug-appliance.d.ts +173 -0
- package/dist/types/enyo-smart-plug-appliance.js +71 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -60,6 +60,7 @@ const MERGEABLE_METADATA_KEYS = [
|
|
|
60
60
|
'temperatureSensor',
|
|
61
61
|
'airConditioning',
|
|
62
62
|
'heatingRod',
|
|
63
|
+
'smartPlug',
|
|
63
64
|
];
|
|
64
65
|
/**
|
|
65
66
|
* Manages appliances in the energy system with configurable identification strategies.
|
|
@@ -209,6 +210,7 @@ class ApplianceManager {
|
|
|
209
210
|
temperatureSensor: appliance.temperatureSensor,
|
|
210
211
|
airConditioning: appliance.airConditioning,
|
|
211
212
|
heatingRod: appliance.heatingRod,
|
|
213
|
+
smartPlug: appliance.smartPlug,
|
|
212
214
|
// Conditionally spread the two optional top-level fields that are NOT
|
|
213
215
|
// covered by MERGEABLE_METADATA_KEYS. If they were always materialized
|
|
214
216
|
// as explicit keys, an omitted (undefined) value would clobber the
|
|
@@ -10,6 +10,7 @@ import type { EnyoMeterAppliance } from "../../types/enyo-meter-appliance.cjs";
|
|
|
10
10
|
import type { EnyoTemperatureSensorApplianceMetadata } from "../../types/enyo-temperature-sensor-appliance.cjs";
|
|
11
11
|
import type { EnyoAirConditioningApplianceMetadata } from "../../types/enyo-air-conditioning-appliance.cjs";
|
|
12
12
|
import type { EnyoHeatingRodApplianceMetadata } from "../../types/enyo-heating-rod-appliance.cjs";
|
|
13
|
+
import type { EnyoSmartPlugApplianceMetadata } from "../../types/enyo-smart-plug-appliance.cjs";
|
|
13
14
|
import { IdentifierStrategy } from "./identifier-strategies.cjs";
|
|
14
15
|
/**
|
|
15
16
|
* Thrown when {@link ApplianceManager.createOrUpdateAppliance} is called with
|
|
@@ -62,6 +63,7 @@ export interface ApplianceConfig {
|
|
|
62
63
|
temperatureSensor?: EnyoTemperatureSensorApplianceMetadata;
|
|
63
64
|
airConditioning?: EnyoAirConditioningApplianceMetadata;
|
|
64
65
|
heatingRod?: EnyoHeatingRodApplianceMetadata;
|
|
66
|
+
smartPlug?: EnyoSmartPlugApplianceMetadata;
|
|
65
67
|
availableFeatures?: EnyoApplianceAvailableFeaturesEnum[];
|
|
66
68
|
/**
|
|
67
69
|
* Optional identifier of the cloud-deployed energy app package that manages
|
|
@@ -437,6 +439,8 @@ export interface PartialEnyoAppliance {
|
|
|
437
439
|
airConditioning?: Partial<EnyoAirConditioningApplianceMetadata>;
|
|
438
440
|
/** Optional Metadata of the Appliance if of type HeatingRod */
|
|
439
441
|
heatingRod?: Partial<EnyoHeatingRodApplianceMetadata>;
|
|
442
|
+
/** Optional Metadata of the Appliance if of type SmartPlug */
|
|
443
|
+
smartPlug?: Partial<EnyoSmartPlugApplianceMetadata>;
|
|
440
444
|
/** Optional custom name for the appliance, defined by the user */
|
|
441
445
|
customName?: string;
|
|
442
446
|
/**
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -86,6 +86,7 @@ __exportStar(require("./types/enyo-configuration-manager.cjs"), exports);
|
|
|
86
86
|
__exportStar(require("./packages/energy-app-configuration-manager.cjs"), exports);
|
|
87
87
|
__exportStar(require("./types/enyo-air-conditioning-appliance.cjs"), exports);
|
|
88
88
|
__exportStar(require("./types/enyo-heating-rod-appliance.cjs"), exports);
|
|
89
|
+
__exportStar(require("./types/enyo-smart-plug-appliance.cjs"), exports);
|
|
89
90
|
__exportStar(require("./types/enyo-charger-appliance.cjs"), exports);
|
|
90
91
|
__exportStar(require("./types/enyo-charging-card.cjs"), exports);
|
|
91
92
|
__exportStar(require("./packages/energy-app-charging-card.cjs"), exports);
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -70,6 +70,7 @@ export * from './types/enyo-configuration-manager.cjs';
|
|
|
70
70
|
export * from './packages/energy-app-configuration-manager.cjs';
|
|
71
71
|
export * from './types/enyo-air-conditioning-appliance.cjs';
|
|
72
72
|
export * from './types/enyo-heating-rod-appliance.cjs';
|
|
73
|
+
export * from './types/enyo-smart-plug-appliance.cjs';
|
|
73
74
|
export * from './types/enyo-charger-appliance.cjs';
|
|
74
75
|
export * from './types/enyo-charging-card.cjs';
|
|
75
76
|
export * from './packages/energy-app-charging-card.cjs';
|
|
@@ -11,6 +11,8 @@ var EnyoApplianceTypeEnum;
|
|
|
11
11
|
EnyoApplianceTypeEnum["AirConditioning"] = "AirConditioning";
|
|
12
12
|
EnyoApplianceTypeEnum["TemperatureSensor"] = "TemperatureSensor";
|
|
13
13
|
EnyoApplianceTypeEnum["HeatingRod"] = "HeatingRod";
|
|
14
|
+
/** Switchable socket / relay channel powering an arbitrary load (e.g. a Shelly channel) */
|
|
15
|
+
EnyoApplianceTypeEnum["SmartPlug"] = "SmartPlug";
|
|
14
16
|
})(EnyoApplianceTypeEnum || (exports.EnyoApplianceTypeEnum = EnyoApplianceTypeEnum = {}));
|
|
15
17
|
var EnyoApplianceStateEnum;
|
|
16
18
|
(function (EnyoApplianceStateEnum) {
|
|
@@ -8,6 +8,7 @@ import { EnyoMeterAppliance } from "./enyo-meter-appliance.cjs";
|
|
|
8
8
|
import { EnyoTemperatureSensorApplianceMetadata } from "./enyo-temperature-sensor-appliance.cjs";
|
|
9
9
|
import { EnyoAirConditioningApplianceMetadata } from "./enyo-air-conditioning-appliance.cjs";
|
|
10
10
|
import { EnyoHeatingRodApplianceMetadata } from "./enyo-heating-rod-appliance.cjs";
|
|
11
|
+
import { EnyoSmartPlugApplianceMetadata } from "./enyo-smart-plug-appliance.cjs";
|
|
11
12
|
export declare enum EnyoApplianceTypeEnum {
|
|
12
13
|
Inverter = "Inverter",
|
|
13
14
|
Charger = "Charger",
|
|
@@ -16,7 +17,9 @@ export declare enum EnyoApplianceTypeEnum {
|
|
|
16
17
|
Heatpump = "Heatpump",
|
|
17
18
|
AirConditioning = "AirConditioning",
|
|
18
19
|
TemperatureSensor = "TemperatureSensor",
|
|
19
|
-
HeatingRod = "HeatingRod"
|
|
20
|
+
HeatingRod = "HeatingRod",
|
|
21
|
+
/** Switchable socket / relay channel powering an arbitrary load (e.g. a Shelly channel) */
|
|
22
|
+
SmartPlug = "SmartPlug"
|
|
20
23
|
}
|
|
21
24
|
export interface EnyoApplianceName {
|
|
22
25
|
language: EnergyAppPackageLanguage;
|
|
@@ -270,6 +273,8 @@ export interface EnyoAppliance {
|
|
|
270
273
|
airConditioning?: EnyoAirConditioningApplianceMetadata;
|
|
271
274
|
/** Optional Metadata of the Appliance if of type HeatingRod */
|
|
272
275
|
heatingRod?: EnyoHeatingRodApplianceMetadata;
|
|
276
|
+
/** Optional Metadata of the Appliance if of type SmartPlug */
|
|
277
|
+
smartPlug?: EnyoSmartPlugApplianceMetadata;
|
|
273
278
|
/** Optional custom name for the appliance, defined by the user */
|
|
274
279
|
customName?: string;
|
|
275
280
|
/**
|
|
@@ -280,6 +280,10 @@ var EnyoDataBusMessageEnum;
|
|
|
280
280
|
EnyoDataBusMessageEnum["SetHeatingRodAvailablePowerV2"] = "SetHeatingRodAvailablePowerV2";
|
|
281
281
|
/** V2 control command: prescribe a single-setpoint control (mode + direction + power) to a battery/storage appliance. */
|
|
282
282
|
EnyoDataBusMessageEnum["SetStorageControlV2"] = "SetStorageControlV2";
|
|
283
|
+
/** Live values of a smart plug: relay state, power draw and energy meter reading. */
|
|
284
|
+
EnyoDataBusMessageEnum["SmartPlugValuesUpdateV1"] = "SmartPlugValuesUpdateV1";
|
|
285
|
+
/** Control command: switch a smart plug / relay channel on or off. */
|
|
286
|
+
EnyoDataBusMessageEnum["SetSmartPlugSwitchV1"] = "SetSmartPlugSwitchV1";
|
|
283
287
|
EnyoDataBusMessageEnum["EnergyAppStartedV1"] = "EnergyAppStartedV1";
|
|
284
288
|
})(EnyoDataBusMessageEnum || (exports.EnyoDataBusMessageEnum = EnyoDataBusMessageEnum = {}));
|
|
285
289
|
/**
|
|
@@ -7,6 +7,7 @@ import { PreviewChargingSchedule, PreviewChargingScheduleCostComparison, Preview
|
|
|
7
7
|
import { EnyoEnergyPrices } from "./enyo-energy-prices.cjs";
|
|
8
8
|
import { EnyoCurrencyEnum } from "./enyo-currency.cjs";
|
|
9
9
|
import { EnyoHeatpumpApplianceModeEnum } from "./enyo-heatpump-appliance.cjs";
|
|
10
|
+
import { EnyoSmartPlugApplianceStateEnum } from "./enyo-smart-plug-appliance.cjs";
|
|
10
11
|
import { EnyoAirConditioningApplianceModeEnum, EnyoAirConditioningOptimizationModeEnum } from "./enyo-air-conditioning-appliance.cjs";
|
|
11
12
|
import { EnergyAppPackageCategory } from "../energy-app-package-definition.cjs";
|
|
12
13
|
import { EnyoPackageConfigurationTranslatedValue } from "./enyo-settings.cjs";
|
|
@@ -344,6 +345,10 @@ export declare enum EnyoDataBusMessageEnum {
|
|
|
344
345
|
SetHeatingRodAvailablePowerV2 = "SetHeatingRodAvailablePowerV2",
|
|
345
346
|
/** V2 control command: prescribe a single-setpoint control (mode + direction + power) to a battery/storage appliance. */
|
|
346
347
|
SetStorageControlV2 = "SetStorageControlV2",
|
|
348
|
+
/** Live values of a smart plug: relay state, power draw and energy meter reading. */
|
|
349
|
+
SmartPlugValuesUpdateV1 = "SmartPlugValuesUpdateV1",
|
|
350
|
+
/** Control command: switch a smart plug / relay channel on or off. */
|
|
351
|
+
SetSmartPlugSwitchV1 = "SetSmartPlugSwitchV1",
|
|
347
352
|
EnergyAppStartedV1 = "EnergyAppStartedV1"
|
|
348
353
|
}
|
|
349
354
|
export type EnyoDataBusMessageResolution = '1s' | '10s' | '30s' | '1m' | '15m' | '1h' | '1d' | 'dynamic';
|
|
@@ -2429,3 +2434,68 @@ export interface EnyoDataBusVehicleSocUpdateV1 extends EnyoDataBusMessage {
|
|
|
2429
2434
|
batterySizeKwh?: number;
|
|
2430
2435
|
};
|
|
2431
2436
|
}
|
|
2437
|
+
/**
|
|
2438
|
+
* Live values of a smart plug / switchable relay channel, published by the
|
|
2439
|
+
* integration that owns the appliance.
|
|
2440
|
+
*
|
|
2441
|
+
* Send this whenever the relay state or the measured power changes, so an
|
|
2442
|
+
* energy manager can account for the load and decide whether to switch the plug
|
|
2443
|
+
* via {@link EnyoDataBusSetSmartPlugSwitchV1}.
|
|
2444
|
+
*/
|
|
2445
|
+
export interface EnyoDataBusSmartPlugValuesV1 extends EnyoDataBusMessage {
|
|
2446
|
+
type: 'message';
|
|
2447
|
+
message: EnyoDataBusMessageEnum.SmartPlugValuesUpdateV1;
|
|
2448
|
+
/** ID of the smart plug appliance that delivered these values */
|
|
2449
|
+
applianceId: string;
|
|
2450
|
+
data: {
|
|
2451
|
+
/**
|
|
2452
|
+
* Current relay state of the plug. Omit when the integration cannot
|
|
2453
|
+
* determine it — `undefined` means "not known", which is not the same
|
|
2454
|
+
* as {@link EnyoSmartPlugApplianceStateEnum.Off}.
|
|
2455
|
+
*/
|
|
2456
|
+
state?: EnyoSmartPlugApplianceStateEnum;
|
|
2457
|
+
/**
|
|
2458
|
+
* Current active power drawn by the connected load in Watt. Normally
|
|
2459
|
+
* positive (a plug powers a consumer). Omit when the plug cannot
|
|
2460
|
+
* measure it — do not send `0` as a stand-in for "unknown", since a
|
|
2461
|
+
* consumer cannot tell that apart from "nothing is drawing power".
|
|
2462
|
+
*/
|
|
2463
|
+
powerW?: number;
|
|
2464
|
+
/** Cumulative energy meter reading of the plug in Watt hours */
|
|
2465
|
+
meterValueWh?: number;
|
|
2466
|
+
/** Voltage measured at the plug in V, when reported */
|
|
2467
|
+
voltageV?: number;
|
|
2468
|
+
/** Current measured at the plug in A, when reported */
|
|
2469
|
+
currentA?: number;
|
|
2470
|
+
};
|
|
2471
|
+
}
|
|
2472
|
+
/**
|
|
2473
|
+
* Command switching a smart plug / relay channel on or off.
|
|
2474
|
+
*
|
|
2475
|
+
* Only valid for appliances that list
|
|
2476
|
+
* {@link EnyoSmartPlugApplianceAvailableFeaturesEnum.Switching} and whose
|
|
2477
|
+
* metadata does not set `controlAllowed: false`. The receiving integration
|
|
2478
|
+
* should answer with an {@link EnyoDataBusCommandAcknowledgeV1} message
|
|
2479
|
+
* referencing this message's `id`, and reflect the resulting relay state in the
|
|
2480
|
+
* next {@link EnyoDataBusSmartPlugValuesV1}.
|
|
2481
|
+
*/
|
|
2482
|
+
export interface EnyoDataBusSetSmartPlugSwitchV1 extends EnyoDataBusMessage {
|
|
2483
|
+
type: 'message';
|
|
2484
|
+
message: EnyoDataBusMessageEnum.SetSmartPlugSwitchV1;
|
|
2485
|
+
/** ID of the smart plug appliance to switch */
|
|
2486
|
+
applianceId: string;
|
|
2487
|
+
data: {
|
|
2488
|
+
/** Target relay state: `On` closes the relay, `Off` opens it */
|
|
2489
|
+
state: EnyoSmartPlugApplianceStateEnum;
|
|
2490
|
+
/**
|
|
2491
|
+
* Minimum time in minutes the requested state should be held before the
|
|
2492
|
+
* plug may be switched again, to protect the connected load from
|
|
2493
|
+
* short-cycling. When omitted, the integration should fall back to the
|
|
2494
|
+
* appliance's `minOnDurationMinutes` / `minOffDurationMinutes`
|
|
2495
|
+
* metadata, and otherwise switch immediately.
|
|
2496
|
+
*/
|
|
2497
|
+
minDurationMinutes?: number;
|
|
2498
|
+
/** Optional reason why this command was issued */
|
|
2499
|
+
reason?: EnyoDataBusCommandReason;
|
|
2500
|
+
};
|
|
2501
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EnyoSmartPlugApplianceIconEnum = exports.EnyoSmartPlugApplianceStateEnum = exports.EnyoSmartPlugApplianceAvailableFeaturesEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Capabilities a smart plug / switchable relay appliance may support. A plug
|
|
6
|
+
* that only reports power without being switchable lists {@link Power} alone;
|
|
7
|
+
* one that can only be switched lists {@link Switching} alone.
|
|
8
|
+
*/
|
|
9
|
+
var EnyoSmartPlugApplianceAvailableFeaturesEnum;
|
|
10
|
+
(function (EnyoSmartPlugApplianceAvailableFeaturesEnum) {
|
|
11
|
+
/** If the plug can be switched on and off by the energy manager or an automation */
|
|
12
|
+
EnyoSmartPlugApplianceAvailableFeaturesEnum["Switching"] = "Switching";
|
|
13
|
+
/** If the plug measures the active power (W) drawn by the connected load */
|
|
14
|
+
EnyoSmartPlugApplianceAvailableFeaturesEnum["Power"] = "Power";
|
|
15
|
+
/** If the plug reports a cumulative energy meter reading (Wh) for the connected load */
|
|
16
|
+
EnyoSmartPlugApplianceAvailableFeaturesEnum["EnergyMetering"] = "EnergyMetering";
|
|
17
|
+
})(EnyoSmartPlugApplianceAvailableFeaturesEnum || (exports.EnyoSmartPlugApplianceAvailableFeaturesEnum = EnyoSmartPlugApplianceAvailableFeaturesEnum = {}));
|
|
18
|
+
/**
|
|
19
|
+
* Relay state of a smart plug channel.
|
|
20
|
+
*/
|
|
21
|
+
var EnyoSmartPlugApplianceStateEnum;
|
|
22
|
+
(function (EnyoSmartPlugApplianceStateEnum) {
|
|
23
|
+
/** The relay is closed — the connected load is powered */
|
|
24
|
+
EnyoSmartPlugApplianceStateEnum["On"] = "On";
|
|
25
|
+
/** The relay is open — the connected load is not powered */
|
|
26
|
+
EnyoSmartPlugApplianceStateEnum["Off"] = "Off";
|
|
27
|
+
})(EnyoSmartPlugApplianceStateEnum || (exports.EnyoSmartPlugApplianceStateEnum = EnyoSmartPlugApplianceStateEnum = {}));
|
|
28
|
+
/**
|
|
29
|
+
* Icon suggested for a smart plug appliance in end-user surfaces. Describes the
|
|
30
|
+
* load connected to the plug rather than the plug itself, so a user recognises
|
|
31
|
+
* "Dishwasher" instead of "Shelly channel 1".
|
|
32
|
+
*
|
|
33
|
+
* Purely presentational — consumers must not derive control behaviour from it.
|
|
34
|
+
* When omitted, or when a consumer does not know the member, it should fall
|
|
35
|
+
* back to a generic plug icon.
|
|
36
|
+
*/
|
|
37
|
+
var EnyoSmartPlugApplianceIconEnum;
|
|
38
|
+
(function (EnyoSmartPlugApplianceIconEnum) {
|
|
39
|
+
/** Generic socket / unspecified load */
|
|
40
|
+
EnyoSmartPlugApplianceIconEnum["SmartPlug"] = "SmartPlug";
|
|
41
|
+
EnyoSmartPlugApplianceIconEnum["Dishwasher"] = "Dishwasher";
|
|
42
|
+
EnyoSmartPlugApplianceIconEnum["WashingMachine"] = "WashingMachine";
|
|
43
|
+
EnyoSmartPlugApplianceIconEnum["Dryer"] = "Dryer";
|
|
44
|
+
EnyoSmartPlugApplianceIconEnum["Refrigerator"] = "Refrigerator";
|
|
45
|
+
EnyoSmartPlugApplianceIconEnum["Freezer"] = "Freezer";
|
|
46
|
+
EnyoSmartPlugApplianceIconEnum["Oven"] = "Oven";
|
|
47
|
+
EnyoSmartPlugApplianceIconEnum["CoffeeMachine"] = "CoffeeMachine";
|
|
48
|
+
/** Kettle, toaster and other small kitchen appliances */
|
|
49
|
+
EnyoSmartPlugApplianceIconEnum["KitchenAppliance"] = "KitchenAppliance";
|
|
50
|
+
/** TV, hi-fi, console and other entertainment loads */
|
|
51
|
+
EnyoSmartPlugApplianceIconEnum["Entertainment"] = "Entertainment";
|
|
52
|
+
/** Desktop, server, network equipment */
|
|
53
|
+
EnyoSmartPlugApplianceIconEnum["Computer"] = "Computer";
|
|
54
|
+
EnyoSmartPlugApplianceIconEnum["Lighting"] = "Lighting";
|
|
55
|
+
/** Pool pump or pool filter system */
|
|
56
|
+
EnyoSmartPlugApplianceIconEnum["PoolPump"] = "PoolPump";
|
|
57
|
+
/** Circulation, well or sump pump */
|
|
58
|
+
EnyoSmartPlugApplianceIconEnum["Pump"] = "Pump";
|
|
59
|
+
/** Electric water heater / boiler */
|
|
60
|
+
EnyoSmartPlugApplianceIconEnum["WaterHeater"] = "WaterHeater";
|
|
61
|
+
/** Portable electric heater */
|
|
62
|
+
EnyoSmartPlugApplianceIconEnum["Heater"] = "Heater";
|
|
63
|
+
/** Fan or ventilation unit */
|
|
64
|
+
EnyoSmartPlugApplianceIconEnum["Fan"] = "Fan";
|
|
65
|
+
EnyoSmartPlugApplianceIconEnum["Aquarium"] = "Aquarium";
|
|
66
|
+
/** Garden, irrigation or greenhouse equipment */
|
|
67
|
+
EnyoSmartPlugApplianceIconEnum["Garden"] = "Garden";
|
|
68
|
+
/** Workshop machinery and power tools */
|
|
69
|
+
EnyoSmartPlugApplianceIconEnum["Workshop"] = "Workshop";
|
|
70
|
+
/** Car / e-bike charging via a plain socket */
|
|
71
|
+
EnyoSmartPlugApplianceIconEnum["Charging"] = "Charging";
|
|
72
|
+
/** Known load that none of the other members describe */
|
|
73
|
+
EnyoSmartPlugApplianceIconEnum["Other"] = "Other";
|
|
74
|
+
})(EnyoSmartPlugApplianceIconEnum || (exports.EnyoSmartPlugApplianceIconEnum = EnyoSmartPlugApplianceIconEnum = {}));
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capabilities a smart plug / switchable relay appliance may support. A plug
|
|
3
|
+
* that only reports power without being switchable lists {@link Power} alone;
|
|
4
|
+
* one that can only be switched lists {@link Switching} alone.
|
|
5
|
+
*/
|
|
6
|
+
export declare enum EnyoSmartPlugApplianceAvailableFeaturesEnum {
|
|
7
|
+
/** If the plug can be switched on and off by the energy manager or an automation */
|
|
8
|
+
Switching = "Switching",
|
|
9
|
+
/** If the plug measures the active power (W) drawn by the connected load */
|
|
10
|
+
Power = "Power",
|
|
11
|
+
/** If the plug reports a cumulative energy meter reading (Wh) for the connected load */
|
|
12
|
+
EnergyMetering = "EnergyMetering"
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Relay state of a smart plug channel.
|
|
16
|
+
*/
|
|
17
|
+
export declare enum EnyoSmartPlugApplianceStateEnum {
|
|
18
|
+
/** The relay is closed — the connected load is powered */
|
|
19
|
+
On = "On",
|
|
20
|
+
/** The relay is open — the connected load is not powered */
|
|
21
|
+
Off = "Off"
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Icon suggested for a smart plug appliance in end-user surfaces. Describes the
|
|
25
|
+
* load connected to the plug rather than the plug itself, so a user recognises
|
|
26
|
+
* "Dishwasher" instead of "Shelly channel 1".
|
|
27
|
+
*
|
|
28
|
+
* Purely presentational — consumers must not derive control behaviour from it.
|
|
29
|
+
* When omitted, or when a consumer does not know the member, it should fall
|
|
30
|
+
* back to a generic plug icon.
|
|
31
|
+
*/
|
|
32
|
+
export declare enum EnyoSmartPlugApplianceIconEnum {
|
|
33
|
+
/** Generic socket / unspecified load */
|
|
34
|
+
SmartPlug = "SmartPlug",
|
|
35
|
+
Dishwasher = "Dishwasher",
|
|
36
|
+
WashingMachine = "WashingMachine",
|
|
37
|
+
Dryer = "Dryer",
|
|
38
|
+
Refrigerator = "Refrigerator",
|
|
39
|
+
Freezer = "Freezer",
|
|
40
|
+
Oven = "Oven",
|
|
41
|
+
CoffeeMachine = "CoffeeMachine",
|
|
42
|
+
/** Kettle, toaster and other small kitchen appliances */
|
|
43
|
+
KitchenAppliance = "KitchenAppliance",
|
|
44
|
+
/** TV, hi-fi, console and other entertainment loads */
|
|
45
|
+
Entertainment = "Entertainment",
|
|
46
|
+
/** Desktop, server, network equipment */
|
|
47
|
+
Computer = "Computer",
|
|
48
|
+
Lighting = "Lighting",
|
|
49
|
+
/** Pool pump or pool filter system */
|
|
50
|
+
PoolPump = "PoolPump",
|
|
51
|
+
/** Circulation, well or sump pump */
|
|
52
|
+
Pump = "Pump",
|
|
53
|
+
/** Electric water heater / boiler */
|
|
54
|
+
WaterHeater = "WaterHeater",
|
|
55
|
+
/** Portable electric heater */
|
|
56
|
+
Heater = "Heater",
|
|
57
|
+
/** Fan or ventilation unit */
|
|
58
|
+
Fan = "Fan",
|
|
59
|
+
Aquarium = "Aquarium",
|
|
60
|
+
/** Garden, irrigation or greenhouse equipment */
|
|
61
|
+
Garden = "Garden",
|
|
62
|
+
/** Workshop machinery and power tools */
|
|
63
|
+
Workshop = "Workshop",
|
|
64
|
+
/** Car / e-bike charging via a plain socket */
|
|
65
|
+
Charging = "Charging",
|
|
66
|
+
/** Known load that none of the other members describe */
|
|
67
|
+
Other = "Other"
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Initial presentation defaults for a smart plug appliance, supplied by the
|
|
71
|
+
* owning energy app **once, when the appliance is first created**.
|
|
72
|
+
*
|
|
73
|
+
* These are seed values for user-owned settings: after creation the end user
|
|
74
|
+
* owns them, and the energy app must not send them again or overwrite what the
|
|
75
|
+
* user changed. Consumers that persist user edits should therefore ignore this
|
|
76
|
+
* object on subsequent appliance updates.
|
|
77
|
+
*
|
|
78
|
+
* The user-facing display name follows the same pattern and is already covered
|
|
79
|
+
* generally by {@link EnyoAppliance.customName} — it is not repeated here.
|
|
80
|
+
*/
|
|
81
|
+
export interface EnyoSmartPlugApplianceDefaults {
|
|
82
|
+
/**
|
|
83
|
+
* Whether the appliance should be shown in the end-user cockpit by default.
|
|
84
|
+
* Set `false` for plugs that are operationally relevant but not interesting
|
|
85
|
+
* to look at (e.g. an auxiliary relay).
|
|
86
|
+
*/
|
|
87
|
+
showInCockpit: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Whether the cockpit should offer a manual on/off switch for this plug by
|
|
90
|
+
* default. Only meaningful for plugs that list
|
|
91
|
+
* {@link EnyoSmartPlugApplianceAvailableFeaturesEnum.Switching}; a
|
|
92
|
+
* measure-only plug should set this to `false`.
|
|
93
|
+
*/
|
|
94
|
+
onOffSwitchShown: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Icon to display for the plug by default, describing the connected load.
|
|
97
|
+
* Omit when the energy app cannot tell what is plugged in — consumers then
|
|
98
|
+
* fall back to a generic plug icon.
|
|
99
|
+
*/
|
|
100
|
+
icon?: EnyoSmartPlugApplianceIconEnum;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Type-specific metadata for a smart plug appliance — a switchable socket or
|
|
104
|
+
* relay channel (e.g. one channel of a Shelly device) that powers an arbitrary
|
|
105
|
+
* load.
|
|
106
|
+
*
|
|
107
|
+
* A device exposing several independently switchable channels should be
|
|
108
|
+
* modelled as one {@link EnyoAppliance} of type
|
|
109
|
+
* {@link EnyoApplianceTypeEnum.SmartPlug} per channel, each carrying its own
|
|
110
|
+
* {@link channel} index.
|
|
111
|
+
*
|
|
112
|
+
* Appliances that can be switched should list
|
|
113
|
+
* {@link EnyoAutomationActionTypeEnum.SmartPlugSwitch} in
|
|
114
|
+
* {@link EnyoAppliance.supportedAutomationActions} so the automation UI offers
|
|
115
|
+
* them as targets.
|
|
116
|
+
*/
|
|
117
|
+
export interface EnyoSmartPlugApplianceMetadata {
|
|
118
|
+
/** List of features supported by this smart plug */
|
|
119
|
+
availableFeatures: EnyoSmartPlugApplianceAvailableFeaturesEnum[];
|
|
120
|
+
/**
|
|
121
|
+
* Current relay state of the plug, when known. Omit when the integration
|
|
122
|
+
* cannot determine it — `undefined` means "not known", which is not the
|
|
123
|
+
* same as {@link EnyoSmartPlugApplianceStateEnum.Off}.
|
|
124
|
+
*/
|
|
125
|
+
state?: EnyoSmartPlugApplianceStateEnum;
|
|
126
|
+
/**
|
|
127
|
+
* Zero-based channel index within the physical device, for devices that
|
|
128
|
+
* expose more than one switchable channel. Omit for single-channel plugs.
|
|
129
|
+
*/
|
|
130
|
+
channel?: number;
|
|
131
|
+
/**
|
|
132
|
+
* Maximum electrical power the plug is rated to switch, in watts. Used to
|
|
133
|
+
* bound how much load an energy manager assumes it can move onto this plug.
|
|
134
|
+
*/
|
|
135
|
+
ratedPowerW?: number;
|
|
136
|
+
/**
|
|
137
|
+
* Typical power draw of the load connected to this plug, in watts, when it
|
|
138
|
+
* is known (either configured by the user or learned from measurements).
|
|
139
|
+
*
|
|
140
|
+
* Lets a consumer estimate the effect of switching the plug on before it
|
|
141
|
+
* has ever been switched — a plug reporting `0 W` while off says nothing
|
|
142
|
+
* about what it will draw once on.
|
|
143
|
+
*/
|
|
144
|
+
expectedLoadPowerW?: number;
|
|
145
|
+
/**
|
|
146
|
+
* Minimum time in minutes the plug should stay on after being switched on,
|
|
147
|
+
* to protect the connected load from short-cycling (e.g. a pool pump or a
|
|
148
|
+
* compressor). Consumers issuing
|
|
149
|
+
* {@link EnyoDataBusSetSmartPlugSwitchV1} commands should respect this.
|
|
150
|
+
*/
|
|
151
|
+
minOnDurationMinutes?: number;
|
|
152
|
+
/**
|
|
153
|
+
* Minimum time in minutes the plug should stay off after being switched
|
|
154
|
+
* off, for the same short-cycling protection as
|
|
155
|
+
* {@link minOnDurationMinutes}.
|
|
156
|
+
*/
|
|
157
|
+
minOffDurationMinutes?: number;
|
|
158
|
+
/**
|
|
159
|
+
* Initial presentation defaults for this plug (cockpit visibility, manual
|
|
160
|
+
* switch, icon), supplied once when the appliance is created. The end user
|
|
161
|
+
* owns these settings afterwards — see
|
|
162
|
+
* {@link EnyoSmartPlugApplianceDefaults}. The energy app must not use this
|
|
163
|
+
* field to change them later.
|
|
164
|
+
*/
|
|
165
|
+
defaults?: EnyoSmartPlugApplianceDefaults;
|
|
166
|
+
/**
|
|
167
|
+
* Whether the energy manager is allowed to actively switch this plug. When
|
|
168
|
+
* `false`, the plug is treated as read-only/monitor-only and the EMS must
|
|
169
|
+
* not issue switch commands to it. When omitted, consumers should fall back
|
|
170
|
+
* to their configured default behaviour.
|
|
171
|
+
*/
|
|
172
|
+
controlAllowed?: boolean;
|
|
173
|
+
}
|
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.10.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
|
@@ -10,6 +10,7 @@ import type { EnyoMeterAppliance } from "../../types/enyo-meter-appliance.js";
|
|
|
10
10
|
import type { EnyoTemperatureSensorApplianceMetadata } from "../../types/enyo-temperature-sensor-appliance.js";
|
|
11
11
|
import type { EnyoAirConditioningApplianceMetadata } from "../../types/enyo-air-conditioning-appliance.js";
|
|
12
12
|
import type { EnyoHeatingRodApplianceMetadata } from "../../types/enyo-heating-rod-appliance.js";
|
|
13
|
+
import type { EnyoSmartPlugApplianceMetadata } from "../../types/enyo-smart-plug-appliance.js";
|
|
13
14
|
import { IdentifierStrategy } from "./identifier-strategies.js";
|
|
14
15
|
/**
|
|
15
16
|
* Thrown when {@link ApplianceManager.createOrUpdateAppliance} is called with
|
|
@@ -62,6 +63,7 @@ export interface ApplianceConfig {
|
|
|
62
63
|
temperatureSensor?: EnyoTemperatureSensorApplianceMetadata;
|
|
63
64
|
airConditioning?: EnyoAirConditioningApplianceMetadata;
|
|
64
65
|
heatingRod?: EnyoHeatingRodApplianceMetadata;
|
|
66
|
+
smartPlug?: EnyoSmartPlugApplianceMetadata;
|
|
65
67
|
availableFeatures?: EnyoApplianceAvailableFeaturesEnum[];
|
|
66
68
|
/**
|
|
67
69
|
* Optional identifier of the cloud-deployed energy app package that manages
|
|
@@ -437,6 +439,8 @@ export interface PartialEnyoAppliance {
|
|
|
437
439
|
airConditioning?: Partial<EnyoAirConditioningApplianceMetadata>;
|
|
438
440
|
/** Optional Metadata of the Appliance if of type HeatingRod */
|
|
439
441
|
heatingRod?: Partial<EnyoHeatingRodApplianceMetadata>;
|
|
442
|
+
/** Optional Metadata of the Appliance if of type SmartPlug */
|
|
443
|
+
smartPlug?: Partial<EnyoSmartPlugApplianceMetadata>;
|
|
440
444
|
/** Optional custom name for the appliance, defined by the user */
|
|
441
445
|
customName?: string;
|
|
442
446
|
/**
|
|
@@ -54,6 +54,7 @@ const MERGEABLE_METADATA_KEYS = [
|
|
|
54
54
|
'temperatureSensor',
|
|
55
55
|
'airConditioning',
|
|
56
56
|
'heatingRod',
|
|
57
|
+
'smartPlug',
|
|
57
58
|
];
|
|
58
59
|
/**
|
|
59
60
|
* Manages appliances in the energy system with configurable identification strategies.
|
|
@@ -203,6 +204,7 @@ export class ApplianceManager {
|
|
|
203
204
|
temperatureSensor: appliance.temperatureSensor,
|
|
204
205
|
airConditioning: appliance.airConditioning,
|
|
205
206
|
heatingRod: appliance.heatingRod,
|
|
207
|
+
smartPlug: appliance.smartPlug,
|
|
206
208
|
// Conditionally spread the two optional top-level fields that are NOT
|
|
207
209
|
// covered by MERGEABLE_METADATA_KEYS. If they were always materialized
|
|
208
210
|
// as explicit keys, an omitted (undefined) value would clobber the
|
package/dist/index.d.ts
CHANGED
|
@@ -70,6 +70,7 @@ export * from './types/enyo-configuration-manager.js';
|
|
|
70
70
|
export * from './packages/energy-app-configuration-manager.js';
|
|
71
71
|
export * from './types/enyo-air-conditioning-appliance.js';
|
|
72
72
|
export * from './types/enyo-heating-rod-appliance.js';
|
|
73
|
+
export * from './types/enyo-smart-plug-appliance.js';
|
|
73
74
|
export * from './types/enyo-charger-appliance.js';
|
|
74
75
|
export * from './types/enyo-charging-card.js';
|
|
75
76
|
export * from './packages/energy-app-charging-card.js';
|
package/dist/index.js
CHANGED
|
@@ -70,6 +70,7 @@ export * from './types/enyo-configuration-manager.js';
|
|
|
70
70
|
export * from './packages/energy-app-configuration-manager.js';
|
|
71
71
|
export * from './types/enyo-air-conditioning-appliance.js';
|
|
72
72
|
export * from './types/enyo-heating-rod-appliance.js';
|
|
73
|
+
export * from './types/enyo-smart-plug-appliance.js';
|
|
73
74
|
export * from './types/enyo-charger-appliance.js';
|
|
74
75
|
export * from './types/enyo-charging-card.js';
|
|
75
76
|
export * from './packages/energy-app-charging-card.js';
|
|
@@ -8,6 +8,7 @@ import { EnyoMeterAppliance } from "./enyo-meter-appliance.js";
|
|
|
8
8
|
import { EnyoTemperatureSensorApplianceMetadata } from "./enyo-temperature-sensor-appliance.js";
|
|
9
9
|
import { EnyoAirConditioningApplianceMetadata } from "./enyo-air-conditioning-appliance.js";
|
|
10
10
|
import { EnyoHeatingRodApplianceMetadata } from "./enyo-heating-rod-appliance.js";
|
|
11
|
+
import { EnyoSmartPlugApplianceMetadata } from "./enyo-smart-plug-appliance.js";
|
|
11
12
|
export declare enum EnyoApplianceTypeEnum {
|
|
12
13
|
Inverter = "Inverter",
|
|
13
14
|
Charger = "Charger",
|
|
@@ -16,7 +17,9 @@ export declare enum EnyoApplianceTypeEnum {
|
|
|
16
17
|
Heatpump = "Heatpump",
|
|
17
18
|
AirConditioning = "AirConditioning",
|
|
18
19
|
TemperatureSensor = "TemperatureSensor",
|
|
19
|
-
HeatingRod = "HeatingRod"
|
|
20
|
+
HeatingRod = "HeatingRod",
|
|
21
|
+
/** Switchable socket / relay channel powering an arbitrary load (e.g. a Shelly channel) */
|
|
22
|
+
SmartPlug = "SmartPlug"
|
|
20
23
|
}
|
|
21
24
|
export interface EnyoApplianceName {
|
|
22
25
|
language: EnergyAppPackageLanguage;
|
|
@@ -270,6 +273,8 @@ export interface EnyoAppliance {
|
|
|
270
273
|
airConditioning?: EnyoAirConditioningApplianceMetadata;
|
|
271
274
|
/** Optional Metadata of the Appliance if of type HeatingRod */
|
|
272
275
|
heatingRod?: EnyoHeatingRodApplianceMetadata;
|
|
276
|
+
/** Optional Metadata of the Appliance if of type SmartPlug */
|
|
277
|
+
smartPlug?: EnyoSmartPlugApplianceMetadata;
|
|
273
278
|
/** Optional custom name for the appliance, defined by the user */
|
|
274
279
|
customName?: string;
|
|
275
280
|
/**
|
|
@@ -8,6 +8,8 @@ export var EnyoApplianceTypeEnum;
|
|
|
8
8
|
EnyoApplianceTypeEnum["AirConditioning"] = "AirConditioning";
|
|
9
9
|
EnyoApplianceTypeEnum["TemperatureSensor"] = "TemperatureSensor";
|
|
10
10
|
EnyoApplianceTypeEnum["HeatingRod"] = "HeatingRod";
|
|
11
|
+
/** Switchable socket / relay channel powering an arbitrary load (e.g. a Shelly channel) */
|
|
12
|
+
EnyoApplianceTypeEnum["SmartPlug"] = "SmartPlug";
|
|
11
13
|
})(EnyoApplianceTypeEnum || (EnyoApplianceTypeEnum = {}));
|
|
12
14
|
export var EnyoApplianceStateEnum;
|
|
13
15
|
(function (EnyoApplianceStateEnum) {
|
|
@@ -7,6 +7,7 @@ import { PreviewChargingSchedule, PreviewChargingScheduleCostComparison, Preview
|
|
|
7
7
|
import { EnyoEnergyPrices } from "./enyo-energy-prices.js";
|
|
8
8
|
import { EnyoCurrencyEnum } from "./enyo-currency.js";
|
|
9
9
|
import { EnyoHeatpumpApplianceModeEnum } from "./enyo-heatpump-appliance.js";
|
|
10
|
+
import { EnyoSmartPlugApplianceStateEnum } from "./enyo-smart-plug-appliance.js";
|
|
10
11
|
import { EnyoAirConditioningApplianceModeEnum, EnyoAirConditioningOptimizationModeEnum } from "./enyo-air-conditioning-appliance.js";
|
|
11
12
|
import { EnergyAppPackageCategory } from "../energy-app-package-definition.js";
|
|
12
13
|
import { EnyoPackageConfigurationTranslatedValue } from "./enyo-settings.js";
|
|
@@ -344,6 +345,10 @@ export declare enum EnyoDataBusMessageEnum {
|
|
|
344
345
|
SetHeatingRodAvailablePowerV2 = "SetHeatingRodAvailablePowerV2",
|
|
345
346
|
/** V2 control command: prescribe a single-setpoint control (mode + direction + power) to a battery/storage appliance. */
|
|
346
347
|
SetStorageControlV2 = "SetStorageControlV2",
|
|
348
|
+
/** Live values of a smart plug: relay state, power draw and energy meter reading. */
|
|
349
|
+
SmartPlugValuesUpdateV1 = "SmartPlugValuesUpdateV1",
|
|
350
|
+
/** Control command: switch a smart plug / relay channel on or off. */
|
|
351
|
+
SetSmartPlugSwitchV1 = "SetSmartPlugSwitchV1",
|
|
347
352
|
EnergyAppStartedV1 = "EnergyAppStartedV1"
|
|
348
353
|
}
|
|
349
354
|
export type EnyoDataBusMessageResolution = '1s' | '10s' | '30s' | '1m' | '15m' | '1h' | '1d' | 'dynamic';
|
|
@@ -2429,3 +2434,68 @@ export interface EnyoDataBusVehicleSocUpdateV1 extends EnyoDataBusMessage {
|
|
|
2429
2434
|
batterySizeKwh?: number;
|
|
2430
2435
|
};
|
|
2431
2436
|
}
|
|
2437
|
+
/**
|
|
2438
|
+
* Live values of a smart plug / switchable relay channel, published by the
|
|
2439
|
+
* integration that owns the appliance.
|
|
2440
|
+
*
|
|
2441
|
+
* Send this whenever the relay state or the measured power changes, so an
|
|
2442
|
+
* energy manager can account for the load and decide whether to switch the plug
|
|
2443
|
+
* via {@link EnyoDataBusSetSmartPlugSwitchV1}.
|
|
2444
|
+
*/
|
|
2445
|
+
export interface EnyoDataBusSmartPlugValuesV1 extends EnyoDataBusMessage {
|
|
2446
|
+
type: 'message';
|
|
2447
|
+
message: EnyoDataBusMessageEnum.SmartPlugValuesUpdateV1;
|
|
2448
|
+
/** ID of the smart plug appliance that delivered these values */
|
|
2449
|
+
applianceId: string;
|
|
2450
|
+
data: {
|
|
2451
|
+
/**
|
|
2452
|
+
* Current relay state of the plug. Omit when the integration cannot
|
|
2453
|
+
* determine it — `undefined` means "not known", which is not the same
|
|
2454
|
+
* as {@link EnyoSmartPlugApplianceStateEnum.Off}.
|
|
2455
|
+
*/
|
|
2456
|
+
state?: EnyoSmartPlugApplianceStateEnum;
|
|
2457
|
+
/**
|
|
2458
|
+
* Current active power drawn by the connected load in Watt. Normally
|
|
2459
|
+
* positive (a plug powers a consumer). Omit when the plug cannot
|
|
2460
|
+
* measure it — do not send `0` as a stand-in for "unknown", since a
|
|
2461
|
+
* consumer cannot tell that apart from "nothing is drawing power".
|
|
2462
|
+
*/
|
|
2463
|
+
powerW?: number;
|
|
2464
|
+
/** Cumulative energy meter reading of the plug in Watt hours */
|
|
2465
|
+
meterValueWh?: number;
|
|
2466
|
+
/** Voltage measured at the plug in V, when reported */
|
|
2467
|
+
voltageV?: number;
|
|
2468
|
+
/** Current measured at the plug in A, when reported */
|
|
2469
|
+
currentA?: number;
|
|
2470
|
+
};
|
|
2471
|
+
}
|
|
2472
|
+
/**
|
|
2473
|
+
* Command switching a smart plug / relay channel on or off.
|
|
2474
|
+
*
|
|
2475
|
+
* Only valid for appliances that list
|
|
2476
|
+
* {@link EnyoSmartPlugApplianceAvailableFeaturesEnum.Switching} and whose
|
|
2477
|
+
* metadata does not set `controlAllowed: false`. The receiving integration
|
|
2478
|
+
* should answer with an {@link EnyoDataBusCommandAcknowledgeV1} message
|
|
2479
|
+
* referencing this message's `id`, and reflect the resulting relay state in the
|
|
2480
|
+
* next {@link EnyoDataBusSmartPlugValuesV1}.
|
|
2481
|
+
*/
|
|
2482
|
+
export interface EnyoDataBusSetSmartPlugSwitchV1 extends EnyoDataBusMessage {
|
|
2483
|
+
type: 'message';
|
|
2484
|
+
message: EnyoDataBusMessageEnum.SetSmartPlugSwitchV1;
|
|
2485
|
+
/** ID of the smart plug appliance to switch */
|
|
2486
|
+
applianceId: string;
|
|
2487
|
+
data: {
|
|
2488
|
+
/** Target relay state: `On` closes the relay, `Off` opens it */
|
|
2489
|
+
state: EnyoSmartPlugApplianceStateEnum;
|
|
2490
|
+
/**
|
|
2491
|
+
* Minimum time in minutes the requested state should be held before the
|
|
2492
|
+
* plug may be switched again, to protect the connected load from
|
|
2493
|
+
* short-cycling. When omitted, the integration should fall back to the
|
|
2494
|
+
* appliance's `minOnDurationMinutes` / `minOffDurationMinutes`
|
|
2495
|
+
* metadata, and otherwise switch immediately.
|
|
2496
|
+
*/
|
|
2497
|
+
minDurationMinutes?: number;
|
|
2498
|
+
/** Optional reason why this command was issued */
|
|
2499
|
+
reason?: EnyoDataBusCommandReason;
|
|
2500
|
+
};
|
|
2501
|
+
}
|
|
@@ -277,6 +277,10 @@ export var EnyoDataBusMessageEnum;
|
|
|
277
277
|
EnyoDataBusMessageEnum["SetHeatingRodAvailablePowerV2"] = "SetHeatingRodAvailablePowerV2";
|
|
278
278
|
/** V2 control command: prescribe a single-setpoint control (mode + direction + power) to a battery/storage appliance. */
|
|
279
279
|
EnyoDataBusMessageEnum["SetStorageControlV2"] = "SetStorageControlV2";
|
|
280
|
+
/** Live values of a smart plug: relay state, power draw and energy meter reading. */
|
|
281
|
+
EnyoDataBusMessageEnum["SmartPlugValuesUpdateV1"] = "SmartPlugValuesUpdateV1";
|
|
282
|
+
/** Control command: switch a smart plug / relay channel on or off. */
|
|
283
|
+
EnyoDataBusMessageEnum["SetSmartPlugSwitchV1"] = "SetSmartPlugSwitchV1";
|
|
280
284
|
EnyoDataBusMessageEnum["EnergyAppStartedV1"] = "EnergyAppStartedV1";
|
|
281
285
|
})(EnyoDataBusMessageEnum || (EnyoDataBusMessageEnum = {}));
|
|
282
286
|
/**
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capabilities a smart plug / switchable relay appliance may support. A plug
|
|
3
|
+
* that only reports power without being switchable lists {@link Power} alone;
|
|
4
|
+
* one that can only be switched lists {@link Switching} alone.
|
|
5
|
+
*/
|
|
6
|
+
export declare enum EnyoSmartPlugApplianceAvailableFeaturesEnum {
|
|
7
|
+
/** If the plug can be switched on and off by the energy manager or an automation */
|
|
8
|
+
Switching = "Switching",
|
|
9
|
+
/** If the plug measures the active power (W) drawn by the connected load */
|
|
10
|
+
Power = "Power",
|
|
11
|
+
/** If the plug reports a cumulative energy meter reading (Wh) for the connected load */
|
|
12
|
+
EnergyMetering = "EnergyMetering"
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Relay state of a smart plug channel.
|
|
16
|
+
*/
|
|
17
|
+
export declare enum EnyoSmartPlugApplianceStateEnum {
|
|
18
|
+
/** The relay is closed — the connected load is powered */
|
|
19
|
+
On = "On",
|
|
20
|
+
/** The relay is open — the connected load is not powered */
|
|
21
|
+
Off = "Off"
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Icon suggested for a smart plug appliance in end-user surfaces. Describes the
|
|
25
|
+
* load connected to the plug rather than the plug itself, so a user recognises
|
|
26
|
+
* "Dishwasher" instead of "Shelly channel 1".
|
|
27
|
+
*
|
|
28
|
+
* Purely presentational — consumers must not derive control behaviour from it.
|
|
29
|
+
* When omitted, or when a consumer does not know the member, it should fall
|
|
30
|
+
* back to a generic plug icon.
|
|
31
|
+
*/
|
|
32
|
+
export declare enum EnyoSmartPlugApplianceIconEnum {
|
|
33
|
+
/** Generic socket / unspecified load */
|
|
34
|
+
SmartPlug = "SmartPlug",
|
|
35
|
+
Dishwasher = "Dishwasher",
|
|
36
|
+
WashingMachine = "WashingMachine",
|
|
37
|
+
Dryer = "Dryer",
|
|
38
|
+
Refrigerator = "Refrigerator",
|
|
39
|
+
Freezer = "Freezer",
|
|
40
|
+
Oven = "Oven",
|
|
41
|
+
CoffeeMachine = "CoffeeMachine",
|
|
42
|
+
/** Kettle, toaster and other small kitchen appliances */
|
|
43
|
+
KitchenAppliance = "KitchenAppliance",
|
|
44
|
+
/** TV, hi-fi, console and other entertainment loads */
|
|
45
|
+
Entertainment = "Entertainment",
|
|
46
|
+
/** Desktop, server, network equipment */
|
|
47
|
+
Computer = "Computer",
|
|
48
|
+
Lighting = "Lighting",
|
|
49
|
+
/** Pool pump or pool filter system */
|
|
50
|
+
PoolPump = "PoolPump",
|
|
51
|
+
/** Circulation, well or sump pump */
|
|
52
|
+
Pump = "Pump",
|
|
53
|
+
/** Electric water heater / boiler */
|
|
54
|
+
WaterHeater = "WaterHeater",
|
|
55
|
+
/** Portable electric heater */
|
|
56
|
+
Heater = "Heater",
|
|
57
|
+
/** Fan or ventilation unit */
|
|
58
|
+
Fan = "Fan",
|
|
59
|
+
Aquarium = "Aquarium",
|
|
60
|
+
/** Garden, irrigation or greenhouse equipment */
|
|
61
|
+
Garden = "Garden",
|
|
62
|
+
/** Workshop machinery and power tools */
|
|
63
|
+
Workshop = "Workshop",
|
|
64
|
+
/** Car / e-bike charging via a plain socket */
|
|
65
|
+
Charging = "Charging",
|
|
66
|
+
/** Known load that none of the other members describe */
|
|
67
|
+
Other = "Other"
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Initial presentation defaults for a smart plug appliance, supplied by the
|
|
71
|
+
* owning energy app **once, when the appliance is first created**.
|
|
72
|
+
*
|
|
73
|
+
* These are seed values for user-owned settings: after creation the end user
|
|
74
|
+
* owns them, and the energy app must not send them again or overwrite what the
|
|
75
|
+
* user changed. Consumers that persist user edits should therefore ignore this
|
|
76
|
+
* object on subsequent appliance updates.
|
|
77
|
+
*
|
|
78
|
+
* The user-facing display name follows the same pattern and is already covered
|
|
79
|
+
* generally by {@link EnyoAppliance.customName} — it is not repeated here.
|
|
80
|
+
*/
|
|
81
|
+
export interface EnyoSmartPlugApplianceDefaults {
|
|
82
|
+
/**
|
|
83
|
+
* Whether the appliance should be shown in the end-user cockpit by default.
|
|
84
|
+
* Set `false` for plugs that are operationally relevant but not interesting
|
|
85
|
+
* to look at (e.g. an auxiliary relay).
|
|
86
|
+
*/
|
|
87
|
+
showInCockpit: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Whether the cockpit should offer a manual on/off switch for this plug by
|
|
90
|
+
* default. Only meaningful for plugs that list
|
|
91
|
+
* {@link EnyoSmartPlugApplianceAvailableFeaturesEnum.Switching}; a
|
|
92
|
+
* measure-only plug should set this to `false`.
|
|
93
|
+
*/
|
|
94
|
+
onOffSwitchShown: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Icon to display for the plug by default, describing the connected load.
|
|
97
|
+
* Omit when the energy app cannot tell what is plugged in — consumers then
|
|
98
|
+
* fall back to a generic plug icon.
|
|
99
|
+
*/
|
|
100
|
+
icon?: EnyoSmartPlugApplianceIconEnum;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Type-specific metadata for a smart plug appliance — a switchable socket or
|
|
104
|
+
* relay channel (e.g. one channel of a Shelly device) that powers an arbitrary
|
|
105
|
+
* load.
|
|
106
|
+
*
|
|
107
|
+
* A device exposing several independently switchable channels should be
|
|
108
|
+
* modelled as one {@link EnyoAppliance} of type
|
|
109
|
+
* {@link EnyoApplianceTypeEnum.SmartPlug} per channel, each carrying its own
|
|
110
|
+
* {@link channel} index.
|
|
111
|
+
*
|
|
112
|
+
* Appliances that can be switched should list
|
|
113
|
+
* {@link EnyoAutomationActionTypeEnum.SmartPlugSwitch} in
|
|
114
|
+
* {@link EnyoAppliance.supportedAutomationActions} so the automation UI offers
|
|
115
|
+
* them as targets.
|
|
116
|
+
*/
|
|
117
|
+
export interface EnyoSmartPlugApplianceMetadata {
|
|
118
|
+
/** List of features supported by this smart plug */
|
|
119
|
+
availableFeatures: EnyoSmartPlugApplianceAvailableFeaturesEnum[];
|
|
120
|
+
/**
|
|
121
|
+
* Current relay state of the plug, when known. Omit when the integration
|
|
122
|
+
* cannot determine it — `undefined` means "not known", which is not the
|
|
123
|
+
* same as {@link EnyoSmartPlugApplianceStateEnum.Off}.
|
|
124
|
+
*/
|
|
125
|
+
state?: EnyoSmartPlugApplianceStateEnum;
|
|
126
|
+
/**
|
|
127
|
+
* Zero-based channel index within the physical device, for devices that
|
|
128
|
+
* expose more than one switchable channel. Omit for single-channel plugs.
|
|
129
|
+
*/
|
|
130
|
+
channel?: number;
|
|
131
|
+
/**
|
|
132
|
+
* Maximum electrical power the plug is rated to switch, in watts. Used to
|
|
133
|
+
* bound how much load an energy manager assumes it can move onto this plug.
|
|
134
|
+
*/
|
|
135
|
+
ratedPowerW?: number;
|
|
136
|
+
/**
|
|
137
|
+
* Typical power draw of the load connected to this plug, in watts, when it
|
|
138
|
+
* is known (either configured by the user or learned from measurements).
|
|
139
|
+
*
|
|
140
|
+
* Lets a consumer estimate the effect of switching the plug on before it
|
|
141
|
+
* has ever been switched — a plug reporting `0 W` while off says nothing
|
|
142
|
+
* about what it will draw once on.
|
|
143
|
+
*/
|
|
144
|
+
expectedLoadPowerW?: number;
|
|
145
|
+
/**
|
|
146
|
+
* Minimum time in minutes the plug should stay on after being switched on,
|
|
147
|
+
* to protect the connected load from short-cycling (e.g. a pool pump or a
|
|
148
|
+
* compressor). Consumers issuing
|
|
149
|
+
* {@link EnyoDataBusSetSmartPlugSwitchV1} commands should respect this.
|
|
150
|
+
*/
|
|
151
|
+
minOnDurationMinutes?: number;
|
|
152
|
+
/**
|
|
153
|
+
* Minimum time in minutes the plug should stay off after being switched
|
|
154
|
+
* off, for the same short-cycling protection as
|
|
155
|
+
* {@link minOnDurationMinutes}.
|
|
156
|
+
*/
|
|
157
|
+
minOffDurationMinutes?: number;
|
|
158
|
+
/**
|
|
159
|
+
* Initial presentation defaults for this plug (cockpit visibility, manual
|
|
160
|
+
* switch, icon), supplied once when the appliance is created. The end user
|
|
161
|
+
* owns these settings afterwards — see
|
|
162
|
+
* {@link EnyoSmartPlugApplianceDefaults}. The energy app must not use this
|
|
163
|
+
* field to change them later.
|
|
164
|
+
*/
|
|
165
|
+
defaults?: EnyoSmartPlugApplianceDefaults;
|
|
166
|
+
/**
|
|
167
|
+
* Whether the energy manager is allowed to actively switch this plug. When
|
|
168
|
+
* `false`, the plug is treated as read-only/monitor-only and the EMS must
|
|
169
|
+
* not issue switch commands to it. When omitted, consumers should fall back
|
|
170
|
+
* to their configured default behaviour.
|
|
171
|
+
*/
|
|
172
|
+
controlAllowed?: boolean;
|
|
173
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capabilities a smart plug / switchable relay appliance may support. A plug
|
|
3
|
+
* that only reports power without being switchable lists {@link Power} alone;
|
|
4
|
+
* one that can only be switched lists {@link Switching} alone.
|
|
5
|
+
*/
|
|
6
|
+
export var EnyoSmartPlugApplianceAvailableFeaturesEnum;
|
|
7
|
+
(function (EnyoSmartPlugApplianceAvailableFeaturesEnum) {
|
|
8
|
+
/** If the plug can be switched on and off by the energy manager or an automation */
|
|
9
|
+
EnyoSmartPlugApplianceAvailableFeaturesEnum["Switching"] = "Switching";
|
|
10
|
+
/** If the plug measures the active power (W) drawn by the connected load */
|
|
11
|
+
EnyoSmartPlugApplianceAvailableFeaturesEnum["Power"] = "Power";
|
|
12
|
+
/** If the plug reports a cumulative energy meter reading (Wh) for the connected load */
|
|
13
|
+
EnyoSmartPlugApplianceAvailableFeaturesEnum["EnergyMetering"] = "EnergyMetering";
|
|
14
|
+
})(EnyoSmartPlugApplianceAvailableFeaturesEnum || (EnyoSmartPlugApplianceAvailableFeaturesEnum = {}));
|
|
15
|
+
/**
|
|
16
|
+
* Relay state of a smart plug channel.
|
|
17
|
+
*/
|
|
18
|
+
export var EnyoSmartPlugApplianceStateEnum;
|
|
19
|
+
(function (EnyoSmartPlugApplianceStateEnum) {
|
|
20
|
+
/** The relay is closed — the connected load is powered */
|
|
21
|
+
EnyoSmartPlugApplianceStateEnum["On"] = "On";
|
|
22
|
+
/** The relay is open — the connected load is not powered */
|
|
23
|
+
EnyoSmartPlugApplianceStateEnum["Off"] = "Off";
|
|
24
|
+
})(EnyoSmartPlugApplianceStateEnum || (EnyoSmartPlugApplianceStateEnum = {}));
|
|
25
|
+
/**
|
|
26
|
+
* Icon suggested for a smart plug appliance in end-user surfaces. Describes the
|
|
27
|
+
* load connected to the plug rather than the plug itself, so a user recognises
|
|
28
|
+
* "Dishwasher" instead of "Shelly channel 1".
|
|
29
|
+
*
|
|
30
|
+
* Purely presentational — consumers must not derive control behaviour from it.
|
|
31
|
+
* When omitted, or when a consumer does not know the member, it should fall
|
|
32
|
+
* back to a generic plug icon.
|
|
33
|
+
*/
|
|
34
|
+
export var EnyoSmartPlugApplianceIconEnum;
|
|
35
|
+
(function (EnyoSmartPlugApplianceIconEnum) {
|
|
36
|
+
/** Generic socket / unspecified load */
|
|
37
|
+
EnyoSmartPlugApplianceIconEnum["SmartPlug"] = "SmartPlug";
|
|
38
|
+
EnyoSmartPlugApplianceIconEnum["Dishwasher"] = "Dishwasher";
|
|
39
|
+
EnyoSmartPlugApplianceIconEnum["WashingMachine"] = "WashingMachine";
|
|
40
|
+
EnyoSmartPlugApplianceIconEnum["Dryer"] = "Dryer";
|
|
41
|
+
EnyoSmartPlugApplianceIconEnum["Refrigerator"] = "Refrigerator";
|
|
42
|
+
EnyoSmartPlugApplianceIconEnum["Freezer"] = "Freezer";
|
|
43
|
+
EnyoSmartPlugApplianceIconEnum["Oven"] = "Oven";
|
|
44
|
+
EnyoSmartPlugApplianceIconEnum["CoffeeMachine"] = "CoffeeMachine";
|
|
45
|
+
/** Kettle, toaster and other small kitchen appliances */
|
|
46
|
+
EnyoSmartPlugApplianceIconEnum["KitchenAppliance"] = "KitchenAppliance";
|
|
47
|
+
/** TV, hi-fi, console and other entertainment loads */
|
|
48
|
+
EnyoSmartPlugApplianceIconEnum["Entertainment"] = "Entertainment";
|
|
49
|
+
/** Desktop, server, network equipment */
|
|
50
|
+
EnyoSmartPlugApplianceIconEnum["Computer"] = "Computer";
|
|
51
|
+
EnyoSmartPlugApplianceIconEnum["Lighting"] = "Lighting";
|
|
52
|
+
/** Pool pump or pool filter system */
|
|
53
|
+
EnyoSmartPlugApplianceIconEnum["PoolPump"] = "PoolPump";
|
|
54
|
+
/** Circulation, well or sump pump */
|
|
55
|
+
EnyoSmartPlugApplianceIconEnum["Pump"] = "Pump";
|
|
56
|
+
/** Electric water heater / boiler */
|
|
57
|
+
EnyoSmartPlugApplianceIconEnum["WaterHeater"] = "WaterHeater";
|
|
58
|
+
/** Portable electric heater */
|
|
59
|
+
EnyoSmartPlugApplianceIconEnum["Heater"] = "Heater";
|
|
60
|
+
/** Fan or ventilation unit */
|
|
61
|
+
EnyoSmartPlugApplianceIconEnum["Fan"] = "Fan";
|
|
62
|
+
EnyoSmartPlugApplianceIconEnum["Aquarium"] = "Aquarium";
|
|
63
|
+
/** Garden, irrigation or greenhouse equipment */
|
|
64
|
+
EnyoSmartPlugApplianceIconEnum["Garden"] = "Garden";
|
|
65
|
+
/** Workshop machinery and power tools */
|
|
66
|
+
EnyoSmartPlugApplianceIconEnum["Workshop"] = "Workshop";
|
|
67
|
+
/** Car / e-bike charging via a plain socket */
|
|
68
|
+
EnyoSmartPlugApplianceIconEnum["Charging"] = "Charging";
|
|
69
|
+
/** Known load that none of the other members describe */
|
|
70
|
+
EnyoSmartPlugApplianceIconEnum["Other"] = "Other";
|
|
71
|
+
})(EnyoSmartPlugApplianceIconEnum || (EnyoSmartPlugApplianceIconEnum = {}));
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED