由於很多因素,買了很多燈切,但最後由於外貿系關係,所以決定使用Vizo
以下採用VIZO Zigbee 三鍵版本,型號 VZ-223S

官方蝦皮購物連結
https://shopee.tw/shop/149801928/search?shopCollection=44027915
但,測試時配對之後,看到『不支援』一度以為不能用了

這邊分享如何讓 zigbee2mqtt 抓到 Vizo 的開關
先新增三按鍵檔案定義 這裡用 tz3210.js
檔名取什麼都可以,但要.js 結尾
p.s 這個檔案必須跟 configuration.yaml 同的位置,一般在 /config/zigbee2mqtt/ 底下
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require("zigbee-herdsman-converters/lib/tuya");
const definition = {
fingerprint: [
{
modelID: 'TS0014',
manufacturerName: '_TZ3210_z4hgsevd'
}
],
model: 'Z3W21A0447',
vendor: 'Vizo',
description: 'Vizo 3p 開關',
toZigbee: extend.switch().toZigbee.concat([tz.moes_power_on_behavior, tz.tuya_switch_type]),
fromZigbee: extend.switch().fromZigbee.concat([fz.moes_power_on_behavior, fz.tuya_switch_type]),
exposes: [e.switch().withEndpoint('l1'), e.switch().withEndpoint('l2'), e.switch().withEndpoint('l3')],
endpoint: (device) => {
return {'l1': 1, 'l2': 2, 'l3': 3};
},
configure: async (device, coordinatorEndpoint, logger) => {
try {
for (const ID of [1, 2, 3]) {
const endpoint = device.getEndpoint(ID);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
}
} catch (e) {
// Fails for some: [https://github.com/Koenkk/zigbee2mqtt/issues/4872
](https://github.com/Koenkk/zigbee2mqtt/issues/4872
) }
device.powerSource = 'Mains (single phase)';
device.save();
}
};
module.exports = definition;
新增檔案後由於 z2m 並不知道這個設定檔在哪所以需要設定 configuration.yaml 內external_converters 底下讓 z2m 找到這個設定檔,
advanced:
log_level: debug
external_converters:
- tz3210.js
若是你檔名有調整,請更換你設定的檔名,接下來重新啟動z2m
在z2m設備清單就可以看到狀態已更新,變成已支援
