interface DeviceEnergyManagementBehavior {
    [reference]: Datasource<StateType>;
    agent: Agent;
    cluster: never;
    context: ActionContext;
    endpoint: Endpoint<Empty>;
    env: Environment;
    events: EventEmitter & Omit<ClusterEvents<Of<{
        attributes: {};
        commands: {};
        events: {};
        id: 0;
        name: "Unknown";
        revision: 0;
    }>, typeof ClusterBehavior>, never> & {
        absMaxPower$Changing: ClusterEvents.AttributeObservable<Attribute<number | bigint, any>>;
        absMinPower$Changing: ClusterEvents.AttributeObservable<Attribute<number | bigint, any>>;
        esaCanGenerate$Changing: ClusterEvents.AttributeObservable<FixedAttribute<boolean, any>>;
        esaState$Changing: ClusterEvents.AttributeObservable<Attribute<DeviceEnergyManagement.EsaState, any>>;
        esaType$Changing: ClusterEvents.AttributeObservable<FixedAttribute<DeviceEnergyManagement.EsaType, any>>;
    } & {} & {
        absMaxPower$Changed: ClusterEvents.AttributeObservable<Attribute<number | bigint, any>>;
        absMinPower$Changed: ClusterEvents.AttributeObservable<Attribute<number | bigint, any>>;
        esaCanGenerate$Changed: ClusterEvents.AttributeObservable<FixedAttribute<boolean, any>>;
        esaState$Changed: ClusterEvents.AttributeObservable<Attribute<DeviceEnergyManagement.EsaState, any>>;
        esaType$Changed: ClusterEvents.AttributeObservable<FixedAttribute<DeviceEnergyManagement.EsaType, any>>;
    } & {} & {} & {};
    features: TypeFromBitSchema<{}> & TypeFromBitSchema<{
        constraintBasedAdjustment: BitFlag;
        forecastAdjustment: BitFlag;
        pausable: BitFlag;
        powerAdjustment: BitFlag;
        powerForecastReporting: BitFlag;
        startTimeAdjustment: BitFlag;
        stateForecastReporting: BitFlag;
    }>;
    session: SecureSession;
    state: Omit<ClusterState.Type<Of<{
        attributes: {};
        commands: {};
        events: {};
        id: 0;
        name: "Unknown";
        revision: 0;
    }>, typeof ClusterBehavior>, never> & {
        absMaxPower: number | bigint;
        absMinPower: number | bigint;
        esaState: DeviceEnergyManagement.EsaState;
    } & {} & {
        esaCanGenerate: boolean;
        esaType: DeviceEnergyManagement.EsaType;
    } & {};
    [asyncDispose](): MaybePromise;
    asAdmin(fn: (() => void)): void;
    assertAttributeEnabled<This, K>(this: This, attributeName: K): void;
    callback<A, R>(reactor: Reactor<A, R>, options?: Reactor.Options): ((...args: A) => undefined | R);
    initialize(_options?: {}): MaybePromise;
    reactTo<O>(observable: O, reactor: Reactor<Parameters<O["emit"]>, ReturnType<O["emit"]>>, options?: Reactor.Options): void;
    requireAttributeEnabled<This, K>(this: This, attributeName: K): Exclude<This["state"][K], undefined>;
    toString(): string;
    State: any;
}

Hierarchy (view full)

Properties

[reference]: Datasource<StateType>
agent: Agent
cluster: never

The implemented cluster.

context: ActionContext
endpoint: Endpoint<Empty>
events: EventEmitter & Omit<ClusterEvents<Of<{
    attributes: {};
    commands: {};
    events: {};
    id: 0;
    name: "Unknown";
    revision: 0;
}>, typeof ClusterBehavior>, never> & {
    absMaxPower$Changing: ClusterEvents.AttributeObservable<Attribute<number | bigint, any>>;
    absMinPower$Changing: ClusterEvents.AttributeObservable<Attribute<number | bigint, any>>;
    esaCanGenerate$Changing: ClusterEvents.AttributeObservable<FixedAttribute<boolean, any>>;
    esaState$Changing: ClusterEvents.AttributeObservable<Attribute<DeviceEnergyManagement.EsaState, any>>;
    esaType$Changing: ClusterEvents.AttributeObservable<FixedAttribute<DeviceEnergyManagement.EsaType, any>>;
} & {} & {
    absMaxPower$Changed: ClusterEvents.AttributeObservable<Attribute<number | bigint, any>>;
    absMinPower$Changed: ClusterEvents.AttributeObservable<Attribute<number | bigint, any>>;
    esaCanGenerate$Changed: ClusterEvents.AttributeObservable<FixedAttribute<boolean, any>>;
    esaState$Changed: ClusterEvents.AttributeObservable<Attribute<DeviceEnergyManagement.EsaState, any>>;
    esaType$Changed: ClusterEvents.AttributeObservable<FixedAttribute<DeviceEnergyManagement.EsaType, any>>;
} & {} & {} & {}

Access the behavior's events.

features: TypeFromBitSchema<{}> & TypeFromBitSchema<{
    constraintBasedAdjustment: BitFlag;
    forecastAdjustment: BitFlag;
    pausable: BitFlag;
    powerAdjustment: BitFlag;
    powerForecastReporting: BitFlag;
    startTimeAdjustment: BitFlag;
    stateForecastReporting: BitFlag;
}>

Supported features as a flag object.

session: SecureSession
state: Omit<ClusterState.Type<Of<{
    attributes: {};
    commands: {};
    events: {};
    id: 0;
    name: "Unknown";
    revision: 0;
}>, typeof ClusterBehavior>, never> & {
    absMaxPower: number | bigint;
    absMinPower: number | bigint;
    esaState: DeviceEnergyManagement.EsaState;
} & {} & {
    esaCanGenerate: boolean;
    esaType: DeviceEnergyManagement.EsaType;
} & {}

Access the behavior's state.

Type declaration

  • ReadonlyabsMaxPower: number | bigint

    Indicates the maximum electrical power that the ESA can consume when switched on.

    The value of the AbsMaxPower attribute shall be limited

    AbsMaxPower >= AbsMinPower

    Note that for Generator ESAs that can discharge a battery to loads in the home (such as a battery storage inverter), the AbsMaxPower will be a positive number representing the maximum power at which the ESA can discharge its internal battery.

    For example, a battery storage inverter that can charge its battery at a maximum power of 2000W and can discharge the battery at a maximum power of 3000W, would have a AbsMinPower: -2000, AbsMaxPower: 3000W.

    MatterSpecification.v13.Cluster § 9.2.8.5

  • ReadonlyabsMinPower: number | bigint

    Indicates the minimum electrical power that the ESA can consume when switched on. This does not include when in power save or standby modes.

    Note that for Generator ESAs that can charge an internal battery (such as a battery storage inverter), the AbsMinPower will be a negative number representing the maximum power that the ESA can charge its internal battery.

    MatterSpecification.v13.Cluster § 9.2.8.4

  • ReadonlyesaState: DeviceEnergyManagement.EsaState

    Indicates the current state of the ESA.

    If the ESA is in the Offline or Fault state it cannot be controlled by an EMS, and may not be able to report its Forecast information. An EMS may subscribe to the ESAState to get notified about changes in operational state.

    The ESA may have a local user interface to allow a service technician to put the ESA into Offline mode, for example to avoid the EMS accidentally starting or stopping the appliance when it is being serviced or tested.

    MatterSpecification.v13.Cluster § 9.2.8.3

Type declaration

  • ReadonlyesaCanGenerate: boolean

    Indicates whether the ESA is classed as a generator or load. This allows an EMS to understand whether the power values reported by the ESA need to have their sign inverted when dealing with forecasts and adjustments.

    For example, a solar PV inverter (being a generator) may produce positive values to indicate generation, however an EMS when predicting the total home load would need to subtract these positive values from the loads to compute a net import at the grid meter.

    For example, a home battery storage system (BESS) which needs to charge the battery and then discharge to the home loads, would be classed as a generator. These types of devices shall have this field set to true. When generating its forecast or advertising its PowerAdjustmentCapability, the power values shall be positive to indicate discharging to the loads in the home, and negative to indicate when it is charging its battery.

    GRID meter = Σ LoadPowers - Σ GeneratorPowers

    Example:

    MatterSpecification.v13.Cluster § 9.2.8.2

  • ReadonlyesaType: DeviceEnergyManagement.EsaType

    Indicates the type of ESA.

    This attribute enables an EMS to understand some of the basic properties about how the energy may be consumed, generated, and stored by the ESA.

    For example, the heat energy converted by a heat pump will naturally be lost through the building to the outdoor environment relatively quickly, compared to storing heat in a well-insulated hot water tank. Similarly, battery storage and EVs can store electrical energy for much longer durations.

    This attribute can also help the EMS display information to a user and to make basic assumptions about typical best use of energy. For example, an EVSE may not always have an EV plugged in, so knowing the type of ESA that is being controlled can allow advanced energy management strategies.

    MatterSpecification.v13.Cluster § 9.2.8.1

Methods

  • Create a generic callback function that has the same properties as a Reactor.

    Like a reactor, the callback's "this" will be bound to an active Behavior instance. Because of this: The reactor MUST be a real JS function - arrow functions will not work!

    Type Parameters

    • A extends any[]
    • R

    Parameters

    Returns ((...args: A) => undefined | R)

      • (...args): undefined | R
      • Parameters

        • Rest...args: A

        Returns undefined | R

  • Behaviors are ephemeral and should not perform initialization in their constructor. They can override this method instead.

    This method may be synchronous or asyncronous. If asynchronous, the behavior will not be available for external use until initialization completes.

    Parameters

    • Optional_options: {}

      Returns MaybePromise

    • Install a Reactor.

      Important: The reactor MUST be a real JS function - arrow functions will not work!

      Type Parameters

      Parameters

      Returns void