zigbee-herdsman-converters
Version:
Collection of device converters to be used with zigbee-herdsman
919 lines • 76.2 kB
JavaScript
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const zigbee_herdsman_1 = require("zigbee-herdsman");
const exposes = __importStar(require("../lib/exposes"));
const fromZigbee_1 = __importDefault(require("../converters/fromZigbee"));
const legacy = __importStar(require("../lib/legacy"));
const toZigbee_1 = __importDefault(require("../converters/toZigbee"));
const constants = __importStar(require("../lib/constants"));
const reporting = __importStar(require("../lib/reporting"));
const utils = __importStar(require("../lib/utils"));
const ota = __importStar(require("../lib/ota"));
const modernExtend_1 = require("../lib/modernExtend");
const e = exposes.presets;
const ea = exposes.access;
function indicatorMode(endpoint) {
let description = 'Set Indicator Mode.';
if (endpoint) {
description = 'Set Indicator Mode for ' + endpoint + ' switch.';
}
return (0, modernExtend_1.enumLookup)({
name: 'indicator_mode',
lookup: {
'reverse_with_load': 2,
'consistent_with_load': 0,
'always_off': 3,
'always_on': 1,
},
cluster: 'manuSpecificSchneiderLightSwitchConfiguration',
attribute: 'ledIndication',
description: description,
endpointName: endpoint,
});
}
function socketIndicatorMode() {
return (0, modernExtend_1.enumLookup)({
name: 'indicator_mode',
lookup: {
'reverse_with_load': 0,
'consistent_with_load': 1,
'always_off': 2,
'always_on': 3,
},
cluster: 'manuSpecificSchneiderFanSwitchConfiguration',
attribute: 'ledIndication',
description: 'Set indicator mode',
});
}
function fanIndicatorMode() {
const description = 'Set Indicator Mode.';
return (0, modernExtend_1.enumLookup)({
name: 'indicator_mode',
lookup: {
'always_on': 3,
'on_with_timeout_but_as_locator': 4,
'on_with_timeout': 5,
},
cluster: 'manuSpecificSchneiderFanSwitchConfiguration',
attribute: 'ledIndication',
description: description,
});
}
function fanIndicatorOrientation() {
const description = 'Set Indicator Orientation.';
return (0, modernExtend_1.enumLookup)({
name: 'indicator_orientation',
lookup: {
'horizontal_left': 2,
'horizontal_right': 0,
'vertical_top': 3,
'vertical_bottom': 1,
},
cluster: 'manuSpecificSchneiderFanSwitchConfiguration',
attribute: 'ledOrientation',
description: description,
});
}
function switchActions(endpoint) {
let description = 'Set Switch Action.';
if (endpoint) {
description = 'Set Switch Action for ' + endpoint + ' Button.';
}
return (0, modernExtend_1.enumLookup)({
name: 'switch_actions',
lookup: {
'light': 0,
'light_opposite': 254,
'dimmer': 1,
'dimmer_opposite': 253,
'standard_shutter': 2,
'standard_shutter_opposite': 252,
'schneider_shutter': 3,
'schneider_shutter_opposite': 251,
'scene': 4,
'toggle_light': 5,
'toggle_dimmer': 6,
'alternate_light': 7,
'alternate_dimmer': 8,
'not_used': 127,
},
cluster: 'manuSpecificSchneiderLightSwitchConfiguration',
attribute: 'switchActions',
description: description,
endpointName: endpoint,
});
}
const tzLocal = {
lift_duration: {
key: ['lift_duration'],
convertSet: async (entity, key, value, meta) => {
await entity.write(0x0102, { 0xe000: { value, type: 0x21 } }, { manufacturerCode: zigbee_herdsman_1.Zcl.ManufacturerCode.SCHNEIDER_ELECTRIC });
return { state: { lift_duration: value } };
},
},
fan_mode: {
...toZigbee_1.default.fan_mode,
convertSet: async (entity, key, value, meta) => {
utils.assertString(value);
if (value.toLowerCase() === 'on')
value = 'low';
return toZigbee_1.default.fan_mode.convertSet(entity, key, value, meta);
},
},
};
const fzLocal = {
schneider_powertag: {
cluster: 'greenPower',
type: ['commandNotification', 'commandCommissioningNotification'],
convert: async (model, msg, publish, options, meta) => {
if (msg.type !== 'commandNotification') {
return;
}
const commandID = msg.data.commandID;
if (utils.hasAlreadyProcessedMessage(msg, model, msg.data.frameCounter, `${msg.device.ieeeAddr}_${commandID}`))
return;
const rxAfterTx = (msg.data.options & (1 << 11));
const ret = {};
switch (commandID) {
case 0xA1: {
const attr = msg.data.commandFrame.attributes;
const clusterID = msg.data.commandFrame.clusterID;
switch (clusterID) {
case 2820: { // haElectricalMeasurement
const acCurrentDivisor = attr['acCurrentDivisor'];
const acVoltageDivisor = attr['acVoltageDivisor'];
const acFrequencyDivisor = attr['acFrequencyDivisor'];
const powerDivisor = attr['powerDivisor'];
if (attr.hasOwnProperty('rmsVoltage')) {
ret['voltage_phase_a'] = attr['rmsVoltage'] / acVoltageDivisor;
}
if (attr.hasOwnProperty('rmsVoltagePhB')) {
ret['voltage_phase_b'] = attr['rmsVoltagePhB'] / acVoltageDivisor;
}
if (attr.hasOwnProperty('rmsVoltagePhC')) {
ret['voltage_phase_c'] = attr['rmsVoltagePhC'] / acVoltageDivisor;
}
if (attr.hasOwnProperty('19200')) {
ret['voltage_phase_ab'] = attr['19200'] / acVoltageDivisor;
}
if (attr.hasOwnProperty('19456')) {
ret['voltage_phase_bc'] = attr['19456'] / acVoltageDivisor;
}
if (attr.hasOwnProperty('19712')) {
ret['voltage_phase_ca'] = attr['19712'] / acVoltageDivisor;
}
if (attr.hasOwnProperty('rmsCurrent')) {
ret['current_phase_a'] = attr['rmsCurrent'] / acCurrentDivisor;
}
if (attr.hasOwnProperty('rmsCurrentPhB')) {
ret['current_phase_b'] = attr['rmsCurrentPhB'] / acCurrentDivisor;
}
if (attr.hasOwnProperty('rmsCurrentPhC')) {
ret['current_phase_c'] = attr['rmsCurrentPhC'] / acCurrentDivisor;
}
if (attr.hasOwnProperty('totalActivePower')) {
ret['power'] = attr['totalActivePower'] * 1000 / powerDivisor;
}
if (attr.hasOwnProperty('totalApparentPower')) {
ret['power_apparent'] = attr['totalApparentPower'] * 1000 / powerDivisor;
}
if (attr.hasOwnProperty('acFrequency')) {
ret['ac_frequency'] = attr['acFrequency'] / acFrequencyDivisor;
}
if (attr.hasOwnProperty('activePower')) {
ret['power_phase_a'] = attr['activePower'] * 1000 / powerDivisor;
}
if (attr.hasOwnProperty('activePowerPhB')) {
ret['power_phase_b'] = attr['activePowerPhB'] * 1000 / powerDivisor;
}
if (attr.hasOwnProperty('activePowerPhC')) {
ret['power_phase_c'] = attr['activePowerPhC'] * 1000 / powerDivisor;
}
break;
}
case 1794: { // seMetering
const divisor = attr['divisor'];
if (attr.hasOwnProperty('currentSummDelivered')) {
const val = attr['currentSummDelivered'];
ret['energy'] = ((parseInt(val[0]) << 32) + parseInt(val[1])) / divisor;
}
if (attr.hasOwnProperty('16652')) {
const val = attr['16652'];
ret['energy_phase_a'] = ((parseInt(val[0]) << 32) + parseInt(val[1])) / divisor;
}
if (attr.hasOwnProperty('16908')) {
const val = attr['16908'];
ret['energy_phase_b'] = ((parseInt(val[0]) << 32) + parseInt(val[1])) / divisor;
}
if (attr.hasOwnProperty('17164')) {
const val = attr['17164'];
ret['energy_phase_c'] = ((parseInt(val[0]) << 32) + parseInt(val[1])) / divisor;
}
if (attr.hasOwnProperty('powerFactor')) {
ret['power_factor'] = attr['powerFactor'];
}
break;
}
}
break;
}
case 0xA3:
// Should handle this cluster as well
break;
}
if (rxAfterTx) {
// Send Schneider specific ACK to make PowerTag happy
// @ts-expect-error
const networkParameters = await msg.device.constructor.adapter.getNetworkParameters();
const payload = {
options: 0b000,
tempMaster: msg.data.gppNwkAddr,
tempMasterTx: networkParameters.channel - 11,
srcID: msg.data.srcID,
gpdCmd: 0xFE,
gpdPayload: {
commandID: 0xFE,
buffer: Buffer.alloc(1), // I hope it's zero initialised
},
};
await msg.endpoint.commandResponse('greenPower', 'response', payload, {
srcEndpoint: 242,
disableDefaultResponse: true,
});
}
return ret;
},
},
};
const definitions = [
{
zigbeeModel: ['PUCK/SHUTTER/1'],
model: 'CCT5015-0001',
vendor: 'Schneider Electric',
description: 'Roller shutter module',
fromZigbee: [fromZigbee_1.default.cover_position_tilt],
toZigbee: [toZigbee_1.default.cover_position_tilt, toZigbee_1.default.cover_state, tzLocal.lift_duration],
exposes: [e.cover_position(), e.numeric('lift_duration', ea.STATE_SET).withUnit('s')
.withValueMin(0).withValueMax(300).withDescription('Duration of lift')],
meta: { coverInverted: true },
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(5);
await reporting.bind(endpoint, coordinatorEndpoint, ['closuresWindowCovering']);
await reporting.currentPositionLiftPercentage(endpoint);
},
},
{
zigbeeModel: ['NHPB/SHUTTER/1'],
model: 'S520567',
vendor: 'Schneider Electric',
description: 'Roller shutter',
fromZigbee: [fromZigbee_1.default.cover_position_tilt],
toZigbee: [toZigbee_1.default.cover_position_tilt, toZigbee_1.default.cover_state, tzLocal.lift_duration],
exposes: [e.cover_position(), e.numeric('lift_duration', ea.STATE_SET).withUnit('s')
.withValueMin(0).withValueMax(300).withDescription('Duration of lift')],
meta: { coverInverted: true },
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(5);
await reporting.bind(endpoint, coordinatorEndpoint, ['closuresWindowCovering']);
await reporting.currentPositionLiftPercentage(endpoint);
},
},
{
zigbeeModel: ['iTRV'],
model: 'WV704R0A0902',
vendor: 'Schneider Electric',
description: 'Wiser radiator thermostat',
fromZigbee: [fromZigbee_1.default.ignore_basic_report, fromZigbee_1.default.ignore_haDiagnostic, fromZigbee_1.default.ignore_genOta, fromZigbee_1.default.ignore_zclversion_read,
legacy.fz.wiser_thermostat, legacy.fz.wiser_itrv_battery, fromZigbee_1.default.hvac_user_interface, fromZigbee_1.default.wiser_device_info],
toZigbee: [toZigbee_1.default.thermostat_occupied_heating_setpoint, toZigbee_1.default.thermostat_keypad_lockout],
meta: { battery: { voltageToPercentage: '3V_2500_3200' } },
exposes: [
e.climate().withSetpoint('occupied_heating_setpoint', 5, 30, 0.5).withLocalTemperature(ea.STATE)
.withRunningState(['idle', 'heat'], ea.STATE).withPiHeatingDemand(), e.battery(), e.battery_voltage(),
e.keypad_lockout().withAccess(ea.ALL)
],
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(1);
const binds = ['genBasic', 'genPowerCfg', 'hvacThermostat', 'haDiagnostic'];
await reporting.bind(endpoint, coordinatorEndpoint, binds);
await reporting.batteryVoltage(endpoint);
await reporting.thermostatTemperature(endpoint);
await reporting.thermostatOccupiedHeatingSetpoint(endpoint);
await reporting.thermostatPIHeatingDemand(endpoint);
// bind of hvacUserInterfaceCfg fails with 'Table Full', does this have any effect?
await endpoint.configureReporting('hvacUserInterfaceCfg', [{ attribute: 'keypadLockout', reportableChange: 1,
minimumReportInterval: constants.repInterval.MINUTE, maximumReportInterval: constants.repInterval.HOUR }]);
},
},
{
zigbeeModel: ['U202DST600ZB'],
model: 'U202DST600ZB',
vendor: 'Schneider Electric',
description: 'EZinstall3 2 gang 2x300W dimmer module',
extend: [
(0, modernExtend_1.deviceEndpoints)({ endpoints: { 'l1': 10, 'l2': 11 } }),
(0, modernExtend_1.light)({ endpointNames: ['l1', 'l2'], configureReporting: true }),
],
},
{
zigbeeModel: ['PUCK/DIMMER/1'],
model: 'CCT5010-0001',
vendor: 'Schneider Electric',
description: 'Micro module dimmer',
ota: ota.zigbeeOTA,
extend: [(0, modernExtend_1.light)({ configureReporting: true, levelConfig: {} })],
fromZigbee: [fromZigbee_1.default.wiser_lighting_ballast_configuration],
toZigbee: [toZigbee_1.default.ballast_config, toZigbee_1.default.wiser_dimmer_mode],
exposes: [
e.numeric('ballast_minimum_level', ea.ALL).withValueMin(1).withValueMax(254)
.withDescription('Specifies the minimum light output of the ballast'),
e.numeric('ballast_maximum_level', ea.ALL).withValueMin(1).withValueMax(254)
.withDescription('Specifies the maximum light output of the ballast'),
e.enum('dimmer_mode', ea.ALL, ['auto', 'rc', 'rl', 'rl_led'])
.withDescription('Sets dimming mode to autodetect or fixed RC/RL/RL_LED mode (max load is reduced in RL_LED)')
],
whiteLabel: [{ vendor: 'Elko', model: 'EKO07090' }],
},
{
zigbeeModel: ['PUCK/SWITCH/1'],
model: 'CCT5011-0001/CCT5011-0002/MEG5011-0001',
vendor: 'Schneider Electric',
description: 'Micro module switch',
ota: ota.zigbeeOTA,
extend: [(0, modernExtend_1.onOff)({ powerOnBehavior: false })],
whiteLabel: [{ vendor: 'Elko', model: 'EKO07144' }],
},
{
zigbeeModel: ['CCTFR6730'],
model: 'CCTFR6730',
vendor: 'Schneider Electric',
description: 'Wiser power micromodule',
whiteLabel: [{ vendor: 'Elko', model: 'EKO20004' }],
extend: [(0, modernExtend_1.onOff)({ powerOnBehavior: true }), (0, modernExtend_1.electricityMeter)({ 'cluster': 'metering' }), (0, modernExtend_1.identify)()],
},
{
zigbeeModel: ['NHROTARY/DIMMER/1'],
model: 'WDE002334',
vendor: 'Schneider Electric',
description: 'Rotary dimmer',
fromZigbee: [fromZigbee_1.default.on_off, fromZigbee_1.default.brightness, fromZigbee_1.default.level_config, fromZigbee_1.default.wiser_lighting_ballast_configuration],
toZigbee: [toZigbee_1.default.light_onoff_brightness, toZigbee_1.default.level_config, toZigbee_1.default.ballast_config, toZigbee_1.default.wiser_dimmer_mode],
exposes: [e.light_brightness().withLevelConfig(),
e.numeric('ballast_minimum_level', ea.ALL).withValueMin(1).withValueMax(254)
.withDescription('Specifies the minimum light output of the ballast'),
e.numeric('ballast_maximum_level', ea.ALL).withValueMin(1).withValueMax(254)
.withDescription('Specifies the maximum light output of the ballast'),
e.enum('dimmer_mode', ea.ALL, ['auto', 'rc', 'rl', 'rl_led'])
.withDescription('Sets dimming mode to autodetect or fixed RC/RL/RL_LED mode (max load is reduced in RL_LED)')],
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(3);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl', 'lightingBallastCfg']);
await reporting.onOff(endpoint);
await reporting.brightness(endpoint);
},
},
{
zigbeeModel: ['NHROTARY/UNIDIM/1'],
model: 'WDE002961',
vendor: 'Schneider Electric',
description: 'Rotary dimmer',
fromZigbee: [fromZigbee_1.default.on_off, fromZigbee_1.default.brightness, fromZigbee_1.default.level_config, fromZigbee_1.default.wiser_lighting_ballast_configuration],
toZigbee: [toZigbee_1.default.light_onoff_brightness, toZigbee_1.default.level_config, toZigbee_1.default.ballast_config, toZigbee_1.default.wiser_dimmer_mode],
exposes: [e.light_brightness().withLevelConfig(),
e.numeric('ballast_minimum_level', ea.ALL).withValueMin(1).withValueMax(254)
.withDescription('Specifies the minimum light output of the ballast'),
e.numeric('ballast_maximum_level', ea.ALL).withValueMin(1).withValueMax(254)
.withDescription('Specifies the maximum light output of the ballast'),
e.enum('dimmer_mode', ea.ALL, ['auto', 'rc', 'rl', 'rl_led'])
.withDescription('Sets dimming mode to autodetect or fixed RC/RL/RL_LED mode (max load is reduced in RL_LED)')],
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(3);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl', 'lightingBallastCfg']);
await reporting.onOff(endpoint);
await reporting.brightness(endpoint);
},
},
{
zigbeeModel: ['NHPB/UNIDIM/1'],
model: 'WDE002960',
vendor: 'Schneider Electric',
description: 'Push button dimmer',
fromZigbee: [fromZigbee_1.default.on_off, fromZigbee_1.default.brightness, fromZigbee_1.default.level_config, fromZigbee_1.default.wiser_lighting_ballast_configuration],
toZigbee: [toZigbee_1.default.light_onoff_brightness, toZigbee_1.default.level_config, toZigbee_1.default.ballast_config, toZigbee_1.default.wiser_dimmer_mode],
exposes: [e.light_brightness().withLevelConfig(),
e.numeric('ballast_minimum_level', ea.ALL).withValueMin(1).withValueMax(254)
.withDescription('Specifies the minimum light output of the ballast'),
e.numeric('ballast_maximum_level', ea.ALL).withValueMin(1).withValueMax(254)
.withDescription('Specifies the maximum light output of the ballast'),
e.enum('dimmer_mode', ea.ALL, ['auto', 'rc', 'rl', 'rl_led'])
.withDescription('Sets dimming mode to autodetect or fixed RC/RL/RL_LED mode (max load is reduced in RL_LED)')],
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(3);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl', 'lightingBallastCfg']);
await reporting.onOff(endpoint);
await reporting.brightness(endpoint);
},
},
{
zigbeeModel: ['CCT593011_AS'],
model: '550B1024',
vendor: 'Schneider Electric',
description: 'Temperature & humidity sensor',
fromZigbee: [fromZigbee_1.default.humidity, fromZigbee_1.default.temperature, fromZigbee_1.default.battery],
toZigbee: [],
exposes: [e.battery(), e.temperature(), e.humidity()],
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(1);
const binds = ['msTemperatureMeasurement', 'genPowerCfg', 'msRelativeHumidity'];
await reporting.bind(endpoint, coordinatorEndpoint, binds);
await reporting.batteryPercentageRemaining(endpoint);
await reporting.temperature(endpoint);
await reporting.humidity(endpoint);
},
},
{
zigbeeModel: ['NHPB/DIMMER/1'],
model: 'WDE002386',
vendor: 'Schneider Electric',
description: 'Push button dimmer',
fromZigbee: [fromZigbee_1.default.on_off, fromZigbee_1.default.brightness, fromZigbee_1.default.level_config, fromZigbee_1.default.lighting_ballast_configuration],
toZigbee: [toZigbee_1.default.light_onoff_brightness, toZigbee_1.default.level_config, toZigbee_1.default.ballast_config],
exposes: [e.light_brightness().withLevelConfig(),
e.numeric('ballast_minimum_level', ea.ALL).withValueMin(1).withValueMax(254)
.withDescription('Specifies the minimum light output of the ballast'),
e.numeric('ballast_maximum_level', ea.ALL).withValueMin(1).withValueMax(254)
.withDescription('Specifies the maximum light output of the ballast')],
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(3);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl', 'lightingBallastCfg']);
await reporting.onOff(endpoint);
await reporting.brightness(endpoint);
},
},
{
zigbeeModel: ['CH/DIMMER/1'],
model: '41EPBDWCLMZ/354PBDMBTZ',
vendor: 'Schneider Electric',
description: 'Wiser 40/300-Series Module Dimmer',
fromZigbee: [fromZigbee_1.default.on_off, fromZigbee_1.default.brightness, fromZigbee_1.default.level_config, fromZigbee_1.default.lighting_ballast_configuration],
toZigbee: [toZigbee_1.default.light_onoff_brightness, toZigbee_1.default.level_config, toZigbee_1.default.ballast_config],
exposes: [e.light_brightness(),
e.numeric('ballast_minimum_level', ea.ALL).withValueMin(1).withValueMax(254)
.withDescription('Specifies the minimum light output of the ballast'),
e.numeric('ballast_maximum_level', ea.ALL).withValueMin(1).withValueMax(254)
.withDescription('Specifies the maximum light output of the ballast')],
ota: ota.zigbeeOTA,
extend: [indicatorMode('smart')],
meta: { multiEndpoint: true },
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(3);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl', 'lightingBallastCfg']);
await reporting.onOff(endpoint);
await reporting.brightness(endpoint);
},
endpoint: (device) => {
return { 'smart': 21 };
},
},
{
zigbeeModel: ['CH2AX/SWITCH/1'],
model: '41E2PBSWMZ/356PB2MBTZ',
vendor: 'Schneider Electric',
description: 'Wiser 40/300-Series module switch 2AX',
ota: ota.zigbeeOTA,
extend: [(0, modernExtend_1.onOff)({ powerOnBehavior: false }), indicatorMode('smart')],
meta: { multiEndpoint: true },
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
await reporting.onOff(endpoint);
},
endpoint: (device) => {
return { 'smart': 21 };
},
},
{
zigbeeModel: ['CH10AX/SWITCH/1'],
model: '41E10PBSWMZ-VW',
vendor: 'Schneider Electric',
description: 'Wiser 40/300-Series module switch 10AX with ControlLink',
ota: ota.zigbeeOTA,
extend: [(0, modernExtend_1.onOff)({ powerOnBehavior: false }), indicatorMode('smart')],
meta: { multiEndpoint: true },
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
await reporting.onOff(endpoint);
},
endpoint: (device) => {
return { 'smart': 21 };
},
},
{
zigbeeModel: ['CHFAN/SWITCH/1'],
model: '41ECSFWMZ-VW',
vendor: 'Schneider Electric',
description: 'Wiser 40/300-Series Module AC Fan Controller',
fromZigbee: [fromZigbee_1.default.fan],
toZigbee: [tzLocal.fan_mode],
exposes: [e.fan().withModes(['off', 'low', 'medium', 'high', 'on'])],
ota: ota.zigbeeOTA,
extend: [fanIndicatorMode(), fanIndicatorOrientation()],
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(7);
await reporting.bind(endpoint, coordinatorEndpoint, ['hvacFanCtrl']);
await reporting.fanMode(endpoint);
},
},
{
zigbeeModel: ['SMARTPLUG/1'],
model: 'CCT711119',
vendor: 'Schneider Electric',
description: 'Wiser smart plug',
fromZigbee: [fromZigbee_1.default.on_off, fromZigbee_1.default.electrical_measurement, fromZigbee_1.default.metering, fromZigbee_1.default.power_on_behavior],
toZigbee: [toZigbee_1.default.on_off, toZigbee_1.default.power_on_behavior, toZigbee_1.default.electrical_measurement_power],
exposes: [e.switch(), e.power().withAccess(ea.STATE_GET), e.energy(),
e.enum('power_on_behavior', ea.ALL, ['off', 'previous', 'on'])
.withDescription('Controls the behaviour when the device is powered on')],
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'haElectricalMeasurement', 'seMetering']);
await reporting.onOff(endpoint);
// only activePower seems to be support, although compliance document states otherwise
await endpoint.read('haElectricalMeasurement', ['acPowerMultiplier', 'acPowerDivisor']);
await reporting.activePower(endpoint);
await reporting.readMeteringMultiplierDivisor(endpoint);
await reporting.currentSummDelivered(endpoint, { min: 60, change: 1 });
},
},
{
zigbeeModel: ['U201DST600ZB'],
model: 'U201DST600ZB',
vendor: 'Schneider Electric',
description: 'EZinstall3 1 gang 550W dimmer module',
extend: [(0, modernExtend_1.light)({ configureReporting: true })],
},
{
zigbeeModel: ['U201SRY2KWZB'],
model: 'U201SRY2KWZB',
vendor: 'Schneider Electric',
description: 'Ulti 240V 9.1 A 1 gang relay switch impress switch module, amber LED',
extend: [(0, modernExtend_1.onOff)()],
},
{
zigbeeModel: ['CCTFR6100'],
model: 'CCTFR6100Z3',
vendor: 'Schneider Electric',
description: 'Wiser radiator thermostat',
fromZigbee: [fromZigbee_1.default.ignore_basic_report, fromZigbee_1.default.ignore_haDiagnostic, fromZigbee_1.default.ignore_genOta, fromZigbee_1.default.ignore_zclversion_read,
legacy.fz.wiser_thermostat, legacy.fz.wiser_itrv_battery, fromZigbee_1.default.hvac_user_interface, fromZigbee_1.default.wiser_device_info],
toZigbee: [toZigbee_1.default.thermostat_occupied_heating_setpoint, toZigbee_1.default.thermostat_keypad_lockout],
exposes: [e.climate().withSetpoint('occupied_heating_setpoint', 7, 30, 1).withLocalTemperature(ea.STATE)
.withRunningState(['idle', 'heat'], ea.STATE).withPiHeatingDemand()],
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(1);
const binds = ['genBasic', 'genPowerCfg', 'hvacThermostat', 'haDiagnostic'];
await reporting.bind(endpoint, coordinatorEndpoint, binds);
await reporting.batteryVoltage(endpoint);
await reporting.thermostatTemperature(endpoint);
await reporting.thermostatOccupiedHeatingSetpoint(endpoint);
await reporting.thermostatPIHeatingDemand(endpoint);
// bind of hvacUserInterfaceCfg fails with 'Table Full', does this have any effect?
await endpoint.configureReporting('hvacUserInterfaceCfg', [{ attribute: 'keypadLockout', reportableChange: 1,
minimumReportInterval: constants.repInterval.MINUTE, maximumReportInterval: constants.repInterval.HOUR }]);
},
},
{
zigbeeModel: ['NHPB/SWITCH/1'],
model: 'S520530W',
vendor: 'Schneider Electric',
description: 'Odace connectable relay switch 10A',
extend: [(0, modernExtend_1.onOff)({ powerOnBehavior: false })],
},
{
zigbeeModel: ['U202SRY2KWZB'],
model: 'U202SRY2KWZB',
vendor: 'Schneider Electric',
description: 'Ulti 240V 9.1 A 2 gangs relay switch impress switch module, amber LED',
extend: [
(0, modernExtend_1.deviceEndpoints)({ endpoints: { 'l1': 10, 'l2': 11 } }),
(0, modernExtend_1.onOff)({ endpointNames: ['l1', 'l2'] }),
],
},
{
zigbeeModel: ['1GANG/SHUTTER/1'],
model: 'MEG5113-0300/MEG5165-0000',
vendor: 'Schneider Electric',
description: 'Merten MEG5165 PlusLink Shutter insert with Merten Wiser System M Push Button (1fold)',
fromZigbee: [fromZigbee_1.default.cover_position_tilt, fromZigbee_1.default.command_cover_close, fromZigbee_1.default.command_cover_open, fromZigbee_1.default.command_cover_stop],
toZigbee: [toZigbee_1.default.cover_position_tilt, toZigbee_1.default.cover_state, tzLocal.lift_duration],
exposes: [e.cover_position(), e.numeric('lift_duration', ea.STATE_SET).withUnit('s')
.withValueMin(0).withValueMax(300).withDescription('Duration of lift')],
meta: { coverInverted: true },
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(1) || device.getEndpoint(5);
await reporting.bind(endpoint, coordinatorEndpoint, ['closuresWindowCovering']);
await reporting.currentPositionLiftPercentage(endpoint);
},
},
{
zigbeeModel: ['1GANG/DIMMER/1'],
model: 'MEG5116-0300/MEG5171-0000',
vendor: 'Schneider Electric',
description: 'Merten MEG5171 PlusLink Dimmer insert with Merten Wiser System M Push Button (1fold)',
fromZigbee: [fromZigbee_1.default.on_off, fromZigbee_1.default.brightness, fromZigbee_1.default.level_config, fromZigbee_1.default.wiser_lighting_ballast_configuration],
toZigbee: [toZigbee_1.default.light_onoff_brightness, toZigbee_1.default.level_config, toZigbee_1.default.ballast_config, toZigbee_1.default.wiser_dimmer_mode],
exposes: [e.light_brightness().withLevelConfig(),
e.numeric('ballast_minimum_level', ea.ALL).withValueMin(1).withValueMax(254)
.withDescription('Specifies the minimum light output of the ballast'),
e.numeric('ballast_maximum_level', ea.ALL).withValueMin(1).withValueMax(254)
.withDescription('Specifies the maximum light output of the ballast'),
e.enum('dimmer_mode', ea.ALL, ['auto', 'rc', 'rl', 'rl_led'])
.withDescription('Sets dimming mode to autodetect or fixed RC/RL/RL_LED mode (max load is reduced in RL_LED)')],
extend: [indicatorMode(), switchActions()],
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(3);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl', 'lightingBallastCfg']);
await reporting.onOff(endpoint);
await reporting.brightness(endpoint);
},
},
{
zigbeeModel: ['2GANG/DIMMER/1'],
model: 'MEG5126-0300/MEG5171-0000',
vendor: 'Schneider Electric',
description: 'Merten MEG5171 PlusLink Dimmer insert with Merten Wiser System M Push Button (2fold)',
fromZigbee: [fromZigbee_1.default.on_off, fromZigbee_1.default.brightness, fromZigbee_1.default.level_config, fromZigbee_1.default.wiser_lighting_ballast_configuration],
toZigbee: [toZigbee_1.default.light_onoff_brightness, toZigbee_1.default.level_config, toZigbee_1.default.ballast_config, toZigbee_1.default.wiser_dimmer_mode],
exposes: [e.light_brightness().withLevelConfig(),
e.numeric('ballast_minimum_level', ea.ALL).withValueMin(1).withValueMax(254)
.withDescription('Specifies the minimum light output of the ballast'),
e.numeric('ballast_maximum_level', ea.ALL).withValueMin(1).withValueMax(254)
.withDescription('Specifies the maximum light output of the ballast'),
e.enum('dimmer_mode', ea.ALL, ['auto', 'rc', 'rl', 'rl_led'])
.withDescription('Sets dimming mode to autodetect or fixed RC/RL/RL_LED mode (max load is reduced in RL_LED)')],
extend: [indicatorMode('right'), indicatorMode('left'), switchActions('right'), switchActions('left')],
meta: { multiEndpoint: true },
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(3);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl', 'lightingBallastCfg']);
await reporting.onOff(endpoint);
await reporting.brightness(endpoint);
},
endpoint: (device) => {
return { 'right': 21, 'left': 22 };
},
},
{
zigbeeModel: ['2GANG/DIMMER/2'],
model: 'MEG5126-0300/MEG5172-0000',
vendor: 'Schneider Electric',
description: 'Merten MEG5172 PlusLink Dimmer insert with Merten Wiser System M Push Button (2fold)',
fromZigbee: [fromZigbee_1.default.wiser_lighting_ballast_configuration],
toZigbee: [toZigbee_1.default.ballast_config, toZigbee_1.default.wiser_dimmer_mode],
exposes: [
e.numeric('ballast_minimum_level', ea.ALL).withValueMin(1).withValueMax(254)
.withDescription('Specifies the minimum light output of the ballast'),
e.numeric('ballast_maximum_level', ea.ALL).withValueMin(1).withValueMax(254)
.withDescription('Specifies the maximum light output of the ballast'),
e.enum('dimmer_mode', ea.ALL, ['auto', 'rc', 'rl', 'rl_led'])
.withDescription('Sets dimming mode to autodetect or fixed RC/RL/RL_LED mode (max load is reduced in RL_LED)'),
],
extend: [
(0, modernExtend_1.deviceEndpoints)({ endpoints: { 'left': 4, 'right': 3, 'left_btn': 22, 'right_btn': 21 } }),
(0, modernExtend_1.light)({ endpointNames: ['left', 'right'], configureReporting: true }),
switchActions('left_btn'), switchActions('right_btn'), indicatorMode('left_btn'),
],
},
{
zigbeeModel: ['1GANG/SWITCH/1'],
model: 'MEG5161-0000',
vendor: 'Schneider Electric',
description: 'Merten PlusLink relay insert with Merten Wiser system M push button (1fold)',
extend: [(0, modernExtend_1.onOff)({ powerOnBehavior: false })],
},
{
zigbeeModel: ['LK Switch'],
model: '545D6514',
vendor: 'Schneider Electric',
description: 'LK FUGA wiser wireless double relay',
meta: { multiEndpoint: true },
fromZigbee: [fromZigbee_1.default.on_off, fromZigbee_1.default.command_on, fromZigbee_1.default.command_off],
toZigbee: [toZigbee_1.default.on_off],
endpoint: (device) => {
return { 'l1': 1, 'l2': 2, 's1': 21, 's2': 22, 's3': 23, 's4': 24 };
},
exposes: [e.switch().withEndpoint('l1'), e.switch().withEndpoint('l2'), e.action(['on_s*', 'off_s*'])],
configure: async (device, coordinatorEndpoint) => {
device.endpoints.forEach(async (ep) => {
if (ep.outputClusters.includes(6) || ep.ID <= 2) {
await reporting.bind(ep, coordinatorEndpoint, ['genOnOff']);
if (ep.ID <= 2) {
await reporting.onOff(ep);
}
}
});
},
},
{
zigbeeModel: ['LK Dimmer'],
model: '545D6102',
vendor: 'Schneider Electric',
description: 'LK FUGA wiser wireless dimmer',
fromZigbee: [fromZigbee_1.default.schneider_lighting_ballast_configuration, fromZigbee_1.default.command_recall, fromZigbee_1.default.command_on, fromZigbee_1.default.command_off, fromZigbee_1.default.command_move, fromZigbee_1.default.command_stop],
toZigbee: [toZigbee_1.default.ballast_config, toZigbee_1.default.schneider_dimmer_mode],
endpoint: (device) => {
return { 'l1': 3, 's1': 21, 's2': 22, 's3': 23, 's4': 24 };
},
meta: { multiEndpoint: true },
extend: [(0, modernExtend_1.light)({ endpointNames: ['l1'], configureReporting: true, levelConfig: {} })],
exposes: [
e.numeric('ballast_minimum_level', ea.ALL).withValueMin(1).withValueMax(254)
.withDescription('Specifies the minimum light output of the ballast')
.withEndpoint('l1'),
e.numeric('ballast_maximum_level', ea.ALL).withValueMin(1).withValueMax(254)
.withDescription('Specifies the maximum light output of the ballast')
.withEndpoint('l1'),
e.enum('dimmer_mode', ea.ALL, ['RC', 'RL']).withDescription('Controls Capacitive or Inductive Dimming Mode')
.withEndpoint('l1'),
e.action(['on', 'off', 'brightness_move_up', 'brightness_move_down', 'brightness_stop', 'recall_*'])
],
configure: async (device, coordinatorEndpoint) => {
// Configure the dimmer actuator endpoint
const endpoint = device.getEndpoint(3);
await reporting.bind(endpoint, coordinatorEndpoint, ['lightingBallastCfg']);
// Configure the four front switches
device.endpoints.forEach(async (ep) => {
if (21 <= ep.ID && ep.ID <= 22) {
await reporting.bind(ep, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']);
}
else if (23 <= ep.ID && ep.ID <= 24) {
await reporting.bind(ep, coordinatorEndpoint, ['genScenes']);
}
});
},
onEvent: async (type, data, device) => {
// Record the factory default bindings for easy removal/change after deviceInterview
if (type === 'deviceInterview') {
const dimmer = device.getEndpoint(3);
device.endpoints.forEach(async (ep) => {
if (21 <= ep.ID && ep.ID <= 22) {
ep.addBinding('genOnOff', dimmer);
ep.addBinding('genLevelCtrl', dimmer);
}
if (23 <= ep.ID && ep.ID <= 24) {
ep.addBinding('genScenes', dimmer);
}
});
}
},
},
{
zigbeeModel: ['FLS/AIRLINK/4'],
model: '550D6001',
vendor: 'Schneider Electric',
description: 'LK FUGA wiser wireless battery 4 button switch',
fromZigbee: [fromZigbee_1.default.command_on, fromZigbee_1.default.command_off, fromZigbee_1.default.command_move, fromZigbee_1.default.command_stop, fromZigbee_1.default.battery],
toZigbee: [],
endpoint: (device) => {
return { 'top': 21, 'bottom': 22 };
},
whiteLabel: [{ vendor: 'Elko', model: 'EKO07117' }],
meta: { multiEndpoint: true },
exposes: [e.action(['on_top', 'off_top', 'on_bottom', 'off_bottom', 'brightness_move_up_top', 'brightness_stop_top',
'brightness_move_down_top', 'brightness_stop_top', 'brightness_move_up_bottom', 'brightness_stop_bottom',
'brightness_move_down_bottom', 'brightness_stop_bottom']), e.battery()],
configure: async (device, coordinatorEndpoint) => {
// When in 2-gang operation mode, unit operates out of endpoints 21 and 22, otherwise just 21
const topButtonsEndpoint = device.getEndpoint(21);
await reporting.bind(topButtonsEndpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl', 'genPowerCfg']);
await reporting.batteryPercentageRemaining(topButtonsEndpoint);
const bottomButtonsEndpoint = device.getEndpoint(22);
await reporting.bind(bottomButtonsEndpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']);
},
},
{
fingerprint: [{ modelID: 'CCTFR6700', manufacturerName: 'Schneider Electric' }],
model: 'CCTFR6700',
vendor: 'Schneider Electric',
description: 'Heating thermostat',
fromZigbee: [fromZigbee_1.default.thermostat, fromZigbee_1.default.metering, fromZigbee_1.default.schneider_pilot_mode],
toZigbee: [toZigbee_1.default.schneider_temperature_measured_value, toZigbee_1.default.thermostat_system_mode, toZigbee_1.default.thermostat_running_state,
toZigbee_1.default.thermostat_local_temperature, toZigbee_1.default.thermostat_occupied_heating_setpoint, toZigbee_1.default.thermostat_control_sequence_of_operation,
toZigbee_1.default.schneider_pilot_mode, toZigbee_1.default.schneider_temperature_measured_value],
exposes: [e.power(), e.energy(),
e.enum('schneider_pilot_mode', ea.ALL, ['contactor', 'pilot']).withDescription('Controls piloting mode'),
e.climate().withSetpoint('occupied_heating_setpoint', 4, 30, 0.5).withLocalTemperature()
.withSystemMode(['off', 'auto', 'heat']).withPiHeatingDemand()],
configure: async (device, coordinatorEndpoint) => {
const endpoint1 = device.getEndpoint(1);
const endpoint2 = device.getEndpoint(2);
await reporting.bind(endpoint1, coordinatorEndpoint, ['hvacThermostat']);
await reporting.thermostatOccupiedHeatingSetpoint(endpoint1);
await reporting.thermostatPIHeatingDemand(endpoint1);
await reporting.bind(endpoint2, coordinatorEndpoint, ['seMetering']);
await reporting.instantaneousDemand(endpoint2, { min: 0, max: 60, change: 1 });
await reporting.currentSummDelivered(endpoint2, { min: 0, max: 60, change: 1 });
},
},
{
fingerprint: [{ modelID: 'Thermostat', manufacturerName: 'Schneider Electric' }],
model: 'CCTFR6400',
vendor: 'Schneider Electric',
description: 'Temperature/Humidity measurement with thermostat interface',
fromZigbee: [fromZigbee_1.default.battery, fromZigbee_1.default.schneider_temperature, fromZigbee_1.default.humidity, fromZigbee_1.default.thermostat, fromZigbee_1.default.schneider_ui_action],
toZigbee: [toZigbee_1.default.schneider_thermostat_system_mode, toZigbee_1.default.schneider_thermostat_occupied_heating_setpoint,
toZigbee_1.default.schneider_thermostat_control_sequence_of_operation, toZigbee_1.default.schneider_thermostat_pi_heating_demand,
toZigbee_1.default.schneider_thermostat_keypad_lockout],
exposes: [e.keypad_lockout().withAccess(ea.STATE_SET), e.humidity(), e.battery(), e.battery_voltage(),
e.action(['screen_sleep', 'screen_wake', 'button_press_plus_down', 'button_press_center_down', 'button_press_minus_down']),
e.climate().withSetpoint('occupied_heating_setpoint', 4, 30, 0.5, ea.SET).withLocalTemperature(ea.STATE)
.withPiHeatingDemand(ea.SET)],
meta: { battery: { dontDividePercentage: true } },
configure: async (device, coordinatorEndpoint) => {
const endpoint1 = device.getEndpoint(1);
await reporting.bind(endpoint1, coordinatorEndpoint, ['genPowerCfg', 'hvacThermostat', 'msTemperatureMeasurement', 'msRelativeHumidity']);
await reporting.temperature(endpoint1);
await reporting.humidity(endpoint1);
await reporting.batteryPercentageRemaining(endpoint1);
endpoint1.saveClusterAttributeKeyValue('genBasic', { zclVersion: 3 });
endpoint1.saveClusterAttributeKeyValue('hvacThermostat', { schneiderWiserSpecific: 1, systemMode: 4, ctrlSeqeOfOper: 2 });
endpoint1.saveClusterAttributeKeyValue('hvacUserInterfaceCfg', { keypadLockout: 0 });
},
},
{
zigbeeModel: ['EH-ZB-SPD-V2'],
model: 'EER40030',
vendor: 'Schneider Electric',
description: 'Zigbee smart plug with power meter',
fromZigbee: [fromZigbee_1.default.on_off, fromZigbee_1.default.metering],
toZigbee: [toZigbee_1.default.on_off],
exposes: [e.switch(), e.power(), e.energy()],
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(11);
const options = { disableDefaultResponse: true };
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'seMetering']);
await reporting.onOff(endpoint);
await reporting.readMeteringMultiplierDivisor(endpoint);
await reporting.instantaneousDemand(endpoint);
await endpoint.write('genBasic', { 0xe050: { value: 1, type: 0x10 } }, options);
},
},
{
zigbeeModel: ['EH-ZB-LMACT'],
model: 'EER42000',
vendor: 'Schneider Electric',
description: 'Zigbee load actuator with power meter',
fromZigbee: [fromZigbee_1.default.on_off, fromZigbee_1.default.metering],
toZigbee: [toZigbee_1.default.on_off],
exposes: [e.switch(), e.power(), e.energy()],
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(11);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'seMetering']);
await reporting.onOff(endpoint);
await reporting.readMeteringMultiplierDivisor(endpoint);
await reporting.instantaneousDemand(endpoint);
},
},
{
zigbeeModel: ['2GANG/SWITCH/2', '2GANG/SWITCH/1'],
model: 'MEG5126-0300',
vendor: 'Schneider Electric',
description: 'Merten MEG5165 PlusLink relais insert with Merten Wiser System M push button (2fold)',
extend: [
(0, modernExtend_1.deviceEndpoints)({ endpoints: { 'l1': 1, 'l2': 2 } }),
(0, modernExtend_1.onOff)({ endpointNames: ['l1', 'l2'] }),
],
},
{
zigbeeModel: ['EH-ZB-VACT'],
model: 'EER53000',
vendor: 'Schneider Electric',
description: 'Wiser radiator thermostat (VACT)',
fromZigbee: [fromZigbee_1