interface ThermostatBehavior {
    [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> & {
        controlSequenceOfOperation$Changing: ClusterEvents.AttributeObservable<WritableAttribute<Thermostat.ControlSequenceOfOperation, any>>;
        localTemperature$Changing: ClusterEvents.AttributeObservable<Attribute<null | number, any>>;
        systemMode$Changing: ClusterEvents.AttributeObservable<WritableAttribute<Thermostat.SystemMode, any>>;
    } & {
        acCapacity$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<number, any>>;
        acCapacityFormat$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<BtUh, any>>;
        acCoilTemperature$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<null | number, any>>;
        acCompressorType$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<Thermostat.AcCompressorType, any>>;
        acErrorCode$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<TypeFromPartialBitSchema<{
            coilSensorFail: BitFlag;
            compressorFail: BitFlag;
            fanFail: BitFlag;
            outdoorSensorFail: BitFlag;
            roomSensorFail: BitFlag;
        }>, any>>;
        acLouverPosition$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<Thermostat.AcLouverPosition, any>>;
        acRefrigerantType$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<Thermostat.AcRefrigerantType, any>>;
        acType$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<Thermostat.AcType, any>>;
        emergencyHeatDelta$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<number, any>>;
        outdoorTemperature$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<null | number, any>>;
        remoteSensing$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<TypeFromPartialBitSchema<{
            localTemperature: BitFlag;
            occupancy: BitFlag;
            outdoorTemperature: BitFlag;
        }>, any>>;
        setpointChangeAmount$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<null | number, any>>;
        setpointChangeSource$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<Thermostat.SetpointChangeSource, any>>;
        setpointChangeSourceTimestamp$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<number, any>>;
        temperatureSetpointHold$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<Thermostat.TemperatureSetpointHold, any>>;
        temperatureSetpointHoldDuration$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<null | number, any>>;
        thermostatProgrammingOperationMode$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<TypeFromPartialBitSchema<{
            autoRecovery: BitFlag;
            economy: BitFlag;
            scheduleActive: BitFlag;
        }>, any>>;
        thermostatRunningState$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<TypeFromPartialBitSchema<{
            cool: BitFlag;
            coolStage2: BitFlag;
            fan: BitFlag;
            fanStage2: BitFlag;
            fanStage3: BitFlag;
            heat: BitFlag;
            heatStage2: BitFlag;
        }>, any>>;
    } & {
        controlSequenceOfOperation$Changed: ClusterEvents.AttributeObservable<WritableAttribute<Thermostat.ControlSequenceOfOperation, any>>;
        localTemperature$Changed: ClusterEvents.AttributeObservable<Attribute<null | number, any>>;
        systemMode$Changed: ClusterEvents.AttributeObservable<WritableAttribute<Thermostat.SystemMode, any>>;
    } & {
        acCapacity$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<number, any>>;
        acCapacityFormat$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<BtUh, any>>;
        acCoilTemperature$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<null | number, any>>;
        acCompressorType$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<Thermostat.AcCompressorType, any>>;
        acErrorCode$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<TypeFromPartialBitSchema<{
            coilSensorFail: BitFlag;
            compressorFail: BitFlag;
            fanFail: BitFlag;
            outdoorSensorFail: BitFlag;
            roomSensorFail: BitFlag;
        }>, any>>;
        acLouverPosition$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<Thermostat.AcLouverPosition, any>>;
        acRefrigerantType$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<Thermostat.AcRefrigerantType, any>>;
        acType$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<Thermostat.AcType, any>>;
        emergencyHeatDelta$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<number, any>>;
        outdoorTemperature$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<null | number, any>>;
        remoteSensing$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<TypeFromPartialBitSchema<{
            localTemperature: BitFlag;
            occupancy: BitFlag;
            outdoorTemperature: BitFlag;
        }>, any>>;
        setpointChangeAmount$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<null | number, any>>;
        setpointChangeSource$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<Thermostat.SetpointChangeSource, any>>;
        setpointChangeSourceTimestamp$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<number, any>>;
        temperatureSetpointHold$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<Thermostat.TemperatureSetpointHold, any>>;
        temperatureSetpointHoldDuration$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<null | number, any>>;
        thermostatProgrammingOperationMode$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<TypeFromPartialBitSchema<{
            autoRecovery: BitFlag;
            economy: BitFlag;
            scheduleActive: BitFlag;
        }>, any>>;
        thermostatRunningState$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<TypeFromPartialBitSchema<{
            cool: BitFlag;
            coolStage2: BitFlag;
            fan: BitFlag;
            fanStage2: BitFlag;
            fanStage3: BitFlag;
            heat: BitFlag;
            heatStage2: BitFlag;
        }>, any>>;
    } & {} & {};
    features: TypeFromBitSchema<{}> & TypeFromBitSchema<{
        autoMode: BitFlag;
        cooling: BitFlag;
        heating: BitFlag;
        localTemperatureNotExposed: BitFlag;
        occupancy: BitFlag;
        scheduleConfiguration: BitFlag;
        setback: BitFlag;
    }>;
    session: SecureSession;
    state: Omit<ClusterState.Type<Of<{
        attributes: {};
        commands: {};
        events: {};
        id: 0;
        name: "Unknown";
        revision: 0;
    }>, typeof ClusterBehavior>, never> & {
        controlSequenceOfOperation: Thermostat.ControlSequenceOfOperation;
        localTemperature: null | number;
        systemMode: Thermostat.SystemMode;
    } & {
        acCapacity?: number;
        acCapacityFormat?: BtUh;
        acCoilTemperature?: null | number;
        acCompressorType?: Thermostat.AcCompressorType;
        acErrorCode?: TypeFromPartialBitSchema<{
            coilSensorFail: BitFlag;
            compressorFail: BitFlag;
            fanFail: BitFlag;
            outdoorSensorFail: BitFlag;
            roomSensorFail: BitFlag;
        }>;
        acLouverPosition?: Thermostat.AcLouverPosition;
        acRefrigerantType?: Thermostat.AcRefrigerantType;
        acType?: Thermostat.AcType;
        emergencyHeatDelta?: number;
        outdoorTemperature?: null | number;
        remoteSensing?: TypeFromPartialBitSchema<{
            localTemperature: BitFlag;
            occupancy: BitFlag;
            outdoorTemperature: BitFlag;
        }>;
        setpointChangeAmount?: null | number;
        setpointChangeSource?: Thermostat.SetpointChangeSource;
        setpointChangeSourceTimestamp?: number;
        temperatureSetpointHold?: Thermostat.TemperatureSetpointHold;
        temperatureSetpointHoldDuration?: null | number;
        thermostatProgrammingOperationMode?: TypeFromPartialBitSchema<{
            autoRecovery: BitFlag;
            economy: BitFlag;
            scheduleActive: BitFlag;
        }>;
        thermostatRunningState?: TypeFromPartialBitSchema<{
            cool: BitFlag;
            coolStage2: BitFlag;
            fan: BitFlag;
            fanStage2: BitFlag;
            fanStage3: BitFlag;
            heat: BitFlag;
            heatStage2: BitFlag;
        }>;
    } & {} & {};
    [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>;
    setpointRaiseLower(request: Thermostat.SetpointRaiseLowerRequest): MaybePromise;
    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> & {
    controlSequenceOfOperation$Changing: ClusterEvents.AttributeObservable<WritableAttribute<Thermostat.ControlSequenceOfOperation, any>>;
    localTemperature$Changing: ClusterEvents.AttributeObservable<Attribute<null | number, any>>;
    systemMode$Changing: ClusterEvents.AttributeObservable<WritableAttribute<Thermostat.SystemMode, any>>;
} & {
    acCapacity$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<number, any>>;
    acCapacityFormat$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<BtUh, any>>;
    acCoilTemperature$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<null | number, any>>;
    acCompressorType$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<Thermostat.AcCompressorType, any>>;
    acErrorCode$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<TypeFromPartialBitSchema<{
        coilSensorFail: BitFlag;
        compressorFail: BitFlag;
        fanFail: BitFlag;
        outdoorSensorFail: BitFlag;
        roomSensorFail: BitFlag;
    }>, any>>;
    acLouverPosition$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<Thermostat.AcLouverPosition, any>>;
    acRefrigerantType$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<Thermostat.AcRefrigerantType, any>>;
    acType$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<Thermostat.AcType, any>>;
    emergencyHeatDelta$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<number, any>>;
    outdoorTemperature$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<null | number, any>>;
    remoteSensing$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<TypeFromPartialBitSchema<{
        localTemperature: BitFlag;
        occupancy: BitFlag;
        outdoorTemperature: BitFlag;
    }>, any>>;
    setpointChangeAmount$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<null | number, any>>;
    setpointChangeSource$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<Thermostat.SetpointChangeSource, any>>;
    setpointChangeSourceTimestamp$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<number, any>>;
    temperatureSetpointHold$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<Thermostat.TemperatureSetpointHold, any>>;
    temperatureSetpointHoldDuration$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<null | number, any>>;
    thermostatProgrammingOperationMode$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<TypeFromPartialBitSchema<{
        autoRecovery: BitFlag;
        economy: BitFlag;
        scheduleActive: BitFlag;
    }>, any>>;
    thermostatRunningState$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<TypeFromPartialBitSchema<{
        cool: BitFlag;
        coolStage2: BitFlag;
        fan: BitFlag;
        fanStage2: BitFlag;
        fanStage3: BitFlag;
        heat: BitFlag;
        heatStage2: BitFlag;
    }>, any>>;
} & {
    controlSequenceOfOperation$Changed: ClusterEvents.AttributeObservable<WritableAttribute<Thermostat.ControlSequenceOfOperation, any>>;
    localTemperature$Changed: ClusterEvents.AttributeObservable<Attribute<null | number, any>>;
    systemMode$Changed: ClusterEvents.AttributeObservable<WritableAttribute<Thermostat.SystemMode, any>>;
} & {
    acCapacity$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<number, any>>;
    acCapacityFormat$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<BtUh, any>>;
    acCoilTemperature$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<null | number, any>>;
    acCompressorType$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<Thermostat.AcCompressorType, any>>;
    acErrorCode$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<TypeFromPartialBitSchema<{
        coilSensorFail: BitFlag;
        compressorFail: BitFlag;
        fanFail: BitFlag;
        outdoorSensorFail: BitFlag;
        roomSensorFail: BitFlag;
    }>, any>>;
    acLouverPosition$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<Thermostat.AcLouverPosition, any>>;
    acRefrigerantType$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<Thermostat.AcRefrigerantType, any>>;
    acType$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<Thermostat.AcType, any>>;
    emergencyHeatDelta$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<number, any>>;
    outdoorTemperature$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<null | number, any>>;
    remoteSensing$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<TypeFromPartialBitSchema<{
        localTemperature: BitFlag;
        occupancy: BitFlag;
        outdoorTemperature: BitFlag;
    }>, any>>;
    setpointChangeAmount$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<null | number, any>>;
    setpointChangeSource$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<Thermostat.SetpointChangeSource, any>>;
    setpointChangeSourceTimestamp$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<number, any>>;
    temperatureSetpointHold$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<Thermostat.TemperatureSetpointHold, any>>;
    temperatureSetpointHoldDuration$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<null | number, any>>;
    thermostatProgrammingOperationMode$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<TypeFromPartialBitSchema<{
        autoRecovery: BitFlag;
        economy: BitFlag;
        scheduleActive: BitFlag;
    }>, any>>;
    thermostatRunningState$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<TypeFromPartialBitSchema<{
        cool: BitFlag;
        coolStage2: BitFlag;
        fan: BitFlag;
        fanStage2: BitFlag;
        fanStage3: BitFlag;
        heat: BitFlag;
        heatStage2: BitFlag;
    }>, any>>;
} & {} & {}

Access the behavior's events.

features: TypeFromBitSchema<{}> & TypeFromBitSchema<{
    autoMode: BitFlag;
    cooling: BitFlag;
    heating: BitFlag;
    localTemperatureNotExposed: BitFlag;
    occupancy: BitFlag;
    scheduleConfiguration: BitFlag;
    setback: 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> & {
    controlSequenceOfOperation: Thermostat.ControlSequenceOfOperation;
    localTemperature: null | number;
    systemMode: Thermostat.SystemMode;
} & {
    acCapacity?: number;
    acCapacityFormat?: BtUh;
    acCoilTemperature?: null | number;
    acCompressorType?: Thermostat.AcCompressorType;
    acErrorCode?: TypeFromPartialBitSchema<{
        coilSensorFail: BitFlag;
        compressorFail: BitFlag;
        fanFail: BitFlag;
        outdoorSensorFail: BitFlag;
        roomSensorFail: BitFlag;
    }>;
    acLouverPosition?: Thermostat.AcLouverPosition;
    acRefrigerantType?: Thermostat.AcRefrigerantType;
    acType?: Thermostat.AcType;
    emergencyHeatDelta?: number;
    outdoorTemperature?: null | number;
    remoteSensing?: TypeFromPartialBitSchema<{
        localTemperature: BitFlag;
        occupancy: BitFlag;
        outdoorTemperature: BitFlag;
    }>;
    setpointChangeAmount?: null | number;
    setpointChangeSource?: Thermostat.SetpointChangeSource;
    setpointChangeSourceTimestamp?: number;
    temperatureSetpointHold?: Thermostat.TemperatureSetpointHold;
    temperatureSetpointHoldDuration?: null | number;
    thermostatProgrammingOperationMode?: TypeFromPartialBitSchema<{
        autoRecovery: BitFlag;
        economy: BitFlag;
        scheduleActive: BitFlag;
    }>;
    thermostatRunningState?: TypeFromPartialBitSchema<{
        cool: BitFlag;
        coolStage2: BitFlag;
        fan: BitFlag;
        fanStage2: BitFlag;
        fanStage3: BitFlag;
        heat: BitFlag;
        heatStage2: BitFlag;
    }>;
} & {} & {}

Access the behavior's state.

Methods

  • Release resources. This is the public API for releasing application resources held by behaviors in internal state.

    Returns MaybePromise

  • Execute logic with elevated privileges.

    The provided function executes with privileges escalated to offline mode. This is not commonly necessary.

    Elevated logic effectively ignores ACLs so should be used with care.

    Note that interactions with the behavior will remain elevated until the synchronous completion of this call. You should only elevate privileges for synchronous logic.

    Parameters

    • fn: (() => void)

      the elevated logic

        • (): void
        • Returns void

    Returns void

  • Type Parameters

    • This extends Behavior
    • K extends string | number | symbol

    Parameters

    • this: This
    • attributeName: K

    Returns void

  • 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

    • Type Parameters

      • This extends Behavior
      • K extends string | number | symbol

      Parameters

      • this: This
      • attributeName: K

      Returns Exclude<This["state"][K], undefined>

    • Upon receipt, the attributes for the indicated setpoint(s) shall have the amount specified in the Amount field added to them. If the resulting value is outside the limits imposed by MinCoolSetpointLimit, MaxCoolSetpointLimit, MinHeatSetpointLimit and MaxHeatSetpointLimit, the value is clamped to those limits. This is not considered an error condition.

      Returns MaybePromise

      MatterSpecification.v13.Cluster § 4.3.10.1

    • Description used in diagnostic messages.

      Returns string