zigbee-herdsman-converters
Version:
Collection of device converters to be used with zigbee-herdsman
911 lines (910 loc) • 184 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 exposes = __importStar(require("../lib/exposes"));
const fromZigbee_1 = __importDefault(require("../converters/fromZigbee"));
const toZigbee_1 = __importDefault(require("../converters/toZigbee"));
const constants = __importStar(require("../lib/constants"));
const reporting = __importStar(require("../lib/reporting"));
const modernExtend_1 = require("../lib/modernExtend");
const e = exposes.presets;
const ea = exposes.access;
const globalStore = __importStar(require("../lib/store"));
const lumi = __importStar(require("../lib/lumi"));
const { lumiAction, lumiOperationMode, lumiPowerOnBehavior, lumiZigbeeOTA, lumiSwitchType, lumiAirQuality, lumiVoc, lumiDisplayUnit, lumiLight, lumiOutageCountRestoreBindReporting, lumiElectricityMeter, lumiPower, lumiOverloadProtection, lumiLedIndicator, lumiButtonLock, lumiMotorSpeed, lumiOnOff, lumiLedDisabledNight, lumiFlipIndicatorLight, lumiPreventReset, lumiClickMode, lumiSlider, lumiSetEventMode, lumiSwitchMode, lumiVibration, lumiKnobRotation, lumiCommandMode, lumiBattery, } = lumi.modernExtend;
const logger_1 = require("../lib/logger");
const NS = 'zhc:lumi';
const { manufacturerCode } = lumi;
const definitions = [
{
zigbeeModel: ['lumi.flood.acn001'],
model: 'SJCGQ13LM',
vendor: 'Aqara',
description: 'Water leak sensor E1',
fromZigbee: [fromZigbee_1.default.ias_water_leak_alarm_1, lumi.fromZigbee.lumi_specific, fromZigbee_1.default.battery],
toZigbee: [],
exposes: [e.water_leak(), e.battery(), e.battery_low(), e.battery_voltage(), e.device_temperature(), e.power_outage_count(false)],
meta: { battery: { voltageToPercentage: '3V_2850_3000' } },
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(1);
await endpoint.read('genPowerCfg', ['batteryVoltage']);
},
extend: [(0, modernExtend_1.quirkCheckinInterval)('1_HOUR'), lumiZigbeeOTA()],
},
{
zigbeeModel: ['lumi.airm.fhac01'],
model: 'KQJCMB11LM',
vendor: 'Aqara',
description: 'Air monitoring panel S1',
fromZigbee: [fromZigbee_1.default.temperature, fromZigbee_1.default.humidity, lumi.fromZigbee.lumi_pm25, lumi.fromZigbee.lumi_co2],
toZigbee: [],
exposes: [e.temperature(), e.humidity(), e.pm25(), e.co2()],
extend: [lumiZigbeeOTA()],
},
{
zigbeeModel: ['lumi.magnet.acn001'],
model: 'MCCGQ14LM',
vendor: 'Aqara',
description: 'Door and window sensor E1',
fromZigbee: [fromZigbee_1.default.ias_contact_alarm_1, lumi.fromZigbee.lumi_specific, fromZigbee_1.default.battery],
toZigbee: [],
meta: { battery: { voltageToPercentage: '3V_2850_3000' } },
exposes: [e.contact(), e.battery(), e.battery_low(), e.battery_voltage()],
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(1);
await endpoint.read('genPowerCfg', ['batteryVoltage']);
},
extend: [
(0, modernExtend_1.quirkCheckinInterval)('1_HOUR'),
// OTA request: "fieldControl":0, "manufacturerCode":4447, "imageType":10635, no available for now
// https://github.com/Koenkk/zigbee-OTA/pull/138
// lumiZigbeeOTA(),
],
},
{
zigbeeModel: ['lumi.magnet.ac01'],
model: 'MCCGQ13LM',
vendor: 'Aqara',
description: 'Door and window sensor P1',
fromZigbee: [lumi.fromZigbee.lumi_contact, fromZigbee_1.default.ias_contact_alarm_1, lumi.fromZigbee.lumi_specific],
toZigbee: [lumi.toZigbee.lumi_detection_distance],
meta: { battery: { voltageToPercentage: '3V_2850_3000' } },
exposes: [e.contact(), e.battery(), e.battery_voltage(),
e.tamper(),
e.enum('detection_distance', ea.ALL, ['10mm', '20mm', '30mm'])
.withDescription('The sensor will be considered "off" within the set distance. Please press the device button before setting'),
],
extend: [(0, modernExtend_1.quirkCheckinInterval)('1_HOUR')],
},
{
zigbeeModel: ['lumi.dimmer.rcbac1'],
model: 'ZNDDMK11LM',
vendor: 'Aqara',
description: 'Smart lightstrip driver',
fromZigbee: [lumi.fromZigbee.lumi_power, lumi.fromZigbee.lumi_specific, ...(0, modernExtend_1.light)({ colorTemp: { range: undefined }, color: true }).fromZigbee],
toZigbee: [lumi.toZigbee.lumi_dimmer_mode, lumi.toZigbee.lumi_switch_power_outage_memory,
...(0, modernExtend_1.light)({ colorTemp: { range: undefined }, color: true }).toZigbee],
exposes: [e.power(), e.energy(), e.voltage(), e.device_temperature(), e.power_outage_memory(),
// When in rgbw mode, only one of color and colortemp will be valid, and l2 will be invalid
// Do not control l2 in rgbw mode
e.light_brightness_colortemp_colorxy([153, 370]).removeFeature('color_temp_startup').withEndpoint('l1'),
e.light_brightness_colortemp([153, 370]).removeFeature('color_temp_startup').withEndpoint('l2'),
e.enum('dimmer_mode', ea.ALL, ['rgbw', 'dual_ct'])
.withDescription('Switch between rgbw mode or dual color temperature mode')],
extend: [
(0, modernExtend_1.deviceEndpoints)({ endpoints: { l1: 1, l2: 2 } }),
lumiZigbeeOTA(),
],
},
{
zigbeeModel: ['lumi.light.aqcn02'],
model: 'ZNLDP12LM',
vendor: 'Aqara',
description: 'Light bulb',
extend: [lumiLight({ colorTemp: true, powerOutageMemory: 'light' }), lumiZigbeeOTA()],
},
{
zigbeeModel: ['lumi.light.acn003'],
model: 'ZNXDD01LM',
vendor: 'Aqara',
description: 'Ceiling light L1-350',
extend: [lumiLight({ colorTemp: true, powerOutageMemory: 'switch' }), lumiZigbeeOTA()],
},
{
zigbeeModel: ['lumi.light.cwac02', 'lumi.light.acn014'],
model: 'ZNLDP13LM',
vendor: 'Aqara',
description: 'Light bulb T1',
whiteLabel: [{ vendor: 'Aqara', model: 'LEDLBT1-L01' }],
extend: [
lumiZigbeeOTA(),
lumiLight({ colorTemp: true, powerOutageMemory: 'switch' }),
(0, modernExtend_1.forceDeviceType)({ type: 'Router' }),
(0, modernExtend_1.forcePowerSource)({ powerSource: 'Mains (single phase)' }),
],
},
{
zigbeeModel: ['lumi.light.cwopcn01'],
model: 'XDD11LM',
vendor: 'Aqara',
description: 'Opple MX960',
meta: { turnsOffAtBrightness1: true },
extend: [lumiLight({ colorTemp: true, powerOutageMemory: 'switch' }), lumiZigbeeOTA()],
},
{
zigbeeModel: ['lumi.light.cwopcn02'],
model: 'XDD12LM',
vendor: 'Aqara',
description: 'Opple MX650',
meta: { turnsOffAtBrightness1: true },
extend: [lumiZigbeeOTA(), lumiLight({ colorTemp: true, powerOutageMemory: 'switch' })],
},
{
zigbeeModel: ['lumi.light.cwopcn03'],
model: 'XDD13LM',
vendor: 'Aqara',
description: 'Opple MX480',
meta: { turnsOffAtBrightness1: true },
extend: [lumiLight({ colorTemp: true, powerOutageMemory: 'switch' }), lumiZigbeeOTA()],
},
{
zigbeeModel: ['lumi.light.cwjwcn01'],
model: 'JWSP001A',
vendor: 'Aqara',
description: 'Jiawen LED Driver & Dimmer',
extend: [lumiLight({ colorTemp: true, powerOutageMemory: 'switch' })],
},
{
zigbeeModel: ['lumi.light.cwjwcn02'],
model: 'JWDL001A',
vendor: 'Aqara',
description: 'Embedded spot led light',
extend: [lumiLight({ colorTemp: true, powerOutageMemory: 'switch' })],
},
{
zigbeeModel: ['lumi.sensor_switch'],
model: 'WXKG01LM',
vendor: 'Xiaomi',
whiteLabel: [
{ vendor: 'Xiaomi', model: 'YTC4040GL' },
{ vendor: 'Xiaomi', model: 'YTC4006CN' },
{ vendor: 'Xiaomi', model: 'YTC4017CN' },
{ vendor: 'Xiaomi', model: 'ZHTZ02LM' }
],
description: 'Mi wireless switch',
meta: { battery: { voltageToPercentage: '3V_2850_3000' } },
fromZigbee: [lumi.fromZigbee.lumi_basic, lumi.fromZigbee.lumi_action_WXKG01LM, lumi.legacyFromZigbee.WXKG01LM_click],
exposes: [e.battery(), e.action(['single', 'double', 'triple', 'quadruple', 'hold', 'release', 'many']), e.battery_voltage(),
e.power_outage_count(false)],
toZigbee: [],
extend: [(0, modernExtend_1.quirkCheckinInterval)('1_HOUR')],
},
{
zigbeeModel: ['lumi.sensor_switch.aq2', 'lumi.remote.b1acn01'],
model: 'WXKG11LM',
vendor: 'Aqara',
description: 'Wireless mini switch',
meta: { battery: { voltageToPercentage: '3V_2850_3000' } },
exposes: [e.battery(), e.battery_voltage(), e.action(['single', 'double', 'triple', 'quadruple', 'hold', 'release']),
e.device_temperature(), e.power_outage_count()],
fromZigbee: [lumi.fromZigbee.lumi_action_multistate, lumi.fromZigbee.lumi_action, lumi.fromZigbee.lumi_basic,
lumi.legacyFromZigbee.WXKG11LM_click, lumi.legacyFromZigbee.lumi_action_click_multistate],
toZigbee: [],
extend: [(0, modernExtend_1.quirkCheckinInterval)('1_HOUR')],
},
{
zigbeeModel: ['lumi.sensor_switch.aq3', 'lumi.sensor_swit'],
model: 'WXKG12LM',
vendor: 'Aqara',
description: 'Wireless mini switch (with gyroscope)',
meta: { battery: { voltageToPercentage: '3V_2850_3000' } },
exposes: [e.battery(), e.action(['single', 'double', 'hold', 'release', 'shake']), e.battery_voltage()],
fromZigbee: [lumi.fromZigbee.lumi_basic, lumi.fromZigbee.lumi_action_multistate, lumi.legacyFromZigbee.WXKG12LM_action_click_multistate],
toZigbee: [],
extend: [(0, modernExtend_1.quirkCheckinInterval)('1_HOUR')],
},
{
zigbeeModel: ['lumi.sensor_86sw1'],
model: 'WXKG03LM_rev1',
vendor: 'Aqara',
description: 'Wireless remote switch (single rocker), 2016 model',
meta: { battery: { voltageToPercentage: '3V_2850_3000' } },
exposes: [e.battery(), e.action(['single']), e.battery_voltage()],
fromZigbee: [lumi.fromZigbee.lumi_action, lumi.fromZigbee.lumi_basic, lumi.legacyFromZigbee.WXKG03LM_click],
toZigbee: [],
extend: [(0, modernExtend_1.quirkCheckinInterval)('1_HOUR'), lumiPreventReset()],
},
{
zigbeeModel: ['lumi.remote.b186acn01'],
model: 'WXKG03LM_rev2',
vendor: 'Aqara',
description: 'Wireless remote switch (single rocker), 2018 model',
meta: { battery: { voltageToPercentage: '3V_2850_3000' } },
exposes: [e.battery(), e.action(['single', 'double', 'hold']), e.battery_voltage()],
fromZigbee: [lumi.fromZigbee.lumi_action, lumi.fromZigbee.lumi_action_multistate, lumi.fromZigbee.lumi_basic,
lumi.legacyFromZigbee.WXKG03LM_click, lumi.legacyFromZigbee.lumi_action_click_multistate],
toZigbee: [],
extend: [(0, modernExtend_1.quirkCheckinInterval)('1_HOUR'), lumiPreventReset()],
},
{
zigbeeModel: ['lumi.remote.b186acn02'],
model: 'WXKG06LM',
vendor: 'Aqara',
description: 'Wireless remote switch D1 (single rocker)',
fromZigbee: [lumi.fromZigbee.lumi_basic, lumi.fromZigbee.lumi_action, lumi.fromZigbee.lumi_action_multistate],
toZigbee: [],
exposes: [e.battery(),
e.action(['single', 'double', 'hold']),
e.battery_voltage()],
meta: { battery: { voltageToPercentage: '3V_2850_3000' } },
extend: [(0, modernExtend_1.quirkCheckinInterval)('1_HOUR'), lumiPreventReset()],
configure: async (device, coordinatorEndpoint) => {
try {
const endpoint = device.endpoints[1];
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genPowerCfg']);
}
catch (error) {
// fails for some but device works as expected: https://github.com/Koenkk/zigbee2mqtt/issues/9136
}
},
},
{
zigbeeModel: ['lumi.light.acn132'],
model: 'LGYCDD01LM',
vendor: 'Aqara',
whiteLabel: [{ vendor: 'Aqara', model: 'RLS-K01D' }],
description: 'Light strip T1',
extend: [
(0, modernExtend_1.light)({ effect: false, powerOnBehavior: false, colorTemp: { startup: false, range: [153, 370] }, color: true }),
lumiPowerOnBehavior(),
(0, modernExtend_1.numeric)({
name: 'length',
valueMin: 1,
valueMax: 10,
valueStep: 0.2,
scale: 5,
unit: 'm',
cluster: 'manuSpecificLumi',
attribute: { ID: 0x051b, type: 0x20 },
description: 'LED strip length',
zigbeeCommandOptions: { manufacturerCode },
}),
(0, modernExtend_1.numeric)({
name: 'min_brightness',
valueMin: 0,
valueMax: 99,
unit: '%',
cluster: 'manuSpecificLumi',
attribute: { ID: 0x0515, type: 0x20 },
description: 'Minimum brightness level',
zigbeeCommandOptions: { manufacturerCode },
}),
(0, modernExtend_1.numeric)({
name: 'max_brightness',
valueMin: 1,
valueMax: 100,
unit: '%',
cluster: 'manuSpecificLumi',
attribute: { ID: 0x0516, type: 0x20 },
description: 'Maximum brightness level',
zigbeeCommandOptions: { manufacturerCode },
}),
(0, modernExtend_1.binary)({
name: 'audio',
valueOn: ['ON', 1],
valueOff: ['OFF', 0],
cluster: 'manuSpecificLumi',
attribute: { ID: 0x051c, type: 0x20 },
description: 'Enabling audio',
zigbeeCommandOptions: { manufacturerCode },
}),
(0, modernExtend_1.enumLookup)({
name: 'audio_sensitivity',
lookup: { 'low': 0, 'medium': 1, 'high': 2 },
cluster: 'manuSpecificLumi',
attribute: { ID: 0x051e, type: 0x20 },
description: 'Audio sensitivity',
zigbeeCommandOptions: { manufacturerCode },
}),
(0, modernExtend_1.enumLookup)({
name: 'audio_effect',
lookup: { 'random': 0, 'blink': 1, 'rainbow': 2, 'wave': 3 },
cluster: 'manuSpecificLumi',
attribute: { ID: 0x051d, type: 0x23 },
description: 'Audio effect',
zigbeeCommandOptions: { manufacturerCode },
}),
(0, modernExtend_1.numeric)({
name: 'preset',
valueMin: 1,
valueMax: 32,
cluster: 'manuSpecificLumi',
attribute: { ID: 0x051f, type: 0x23 },
description: 'Preset index (0-6 default presets)',
zigbeeCommandOptions: { manufacturerCode },
}),
(0, modernExtend_1.numeric)({
name: 'speed',
valueMin: 1,
valueMax: 100,
cluster: 'manuSpecificLumi',
attribute: { ID: 0x0520, type: 0x20 },
description: 'Effect speed',
zigbeeCommandOptions: { manufacturerCode },
}),
lumiZigbeeOTA(),
],
},
{
zigbeeModel: ['lumi.sensor_86sw2', 'lumi.sensor_86sw2.es1'],
model: 'WXKG02LM_rev1',
vendor: 'Aqara',
description: 'Wireless remote switch (double rocker), 2016 model',
meta: { battery: { voltageToPercentage: '3V_2850_3000' } },
exposes: [e.battery(), e.action(['single_left', 'single_right', 'single_both']), e.battery_voltage(), e.power_outage_count(false)],
fromZigbee: [lumi.fromZigbee.lumi_action, lumi.fromZigbee.lumi_basic, lumi.legacyFromZigbee.WXKG02LM_click],
toZigbee: [],
extend: [(0, modernExtend_1.quirkCheckinInterval)('1_HOUR'), lumiPreventReset()],
},
{
zigbeeModel: ['lumi.remote.b286acn01'],
model: 'WXKG02LM_rev2',
vendor: 'Aqara',
description: 'Wireless remote switch (double rocker), 2018 model',
meta: { battery: { voltageToPercentage: '3V_2850_3000' } },
exposes: [e.battery(), e.action(['single_left', 'single_right', 'single_both', 'double_left', 'double_right', 'double_both',
'hold_left', 'hold_right', 'hold_both']), e.battery_voltage()],
fromZigbee: [lumi.fromZigbee.lumi_action, lumi.fromZigbee.lumi_action_multistate, lumi.fromZigbee.lumi_basic,
lumi.legacyFromZigbee.WXKG02LM_click, lumi.legacyFromZigbee.WXKG02LM_click_multistate],
toZigbee: [],
extend: [(0, modernExtend_1.quirkCheckinInterval)('1_HOUR'), lumiPreventReset()],
},
{
zigbeeModel: ['lumi.switch.b1laus01'],
model: 'WS-USC01',
vendor: 'Aqara',
description: 'Smart wall switch (no neutral, single rocker), US',
fromZigbee: [fromZigbee_1.default.on_off, lumi.fromZigbee.lumi_action_multistate, lumi.fromZigbee.lumi_specific],
toZigbee: [toZigbee_1.default.on_off, lumi.toZigbee.lumi_switch_operation_mode_opple,
lumi.toZigbee.lumi_flip_indicator_light, lumi.toZigbee.lumi_switch_mode_switch, lumi.toZigbee.lumi_switch_power_outage_memory],
exposes: [e.switch(), e.action(['single', 'double']),
e.flip_indicator_light(), e.power_outage_memory(),
e.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled']).withDescription('Decoupled mode'),
e.enum('mode_switch', ea.ALL, ['anti_flicker_mode', 'quick_mode'])
.withDescription('Anti flicker mode can be used to solve blinking issues of some lights.' +
'Quick mode makes the device respond faster.'),
e.power_outage_count(), e.device_temperature().withAccess(ea.STATE)],
configure: async (device, coordinatorEndpoint) => {
const endpoint1 = device.getEndpoint(1);
// set "event" mode
await endpoint1.write('manuSpecificLumi', { 'mode': 1 }, { manufacturerCode: manufacturerCode, disableResponse: true });
device.powerSource = 'Mains (single phase)';
device.save();
},
extend: [lumiZigbeeOTA(), lumiPreventReset()],
},
{
zigbeeModel: ['lumi.switch.b2laus01'],
model: 'WS-USC02',
vendor: 'Aqara',
description: 'Smart wall switch (no neutral, double rocker), US',
fromZigbee: [fromZigbee_1.default.on_off, lumi.fromZigbee.lumi_action_multistate, lumi.fromZigbee.lumi_specific],
toZigbee: [
toZigbee_1.default.on_off, lumi.toZigbee.lumi_switch_operation_mode_opple, lumi.toZigbee.lumi_flip_indicator_light,
lumi.toZigbee.lumi_switch_power_outage_memory, lumi.toZigbee.lumi_switch_mode_switch
],
exposes: [
e.switch().withEndpoint('top'),
e.switch().withEndpoint('bottom'),
e.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
.withDescription('Decoupled mode for top button')
.withEndpoint('top'),
e.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
.withDescription('Decoupled mode for bottom button')
.withEndpoint('bottom'),
e.enum('mode_switch', ea.ALL, ['anti_flicker_mode', 'quick_mode'])
.withDescription('Anti flicker mode can be used to solve blinking issues of some lights.' +
'Quick mode makes the device respond faster.'),
e.power_outage_count(),
e.device_temperature().withAccess(ea.STATE),
e.flip_indicator_light(),
e.power_outage_memory(),
e.action(['single_top', 'single_bottom', 'single_both', 'double_top', 'double_bottom', 'double_both'])
],
meta: { multiEndpoint: true },
endpoint: (device) => {
return { 'top': 1, 'bottom': 2 };
},
configure: async (device, coordinatorEndpoint) => {
await device.getEndpoint(1).write('manuSpecificLumi', { mode: 1 }, { manufacturerCode: manufacturerCode, disableResponse: true });
},
extend: [lumiZigbeeOTA(), lumiPreventReset()],
},
{
zigbeeModel: ['lumi.switch.b1naus01'],
model: 'WS-USC03',
vendor: 'Aqara',
description: 'Smart wall switch (with neutral, single rocker), US',
fromZigbee: [fromZigbee_1.default.on_off, lumi.fromZigbee.lumi_power, lumi.fromZigbee.lumi_action_multistate, lumi.fromZigbee.lumi_specific],
toZigbee: [toZigbee_1.default.on_off, lumi.toZigbee.lumi_power, lumi.toZigbee.lumi_switch_operation_mode_opple, lumi.toZigbee.lumi_switch_power_outage_memory,
lumi.toZigbee.lumi_flip_indicator_light],
exposes: [e.switch(), e.action(['single', 'double']), e.flip_indicator_light(), e.power_outage_count(),
e.device_temperature().withAccess(ea.STATE),
e.power().withAccess(ea.STATE_GET), e.energy(), e.voltage(), e.power_outage_memory(),
e.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
.withDescription('Decoupled mode')],
configure: async (device, coordinatorEndpoint) => {
const endpoint1 = device.getEndpoint(1);
// set "event" mode
await endpoint1.write('manuSpecificLumi', { 'mode': 1 }, { manufacturerCode: manufacturerCode, disableResponse: true });
},
extend: [lumiZigbeeOTA(), lumiPreventReset()],
},
{
zigbeeModel: ['lumi.switch.b2naus01'],
model: 'WS-USC04',
vendor: 'Aqara',
description: 'Smart wall switch (with neutral, double rocker), US',
fromZigbee: [fromZigbee_1.default.on_off, lumi.fromZigbee.lumi_power, lumi.fromZigbee.lumi_action_multistate, lumi.fromZigbee.lumi_specific],
toZigbee: [
toZigbee_1.default.on_off, lumi.toZigbee.lumi_power, lumi.toZigbee.lumi_switch_operation_mode_opple, lumi.toZigbee.lumi_switch_power_outage_memory,
lumi.toZigbee.lumi_flip_indicator_light
],
exposes: [
e.switch().withEndpoint('top'),
e.switch().withEndpoint('bottom'),
e.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
.withDescription('Decoupled mode for top button')
.withEndpoint('top'),
e.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
.withDescription('Decoupled mode for bottom button')
.withEndpoint('bottom'),
e.power_outage_count(),
e.device_temperature().withAccess(ea.STATE),
e.flip_indicator_light(),
e.power().withAccess(ea.STATE_GET),
e.energy(),
e.voltage(),
e.power_outage_memory(),
e.action(['single_top', 'single_bottom', 'single_both', 'double_top', 'double_bottom', 'double_both'])
],
meta: { multiEndpoint: true, multiEndpointSkip: ['power', 'energy'] },
endpoint: (device) => {
return { 'top': 1, 'bottom': 2 };
},
configure: async (device, coordinatorEndpoint) => {
await device.getEndpoint(1).write('manuSpecificLumi', { mode: 1 }, { manufacturerCode: manufacturerCode, disableResponse: true });
},
extend: [lumiZigbeeOTA(), lumiPreventReset()],
},
{
zigbeeModel: ['lumi.switch.l1acn1'],
model: 'QBKG27LM',
vendor: 'Aqara',
description: 'Smart wall switch H1 (no neutral, single rocker)',
fromZigbee: [fromZigbee_1.default.on_off, lumi.fromZigbee.lumi_specific, lumi.fromZigbee.lumi_action_multistate],
toZigbee: [toZigbee_1.default.on_off, lumi.toZigbee.lumi_switch_operation_mode_opple, lumi.toZigbee.lumi_switch_power_outage_memory,
lumi.toZigbee.lumi_led_disabled_night, lumi.toZigbee.lumi_flip_indicator_light, lumi.toZigbee.lumi_switch_mode_switch],
exposes: [e.switch(), e.device_temperature(), e.power_outage_memory(), e.led_disabled_night(), e.flip_indicator_light(),
e.action(['single', 'double']),
e.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
.withDescription('Decoupled mode'),
e.power_outage_count(),
e.enum('mode_switch', ea.ALL, ['anti_flicker_mode', 'quick_mode'])
.withDescription('Anti flicker mode can be used to solve blinking issues of some lights.' +
'Quick mode makes the device respond faster.'),
],
configure: async (device, coordinatorEndpoint) => {
await device.getEndpoint(1).write('manuSpecificLumi', { 'mode': 1 }, { manufacturerCode: manufacturerCode, disableResponse: true });
},
extend: [lumiZigbeeOTA(), lumiPreventReset()],
},
{
zigbeeModel: ['lumi.switch.l2acn1'],
model: 'QBKG28LM',
vendor: 'Aqara',
description: 'Smart wall switch H1 (no neutral, double rocker)',
fromZigbee: [fromZigbee_1.default.on_off, lumi.fromZigbee.lumi_action_multistate, lumi.fromZigbee.lumi_specific],
toZigbee: [toZigbee_1.default.on_off, lumi.toZigbee.lumi_switch_operation_mode_opple, lumi.toZigbee.lumi_switch_power_outage_memory,
lumi.toZigbee.lumi_flip_indicator_light, lumi.toZigbee.lumi_led_disabled_night, lumi.toZigbee.lumi_switch_mode_switch],
meta: { multiEndpoint: true },
endpoint: (device) => {
return { 'left': 1, 'right': 2 };
},
exposes: [e.switch().withEndpoint('left'), e.switch().withEndpoint('right'), e.device_temperature(),
e.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
.withDescription('Decoupled mode for left button').withEndpoint('left'),
e.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
.withDescription('Decoupled mode for right button').withEndpoint('right'),
e.action(['single_left', 'double_left', 'single_right', 'double_right', 'single_both', 'double_both']),
e.power_outage_memory(), e.flip_indicator_light(), e.led_disabled_night(),
e.enum('mode_switch', ea.ALL, ['anti_flicker_mode', 'quick_mode'])
.withDescription('Anti flicker mode can be used to solve blinking issues of some lights.' +
'Quick mode makes the device respond faster.'),
],
configure: async (device, coordinatorEndpoint) => {
await device.getEndpoint(1).write('manuSpecificLumi', { 'mode': 1 }, { manufacturerCode: manufacturerCode, disableResponse: true });
},
extend: [lumiZigbeeOTA(), lumiPreventReset()],
},
{
zigbeeModel: ['lumi.switch.l3acn1'],
model: 'QBKG29LM',
vendor: 'Aqara',
description: 'Smart wall switch H1 (no neutral, triple rocker)',
fromZigbee: [fromZigbee_1.default.on_off, lumi.fromZigbee.lumi_action_multistate, lumi.fromZigbee.lumi_specific],
toZigbee: [toZigbee_1.default.on_off, lumi.toZigbee.lumi_switch_operation_mode_opple, lumi.toZigbee.lumi_switch_power_outage_memory,
lumi.toZigbee.lumi_flip_indicator_light, lumi.toZigbee.lumi_led_disabled_night, lumi.toZigbee.lumi_switch_mode_switch],
meta: { multiEndpoint: true },
endpoint: (device) => ({ left: 1, center: 2, right: 3 }),
exposes: [
e.switch().withEndpoint('left'), e.switch().withEndpoint('center'), e.switch().withEndpoint('right'),
e.power_outage_memory(), e.flip_indicator_light(), e.led_disabled_night(), e.power_outage_count(),
e.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
.withDescription('Decoupled mode for left button')
.withEndpoint('left'),
e.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
.withDescription('Decoupled mode for center button')
.withEndpoint('center'),
e.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
.withDescription('Decoupled mode for right button')
.withEndpoint('right'),
e.enum('mode_switch', ea.ALL, ['anti_flicker_mode', 'quick_mode'])
.withDescription('Anti flicker mode can be used to solve blinking issues of some lights.' +
'Quick mode makes the device respond faster.'),
e.device_temperature().withAccess(ea.STATE),
e.action([
'single_left', 'double_left', 'single_center', 'double_center', 'single_right', 'double_right',
'single_left_center', 'double_left_center', 'single_left_right', 'double_left_right',
'single_center_right', 'double_center_right', 'single_all', 'double_all',
]),
],
configure: async (device, coordinatorEndpoint) => {
await device.getEndpoint(1).write('manuSpecificLumi', { 'mode': 1 }, { manufacturerCode: manufacturerCode, disableResponse: true });
},
extend: [lumiPreventReset()],
},
{
zigbeeModel: ['lumi.switch.n1acn1'],
model: 'QBKG30LM',
vendor: 'Aqara',
description: 'Smart wall switch H1 Pro (with neutral, single rocker)',
fromZigbee: [fromZigbee_1.default.on_off, lumi.fromZigbee.lumi_power, lumi.fromZigbee.lumi_specific, lumi.fromZigbee.lumi_action_multistate],
toZigbee: [toZigbee_1.default.on_off, lumi.toZigbee.lumi_switch_operation_mode_opple, lumi.toZigbee.lumi_switch_power_outage_memory,
lumi.toZigbee.lumi_led_disabled_night, lumi.toZigbee.lumi_flip_indicator_light],
exposes: [e.switch(), e.power(), e.energy(), e.voltage(),
e.device_temperature(), e.power_outage_memory(), e.led_disabled_night(), e.flip_indicator_light(),
e.action(['single', 'double']),
e.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
.withDescription('Decoupled mode'),
e.power_outage_count()],
extend: [lumiZigbeeOTA(), lumiPreventReset()],
},
{
zigbeeModel: ['lumi.switch.n2acn1'],
model: 'QBKG31LM',
vendor: 'Aqara',
description: 'Smart wall switch H1 Pro (with neutral, double rocker)',
meta: { multiEndpoint: true, multiEndpointSkip: ['power', 'energy'] },
endpoint: (device) => {
return { 'left': 1, 'right': 2 };
},
fromZigbee: [fromZigbee_1.default.on_off, lumi.fromZigbee.lumi_power, lumi.fromZigbee.lumi_specific, lumi.fromZigbee.lumi_action_multistate],
toZigbee: [toZigbee_1.default.on_off, lumi.toZigbee.lumi_switch_operation_mode_opple, lumi.toZigbee.lumi_switch_power_outage_memory,
lumi.toZigbee.lumi_led_disabled_night, lumi.toZigbee.lumi_flip_indicator_light],
exposes: [e.switch().withEndpoint('left'), e.switch().withEndpoint('right'), e.power(), e.energy(), e.voltage(),
e.device_temperature(), e.power_outage_memory(), e.led_disabled_night(), e.flip_indicator_light(),
e.action([
'single_left', 'single_right', 'single_both',
'double_left', 'double_right', 'double_both'
]),
e.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
.withDescription('Decoupled mode for left button').withEndpoint('left'),
e.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
.withDescription('Decoupled mode for right button').withEndpoint('right'),
e.power_outage_count()],
extend: [lumiZigbeeOTA(), lumiPreventReset()],
},
{
zigbeeModel: ['lumi.switch.n3acn1'],
model: 'QBKG32LM',
vendor: 'Aqara',
description: 'Smart wall switch H1 Pro (with neutral, triple rocker)',
meta: { multiEndpoint: true },
endpoint: (device) => {
return { 'left': 1, 'center': 2, 'right': 3 };
},
fromZigbee: [fromZigbee_1.default.on_off, lumi.fromZigbee.lumi_power, lumi.fromZigbee.lumi_specific, lumi.fromZigbee.lumi_action_multistate],
toZigbee: [toZigbee_1.default.on_off, lumi.toZigbee.lumi_switch_operation_mode_opple, lumi.toZigbee.lumi_switch_power_outage_memory,
lumi.toZigbee.lumi_led_disabled_night, lumi.toZigbee.lumi_flip_indicator_light],
exposes: [e.switch().withEndpoint('left'), e.switch().withEndpoint('right'), e.switch().withEndpoint('center'),
e.power(), e.energy(), e.voltage(), e.device_temperature(), e.power_outage_memory(), e.led_disabled_night(), e.flip_indicator_light(),
e.action([
'single_left', 'double_left', 'single_center', 'double_center',
'single_right', 'double_right', 'single_left_center', 'double_left_center',
'single_left_right', 'double_left_right', 'single_center_right', 'double_center_right',
'single_all', 'double_all'
]),
e.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
.withDescription('Decoupled mode for left button').withEndpoint('left'),
e.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
.withDescription('Decoupled mode for right button').withEndpoint('right'),
e.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
.withDescription('Decoupled mode for center button').withEndpoint('center'),
e.power_outage_count()],
extend: [lumiZigbeeOTA(), lumiPreventReset()],
},
{
zigbeeModel: ['lumi.switch.l1aeu1'],
model: 'WS-EUK01',
vendor: 'Aqara',
description: 'Smart wall switch H1 EU (no neutral, single rocker)',
fromZigbee: [fromZigbee_1.default.on_off, lumi.fromZigbee.lumi_action_multistate, lumi.fromZigbee.lumi_specific],
toZigbee: [toZigbee_1.default.on_off, lumi.toZigbee.lumi_switch_operation_mode_opple, lumi.toZigbee.lumi_switch_power_outage_memory,
lumi.toZigbee.lumi_flip_indicator_light, lumi.toZigbee.lumi_led_disabled_night, lumi.toZigbee.lumi_switch_mode_switch],
exposes: [e.switch(), e.action(['single', 'double']), e.power_outage_memory(), e.flip_indicator_light(),
e.led_disabled_night(), e.power_outage_count(), e.device_temperature().withAccess(ea.STATE),
e.operation_mode_select(['control_relay', 'decoupled']).withDescription('Switches between direct relay control and action sending only'),
e.mode_switch_select(['anti_flicker_mode', 'quick_mode'])
.withDescription('Features. Anti flicker mode can be used to solve blinking issues of some lights.' +
'Quick mode makes the device respond faster.')],
configure: async (device, coordinatorEndpoint) => {
const endpoint1 = device.getEndpoint(1);
// set "event" mode
await endpoint1.write('manuSpecificLumi', { 'mode': 1 }, { manufacturerCode: manufacturerCode, disableResponse: true });
},
extend: [lumiPreventReset()],
},
{
zigbeeModel: ['lumi.switch.l2aeu1'],
model: 'WS-EUK02',
vendor: 'Aqara',
description: 'Smart wall switch H1 EU (no neutral, double rocker)',
fromZigbee: [fromZigbee_1.default.on_off, lumi.fromZigbee.lumi_action_multistate, lumi.fromZigbee.lumi_specific],
toZigbee: [toZigbee_1.default.on_off, lumi.toZigbee.lumi_switch_operation_mode_opple, lumi.toZigbee.lumi_switch_power_outage_memory,
lumi.toZigbee.lumi_flip_indicator_light, lumi.toZigbee.lumi_led_disabled_night, lumi.toZigbee.lumi_switch_mode_switch],
meta: { multiEndpoint: true },
endpoint: (_device) => {
return { 'left': 1, 'right': 2 };
},
exposes: [e.switch().withEndpoint('left'), e.switch().withEndpoint('right'), e.power_outage_memory(),
e.flip_indicator_light(), e.led_disabled_night(), e.power_outage_count(),
e.device_temperature().withAccess(ea.STATE),
e.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
.withDescription('Decoupled mode for left button')
.withEndpoint('left'),
e.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
.withDescription('Decoupled mode for right button')
.withEndpoint('right'),
e.enum('mode_switch', ea.ALL, ['anti_flicker_mode', 'quick_mode'])
.withDescription('Anti flicker mode can be used to solve blinking issues of some lights.' +
'Quick mode makes the device respond faster.'),
e.action(['single_left', 'double_left', 'single_right', 'double_right', 'single_both', 'double_both'])],
configure: async (device, coordinatorEndpoint) => {
await device.getEndpoint(1).write('manuSpecificLumi', { 'mode': 1 }, { manufacturerCode: manufacturerCode, disableResponse: true });
},
extend: [lumiPreventReset()],
},
{
zigbeeModel: ['lumi.switch.n1aeu1'],
model: 'WS-EUK03',
vendor: 'Aqara',
description: 'Smart wall switch H1 EU (with neutral, single rocker)',
fromZigbee: [fromZigbee_1.default.on_off, lumi.fromZigbee.lumi_power, lumi.fromZigbee.lumi_action_multistate, lumi.fromZigbee.lumi_specific],
toZigbee: [toZigbee_1.default.on_off, lumi.toZigbee.lumi_power, lumi.toZigbee.lumi_switch_operation_mode_opple, lumi.toZigbee.lumi_switch_power_outage_memory,
lumi.toZigbee.lumi_flip_indicator_light, lumi.toZigbee.lumi_led_disabled_night],
exposes: [e.switch(), e.action(['single', 'double']), e.power().withAccess(ea.STATE_GET), e.energy(), e.flip_indicator_light(),
e.power_outage_memory(), e.device_temperature().withAccess(ea.STATE), e.led_disabled_night(), e.power_outage_count(),
e.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled']).withDescription('Decoupled mode')],
configure: async (device, coordinatorEndpoint) => {
const endpoint1 = device.getEndpoint(1);
// set "event" mode
await endpoint1.write('manuSpecificLumi', { 'mode': 1 }, { manufacturerCode: manufacturerCode, disableResponse: true });
},
extend: [lumiZigbeeOTA(), lumiPreventReset()],
},
{
zigbeeModel: ['lumi.switch.n2aeu1'],
model: 'WS-EUK04',
vendor: 'Aqara',
description: 'Smart wall switch H1 EU (with neutral, double rocker)',
fromZigbee: [fromZigbee_1.default.on_off, lumi.fromZigbee.lumi_power, lumi.fromZigbee.lumi_action_multistate, lumi.fromZigbee.lumi_specific],
toZigbee: [toZigbee_1.default.on_off, lumi.toZigbee.lumi_power, lumi.toZigbee.lumi_switch_operation_mode_opple, lumi.toZigbee.lumi_switch_power_outage_memory,
lumi.toZigbee.lumi_flip_indicator_light, lumi.toZigbee.lumi_led_disabled_night],
meta: { multiEndpoint: true, multiEndpointSkip: ['power', 'energy'] },
endpoint: (device) => {
return { 'left': 1, 'right': 2 };
},
exposes: [e.switch().withEndpoint('left'), e.switch().withEndpoint('right'), e.power().withAccess(ea.STATE_GET), e.energy(),
e.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled']).withDescription('Decoupled mode for left button')
.withEndpoint('left'),
e.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled']).withDescription('Decoupled mode for right button')
.withEndpoint('right'),
e.action(['single_left', 'double_left', 'single_right', 'double_right', 'single_both', 'double_both']),
e.device_temperature().withAccess(ea.STATE), e.power_outage_memory(), e.flip_indicator_light(),
e.led_disabled_night(), e.power_outage_count()],
configure: async (device, coordinatorEndpoint) => {
const endpoint1 = device.getEndpoint(1);
// set "event" mode
await endpoint1.write('manuSpecificLumi', { 'mode': 1 }, { manufacturerCode: manufacturerCode, disableResponse: true });
},
extend: [lumiPreventReset()],
},
{
zigbeeModel: ['lumi.ctrl_neutral1'],
model: 'QBKG04LM',
vendor: 'Aqara',
description: 'Smart wall switch (no neutral, single rocker)',
fromZigbee: [lumi.fromZigbee.lumi_on_off, lumi.fromZigbee.lumi_action, lumi.fromZigbee.lumi_operation_mode_basic,
lumi.legacyFromZigbee.QBKG04LM_QBKG11LM_click],
exposes: [
e.switch(), e.action(['release', 'hold', 'double', 'single', 'hold_release']),
e.enum('operation_mode', ea.STATE_SET, ['control_relay', 'decoupled'])
.withDescription('Decoupled mode'),
],
toZigbee: [toZigbee_1.default.on_off, { ...lumi.toZigbee.lumi_switch_operation_mode_basic, convertGet: null }],
endpoint: (device) => {
return { 'system': 1, 'default': 2 };
},
configure: async (device, coordinatorEndpoint) => {
// Device advertises itself as Router but is an EndDevice
device.type = 'EndDevice';
device.save();
},
extend: [lumiZigbeeOTA(), lumiPreventReset()],
},
{
zigbeeModel: ['lumi.ctrl_ln1.aq1', 'lumi.ctrl_ln1'],
model: 'QBKG11LM',
vendor: 'Aqara',
description: 'Smart wall switch (with neutral, single rocker)',
fromZigbee: [lumi.fromZigbee.lumi_action, lumi.fromZigbee.lumi_action_multistate, lumi.fromZigbee.lumi_on_off,
lumi.fromZigbee.lumi_basic, lumi.fromZigbee.lumi_operation_mode_basic,
fromZigbee_1.default.ignore_multistate_report, lumi.fromZigbee.lumi_power, lumi.legacyFromZigbee.QBKG04LM_QBKG11LM_click,
lumi.legacyFromZigbee.QBKG11LM_click,
],
exposes: [
e.switch(), e.power().withAccess(ea.STATE_GET), e.device_temperature(), e.energy(),
e.action(['single', 'double', 'release', 'hold']),
e.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
.withDescription('Decoupled mode'),
],
toZigbee: [toZigbee_1.default.on_off, lumi.toZigbee.lumi_switch_operation_mode_basic, lumi.toZigbee.lumi_power],
endpoint: (device) => {
return { 'system': 1 };
},
extend: [lumiZigbeeOTA(), lumiPreventReset()],
configure: async (device, coordinatorEndpoint) => {
device.powerSource = 'Mains (single phase)';
device.save();
},
},
{
zigbeeModel: ['lumi.ctrl_neutral2'],
model: 'QBKG03LM',
vendor: 'Aqara',
description: 'Smart wall switch (no neutral, double rocker)',
fromZigbee: [lumi.fromZigbee.lumi_action, lumi.fromZigbee.lumi_on_off,
lumi.fromZigbee.lumi_operation_mode_basic, lumi.fromZigbee.lumi_basic, lumi.legacyFromZigbee.QBKG03LM_QBKG12LM_click,
lumi.legacyFromZigbee.QBKG03LM_buttons,
],
exposes: [
e.switch().withEndpoint('left'),
e.switch().withEndpoint('right'),
e.device_temperature(),
e.action(['release_left', 'release_right', 'release_both', 'double_left', 'double_right',
'single_left', 'single_right', 'hold_release_left', 'hold_release_left']),
e.enum('operation_mode', ea.STATE_SET, ['control_left_relay', 'control_right_relay', 'decoupled'])
.withDescription('Operation mode for left button')
.withEndpoint('left')
.withCategory('config'),
e.enum('operation_mode', ea.STATE_SET, ['control_left_relay', 'control_right_relay', 'decoupled'])
.withDescription('Operation mode for right button')
.withEndpoint('right')
.withCategory('config'),
],
toZigbee: [toZigbee_1.default.on_off, { ...lumi.toZigbee.lumi_switch_operation_mode_basic, convertGet: null }, lumi.toZigbee.lumi_power],
meta: { multiEndpoint: true },
endpoint: (device) => {
return { 'system': 1, 'left': 2, 'right': 3 };
},
configure: async (device, coordinatorEndpoint) => {
// Device advertises itself as Router but is an EndDevice
device.type = 'EndDevice';
device.save();
},
extend: [lumiZigbeeOTA(), lumiPreventReset()],
},
{
zigbeeModel: ['lumi.ctrl_ln2.aq1', 'lumi.ctrl_ln2'],
model: 'QBKG12LM',
vendor: 'Aqara',
description: 'Smart wall switch (with neutral, double rocker)',
fromZigbee: [lumi.fromZigbee.lumi_action, lumi.fromZigbee.lumi_action_multistate, lumi.fromZigbee.lumi_on_off,
lumi.fromZigbee.lumi_basic, lumi.fromZigbee.lumi_operation_mode_basic, lumi.fromZigbee.lumi_power,
lumi.legacyFromZigbee.QBKG03LM_QBKG12LM_click, lumi.legacyFromZigbee.QBKG12LM_click,
],
exposes: [
e.switch().withEndpoint('left'),
e.switch().withEndpoint('right'),
e.device_temperature(), e.energy(),
e.power().withAccess(ea.STATE_GET),
e.action(['single_left', 'single_right', 'single_both', 'double_left', 'double_right', 'double_both',
'hold_left', 'hold_right', 'hold_both', 'release_left', 'release_right', 'release_both']),
e.enum('operation_mode', ea.ALL, ['control_left_relay', 'control_right_relay', 'decoupled'])
.withDescription('Operation mode for left button')
.withEndpoint('left'),
e.enum('operation_mode', ea.ALL, ['control_left_relay', 'control_right_relay', 'decoupled'])
.withDescription('Operation mode for right button')
.withEndpoint('right'),
],
meta: { multiEndpoint: true, multiEndpointSkip: ['power', 'energy'] },
toZigbee: [toZigbee_1.default.on_off, lumi.toZigbee.lumi_switch_operation_mode_basic, lumi.toZigbee.lumi_power],
endpoint: (device) => {
return { 'left': 1, 'right': 2, 'system': 1 };
},
extend: [lumiZigbeeOTA(), lumiPreventReset()],
configure: async (device, coordinatorEndpoint) => {
device.powerSource = 'Mains (single phase)';
device.save();
},
},
{
zigbeeModel: ['lumi.remote.b286acn02'],
model: 'WXKG07LM',
vendor: 'Aqara',
description: 'Wireless remote switch D1 (double rocker)',
meta: { battery: { voltageToPercentage: '3V_2850_3000' } },
fromZigbee: [lumi.fromZigbee.lumi_basic, lumi.fromZigbee.lumi_action, lumi.fromZigbee.lumi_action_multistate,
lumi.legacyFromZigbee.lumi_on_off_action, lumi.legacyFromZigbee.lumi_multistate_action,
],
toZigbee: [],
endpoint: (device) => {
return { left: 1, right: 2, both: 3 };
},
exposes: [e.battery(), e.battery_voltage(), e.action([
'single_left', 'single_right', 'single_both',
'double_left', 'double_right', 'double_both',
'hold_left', 'hold_right', 'hold_both'
])],
extend: [(0, modernExtend_1.quirkCheckinInterval)('1_HOUR'), lumiPreventReset()],
},
{
zigbeeModel: ['lumi.switch.b1lacn02'],
model: 'QBKG21LM',
vendor: 'Aqara',
description: 'Smart wall switch D1 (no neutral, single rocker)',
fromZigbee: [lumi.fromZigbee.lumi_on_off, lumi.fromZigbee.lumi_action, lumi.fromZigbee.lumi_operation_mode_basic,
lumi.legacyFromZigbee.QBKG04LM_QBKG11LM_click,
],
exposes: [
e.switch(), e.action(['release', 'hold', 'double', 'single', 'hold_release']),
e.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
.withDescription('Decoupled mode'),
],
toZigbee: [toZigbee_1.default.on_off, lumi.toZigbee.lumi_switch_operation_mode_basic],