forked from Koenkk/zigbee-herdsman-converters
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iris.js
147 lines (146 loc) · 6.88 KB
/
iris.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
const exposes = require('../lib/exposes');
const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/legacy').fromZigbee};
const tz = require('../converters/toZigbee');
const reporting = require('../lib/reporting');
const e = exposes.presets;
module.exports = [
{
zigbeeModel: ['1116-S'],
model: 'IL06_1',
vendor: 'Iris',
description: 'Contact and temperature sensor',
fromZigbee: [fz.ias_contact_alarm_1, fz.temperature, fz.battery],
toZigbee: [],
meta: {battery: {voltageToPercentage: '3V_2100'}},
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['msTemperatureMeasurement', 'genPowerCfg']);
await reporting.temperature(endpoint);
await reporting.batteryVoltage(endpoint);
},
exposes: [e.contact(), e.battery_low(), e.tamper(), e.temperature(), e.battery()],
},
{
zigbeeModel: ['3210-L'],
model: '3210-L',
vendor: 'Iris',
description: 'Smart plug',
fromZigbee: [fz.on_off, fz.electrical_measurement],
toZigbee: [tz.on_off],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'haElectricalMeasurement']);
// 3210-L doesn't support reading 'acVoltageMultiplier' or 'acVoltageDivisor'
await endpoint.read('haElectricalMeasurement', ['acCurrentMultiplier', 'acCurrentDivisor']);
await endpoint.read('haElectricalMeasurement', ['acPowerMultiplier', 'acPowerDivisor']);
await reporting.onOff(endpoint);
await reporting.rmsVoltage(endpoint, {change: 2}); // Voltage reports in V
await reporting.rmsCurrent(endpoint, {change: 10}); // Current reports in mA
await reporting.activePower(endpoint); // Power reports in 0.1W
},
exposes: [e.switch(), e.power(), e.current(), e.voltage()],
},
{
zigbeeModel: ['3326-L'],
model: '3326-L',
vendor: 'Iris',
description: 'Motion and temperature sensor',
fromZigbee: [fz.ias_occupancy_alarm_2, fz.temperature, fz.battery],
toZigbee: [],
meta: {battery: {voltageToPercentage: '3V_2100'}},
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['msTemperatureMeasurement', 'genPowerCfg']);
await reporting.temperature(endpoint);
await reporting.batteryVoltage(endpoint);
},
exposes: [e.occupancy(), e.battery_low(), e.tamper(), e.temperature(), e.battery()],
},
{
zigbeeModel: ['3320-L'],
model: '3320-L',
vendor: 'Iris',
description: 'Contact and temperature sensor',
fromZigbee: [fz.ias_contact_alarm_1, fz.temperature, fz.battery],
toZigbee: [],
meta: {battery: {voltageToPercentage: '3V_2100'}},
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['msTemperatureMeasurement', 'genPowerCfg']);
await reporting.temperature(endpoint);
await reporting.batteryVoltage(endpoint);
},
exposes: [e.contact(), e.battery_low(), e.tamper(), e.temperature(), e.battery()],
},
{
zigbeeModel: ['3450-L'],
model: '3450-L',
vendor: 'Iris',
description: 'Smart fob',
fromZigbee: [fz.command_on_presence, fz.command_off, fz.battery, fz.checkin_presence],
toZigbee: [],
exposes: [e.action(['on_1', 'off_1', 'on_2', 'off_2', 'on_3', 'off_3', 'on_4', 'off_4']),
e.battery(), e.presence()],
meta: {battery: {voltageToPercentage: '3V_2100'}, multiEndpoint: true},
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint1 = device.getEndpoint(1);
await reporting.bind(endpoint1, coordinatorEndpoint, ['genOnOff', 'genPowerCfg', 'genPollCtrl']);
await reporting.batteryVoltage(endpoint1);
const interval = 100 - 10; // 100 seconds is default timeout so set inverval to 10 seconds before
await endpoint1.write('genPollCtrl', {'checkinInterval': (interval * 4)});
const endpoint2 = device.getEndpoint(2);
await reporting.bind(endpoint2, coordinatorEndpoint, ['genOnOff']);
const endpoint3 = device.getEndpoint(3);
await reporting.bind(endpoint3, coordinatorEndpoint, ['genOnOff']);
const endpoint4 = device.getEndpoint(4);
await reporting.bind(endpoint4, coordinatorEndpoint, ['genOnOff']);
},
},
{
zigbeeModel: ['3460-L'],
model: '3460-L',
vendor: 'Iris',
description: 'Smart button',
fromZigbee: [fz.command_on, fz.command_off, fz.battery, fz.temperature],
toZigbee: [],
exposes: [e.battery(), e.temperature(), e.action(['on', 'off'])],
meta: {battery: {voltageToPercentage: '3V_2100'}},
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genPowerCfg', 'msTemperatureMeasurement']);
await reporting.onOff(endpoint);
await reporting.batteryVoltage(endpoint);
await reporting.temperature(endpoint);
},
},
{
zigbeeModel: ['1117-S'],
model: 'iL07_1',
vendor: 'Iris',
description: 'Motion Sensor',
fromZigbee: [fz.ias_occupancy_alarm_2, fz.temperature, fz.humidity],
toZigbee: [],
exposes: [e.occupancy(), e.battery_low(), e.temperature(), e.humidity()],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['msTemperatureMeasurement', 'msRelativeHumidity']);
await reporting.temperature(endpoint);
await reporting.humidity(endpoint);
},
},
{
zigbeeModel: ['HT8-ZB'],
model: '27087-03',
vendor: 'Iris',
description: 'Hose faucet water timer',
fromZigbee: [fz.on_off, fz.battery, fz.ignore_time_read],
toZigbee: [tz.on_off],
meta: {battery: {voltageToPercentage: '3V_2500'}},
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genPowerCfg']);
await reporting.batteryVoltage(endpoint);
},
exposes: [e.switch(), e.battery()],
},
];