-
Notifications
You must be signed in to change notification settings - Fork 3.2k
/
Copy pathnous.ts
117 lines (114 loc) · 5.7 KB
/
nous.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
import fz from '../converters/fromZigbee';
import * as exposes from '../lib/exposes';
import * as legacy from '../lib/legacy';
import * as reporting from '../lib/reporting';
import * as tuya from '../lib/tuya';
import {DefinitionWithExtend} from '../lib/types';
const e = exposes.presets;
const ea = exposes.access;
const definitions: DefinitionWithExtend[] = [
{
fingerprint: [{modelID: 'TS0201', manufacturerName: '_TZ3000_lbtpiody'}],
model: 'E5',
vendor: 'Nous',
description: 'Temperature & humidity',
fromZigbee: [fz.temperature, fz.humidity, fz.battery],
toZigbee: [],
exposes: [e.temperature(), e.humidity(), e.battery()],
},
{
fingerprint: [
{modelID: 'TS0601', manufacturerName: '_TZE200_lve3dvpy'},
{modelID: 'TS0601', manufacturerName: '_TZE200_c7emyjom'},
{modelID: 'TS0601', manufacturerName: '_TZE200_locansqn'},
{modelID: 'TS0601', manufacturerName: '_TZE200_qrztc3ev'},
{modelID: 'TS0601', manufacturerName: '_TZE200_snloy4rw'},
{modelID: 'TS0601', manufacturerName: '_TZE200_eanjj2pa'},
{modelID: 'TS0601', manufacturerName: '_TZE200_ydrdfkim'},
{modelID: 'TS0601', manufacturerName: '_TZE284_locansqn'},
],
model: 'SZ-T04',
vendor: 'Nous',
whiteLabel: [tuya.whitelabel('Tuya', 'TH01Z', 'Temperature and humidity sensor with clock', ['_TZE200_locansqn'])],
description: 'Temperature and humidity sensor with clock',
fromZigbee: [legacy.fz.nous_lcd_temperature_humidity_sensor, fz.ignore_tuya_set_time],
toZigbee: [legacy.tz.nous_lcd_temperature_humidity_sensor],
onEvent: tuya.onEventSetLocalTime,
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genBasic']);
},
exposes: [
e.temperature(),
e.humidity(),
e.battery(),
e
.numeric('temperature_report_interval', ea.STATE_SET)
.withUnit('min')
.withValueMin(5)
.withValueMax(120)
.withValueStep(5)
.withDescription('Temperature Report interval'),
e
.numeric('humidity_report_interval', ea.STATE_SET)
.withUnit('min')
.withValueMin(5)
.withValueMax(120)
.withValueStep(5)
.withDescription('Humidity Report interval'),
e.enum('temperature_unit_convert', ea.STATE_SET, ['celsius', 'fahrenheit']).withDescription('Current display unit'),
e.enum('temperature_alarm', ea.STATE, ['canceled', 'lower_alarm', 'upper_alarm']).withDescription('Temperature alarm status'),
e.numeric('max_temperature', ea.STATE_SET).withUnit('°C').withValueMin(-20).withValueMax(60).withDescription('Alarm temperature max'),
e.numeric('min_temperature', ea.STATE_SET).withUnit('°C').withValueMin(-20).withValueMax(60).withDescription('Alarm temperature min'),
e
.numeric('temperature_sensitivity', ea.STATE_SET)
.withUnit('°C')
.withValueMin(0.1)
.withValueMax(50)
.withValueStep(0.1)
.withDescription('Temperature sensitivity'),
e.enum('humidity_alarm', ea.STATE, ['canceled', 'lower_alarm', 'upper_alarm']).withDescription('Humidity alarm status'),
e.numeric('max_humidity', ea.STATE_SET).withUnit('%').withValueMin(0).withValueMax(100).withDescription('Alarm humidity max'),
e.numeric('min_humidity', ea.STATE_SET).withUnit('%').withValueMin(0).withValueMax(100).withDescription('Alarm humidity min'),
e
.numeric('humidity_sensitivity', ea.STATE_SET)
.withUnit('%')
.withValueMin(1)
.withValueMax(100)
.withValueStep(1)
.withDescription('Humidity sensitivity'),
],
},
{
fingerprint: tuya.fingerprint('TS0601', ['_TZE284_wtikaxzs', '_TZE200_nnrfa68v', '_TZE200_zppcgbdj']),
model: 'E6',
vendor: 'Nous',
description: 'Temperature & humidity LCD sensor',
fromZigbee: [legacy.fz.nous_lcd_temperature_humidity_sensor, fz.ignore_tuya_set_time],
toZigbee: [legacy.tz.nous_lcd_temperature_humidity_sensor],
onEvent: tuya.onEventSetLocalTime,
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genBasic']);
},
exposes: [
e.temperature(),
e.humidity(),
e.battery(),
e.battery_low(),
e.enum('temperature_unit_convert', ea.STATE_SET, ['celsius', 'fahrenheit']).withDescription('Current display unit'),
e.enum('temperature_alarm', ea.STATE, ['canceled', 'lower_alarm', 'upper_alarm']).withDescription('Temperature alarm status'),
e.numeric('max_temperature', ea.STATE_SET).withUnit('°C').withValueMin(-20).withValueMax(60).withDescription('Alarm temperature max'),
e.numeric('min_temperature', ea.STATE_SET).withUnit('°C').withValueMin(-20).withValueMax(60).withDescription('Alarm temperature min'),
e
.numeric('temperature_sensitivity', ea.STATE_SET)
.withUnit('°C')
.withValueMin(0.1)
.withValueMax(50)
.withValueStep(0.1)
.withDescription('Temperature sensitivity'),
],
},
];
export default definitions;
module.exports = definitions;