forked from Koenkk/zigbee-herdsman-converters
-
Notifications
You must be signed in to change notification settings - Fork 0
/
konke.js
76 lines (75 loc) · 2.94 KB
/
konke.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
const exposes = require('../lib/exposes');
const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/legacy').fromZigbee};
const reporting = require('../lib/reporting');
const e = exposes.presets;
module.exports = [
{
zigbeeModel: ['3AFE170100510001', '3AFE280100510001'],
model: '2AJZ4KPKEY',
vendor: 'Konke',
description: 'Multi-function button',
fromZigbee: [fz.konke_action, fz.battery, fz.legacy.konke_click],
exposes: [e.battery(), e.action(['single', 'double', 'hold'])],
toZigbee: [],
meta: {battery: {voltageToPercentage: '3V_2500'}},
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
await reporting.batteryVoltage(endpoint);
},
},
{
zigbeeModel: ['3AFE14010402000D', '3AFE27010402000D', '3AFE28010402000D'],
model: '2AJZ4KPBS',
vendor: 'Konke',
description: 'Motion sensor',
fromZigbee: [fz.ias_occupancy_alarm_1_with_timeout, fz.battery],
toZigbee: [],
meta: {battery: {voltageToPercentage: '3V_2500'}},
exposes: [e.occupancy(), e.battery_low(), e.tamper(), e.battery()],
},
{
zigbeeModel: ['3AFE140103020000', '3AFE220103020000'],
model: '2AJZ4KPFT',
vendor: 'Konke',
description: 'Temperature and humidity sensor',
fromZigbee: [fz.temperature, fz.humidity, fz.battery],
toZigbee: [],
meta: {battery: {voltageToPercentage: '3V_2500'}},
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg', 'msTemperatureMeasurement']);
await reporting.batteryVoltage(endpoint);
await reporting.temperature(endpoint);
},
exposes: [e.temperature(), e.humidity(), e.battery()],
},
{
zigbeeModel: ['3AFE010104020028'],
model: 'TW-S1',
description: 'Photoelectric smoke detector',
vendor: 'Konke',
fromZigbee: [fz.ias_smoke_alarm_1],
toZigbee: [],
exposes: [e.smoke(), e.battery_low()],
},
{
zigbeeModel: ['3AFE130104020015', '3AFE270104020015', '3AFE280104020015'],
model: '2AJZ4KPDR',
vendor: 'Konke',
description: 'Contact sensor',
fromZigbee: [fz.ias_contact_alarm_1, fz.battery],
toZigbee: [],
meta: {battery: {voltageToPercentage: '3V_2500'}},
exposes: [e.contact(), e.battery_low(), e.tamper(), e.battery()],
},
{
zigbeeModel: ['LH07321'],
model: 'LH07321',
vendor: 'Konke',
description: 'Water detector',
fromZigbee: [fz.ias_water_leak_alarm_1],
toZigbee: [],
exposes: [e.water_leak(), e.battery_low(), e.tamper()],
},
];