zigbee-herdsman-converters
Version:
Collection of device converters to be used with zigbee-herdsman
246 lines (244 loc) • 13.7 kB
JavaScript
const exposes = require('../lib/exposes');
const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/legacy').fromZigbee};
const tz = require('../converters/toZigbee');
const constants = require('../lib/constants');
const reporting = require('../lib/reporting');
const extend = require('../lib/extend');
const e = exposes.presets;
const ea = exposes.access;
module.exports = [
{
zigbeeModel: ['iTRV'],
model: 'WV704R0A0902',
vendor: 'Schneider Electric',
description: 'Wiser radiator thermostat',
fromZigbee: [fz.ignore_basic_report, fz.ignore_haDiagnostic, fz.ignore_genOta, fz.ignore_zclversion_read,
fz.legacy.wiser_thermostat, fz.legacy.wiser_itrv_battery, fz.hvac_user_interface, fz.wiser_device_info],
toZigbee: [tz.thermostat_occupied_heating_setpoint, tz.thermostat_keypad_lockout],
exposes: [exposes.climate().withSetpoint('occupied_heating_setpoint', 7, 30, 1).withLocalTemperature(ea.STATE)
.withSystemMode(['off', 'auto', 'heat'], ea.STATE).withRunningState(['idle', 'heat'], ea.STATE).withPiHeatingDemand()],
configure: async (device, coordinatorEndpoint, logger) => {
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, {min: 0, max: constants.repInterval.MINUTES_15, change: 25});
await reporting.thermostatOccupiedHeatingSetpoint(endpoint, {min: 0, max: constants.repInterval.MINUTES_15, change: 25});
await reporting.thermostatPIHeatingDemand(endpoint, {min: 0, max: constants.repInterval.MINUTES_15, change: 1});
// 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: extend.light_onoff_brightness({noConfigure: true}),
exposes: [e.light_brightness().withEndpoint('l1'), e.light_brightness().withEndpoint('l2')],
meta: {multiEndpoint: true},
configure: async (device, coordinatorEndpoint, logger) => {
await extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
const endpoint1 = device.getEndpoint(10);
await reporting.bind(endpoint1, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']);
await reporting.onOff(endpoint1);
await reporting.brightness(endpoint1);
const endpoint2 = device.getEndpoint(11);
await reporting.bind(endpoint2, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']);
await reporting.onOff(endpoint2);
await reporting.brightness(endpoint2);
},
endpoint: (device) => {
return {l1: 10, l2: 11};
},
},
{
zigbeeModel: ['PUCK/DIMMER/1'],
model: 'CCT5010-0001',
vendor: 'Schneider Electric',
description: 'Micro module dimmer',
fromZigbee: [fz.on_off, fz.brightness, fz.level_config, fz.lighting_ballast_configuration],
toZigbee: [tz.light_onoff_brightness, tz.level_config, tz.ballast_config],
exposes: [e.light_brightness().withLevelConfig(),
exposes.numeric('ballast_minimum_level', ea.ALL).withValueMin(1).withValueMax(254)
.withDescription('Specifies the minimum light output of the ballast'),
exposes.numeric('ballast_maximum_level', ea.ALL).withValueMin(1).withValueMax(254)
.withDescription('Specifies the maximum light output of the ballast')],
whiteLabel: [{vendor: 'Elko', model: 'EKO07090'}],
configure: async (device, coordinatorEndpoint, logger) => {
await extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
const endpoint = device.getEndpoint(3);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl', 'lightingBallastCfg']);
await reporting.onOff(endpoint);
await reporting.brightness(endpoint);
},
},
{
zigbeeModel: ['PUCK/SWITCH/1'],
model: 'CCT5011-0001/MEG5011-0001',
vendor: 'Schneider Electric',
description: 'Micro module switch',
extend: extend.switch(),
whiteLabel: [{vendor: 'Elko', model: 'EKO07144'}],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
await reporting.onOff(endpoint);
},
},
{
zigbeeModel: ['NHROTARY/DIMMER/1'],
model: 'WDE002334',
vendor: 'Schneider Electric',
description: 'Rotary dimmer',
fromZigbee: [fz.on_off, fz.brightness, fz.level_config, fz.lighting_ballast_configuration],
toZigbee: [tz.light_onoff_brightness, tz.level_config, tz.ballast_config],
exposes: [e.light_brightness().withLevelConfig(),
exposes.numeric('ballast_minimum_level', ea.ALL).withValueMin(1).withValueMax(254)
.withDescription('Specifies the minimum light output of the ballast'),
exposes.numeric('ballast_maximum_level', ea.ALL).withValueMin(1).withValueMax(254)
.withDescription('Specifies the maximum light output of the ballast')],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(3);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl', 'lightingBallastCfg']);
await reporting.onOff(endpoint);
await reporting.brightness(endpoint);
},
},
{
zigbeeModel: ['U201DST600ZB'],
model: 'U201DST600ZB',
vendor: 'Schneider Electric',
description: 'EZinstall3 1 gang 550W dimmer module',
extend: extend.light_onoff_brightness({noConfigure: true}),
configure: async (device, coordinatorEndpoint, logger) => {
await extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
const endpoint = device.getEndpoint(10);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']);
await reporting.onOff(endpoint);
await reporting.brightness(endpoint);
},
},
{
zigbeeModel: ['U201SRY2KWZB'],
model: 'U201SRY2KWZB',
vendor: 'Schneider Electric',
description: 'Ulti 240V 9.1 A 1 gang relay switch impress switch module, amber LED',
extend: extend.switch(),
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(10);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
await reporting.onOff(endpoint);
},
},
{
zigbeeModel: ['U202SRY2KWZB'],
model: 'U202SRY2KWZB',
vendor: 'Schneider Electric',
description: 'Ulti 240V 9.1 A 2 gangs relay switch impress switch module, amber LED',
extend: extend.switch(),
exposes: [e.switch().withEndpoint('l1'), e.switch().withEndpoint('l2')],
meta: {multiEndpoint: true},
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint1 = device.getEndpoint(10);
await reporting.bind(endpoint1, coordinatorEndpoint, ['genOnOff']);
await reporting.onOff(endpoint1);
const endpoint2 = device.getEndpoint(11);
await reporting.bind(endpoint2, coordinatorEndpoint, ['genOnOff']);
await reporting.onOff(endpoint2);
},
endpoint: (device) => {
return {l1: 10, l2: 11};
},
},
{
zigbeeModel: ['1GANG/SHUTTER/1'],
model: 'MEG5113-0300/MEG5165-0000',
vendor: 'Schneider Electric',
description: 'Merten PlusLink Shutter insert with Merten Wiser System M Push Button',
fromZigbee: [fz.cover_position_tilt, fz.command_cover_close, fz.command_cover_open, fz.command_cover_stop],
toZigbee: [tz.cover_position_tilt, tz.cover_state],
exposes: [e.cover_position()],
meta: {coverInverted: true},
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1) || device.getEndpoint(5);
await reporting.bind(endpoint, coordinatorEndpoint, ['closuresWindowCovering']);
await reporting.currentPositionLiftPercentage(endpoint);
},
},
{
zigbeeModel: ['LK Switch'],
model: '545D6514',
vendor: 'Schneider Electric',
description: 'LK FUGA wiser wireless double relay',
meta: {multiEndpoint: true},
fromZigbee: [fz.on_off, fz.command_on, fz.command_off],
toZigbee: [tz.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, logger) => {
device.endpoints.forEach(async (ep) => {
if (ep.outputClusters.includes(6)) {
await reporting.bind(ep, coordinatorEndpoint, ['genOnOff']);
if (ep.ID <= 2) {
await reporting.onOff(ep);
}
}
});
},
},
{
fingerprint: [{modelID: 'CCTFR6700', manufacturerName: 'Schneider Electric'}],
model: 'CCTFR6700',
vendor: 'Schneider Electric',
description: 'Heating thermostat',
fromZigbee: [fz.thermostat, fz.metering, fz.schneider_pilot_mode],
toZigbee: [tz.schneider_temperature_measured_value, tz.thermostat_system_mode, tz.thermostat_running_state,
tz.thermostat_local_temperature, tz.thermostat_occupied_heating_setpoint, tz.thermostat_control_sequence_of_operation,
tz.schneider_pilot_mode, tz.schneider_temperature_measured_value],
exposes: [e.power(), e.energy(),
exposes.enum('schneider_pilot_mode', ea.ALL, ['contactor', 'pilot']).withDescription('Controls piloting mode'),
exposes.numeric('temperature_measured_value', ea.SET),
exposes.climate().withSetpoint('occupied_heating_setpoint', 4, 30, 0.5).withLocalTemperature()
.withSystemMode(['off', 'auto', 'heat']).withRunningState(['idle', 'heat']).withPiHeatingDemand()],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint1 = device.getEndpoint(1);
const endpoint2 = device.getEndpoint(2);
await reporting.bind(endpoint1, coordinatorEndpoint, ['hvacThermostat']);
await reporting.thermostatOccupiedHeatingSetpoint(endpoint1, {min: 0, max: 60, change: 1});
await reporting.thermostatPIHeatingDemand(endpoint1, {min: 0, max: 60, change: 1});
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: [fz.battery, fz.schneider_temperature, fz.humidity, fz.thermostat, fz.schneider_ui_action],
toZigbee: [tz.schneider_thermostat_system_mode, tz.schneider_thermostat_occupied_heating_setpoint,
tz.schneider_thermostat_control_sequence_of_operation, tz.schneider_thermostat_pi_heating_demand,
tz.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']),
exposes.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, logger) => {
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});
},
},
];