- 积分
- 964
- 金钱
- 890
- 威望
- 0
- 贡献
- 0
- HASS币
- 0
高级会员
- 积分
- 964
- 金钱
- 890
- HASS币
- 0
|
本帖最后由 lyt580231 于 2020-3-6 22:40 编辑
注册瀚思彼岸很长时间了,平常应该也算是标准的潜水党,疫情期间,在家无事,低价入了一些zigbee设备,8.5元的门磁,15元的人体感应传感器,智能温湿度传感器,水浸传感器,25元的烟雾传感器,可燃气体传感器等,这些设备已经自行设置,通过zigbee2mqtt设备接入了HA,现在将配置文件发出,供学习使用。打开zigbee2mqtt文件下node_modules/zigbee-herdsman-converters/devices.js,添加下面代码:不知道为什么,编辑多次都无法正确代码显示,直接文本复制上去,知道的讲一下原因,大家自己注意缩进:
{
zigbeeModel: ['FNB56-GAS05FB1.4'],
model: 'FNB56-GAS05FB1.4',
vendor: 'SSJJ',
description: 'Combustible gas sensor',
supports: 'gas',
fromZigbee: [fz.ias_gas_alarm_1],
toZigbee: [],
},
{
zigbeeModel: ['FNB56-SMF06FB1.6'],
model: 'FNB56-SMF06FB1.6',
vendor: 'HEIMAN',
description: 'Smoke detector',
supports: 'smoke',
fromZigbee: [fz.heiman_smoke, fz.battery_200],
toZigbee: [],
meta: {configureKey: 1},
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(1);
await bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
await configureReporting.batteryPercentageRemaining(endpoint);
},
},
{
zigbeeModel: ['FNB56-THM14FB2.4'],
model: 'FNB56-THM14FB2.4',
vendor: 'SSJJ',
description: 'Smart temperature & humidity Sensor',
supports: 'temperature and humidity',
fromZigbee: [fz.temperature, fz.humidity, fz.battery_3V],
toZigbee: [],
meta: {configureKey: 2},
configure: async (device, coordinatorEndpoint) => {
const endpoint1 = device.getEndpoint(1);
await bind(endpoint1, coordinatorEndpoint, ['msTemperatureMeasurement']);
const endpoint2 = device.getEndpoint(2);
await bind(endpoint2, coordinatorEndpoint, ['msRelativeHumidity', 'genPowerCfg']);
await configureReporting.temperature(endpoint1);
await configureReporting.humidity(endpoint2);
await configureReporting.batteryVoltage(endpoint2);
await configureReporting.batteryPercentageRemaining(endpoint2);
},
},
{
zigbeeModel: ['fdd76effa0e146b4bdafa0c203a37192'],
model: 'SM10ZW',
vendor: 'ORVIBO',
description: 'Door or window sensor',
supports: 'contact', fromZigbee: [fz.ias_contact_alarm_1, fz.battery_percentage_remaining],
toZigbee: [],
},
{
zigbeeModel: ['FNB56-WTS05FB2.0'],
model: 'FNB56-WTS05FB2.0',
vendor: 'SSJJ',
description: 'Water leakage sensor',
supports: 'water leak',
fromZigbee: [fz.ias_water_leak_alarm_1],
toZigbee: [],
},
{
zigbeeModel: ['FNB56-BOT06FB2.3'],
model: 'FNB56-BOT06FB2.3',
vendor: 'SSJJ',
description: 'Smart motion sensor',
supports: 'occupancy',
fromZigbee: [fz.iaszone_occupancy_1],
toZigbee: [],
},
为了加入HA,可在=zigbee2mqtt文件下/lib/extension/homeassistant.js,添加下面代码:
'FNB56-WTS05FB2.0': [cfg.binary_sensor_water_leak, cfg.binary_sensor_battery_low],
'FNB56-BOT06FB2.3': [cfg.binary_sensor_occupancy, cfg.binary_sensor_battery_low],
'FNB56-THM14FB2.4': [cfg.sensor_humidity, cfg.sensor_temperature, cfg.sensor_battery],
'SM10ZW': [cfg.binary_sensor_contact],
'FNB56-SMF06FB1.6': [cfg.binary_sensor_smoke, cfg.binary_sensor_battery_low],
'FNB56-GAS05FB1.4': [cfg.binary_sensor_gas],
重启,zigbee2mqtt服务即可。
这里,懒癌发作,并没有自己配置packages,使用的mqtt的自动发现功能,请注意!协调器使用的CC2530USB,也打板了Z2M,元器件还没到全,到时候更换,感谢妖神开发分享。另外大家注意备份下这两个文件,由于在docker运行,容易错误,会导致编辑后的文件丢失,成为新的容器。
感谢最后致敬开源!!!
|
|