zigbee-herdsman-converters
Version:
Collection of device converters to be used with zigbee-herdsman
1,002 lines • 119 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 () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.definitions = void 0;
const fz = __importStar(require("../converters/fromZigbee"));
const tz = __importStar(require("../converters/toZigbee"));
const exposes = __importStar(require("../lib/exposes"));
const legacy = __importStar(require("../lib/legacy"));
const m = __importStar(require("../lib/modernExtend"));
const reporting = __importStar(require("../lib/reporting"));
const tuya = __importStar(require("../lib/tuya"));
const zosung = __importStar(require("../lib/zosung"));
const e = exposes.presets;
const ea = exposes.access;
const fzZosung = zosung.fzZosung;
const tzZosung = zosung.tzZosung;
const ez = zosung.presetsZosung;
const exposesLocal = {
hour: (name) => e.numeric(name, ea.STATE_SET).withUnit("h").withValueMin(0).withValueMax(23),
minute: (name) => e.numeric(name, ea.STATE_SET).withUnit("m").withValueMin(0).withValueMax(59),
program_temperature: (name) => e.numeric(name, ea.STATE_SET).withUnit("°C").withValueMin(5).withValueMax(35).withValueStep(0.5),
};
exports.definitions = [
{
fingerprint: tuya.fingerprint("TS030F", ["_TZ3210_sxtfesc6"]),
model: "ADCBZI01",
vendor: "Moes",
description: "Curtain Robot",
fromZigbee: [fz.cover_position_tilt, tuya.fz.datapoints],
toZigbee: [tz.cover_position_tilt, tz.cover_state, tuya.tz.datapoints],
exposes: [
e.cover_position(),
e.position(),
e.battery(),
e.illuminance(),
e.enum("work_state", ea.STATE, ["standby", "opening", "closing"]).withDescription("Current work state"),
e.numeric("total_time", ea.STATE).withUnit("s").withDescription("Total operation time"),
e.enum("situation_set", ea.STATE_SET, ["fully_open", "fully_close"]).withDescription("Situation control"),
e.enum("fault", ea.STATE, ["none"]).withDescription("Fault status"),
e.enum("charging_status", ea.STATE, ["none", "uncharged", "charging", "charged"]).withDescription("Charging status"),
e.numeric("open_threshold", ea.STATE_SET).withValueMin(0).withValueMax(100).withDescription("Light threshold for opening"),
e.numeric("close_threshold", ea.STATE_SET).withValueMin(0).withValueMax(100).withDescription("Light threshold for closing"),
e.numeric("curtain_status", ea.STATE_SET).withValueMin(0).withValueMax(255).withDescription("Curtain status"),
e.numeric("total_distance", ea.STATE).withUnit("m").withDescription("Total distance traveled"),
e.numeric("factory_test", ea.STATE).withValueMin(0).withValueMax(100).withDescription("Factory test feedback"),
e.text("custom_week_prog_1", ea.STATE_SET).withDescription("Custom week program 1"),
e.text("custom_week_prog_2", ea.STATE_SET).withDescription("Custom week program 2"),
e.text("custom_week_prog_3", ea.STATE_SET).withDescription("Custom week program 3"),
e.text("custom_week_prog_4", ea.STATE_SET).withDescription("Custom week program 4"),
],
meta: {
tuyaDatapoints: [
[1, "state", tuya.valueConverterBasic.lookup({ open: 0, stop: 1, close: 2 })], // Control - open/stop/close
[2, "position", tuya.valueConverter.coverPosition], // Percent control - set position (0-100)
[3, "position", tuya.valueConverter.coverPositionInverted], // Percent state - current position (0-100)
[7, "work_state", tuya.valueConverterBasic.lookup({ standby: 0, opening: 1, closing: 2 })], // Work state
[10, "total_time", tuya.valueConverter.raw], // Total time (0-120000)
[11, "situation_set", tuya.valueConverterBasic.lookup({ fully_open: 0, fully_close: 1 })], // Situation control
[12, "fault", tuya.valueConverterBasic.lookup({ none: 0 })], // Fault (only 'none' available)
[13, "battery", tuya.valueConverter.raw], // Battery percentage (0-100)
[
101,
"charging_status",
tuya.valueConverterBasic.lookup({
none: 0,
uncharged: 1,
charging: 2,
charged: 3,
}),
], // Charging status
[103, "custom_week_prog_1", tuya.valueConverter.raw], // Custom week program 1
[104, "custom_week_prog_2", tuya.valueConverter.raw], // Custom week program 2
[105, "custom_week_prog_3", tuya.valueConverter.raw], // Custom week program 3
[106, "custom_week_prog_4", tuya.valueConverter.raw], // Custom week program 4
[107, "illuminance", tuya.valueConverter.raw], // Light intensity (0-100)
[108, "open_threshold", tuya.valueConverter.raw], // Open window threshold (0-100)
[109, "close_threshold", tuya.valueConverter.raw], // Close window threshold (0-100)
[110, "curtain_status", tuya.valueConverter.raw], // Curtain status (0-255)
[111, "factory_test", tuya.valueConverter.raw], // Factory test (0-100)
[112, "total_distance", tuya.valueConverter.raw], // Total running distance in meters
],
},
},
{
fingerprint: tuya.fingerprint("TS0601", ["_TZE204_zxkwaztm"]),
model: "ZHT-S03",
vendor: "Moes",
description: "Zigbee wall thermostat",
extend: [tuya.modernExtend.tuyaBase({ dp: true, forceTimeUpdates: true, timeStart: "1970" })],
exposes: [
e.child_lock(),
e
.climate()
.withSystemMode(["off", "heat"], ea.STATE)
.withSetpoint("current_heating_setpoint", 5, 35, 0.5, ea.STATE_SET)
.withRunningState(["idle", "heat"], ea.STATE)
.withPreset(["schedule", "manual"])
.withLocalTemperature(ea.STATE)
.withLocalTemperatureCalibration(-9.9, 9.9, 0.1, ea.STATE_SET),
e
.numeric("temperature_delta", ea.STATE_SET)
.withUnit("°C")
.withValueMax(10)
.withValueMin(0.1)
.withValueStep(0.1)
.withPreset("default", 1, "Default value")
.withDescription("The delta between local_temperature and current_heating_setpoint to trigger Heat"),
e.enum("working_day", ea.STATE_SET, ["mon_fri", "mon_sat", "mon_sun"]).withDescription("Workday setting"),
e.text("schedule_weekday", ea.STATE_SET).withDescription("Workdays (6 times `hh:mm/cc.c°C`)"),
e.text("schedule_holiday", ea.STATE_SET).withDescription("Holidays (2 times `hh:mm/cc.c°C)`"),
e.binary("frost_protection", ea.STATE_SET, "ON", "OFF").withDescription("Antifreeze function"),
],
meta: {
tuyaDatapoints: [
[
36,
"running_state",
tuya.valueConverterBasic.lookup({
cool: tuya.enum(2),
heat: tuya.enum(1),
idle: tuya.enum(0),
}),
],
[1, "system_mode", tuya.valueConverterBasic.lookup({ heat: true, off: false })],
[
2,
"preset",
tuya.valueConverterBasic.lookup({
schedule: tuya.enum(0),
manual: tuya.enum(1),
}),
],
[10, "frost_protection", tuya.valueConverter.onOff],
[16, "current_heating_setpoint", tuya.valueConverter.divideBy10],
[24, "local_temperature", tuya.valueConverter.divideBy10],
[40, "child_lock", tuya.valueConverter.lockUnlock],
[109, "local_temperature_calibration", tuya.valueConverter.localTempCalibration3],
[112, "temperature_delta", tuya.valueConverter.divideBy10],
[
31,
"working_day",
tuya.valueConverterBasic.lookup({
mon_fri: tuya.enum(0),
mon_sat: tuya.enum(1),
mon_sun: tuya.enum(2),
}),
],
[67, null, tuya.valueConverter.ZWT198_schedule],
[67, "schedule_weekday", tuya.valueConverter.ZWT198_schedule],
[68, "schedule_holiday", tuya.valueConverter.ZWT198_schedule],
],
},
},
{
fingerprint: tuya.fingerprint("TS0601", ["_TZE284_a1ovdobn", "_TZE200_a1ovdobn"]),
model: "ZS-D1",
vendor: "Moes",
description: "Intelligent dimming switch - 1 gang",
extend: [tuya.modernExtend.tuyaBase({ dp: true })],
exposes: (device, options) => {
return [
e.switch().withEndpoint("l1"),
e.numeric("brightness_1", ea.STATE_SET).withValueMin(10).withValueMax(1000).withValueStep(1).withDescription("Channel 1 brightness"),
e
.numeric("brightness_min_1", ea.STATE_SET)
.withValueMin(10)
.withValueMax(1000)
.withValueStep(1)
.withDescription("Channel 1 minimum brightness"),
e
.numeric("brightness_max_1", ea.STATE_SET)
.withValueMin(10)
.withValueMax(1000)
.withValueStep(1)
.withDescription("Channel 1 maximum brightness"),
e
.numeric("countdown_1", ea.STATE_SET)
.withValueMin(0)
.withValueMax(86400)
.withValueStep(1)
.withUnit("s")
.withDescription("Channel 1 countdown"),
e.enum("relay_status", ea.STATE_SET, ["off", "on", "memory"]).withDescription("Relay mode after power restoration"),
e.enum("light_mode", ea.STATE_SET, ["none", "relay", "pos"]).withDescription("Indicator light mode"),
e.binary("switch_backlight", ea.STATE_SET, "ON", "OFF").withDescription("Backlight switch"),
];
},
meta: {
multiEndpoint: true,
tuyaDatapoints: [
[1, "state_l1", tuya.valueConverter.onOff],
[2, "brightness_1", tuya.valueConverter.raw],
[3, "brightness_min_1", tuya.valueConverter.raw],
[5, "brightness_max_1", tuya.valueConverter.raw],
[6, "countdown_1", tuya.valueConverter.raw],
[
14,
"relay_status",
tuya.valueConverterBasic.lookup({
off: tuya.enum(0),
on: tuya.enum(1),
memory: tuya.enum(2),
}),
],
[
21,
"light_mode",
tuya.valueConverterBasic.lookup({
none: tuya.enum(0),
relay: tuya.enum(1),
pos: tuya.enum(2),
}),
],
[26, "switch_backlight", tuya.valueConverter.onOff],
],
},
endpoint: (device) => {
return {
l1: 1,
};
},
},
{
fingerprint: tuya.fingerprint("TS0601", ["_TZE200_rlqamjhp"]),
model: "ZS-D2",
vendor: "Moes",
description: "Intelligent dimming switch - 2 gang",
extend: [tuya.modernExtend.tuyaBase({ dp: true })],
exposes: (device, options) => {
return [
e.switch().withEndpoint("l1"),
e.numeric("brightness_1", ea.STATE_SET).withValueMin(10).withValueMax(1000).withValueStep(1).withDescription("Channel 1 brightness"),
e
.numeric("brightness_min_1", ea.STATE_SET)
.withValueMin(10)
.withValueMax(1000)
.withValueStep(1)
.withDescription("Channel 1 minimum brightness"),
e
.numeric("brightness_max_1", ea.STATE_SET)
.withValueMin(10)
.withValueMax(1000)
.withValueStep(1)
.withDescription("Channel 1 maximum brightness"),
e
.numeric("countdown_1", ea.STATE_SET)
.withValueMin(0)
.withValueMax(86400)
.withValueStep(1)
.withUnit("s")
.withDescription("Channel 1 countdown"),
e.switch().withEndpoint("l2"),
e.numeric("brightness_2", ea.STATE_SET).withValueMin(10).withValueMax(1000).withValueStep(1).withDescription("Channel 2 brightness"),
e
.numeric("brightness_min_2", ea.STATE_SET)
.withValueMin(10)
.withValueMax(1000)
.withValueStep(1)
.withDescription("Channel 2 minimum brightness"),
e
.numeric("brightness_max_2", ea.STATE_SET)
.withValueMin(10)
.withValueMax(1000)
.withValueStep(1)
.withDescription("Channel 2 maximum brightness"),
e
.numeric("countdown_2", ea.STATE_SET)
.withValueMin(0)
.withValueMax(86400)
.withValueStep(1)
.withUnit("s")
.withDescription("Channel 2 countdown"),
e.enum("relay_status", ea.STATE_SET, ["off", "on", "memory"]).withDescription("Relay mode after power restoration"),
e.enum("light_mode", ea.STATE_SET, ["none", "relay", "pos"]).withDescription("Indicator light mode"),
e.binary("switch_backlight", ea.STATE_SET, "ON", "OFF").withDescription("Backlight switch"),
];
},
meta: {
multiEndpoint: true,
tuyaDatapoints: [
[1, "state_l1", tuya.valueConverter.onOff],
[2, "brightness_1", tuya.valueConverter.raw],
[3, "brightness_min_1", tuya.valueConverter.raw],
[5, "brightness_max_1", tuya.valueConverter.raw],
[6, "countdown_1", tuya.valueConverter.raw],
[7, "state_l2", tuya.valueConverter.onOff],
[8, "brightness_2", tuya.valueConverter.raw],
[9, "brightness_min_2", tuya.valueConverter.raw],
[11, "brightness_max_2", tuya.valueConverter.raw],
[12, "countdown_2", tuya.valueConverter.raw],
[
14,
"relay_status",
tuya.valueConverterBasic.lookup({
off: tuya.enum(0),
on: tuya.enum(1),
memory: tuya.enum(2),
}),
],
[
21,
"light_mode",
tuya.valueConverterBasic.lookup({
none: tuya.enum(0),
relay: tuya.enum(1),
pos: tuya.enum(2),
}),
],
[26, "switch_backlight", tuya.valueConverter.onOff],
],
},
endpoint: (device) => {
return {
l1: 1,
l2: 1,
};
},
},
{
fingerprint: tuya.fingerprint("TS0601", ["_TZE284_vizxbhco"]),
model: "ZS-D3",
vendor: "Moes",
description: "Intelligent dimming switch - 3 gang",
extend: [tuya.modernExtend.tuyaBase({ dp: true })],
exposes: (device, options) => {
return [
e.switch().withEndpoint("l1"),
e.switch().withEndpoint("l2"),
e.switch().withEndpoint("l3"),
e.numeric("brightness_1", ea.STATE_SET).withValueMin(10).withValueMax(1000).withValueStep(1).withDescription("Channel 1 brightness"),
e
.numeric("brightness_min_1", ea.STATE_SET)
.withValueMin(10)
.withValueMax(1000)
.withValueStep(1)
.withDescription("Channel 1 minimum brightness"),
e
.numeric("brightness_max_1", ea.STATE_SET)
.withValueMin(10)
.withValueMax(1000)
.withValueStep(1)
.withDescription("Channel 1 maximum brightness"),
e
.numeric("countdown_1", ea.STATE_SET)
.withValueMin(0)
.withValueMax(86400)
.withValueStep(1)
.withUnit("s")
.withDescription("Channel 1 countdown"),
e.numeric("brightness_2", ea.STATE_SET).withValueMin(10).withValueMax(1000).withValueStep(1).withDescription("Channel 2 brightness"),
e
.numeric("brightness_min_2", ea.STATE_SET)
.withValueMin(10)
.withValueMax(1000)
.withValueStep(1)
.withDescription("Channel 2 minimum brightness"),
e
.numeric("brightness_max_2", ea.STATE_SET)
.withValueMin(10)
.withValueMax(1000)
.withValueStep(1)
.withDescription("Channel 2 maximum brightness"),
e
.numeric("countdown_2", ea.STATE_SET)
.withValueMin(0)
.withValueMax(86400)
.withValueStep(1)
.withUnit("s")
.withDescription("Channel 2 countdown"),
e.enum("relay_status", ea.STATE_SET, ["off", "on", "memory"]).withDescription("Relay mode after power restoration"),
e.numeric("brightness_3", ea.STATE_SET).withValueMin(10).withValueMax(1000).withValueStep(1).withDescription("Channel 3 brightness"),
e
.numeric("brightness_min_3", ea.STATE_SET)
.withValueMin(10)
.withValueMax(1000)
.withValueStep(1)
.withDescription("Channel 3 minimum brightness"),
e
.numeric("brightness_max_3", ea.STATE_SET)
.withValueMin(10)
.withValueMax(1000)
.withValueStep(1)
.withDescription("Channel 3 maximum brightness"),
e
.numeric("countdown_3", ea.STATE_SET)
.withValueMin(0)
.withValueMax(86400)
.withValueStep(1)
.withUnit("s")
.withDescription("Channel 3 countdown"),
e.enum("light_mode", ea.STATE_SET, ["none", "relay", "pos"]).withDescription("Indicator light mode"),
e.binary("switch_backlight", ea.STATE_SET, "ON", "OFF").withDescription("Backlight switch"),
];
},
meta: {
multiEndpoint: true,
tuyaDatapoints: [
[1, "state_l1", tuya.valueConverter.onOff],
[2, "brightness_1", tuya.valueConverter.raw],
[3, "brightness_min_1", tuya.valueConverter.raw],
[5, "brightness_max_1", tuya.valueConverter.raw],
[6, "countdown_1", tuya.valueConverter.raw],
[7, "state_l2", tuya.valueConverter.onOff],
[8, "brightness_2", tuya.valueConverter.raw],
[9, "brightness_min_2", tuya.valueConverter.raw],
[11, "brightness_max_2", tuya.valueConverter.raw],
[12, "countdown_2", tuya.valueConverter.raw],
[
14,
"relay_status",
tuya.valueConverterBasic.lookup({
off: tuya.enum(0),
on: tuya.enum(1),
memory: tuya.enum(2),
}),
],
[15, "state_l3", tuya.valueConverter.onOff],
[16, "brightness_3", tuya.valueConverter.raw],
[17, "brightness_min_3", tuya.valueConverter.raw],
[19, "brightness_max_3", tuya.valueConverter.raw],
[20, "countdown_3", tuya.valueConverter.raw],
[
21,
"light_mode",
tuya.valueConverterBasic.lookup({
none: tuya.enum(0),
relay: tuya.enum(1),
pos: tuya.enum(2),
}),
],
[26, "switch_backlight", tuya.valueConverter.onOff],
],
},
endpoint: (device) => {
return {
l1: 1,
l2: 1,
l3: 1,
};
},
},
{
fingerprint: tuya.fingerprint("TS0601", ["_TZE284_upt8lzi0"]),
model: "ZS-SF-EUC-WH-MS",
vendor: "Moes",
description: "Star feather Zigbee curtain switch",
extend: [tuya.modernExtend.tuyaBase({ dp: true })],
options: [exposes.options.invert_cover()],
exposes: [e.cover_position().setAccess("position", ea.STATE_SET)],
meta: {
tuyaDatapoints: [
[1, "state", tuya.valueConverterBasic.lookup({ OPEN: tuya.enum(0), STOP: tuya.enum(1), CLOSE: tuya.enum(2) })],
[2, "position", tuya.valueConverter.coverPosition],
],
},
},
{
fingerprint: tuya.fingerprint("TS0601", ["_TZE200_stvgmdjz", "_TZE200_ydkqbmpt", "_TZE200_z3u99qxt"]),
model: "SFL02-Z-1",
vendor: "Moes",
description: "Star feather smart switch 1 gang",
extend: [tuya.modernExtend.tuyaBase({ dp: true })],
whiteLabel: [tuya.whitelabel("Nova Digital", "TPZ-1", "Topazio smart switch 1 gang", ["_TZE200_ydkqbmpt"])],
exposes: [
tuya.exposes.backlightModeOffOn().withAccess(ea.STATE_SET),
e.switch().withEndpoint("l1").setAccess("state", ea.STATE_SET),
tuya.exposes.countdown().withEndpoint("l1"),
e
.numeric("momentary_1", ea.STATE_SET)
.withValueMin(0)
.withValueMax(3600)
.withValueStep(1)
.withUnit("s")
.withDescription("Momentary switch timer (0=disable)"),
e.power_on_behavior().withAccess(ea.STATE_SET),
exposes.enum("mode", ea.STATE_SET, ["switch_1", "scene_1"]).withEndpoint("l1").withDescription("Switch1 mode"),
e.action(["scene_1"]),
exposes.enum("indicator_status", ea.ALL, ["off", "relay", "invert"]).withDescription("Indicator status"),
exposes.enum("induction_mode", ea.ALL, ["ON", "OFF"]).withDescription("Induction mode"),
exposes.enum("vibration_mode", ea.ALL, ["Gear 0", "Gear 1", "Gear 2", "Gear 3"]).withDescription("Vibration"),
],
endpoint: (device) => {
return {
l1: 1,
state: 1,
backlight: 1,
induction: 1,
};
},
meta: {
multiEndpoint: true,
tuyaDatapoints: [
[1, "action", tuya.valueConverter.static("scene_1")],
[18, "mode_l1", tuya.valueConverterBasic.lookup({ switch_1: tuya.enum(0), scene_1: tuya.enum(1) })],
[24, "state_l1", tuya.valueConverter.onOff],
[30, "countdown_l1", tuya.valueConverter.countdown],
[36, "backlight_mode", tuya.valueConverter.onOff],
[37, "indicator_status", tuya.valueConverterBasic.lookup({ off: tuya.enum(0), relay: tuya.enum(1), invert: tuya.enum(2) })],
[38, "power_on_behavior", tuya.valueConverter.powerOnBehaviorEnum],
[103, "induction_mode", tuya.valueConverter.onOff],
[
104,
"vibration_mode",
tuya.valueConverterBasic.lookup({ "Gear 0": tuya.enum(0), "Gear 1": tuya.enum(1), "Gear 2": tuya.enum(2), "Gear 3": tuya.enum(3) }),
],
[105, "momentary_1", tuya.valueConverter.countdown],
],
},
},
{
fingerprint: tuya.fingerprint("TS0601", ["_TZE200_uenof8jd", "_TZE200_tzyy0rtq", "_TZE200_hktk6hze"]),
model: "SFL02-Z-2",
vendor: "Moes",
description: "Star feather smart switch 2 gangs",
whiteLabel: [tuya.whitelabel("Nova Digital", "TPZ-2", "Topazio smart switch 2 gangs", ["_TZE200_hktk6hze"])],
exposes: [
tuya.exposes.backlightModeOffOn().withAccess(ea.STATE_SET),
e.switch().withEndpoint("l1").setAccess("state", ea.STATE_SET),
e.switch().withEndpoint("l2").setAccess("state", ea.STATE_SET),
tuya.exposes.countdown().withEndpoint("l1"),
tuya.exposes.countdown().withEndpoint("l2"),
e
.numeric("momentary_1", ea.STATE_SET)
.withValueMin(0)
.withValueMax(3600)
.withValueStep(1)
.withUnit("s")
.withDescription("Momentary switch timer (0=disable)"),
e
.numeric("momentary_2", ea.STATE_SET)
.withValueMin(0)
.withValueMax(3600)
.withValueStep(1)
.withUnit("s")
.withDescription("Momentary switch timer (0=disable)"),
e.power_on_behavior().withAccess(ea.STATE_SET),
exposes.enum("mode", ea.STATE_SET, ["switch_1", "scene_1"]).withEndpoint("l1").withDescription("Switch1 mode"),
exposes.enum("mode", ea.STATE_SET, ["switch_2", "scene_2"]).withEndpoint("l2").withDescription("Switch2 mode"),
e.action(["scene_1", "scene_2"]),
exposes.enum("indicator_status", ea.ALL, ["off", "relay", "invert"]).withDescription("Indicator status"),
exposes.enum("induction_mode", ea.ALL, ["ON", "OFF"]).withDescription("Induction mode"),
exposes.enum("vibration_mode", ea.ALL, ["Gear 0", "Gear 1", "Gear 2", "Gear 3"]).withDescription("Vibration"),
],
extend: [tuya.modernExtend.tuyaBase({ dp: true })],
endpoint: (device) => {
return { l1: 1, l2: 1, state: 1, backlight: 1 };
},
meta: {
multiEndpoint: true,
tuyaDatapoints: [
[1, "action", tuya.valueConverter.static("scene_1")],
[2, "action", tuya.valueConverter.static("scene_2")],
[18, "mode_l1", tuya.valueConverterBasic.lookup({ switch_1: tuya.enum(0), scene_1: tuya.enum(1) })],
[19, "mode_l2", tuya.valueConverterBasic.lookup({ switch_2: tuya.enum(0), scene_2: tuya.enum(1) })],
[24, "state_l1", tuya.valueConverter.onOff],
[25, "state_l2", tuya.valueConverter.onOff],
[30, "countdown_l1", tuya.valueConverter.countdown],
[31, "countdown_l2", tuya.valueConverter.countdown],
[37, "indicator_status", tuya.valueConverterBasic.lookup({ off: tuya.enum(0), relay: tuya.enum(1), invert: tuya.enum(2) })],
[36, "backlight_mode", tuya.valueConverter.onOff],
[38, "power_on_behavior", tuya.valueConverter.powerOnBehaviorEnum],
[103, "induction_mode", tuya.valueConverter.onOff],
[
104,
"vibration_mode",
tuya.valueConverterBasic.lookup({ "Gear 0": tuya.enum(0), "Gear 1": tuya.enum(1), "Gear 2": tuya.enum(2), "Gear 3": tuya.enum(3) }),
],
[105, "momentary_1", tuya.valueConverter.countdown],
[106, "momentary_2", tuya.valueConverter.countdown],
],
},
},
{
fingerprint: tuya.fingerprint("TS0601", ["_TZE200_rd8cdssd", "_TZE200_wv9ukqca", "_TZE200_zo0cfekv"]),
model: "SFL02-Z-3",
vendor: "Moes",
description: "Star feather smart switch 3 gangs",
extend: [tuya.modernExtend.tuyaBase({ dp: true })],
whiteLabel: [tuya.whitelabel("Nova Digital", "TPZ-3", "Topazio smart switch 3 gangs", ["_TZE200_rd8cdssd"])],
exposes: [
e.switch().withEndpoint("l1").setAccess("state", ea.STATE_SET),
e.switch().withEndpoint("l2").setAccess("state", ea.STATE_SET),
e.switch().withEndpoint("l3").setAccess("state", ea.STATE_SET),
tuya.exposes.countdown().withEndpoint("l1"),
tuya.exposes.countdown().withEndpoint("l2"),
tuya.exposes.countdown().withEndpoint("l3"),
e
.numeric("momentary_1", ea.STATE_SET)
.withValueMin(0)
.withValueMax(3600)
.withValueStep(1)
.withUnit("s")
.withDescription("Momentary switch timer (0=disable)"),
e
.numeric("momentary_2", ea.STATE_SET)
.withValueMin(0)
.withValueMax(3600)
.withValueStep(1)
.withUnit("s")
.withDescription("Momentary switch timer (0=disable)"),
e
.numeric("momentary_3", ea.STATE_SET)
.withValueMin(0)
.withValueMax(3600)
.withValueStep(1)
.withUnit("s")
.withDescription("Momentary switch timer (0=disable)"),
exposes.enum("mode", ea.STATE_SET, ["switch_1", "scene_1"]).withEndpoint("l1").withDescription("Switch1 mode"),
exposes.enum("mode", ea.STATE_SET, ["switch_2", "scene_2"]).withEndpoint("l2").withDescription("Switch2 mode"),
exposes.enum("mode", ea.STATE_SET, ["switch_3", "scene_3"]).withEndpoint("l3").withDescription("Switch3 mode"),
e.action(["scene_1", "scene_2", "scene_3"]),
tuya.exposes.backlightModeOffOn().withAccess(ea.STATE_SET),
e.power_on_behavior().withAccess(ea.STATE_SET),
exposes.enum("indicator_status", ea.ALL, ["off", "relay", "invert"]).withDescription("Indicator status"),
exposes.enum("induction_mode", ea.ALL, ["ON", "OFF"]).withDescription("Induction mode"),
exposes.enum("vibration_mode", ea.ALL, ["Gear 0", "Gear 1", "Gear 2", "Gear 3"]).withDescription("Vibration"),
],
endpoint: (device) => {
return {
l1: 1,
l2: 1,
l3: 1,
l4: 1,
state: 1,
backlight: 1,
induction: 1,
};
},
meta: {
multiEndpoint: true,
tuyaDatapoints: [
[1, "action", tuya.valueConverter.static("scene_1")],
[2, "action", tuya.valueConverter.static("scene_2")],
[3, "action", tuya.valueConverter.static("scene_3")],
[18, "mode_l1", tuya.valueConverterBasic.lookup({ switch_1: tuya.enum(0), scene_1: tuya.enum(1) })],
[19, "mode_l2", tuya.valueConverterBasic.lookup({ switch_2: tuya.enum(0), scene_2: tuya.enum(1) })],
[20, "mode_l3", tuya.valueConverterBasic.lookup({ switch_3: tuya.enum(0), scene_3: tuya.enum(1) })],
[24, "state_l1", tuya.valueConverter.onOff],
[25, "state_l2", tuya.valueConverter.onOff],
[26, "state_l3", tuya.valueConverter.onOff],
[30, "countdown_l1", tuya.valueConverter.countdown],
[31, "countdown_l2", tuya.valueConverter.countdown],
[32, "countdown_l3", tuya.valueConverter.countdown],
[36, "backlight_mode", tuya.valueConverter.onOff],
[37, "indicator_status", tuya.valueConverterBasic.lookup({ off: tuya.enum(0), relay: tuya.enum(1), invert: tuya.enum(2) })],
[38, "power_on_behavior", tuya.valueConverter.powerOnBehaviorEnum],
[103, "induction_mode", tuya.valueConverter.onOff],
[
104,
"vibration_mode",
tuya.valueConverterBasic.lookup({ "Gear 0": tuya.enum(0), "Gear 1": tuya.enum(1), "Gear 2": tuya.enum(2), "Gear 3": tuya.enum(3) }),
],
[105, "momentary_1", tuya.valueConverter.countdown],
[106, "momentary_2", tuya.valueConverter.countdown],
[107, "momentary_3", tuya.valueConverter.countdown],
],
},
},
{
fingerprint: tuya.fingerprint("TS0601", ["_TZE200_dq8bu0pt", "_TZE200_hmabvy81", "_TZE200_9dhenr94"]),
model: "SFL02-Z-4",
vendor: "Moes",
description: "Star feather smart switch 4 gangs",
extend: [tuya.modernExtend.tuyaBase({ dp: true })],
whiteLabel: [tuya.whitelabel("Nova Digital", "TPZ-4", "Topazio smart switch 4 gangs", ["_TZE200_hmabvy81"])],
exposes: [
e.switch().withEndpoint("l1").setAccess("state", ea.STATE_SET),
e.switch().withEndpoint("l2").setAccess("state", ea.STATE_SET),
e.switch().withEndpoint("l3").setAccess("state", ea.STATE_SET),
e.switch().withEndpoint("l4").setAccess("state", ea.STATE_SET),
tuya.exposes.countdown().withEndpoint("l1"),
tuya.exposes.countdown().withEndpoint("l2"),
tuya.exposes.countdown().withEndpoint("l3"),
tuya.exposes.countdown().withEndpoint("l4"),
e
.numeric("momentary_1", ea.STATE_SET)
.withValueMin(0)
.withValueMax(3600)
.withValueStep(1)
.withUnit("s")
.withDescription("Momentary switch timer (0=disable)"),
e
.numeric("momentary_2", ea.STATE_SET)
.withValueMin(0)
.withValueMax(3600)
.withValueStep(1)
.withUnit("s")
.withDescription("Momentary switch timer (0=disable)"),
e
.numeric("momentary_3", ea.STATE_SET)
.withValueMin(0)
.withValueMax(3600)
.withValueStep(1)
.withUnit("s")
.withDescription("Momentary switch timer (0=disable)"),
e
.numeric("momentary_4", ea.STATE_SET)
.withValueMin(0)
.withValueMax(3600)
.withValueStep(1)
.withUnit("s")
.withDescription("Momentary switch timer (0=disable)"),
exposes.enum("mode", ea.STATE_SET, ["switch_1", "scene_1"]).withEndpoint("l1").withDescription("Switch1 mode"),
exposes.enum("mode", ea.STATE_SET, ["switch_2", "scene_2"]).withEndpoint("l2").withDescription("Switch2 mode"),
exposes.enum("mode", ea.STATE_SET, ["switch_3", "scene_3"]).withEndpoint("l3").withDescription("Switch3 mode"),
exposes.enum("mode", ea.STATE_SET, ["switch_4", "scene_4"]).withEndpoint("l4").withDescription("Switch4 mode"),
e.action(["scene_1", "scene_2", "scene_3", "scene_4"]),
tuya.exposes.backlightModeOffOn().withAccess(ea.STATE_SET),
e.power_on_behavior().withAccess(ea.STATE_SET),
exposes.enum("indicator_status", ea.ALL, ["off", "relay", "invert"]).withDescription("Indicator status"),
exposes.enum("induction_mode", ea.ALL, ["ON", "OFF"]).withDescription("Induction mode"),
exposes.enum("vibration_mode", ea.ALL, ["Gear 0", "Gear 1", "Gear 2", "Gear 3"]).withDescription("Vibration"),
],
endpoint: (device) => {
return {
l1: 1,
l2: 1,
l3: 1,
l4: 1,
state: 1,
backlight: 1,
induction: 1,
};
},
meta: {
multiEndpoint: true,
tuyaDatapoints: [
[1, "action", tuya.valueConverter.static("scene_1")],
[2, "action", tuya.valueConverter.static("scene_2")],
[3, "action", tuya.valueConverter.static("scene_3")],
[4, "action", tuya.valueConverter.static("scene_4")],
[18, "mode_l1", tuya.valueConverterBasic.lookup({ switch_1: tuya.enum(0), scene_1: tuya.enum(1) })],
[19, "mode_l2", tuya.valueConverterBasic.lookup({ switch_2: tuya.enum(0), scene_2: tuya.enum(1) })],
[20, "mode_l3", tuya.valueConverterBasic.lookup({ switch_3: tuya.enum(0), scene_3: tuya.enum(1) })],
[21, "mode_l4", tuya.valueConverterBasic.lookup({ switch_4: tuya.enum(0), scene_4: tuya.enum(1) })],
[24, "state_l1", tuya.valueConverter.onOff],
[25, "state_l2", tuya.valueConverter.onOff],
[26, "state_l3", tuya.valueConverter.onOff],
[27, "state_l4", tuya.valueConverter.onOff],
[30, "countdown_l1", tuya.valueConverter.countdown],
[31, "countdown_l2", tuya.valueConverter.countdown],
[32, "countdown_l3", tuya.valueConverter.countdown],
[33, "countdown_l4", tuya.valueConverter.countdown],
[36, "backlight_mode", tuya.valueConverter.onOff],
[37, "indicator_status", tuya.valueConverterBasic.lookup({ off: tuya.enum(0), relay: tuya.enum(1), invert: tuya.enum(2) })],
[38, "power_on_behavior", tuya.valueConverter.powerOnBehaviorEnum],
[103, "induction_mode", tuya.valueConverter.onOff],
[
104,
"vibration_mode",
tuya.valueConverterBasic.lookup({ "Gear 0": tuya.enum(0), "Gear 1": tuya.enum(1), "Gear 2": tuya.enum(2), "Gear 3": tuya.enum(3) }),
],
[105, "momentary_1", tuya.valueConverter.countdown],
[106, "momentary_2", tuya.valueConverter.countdown],
[107, "momentary_3", tuya.valueConverter.countdown],
[108, "momentary_4", tuya.valueConverter.countdown],
],
},
},
{
fingerprint: tuya.fingerprint("TS0601", ["_TZE200_ivdc0kwl"]),
model: "ZTRV-S01",
vendor: "Moes",
description: "Zigbee temperature control valve",
extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
exposes: [
e
.climate()
.withLocalTemperature(ea.STATE)
.withSetpoint("current_heating_setpoint", 5, 35, 0.5, ea.STATE_SET)
.withLocalTemperatureCalibration(-10, 10, 0.5, ea.STATE_SET)
.withPreset(["auto", "manual", "off", "on"])
.withRunningState(["idle", "heat"], ea.STATE),
e.window_detection_bool(),
e.child_lock(),
e.binary("frost_protection", ea.STATE_SET, "ON", "OFF"),
e.binary("eco", ea.STATE_SET, "ON", "OFF").withDescription("Eco mode"),
e.eco_temperature().withValueMin(5).withValueMax(35).withValueStep(0.5),
e.binary("window", ea.STATE, "OPENED", "CLOSED").withDescription("Window status closed or open "),
...tuya.exposes.scheduleAllDays(ea.STATE_SET, "HH:MM/C HH:MM/C HH:MM/C HH:MM/C"),
e.min_temperature().withValueMin(5).withValueMax(15),
e.max_temperature().withValueMin(20).withValueMax(35),
e.position(),
e.battery(),
e.enum("screen_orientation", ea.STATE_SET, ["0", "1"]).withDescription("Screen orientation"),
],
meta: {
tuyaDatapoints: [
[
2,
"preset",
tuya.valueConverterBasic.lookup({
auto: tuya.enum(0),
manual: tuya.enum(1),
off: tuya.enum(2),
on: tuya.enum(3),
holiday: tuya.enum(4),
}),
],
[3, "running_state", tuya.valueConverterBasic.lookup({ heat: 0, idle: 1 })],
[6, "battery", tuya.valueConverter.raw],
[
7,
"child_lock",
tuya.valueConverterBasic.lookup({
LOCK: true,
UNLOCK: false,
}),
],
[9, "max_temperature", tuya.valueConverter.divideBy10],
[10, "min_temperature", tuya.valueConverter.divideBy10],
[14, "window_detection", tuya.valueConverterBasic.raw()],
[
15,
"window",
tuya.valueConverterBasic.lookup({
CLOSED: tuya.enum(0),
OPENED: tuya.enum(1),
}),
],
[21, "holiday_temperature", tuya.valueConverter.divideBy10], //
[28, "schedule_monday", tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(1)],
[29, "schedule_tuesday", tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(2)],
[30, "schedule_wednesday", tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(3)],
[31, "schedule_thursday", tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(4)],
[32, "schedule_friday", tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(5)],
[33, "schedule_saturday", tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(6)],
[34, "schedule_sunday", tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(7)],
[
36,
"frost_protection",
tuya.valueConverterBasic.lookup({
ON: true,
OFF: false,
}),
],
[47, "local_temperature_calibration", tuya.valueConverter.localTempCalibration1],
[102, "position", tuya.valueConverter.raw],
[
103,
"screen_orientation",
tuya.valueConverterBasic.lookup({
0: tuya.enum(0),
1: tuya.enum(1),
}),
],
[105, "eco_temperature", tuya.valueConverter.divideBy10],
[106, "eco", tuya.valueConverter.onOff],
//[107, "holiday_start_stop", tuya.valueConverter.raw],(Invalid situations may occur)
[108, "current_heating_setpoint", tuya.valueConverter.divideBy10],
[109, "local_temperature", tuya.valueConverter.divideBy10],
],
},
},
{
fingerprint: tuya.fingerprint("TS011F", ["_TZ3000_cymsnfvf", "_TZ3000_2xlvlnez", "_TZ3210_2uk4z8ce"]),
model: "ZP-LZ-FR2U",
vendor: "Moes",
description: "Zigbee 3.0 dual USB wireless socket plug",
extend: [
tuya.modernExtend.tuyaOnOff({
powerOutageMemory: true,
indicatorMode: true,
childLock: true,
endpoints: ["l1", "l2"],
}),
],
endpoint: (device) => {
return { l1: 1, l2: 2 };
},
meta: { multiEndpoint: true },
configure: async (device, coordinatorEndpoint) => {
await tuya.configureMagicPacket(device, coordinatorEndpoint);
await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ["genOnOff"]);
await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ["genOnOff"]);
await reporting.onOff(device.getEndpoint(1));
await reporting.onOff(device.getEndpoint(2));
},
},
{
fingerprint: [...tuya.fingerprint("TS0121", ["_TYZB01_iuepbmpv"]), ...tuya.fingerprint("TS011F", ["_TZ3000_zmy1waw6", "_TZ3000_bkfe0bab"])],
model: "MS-104Z",
description: "Smart light switch module (1 gang)",
vendor: "Moes",
extend: [tuya.modernExtend.tuyaOnOff()],
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ["genOnOff"]);
try {
// Fails for some devices.
// https://github.com/Koenkk/zigbee2mqtt/issues/4598
await reporting.onOff(endpoint);
}
catch {
/* empty */
}
},
},
{
fingerprint: tuya.fingerprint("TS011F", ["_TZ3000_pmz6mjyu", "_TZ3000_iv6ph5tr"]),
model: "MS-104BZ",
description: "Smart light switch module (2 gang)",
vendor: "Moes",
extend: [tuya.modernExtend.tuyaOnOff({ endpoints: ["l1", "l2"] })],
meta: { multiEndpoint: true },
endpoint: (device) => {
return { l1: 1, l2: 2 };
},
configure: async (device, coordinatorEndpoint) => {
const endpoint1 = device.getEndpoint(1);
await reporting.bind(endpoint1, coordinatorEndpoint, ["genOnOff"]);
await reporting.onOff(endpoint1);
const endpoint2 = device.getEndpoint(2);
await reporting.bind(endpoint2, coordinatorEndpoint, ["genOnOff"]);
await reporting.onOff(endpoint2);
},
whiteLabel: [tuya.whitelabel("KnockautX", "FMS2C017", "2 gang switch", ["_TZ3000_iv6ph5tr"])],
},
{
zigbeeModel: ["TS0112"],
model: "ZK-EU-2U",
vendor: "Moes",
description: "Zigbee 3.0 dual USB wireless socket plug",
extend: [m.onOff({ endpointNames: ["l1", "l2"] })],
meta: { multiEndpoint: true },
endpoint: (device) => {
const hasEndpoint2 = !!device.getEndpoint(2);
return { l1: 1, l2: hasEndpoint2 ? 2 : 7 };
},
},
{
fingerprint: tuya.fingerprint("TS0601", [
"_TZE200_aoclfnxz",
"_TZE200_ztvwu4nk",
"_TZE204_5toc8efa",
"_TZE200_5toc8efa",
"_TZE200_ye5jkfsb",
"_TZE284_ye5jkfsb",
"_TZE204_aoclfnxz",
"_TZE200_u9bfwha0",
"_TZE204_u9bfwha0",
]),
model: "BHT-002",
vendor: "Moes",
description: "Moes BHT series Thermostat",
fromZigbee: [legacy.fz.moes_thermostat],
toZigbee: [
legacy.tz.moes_thermostat_child_lock,
legacy.tz.moes_thermostat_current_heating_setpoint,
legacy.tz.moes_thermostat_mode,
legacy.tz.moes_thermostat_standby,
legacy.tz.moes_thermostat_sensor,
legacy.tz.moes_thermostat_calibration,
legacy.tz.moes_thermostat_deadzone_temperature,
legacy.tz.moes_thermostat_max_temperature_limit,
legacy.tz.moes_thermostat_min_temperature_limit,
legacy.tz.moes_thermostat_program_schedule,
],
whiteLabel: [tuya.whitelabel("Moes", "BHT-002/BHT-006", "Smart heating thermostat", ["_TZE204_aoclfnxz"])],
exposes: (device, options) => {
const heatingStepSize = device.manufacturerName === "_TZE204_5toc8efa" ? 0.5 : 1;
const runningStates = device.manufacturerName === "_TZE200_aoclfnxz" ? ["idle", "heat"] : ["idle", "heat", "cool"];
return [
e.child_lock(),
e.deadzone_temperature(),
e.max_temperature_limit().withValueMax(80),
e.min_temperature_limit(),
e
.climate()
.withSetpoint("current_heating_setpoint", 5, 45, heatingStepSize, ea.ST