matterbridge
Version:
Matterbridge plugin manager for Matter
111 lines • 7.77 kB
TypeScript
/**
* @description This file contains the WaterHeater class.
* @file src/devices/waterHeater.ts
* @author Luca Liguori
* @contributor Ludovic BOUÉ
* @created 2025-05-18
* @version 1.1.0
* @license Apache-2.0
*
* Copyright 2025, 2026, 2027 Luca Liguori.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { MaybePromise } from '@matter/main';
import { ModeBase } from '@matter/main/clusters/mode-base';
import { WaterHeaterManagement } from '@matter/main/clusters/water-heater-management';
import { WaterHeaterMode } from '@matter/main/clusters/water-heater-mode';
import { WaterHeaterManagementServer } from '@matter/main/behaviors/water-heater-management';
import { WaterHeaterModeServer } from '@matter/main/behaviors/water-heater-mode';
import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js';
export declare class WaterHeater extends MatterbridgeEndpoint {
/**
* Creates an instance of the WaterHeater class.
*
* @param {string} name - The name of the water heater.
* @param {string} serial - The serial number of the water heater.
* @param {number} [waterTemperature] - The current water temperature. Defaults to 50.
* @param {number} [targetWaterTemperature] - The target water temperature. Defaults to 55.
* @param {number} [minHeatSetpointLimit] - The minimum heat setpoint limit. Defaults to 20.
* @param {number} [maxHeatSetpointLimit] - The maximum heat setpoint limit. Defaults to 80.
* @param {{ immersionElement1?: boolean; immersionElement2?: boolean; heatPump?: boolean; boiler?: boolean; other?: boolean }} [heaterTypes] - Indicates the heat sources that the water heater can call on for heating. Defaults to { immersionElement1: true }.
* @param {boolean} heaterTypes.immersionElement1 - Indicates if the water heater has an immersion element 1. Defaults to true.
* @param {boolean} heaterTypes.immersionElement2 - Indicates if the water heater has an immersion element 2.
* @param {boolean} heaterTypes.heatPump - Indicates if the water heater has a heat pump.
* @param {boolean} heaterTypes.boiler - Indicates if the water heater has a boiler.
* @param {boolean} heaterTypes.other - Indicates if the water heater has other types of heating sources.
* @param {number} [tankPercentage] - The current tank percentage of the WaterHeaterManagement cluster. Defaults to 90.
* @param {number} [voltage] - The voltage value in millivolts. Defaults to null if not provided.
* @param {number} [current] - The current value in milliamperes. Defaults to null if not provided.
* @param {number} [power] - The power value in milliwatts. Defaults to null if not provided.
* @param {number} [energy] - The total consumption value in mW/h. Defaults to null if not provided.
* @param {number} [absMinPower] - Indicate the minimum electrical power in mw that the ESA can consume when switched on. Defaults to `0` if not provided.
* @param {number} [absMaxPower] - Indicate the maximum electrical power in mw that the ESA can consume when switched on. Defaults to `0` if not provided.
*/
constructor(name: string, serial: string, waterTemperature?: number, targetWaterTemperature?: number, minHeatSetpointLimit?: number, maxHeatSetpointLimit?: number, heaterTypes?: {
immersionElement1?: boolean;
immersionElement2?: boolean;
heatPump?: boolean;
boiler?: boolean;
other?: boolean;
}, tankPercentage?: number, voltage?: number | bigint | null, current?: number | bigint | null, power?: number | bigint | null, energy?: number | bigint | null, absMinPower?: number, absMaxPower?: number);
/**
* Creates a default WaterHeaterManagement Cluster Server.
*
* @param {{ immersionElement1?: boolean; immersionElement2?: boolean; heatPump?: boolean; boiler?: boolean; other?: boolean }} [heaterTypes] - Indicates the heat sources that the water heater can call on for heating. Defaults to { immersionElement1: true }.
* @param {boolean} heaterTypes.immersionElement1 - Indicates if the water heater has an immersion element 1. Defaults to true.
* @param {boolean} heaterTypes.immersionElement2 - Indicates if the water heater has an immersion element 2.
* @param {boolean} heaterTypes.heatPump - Indicates if the water heater has a heat pump.
* @param {boolean} heaterTypes.boiler - Indicates if the water heater has a boiler.
* @param {boolean} heaterTypes.other - Indicates if the water heater has other types of heating sources.
* @param {{ immersionElement1?: boolean; immersionElement2?: boolean; heatPump?: boolean; boiler?: boolean; other?: boolean }} [heatDemand] - Indicates if the water heater is heating water. Defaults to all heat sources unset.
* @param {boolean} heatDemand.immersionElement1 - Indicates if the water heater is heating water with immersion element 1. Defaults to false.
* @param {boolean} heatDemand.immersionElement2 - Indicates if the water heater is heating water with immersion element 2.
* @param {boolean} heatDemand.heatPump - Indicates if the water heater is heating water with a heat pump.
* @param {boolean} heatDemand.boiler - Indicates if the water heater is heating water with a boiler.
* @param {boolean} heatDemand.other - Indicates if the water heater is heating water with other types of heating sources.
* @param {number} [tankPercentage] - The current tank percentage of the WaterHeaterManagement cluster. Defaults to 100.
* @param {WaterHeaterManagement.BoostState} [boostState] - The current boost state of the WaterHeaterManagement cluster. Defaults to Inactive.
* @returns {this} The current MatterbridgeEndpoint instance for chaining.
*/
createDefaultWaterHeaterManagementClusterServer(heaterTypes?: {
immersionElement1?: boolean;
immersionElement2?: boolean;
heatPump?: boolean;
boiler?: boolean;
other?: boolean;
}, heatDemand?: {
immersionElement1?: boolean;
immersionElement2?: boolean;
heatPump?: boolean;
boiler?: boolean;
other?: boolean;
}, tankPercentage?: number, boostState?: WaterHeaterManagement.BoostState): this;
/**
* Creates a default WaterHeaterMode Cluster Server.
*
* @param {number} [currentMode] - The current mode of the WaterHeaterMode cluster. Defaults to mode 1 (WaterHeaterMode.ModeTag.Auto).
* @param {WaterHeaterMode.ModeOption[]} [supportedModes] - The supported modes for the WaterHeaterMode cluster. Defaults all cluster modes.
*
* @returns {this} The current MatterbridgeEndpoint instance for chaining.
*/
createDefaultWaterHeaterModeClusterServer(currentMode?: number, supportedModes?: WaterHeaterMode.ModeOption[]): this;
}
export declare class MatterbridgeWaterHeaterManagementServer extends WaterHeaterManagementServer {
boost(request: WaterHeaterManagement.BoostRequest): MaybePromise;
cancelBoost(): MaybePromise;
}
export declare class MatterbridgeWaterHeaterModeServer extends WaterHeaterModeServer {
changeToMode(request: ModeBase.ChangeToModeRequest): MaybePromise<ModeBase.ChangeToModeResponse>;
}
//# sourceMappingURL=waterHeater.d.ts.map