-
Notifications
You must be signed in to change notification settings - Fork 3.2k
/
Copy pathnodon.ts
189 lines (187 loc) · 7.52 KB
/
nodon.ts
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
import {Definition} from '../lib/types';
import * as exposes from '../lib/exposes';
import * as reporting from '../lib/reporting';
import extend from '../lib/extend';
import * as ota from '../lib/ota';
const e = exposes.presets;
const ea = exposes.access;
import tz from '../converters/toZigbee';
import fz from '../converters/fromZigbee';
const definitions: Definition[] = [
{
zigbeeModel: ['SIN-4-RS-20'],
model: 'SIN-4-RS-20',
vendor: 'NodOn',
description: 'Roller shutter relay switch',
fromZigbee: [fz.cover_position_tilt],
toZigbee: [tz.cover_state, tz.cover_position_tilt],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg', 'closuresWindowCovering']);
await reporting.currentPositionLiftPercentage(endpoint);
await reporting.currentPositionTiltPercentage(endpoint);
},
exposes: [e.cover_position()],
ota: ota.zigbeeOTA,
},
{
zigbeeModel: ['SIN-4-RS-20_PRO'],
model: 'SIN-4-RS-20_PRO',
vendor: 'NodOn',
description: 'Roller shutter relay switch',
fromZigbee: [fz.cover_position_tilt],
toZigbee: [tz.cover_state, tz.cover_position_tilt],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg', 'closuresWindowCovering']);
await reporting.currentPositionLiftPercentage(endpoint);
await reporting.currentPositionTiltPercentage(endpoint);
},
exposes: [e.cover_position()],
ota: ota.zigbeeOTA,
},
{
zigbeeModel: ['SIN-4-1-20'],
model: 'SIN-4-1-20',
vendor: 'NodOn',
description: 'Multifunction relay switch',
extend: extend.switch(),
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
await reporting.onOff(endpoint);
// NodOn Attribute
await endpoint.read('genOnOff', ['nodonTransitionTime']);
},
endpoint: (device) => {
return {default: 1};
},
ota: ota.zigbeeOTA,
},
{
zigbeeModel: ['SIN-4-1-20_PRO'],
model: 'SIN-4-1-20_PRO',
vendor: 'NodOn',
description: 'Multifunction relay switch',
extend: extend.switch(),
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
await reporting.onOff(endpoint);
},
endpoint: (device) => {
return {default: 1};
},
ota: ota.zigbeeOTA,
},
{
zigbeeModel: ['SIN-4-2-20'],
model: 'SIN-4-2-20',
vendor: 'NodOn',
description: 'Lighting relay switch',
exposes: [e.switch().withEndpoint('l1'), e.switch().withEndpoint('l2')],
extend: extend.switch(),
endpoint: (device) => {
return {'l1': 1, 'l2': 2};
},
meta: {multiEndpoint: true},
configure: async (device, coordinatorEndpoint, logger) => {
const ep1 = device.getEndpoint(1);
const ep2 = device.getEndpoint(2);
await reporting.bind(ep1, coordinatorEndpoint, ['genOnOff']);
await reporting.bind(ep2, coordinatorEndpoint, ['genOnOff']);
await reporting.onOff(ep1);
await reporting.onOff(ep2);
},
ota: ota.zigbeeOTA,
},
{
zigbeeModel: ['SIN-4-2-20_PRO'],
model: 'SIN-4-2-20_PRO',
vendor: 'NodOn',
description: 'Lighting relay switch',
exposes: [e.switch().withEndpoint('l1'), e.switch().withEndpoint('l2')],
extend: extend.switch(),
endpoint: (device) => {
return {'l1': 1, 'l2': 2};
},
meta: {multiEndpoint: true},
configure: async (device, coordinatorEndpoint, logger) => {
const ep1 = device.getEndpoint(1);
const ep2 = device.getEndpoint(2);
await reporting.bind(ep1, coordinatorEndpoint, ['genOnOff']);
await reporting.bind(ep2, coordinatorEndpoint, ['genOnOff']);
await reporting.onOff(ep1);
await reporting.onOff(ep2);
},
ota: ota.zigbeeOTA,
},
{
zigbeeModel: ['SIN-4-FP-20'],
model: 'SIN-4-FP-20',
vendor: 'NodOn',
description: 'Pilot wire heating module',
ota: ota.zigbeeOTA,
fromZigbee: [fz.on_off, fz.metering, fz.nodon_fil_pilote_mode],
toZigbee: [tz.on_off, tz.nodon_fil_pilote_mode],
exposes: [
e.switch(),
e.power(),
e.energy(),
e.enum('mode', ea.ALL, ['comfort', 'eco', 'anti-freeze', 'stop', 'comfort_-1', 'comfort_-2']),
],
configure: async (device, coordinatorEndpoint, logger) => {
const ep = device.getEndpoint(1);
await reporting.bind(ep, coordinatorEndpoint, ['genBasic', 'genIdentify', 'genOnOff', 'seMetering', 'manuSpecificNodOnFilPilote']);
await reporting.onOff(ep, {min: 1, max: 3600, change: 0});
await reporting.readMeteringMultiplierDivisor(ep);
await reporting.instantaneousDemand(ep);
await reporting.currentSummDelivered(ep);
await ep.read('manuSpecificNodOnFilPilote', ['mode']);
},
},
{
zigbeeModel: ['SIN-4-FP-21'],
model: 'SIN-4-FP-21',
vendor: 'NodOn',
description: 'Pilot wire heating module',
ota: ota.zigbeeOTA,
fromZigbee: [fz.on_off, fz.metering, fz.nodon_fil_pilote_mode],
toZigbee: [tz.on_off, tz.nodon_fil_pilote_mode],
exposes: [
e.switch(),
e.power(),
e.energy(),
e.enum('mode', ea.ALL, ['comfort', 'eco', 'anti-freeze', 'stop', 'comfort_-1', 'comfort_-2']),
],
configure: async (device, coordinatorEndpoint, logger) => {
const ep = device.getEndpoint(1);
await reporting.bind(ep, coordinatorEndpoint, ['genBasic', 'genIdentify', 'genOnOff', 'seMetering', 'manuSpecificNodOnFilPilote']);
await reporting.onOff(ep, {min: 1, max: 3600, change: 0});
await reporting.readMeteringMultiplierDivisor(ep);
await reporting.instantaneousDemand(ep);
await reporting.currentSummDelivered(ep);
await ep.read('manuSpecificNodOnFilPilote', ['mode']);
},
},
{
zigbeeModel: ['SIN-4-1-21'],
model: 'SIN-4-1-21',
vendor: 'NodOn',
description: 'Multifunction relay switch zith metering',
ota: ota.zigbeeOTA,
fromZigbee: [fz.on_off, fz.metering],
toZigbee: [tz.on_off],
exposes: [e.switch(), e.power(), e.energy()],
configure: async (device, coordinatorEndpoint, logger) => {
const ep = device.getEndpoint(1);
await reporting.bind(ep, coordinatorEndpoint, ['genBasic', 'genIdentify', 'genOnOff', 'seMetering']);
await reporting.onOff(ep, {min: 1, max: 3600, change: 0});
await reporting.readMeteringMultiplierDivisor(ep);
await reporting.instantaneousDemand(ep);
await reporting.currentSummDelivered(ep);
},
},
];
export default definitions;
module.exports = definitions;