zigbee-herdsman-converters 14.0.358 → 14.0.362
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/converters/fromZigbee.js +5 -1
- package/converters/toZigbee.js +20 -2
- package/devices/climax.js +14 -0
- package/devices/danfoss.js +5 -4
- package/devices/gledopto.js +2 -2
- package/devices/hive.js +5 -4
- package/devices/ledvance.js +6 -0
- package/devices/lidl.js +1 -1
- package/devices/neo.js +1 -2
- package/devices/philips.js +42 -0
- package/devices/popp.js +5 -4
- package/devices/schneider_electric.js +1 -1
- package/devices/sinope.js +6 -2
- package/devices/smartthings.js +8 -2
- package/devices/tuya.js +71 -19
- package/devices/xiaomi.js +1 -1
- package/devices/ynoa.js +21 -0
- package/lib/constants.js +6 -0
- package/lib/exposes.js +3 -2
- package/npm-shrinkwrap.json +542 -530
- package/package.json +2 -2
package/converters/fromZigbee.js
CHANGED
|
@@ -89,6 +89,10 @@ const converters = {
|
|
|
89
89
|
result[postfixWithEndpointName('control_sequence_of_operation', msg, model)] =
|
|
90
90
|
constants.thermostatControlSequenceOfOperations[msg.data['ctrlSeqeOfOper']];
|
|
91
91
|
}
|
|
92
|
+
if (msg.data.hasOwnProperty('programingOperMode')) {
|
|
93
|
+
result[postfixWithEndpointName('programming_operation_mode', msg, model)] =
|
|
94
|
+
constants.thermostatProgrammingOperationModes[msg.data['programingOperMode']];
|
|
95
|
+
}
|
|
92
96
|
if (msg.data.hasOwnProperty('systemMode')) {
|
|
93
97
|
result[postfixWithEndpointName('system_mode', msg, model)] = constants.thermostatSystemModes[msg.data['systemMode']];
|
|
94
98
|
}
|
|
@@ -7347,7 +7351,7 @@ const converters = {
|
|
|
7347
7351
|
case tuya.dataPoints.trsMotionSpeed:
|
|
7348
7352
|
return {motion_speed: value};
|
|
7349
7353
|
case tuya.dataPoints.trsMotionDirection:
|
|
7350
|
-
return {motion_direction: {0: '
|
|
7354
|
+
return {motion_direction: {0: 'standing_still', 1: 'moving_forward', 2: 'moving_backward'}[value]};
|
|
7351
7355
|
case tuya.dataPoints.trsScene:
|
|
7352
7356
|
return {radar_scene: {'default': 0, 'area': 1, 'toilet': 2, 'bedroom': 3, 'parlour': 4, 'office': 5, 'hotel': 6}[value]};
|
|
7353
7357
|
case tuya.dataPoints.trsSensitivity:
|
package/converters/toZigbee.js
CHANGED
|
@@ -785,7 +785,7 @@ const converters = {
|
|
|
785
785
|
const {message} = meta;
|
|
786
786
|
const transition = utils.getTransition(entity, 'brightness', meta);
|
|
787
787
|
const turnsOffAtBrightness1 = utils.getMetaValue(entity, meta.mapped, 'turnsOffAtBrightness1', 'allEqual', false);
|
|
788
|
-
|
|
788
|
+
let state = message.hasOwnProperty('state') ? message.state.toLowerCase() : undefined;
|
|
789
789
|
let brightness = undefined;
|
|
790
790
|
if (message.hasOwnProperty('brightness')) {
|
|
791
791
|
brightness = Number(message.brightness);
|
|
@@ -803,7 +803,11 @@ const converters = {
|
|
|
803
803
|
}
|
|
804
804
|
|
|
805
805
|
if (state === 'toggle' || state === 'off' || (brightness === undefined && state === 'on')) {
|
|
806
|
-
if (transition.specified
|
|
806
|
+
if (transition.specified) {
|
|
807
|
+
if (state === 'toggle') {
|
|
808
|
+
state = meta.state.state === 'ON' ? 'OFF' : 'ON';
|
|
809
|
+
}
|
|
810
|
+
|
|
807
811
|
if (state === 'off' && meta.state.brightness && meta.state.state === 'ON') {
|
|
808
812
|
// https://github.com/Koenkk/zigbee2mqtt/issues/2850#issuecomment-580365633
|
|
809
813
|
// We need to remember the state before turning the device off as we need to restore
|
|
@@ -1154,6 +1158,20 @@ const converters = {
|
|
|
1154
1158
|
await entity.read('hvacThermostat', ['ctrlSeqeOfOper']);
|
|
1155
1159
|
},
|
|
1156
1160
|
},
|
|
1161
|
+
thermostat_programming_operation_mode: {
|
|
1162
|
+
key: ['programming_operation_mode'],
|
|
1163
|
+
convertSet: async (entity, key, value, meta) => {
|
|
1164
|
+
const val = utils.getKey(constants.thermostatProgrammingOperationModes, value, undefined, Number);
|
|
1165
|
+
if (val === undefined) {
|
|
1166
|
+
throw new Error('Programming operation mode invalid, must be one of: ' +
|
|
1167
|
+
Object.values(constants.thermostatProgrammingOperationModes).join(', '));
|
|
1168
|
+
}
|
|
1169
|
+
await entity.write('hvacThermostat', {programingOperMode: val});
|
|
1170
|
+
},
|
|
1171
|
+
convertGet: async (entity, key, meta) => {
|
|
1172
|
+
await entity.read('hvacThermostat', ['programingOperMode']);
|
|
1173
|
+
},
|
|
1174
|
+
},
|
|
1157
1175
|
thermostat_temperature_display_mode: {
|
|
1158
1176
|
key: ['temperature_display_mode'],
|
|
1159
1177
|
convertSet: async (entity, key, value, meta) => {
|
package/devices/climax.js
CHANGED
|
@@ -121,4 +121,18 @@ module.exports = [
|
|
|
121
121
|
exposes: [e.battery_low(), e.tamper(), e.action(['emergency', 'panic', 'disarm', 'arm_all_zones', 'arm_day_zones']),
|
|
122
122
|
],
|
|
123
123
|
},
|
|
124
|
+
{
|
|
125
|
+
zigbeeModel: ['PRL_00.00.03.04TC'],
|
|
126
|
+
model: 'PRL-1ZBS-12/24V',
|
|
127
|
+
vendor: 'Climax',
|
|
128
|
+
description: 'Zigbee 12-24V relay controller',
|
|
129
|
+
extend: extend.switch(),
|
|
130
|
+
configure: async (device, coordinatorEndpoint, logger) => {
|
|
131
|
+
const endpoint = device.getEndpoint(1);
|
|
132
|
+
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
|
|
133
|
+
await reporting.onOff(endpoint);
|
|
134
|
+
device.powerSource = 'Mains (single phase)';
|
|
135
|
+
device.save();
|
|
136
|
+
},
|
|
137
|
+
},
|
|
124
138
|
];
|
package/devices/danfoss.js
CHANGED
|
@@ -15,14 +15,15 @@ module.exports = [
|
|
|
15
15
|
model: '014G2461',
|
|
16
16
|
vendor: 'Danfoss',
|
|
17
17
|
description: 'Ally thermostat',
|
|
18
|
-
fromZigbee: [fz.battery, fz.thermostat, fz.hvac_user_interface, fz.danfoss_thermostat],
|
|
18
|
+
fromZigbee: [fz.battery, fz.thermostat, fz.thermostat_weekly_schedule, fz.hvac_user_interface, fz.danfoss_thermostat],
|
|
19
19
|
toZigbee: [tz.danfoss_thermostat_occupied_heating_setpoint, tz.thermostat_local_temperature, tz.danfoss_mounted_mode_active,
|
|
20
20
|
tz.danfoss_mounted_mode_control, tz.danfoss_thermostat_vertical_orientation, tz.danfoss_algorithm_scale_factor,
|
|
21
21
|
tz.danfoss_heat_available, tz.danfoss_heat_required, tz.danfoss_day_of_week, tz.danfoss_trigger_time,
|
|
22
22
|
tz.danfoss_window_open_internal, tz.danfoss_window_open_external, tz.danfoss_load_estimate,
|
|
23
23
|
tz.danfoss_viewing_direction, tz.danfoss_external_measured_room_sensor, tz.danfoss_radiator_covered,
|
|
24
|
-
tz.thermostat_keypad_lockout, tz.thermostat_system_mode, tz.danfoss_load_balancing_enable, tz.danfoss_load_room_mean
|
|
25
|
-
|
|
24
|
+
tz.thermostat_keypad_lockout, tz.thermostat_system_mode, tz.danfoss_load_balancing_enable, tz.danfoss_load_room_mean,
|
|
25
|
+
tz.thermostat_weekly_schedule, tz.thermostat_clear_weekly_schedule, tz.thermostat_programming_operation_mode],
|
|
26
|
+
exposes: [e.battery(), e.keypad_lockout(), e.programming_operation_mode(),
|
|
26
27
|
exposes.binary('mounted_mode_active', ea.STATE_GET, true, false)
|
|
27
28
|
.withDescription('Is the unit in mounting mode. This is set to `false` for mounted (already on ' +
|
|
28
29
|
'the radiator) or `true` for not mounted (after factory reset)'),
|
|
@@ -71,7 +72,7 @@ module.exports = [
|
|
|
71
72
|
'thermostats in the room. The gateway must update load_room_mean if enabled.'),
|
|
72
73
|
exposes.numeric('load_room_mean', ea.ALL)
|
|
73
74
|
.withDescription('Mean radiator load for room calculated by gateway for load balancing purposes (-8000=undefined)')
|
|
74
|
-
.withValueMin(-8000).withValueMax(
|
|
75
|
+
.withValueMin(-8000).withValueMax(2000),
|
|
75
76
|
exposes.numeric('load_estimate', ea.STATE_GET)
|
|
76
77
|
.withDescription('Load estimate on this radiator')],
|
|
77
78
|
ota: ota.zigbeeOTA,
|
package/devices/gledopto.js
CHANGED
|
@@ -237,7 +237,7 @@ module.exports = [
|
|
|
237
237
|
vendor: 'Gledopto',
|
|
238
238
|
ota: ota.zigbeeOTA,
|
|
239
239
|
description: 'Zigbee LED Controller RGB+CCT (pro)',
|
|
240
|
-
extend: gledoptoExtend.light_onoff_brightness_colortemp_color(),
|
|
240
|
+
extend: gledoptoExtend.light_onoff_brightness_colortemp_color({colorTempRange: [158, 495]}),
|
|
241
241
|
meta: {disableDefaultResponse: true},
|
|
242
242
|
},
|
|
243
243
|
{
|
|
@@ -327,7 +327,7 @@ module.exports = [
|
|
|
327
327
|
extend: gledoptoExtend.light_onoff_brightness_colortemp_color(),
|
|
328
328
|
},
|
|
329
329
|
{
|
|
330
|
-
zigbeeModel: ['GL-S-007Z'],
|
|
330
|
+
zigbeeModel: ['GL-S-007Z', 'GL-S-007Z(lk)'],
|
|
331
331
|
model: 'GL-S-007Z',
|
|
332
332
|
vendor: 'Gledopto',
|
|
333
333
|
description: 'Zigbee 5W GU10 Bulb RGB+CCT',
|
package/devices/hive.js
CHANGED
|
@@ -156,14 +156,15 @@ module.exports = [
|
|
|
156
156
|
model: 'UK7004240',
|
|
157
157
|
vendor: 'Hive',
|
|
158
158
|
description: 'Radiator valve based on Danfos Ally',
|
|
159
|
-
fromZigbee: [fz.battery, fz.thermostat, fz.hvac_user_interface, fz.danfoss_thermostat],
|
|
159
|
+
fromZigbee: [fz.battery, fz.thermostat, fz.thermostat_weekly_schedule, fz.hvac_user_interface, fz.danfoss_thermostat],
|
|
160
160
|
toZigbee: [tz.danfoss_thermostat_occupied_heating_setpoint, tz.thermostat_local_temperature, tz.danfoss_mounted_mode_active,
|
|
161
161
|
tz.danfoss_mounted_mode_control, tz.danfoss_thermostat_vertical_orientation, tz.danfoss_algorithm_scale_factor,
|
|
162
162
|
tz.danfoss_heat_available, tz.danfoss_heat_required, tz.danfoss_day_of_week, tz.danfoss_trigger_time,
|
|
163
163
|
tz.danfoss_window_open_internal, tz.danfoss_window_open_external, tz.danfoss_load_estimate,
|
|
164
164
|
tz.danfoss_viewing_direction, tz.danfoss_external_measured_room_sensor, tz.thermostat_keypad_lockout,
|
|
165
|
-
tz.thermostat_system_mode, tz.danfoss_load_balancing_enable, tz.danfoss_load_room_mean
|
|
166
|
-
|
|
165
|
+
tz.thermostat_system_mode, tz.danfoss_load_balancing_enable, tz.danfoss_load_room_mean,
|
|
166
|
+
tz.thermostat_weekly_schedule, tz.thermostat_clear_weekly_schedule, tz.thermostat_programming_operation_mode],
|
|
167
|
+
exposes: [e.battery(), e.keypad_lockout(), e.programming_operation_mode(),
|
|
167
168
|
exposes.binary('mounted_mode_active', ea.STATE_GET, true, false)
|
|
168
169
|
.withDescription('Is the unit in mounting mode. This is set to `false` for mounted (already on ' +
|
|
169
170
|
'the radiator) or `true` for not mounted (after factory reset)'),
|
|
@@ -205,7 +206,7 @@ module.exports = [
|
|
|
205
206
|
'thermostats in the room. The gateway must update load_room_mean if enabled.'),
|
|
206
207
|
exposes.numeric('load_room_mean', ea.ALL)
|
|
207
208
|
.withDescription('Mean radiator load for room calculated by gateway for load balancing purposes (-8000=undefined)')
|
|
208
|
-
.withValueMin(-8000).withValueMax(
|
|
209
|
+
.withValueMin(-8000).withValueMax(2000),
|
|
209
210
|
exposes.numeric('load_estimate', ea.STATE_GET)
|
|
210
211
|
.withDescription('Load estimate on this radiator')],
|
|
211
212
|
configure: async (device, coordinatorEndpoint, logger) => {
|
package/devices/ledvance.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const ota = require('../lib/ota');
|
|
2
2
|
const extend = require('../lib/extend');
|
|
3
|
+
const reporting = require('../lib/reporting');
|
|
3
4
|
|
|
4
5
|
module.exports = [
|
|
5
6
|
{
|
|
@@ -9,6 +10,11 @@ module.exports = [
|
|
|
9
10
|
description: 'Smart Zigbee outdoor plug',
|
|
10
11
|
extend: extend.switch(),
|
|
11
12
|
ota: ota.ledvance,
|
|
13
|
+
configure: async (device, coordinatorEndpoint, logger) => {
|
|
14
|
+
const endpoint = device.getEndpoint(1);
|
|
15
|
+
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
|
|
16
|
+
await reporting.onOff(endpoint);
|
|
17
|
+
},
|
|
12
18
|
},
|
|
13
19
|
{
|
|
14
20
|
zigbeeModel: ['Panel TW Z3'],
|
package/devices/lidl.js
CHANGED
|
@@ -696,7 +696,7 @@ module.exports = [
|
|
|
696
696
|
exposes.numeric('current_heating_setpoint_auto', ea.STATE_SET).withValueMin(0.5).withValueMax(29.5)
|
|
697
697
|
.withValueStep(0.5).withUnit('°C').withDescription('Temperature setpoint automatic'),
|
|
698
698
|
exposes.climate().withSetpoint('current_heating_setpoint', 0.5, 29.5, 0.5, ea.STATE_SET)
|
|
699
|
-
.withLocalTemperature(ea.STATE).withLocalTemperatureCalibration(-
|
|
699
|
+
.withLocalTemperature(ea.STATE).withLocalTemperatureCalibration(-12.5, 5.5, 0.1, ea.STATE_SET)
|
|
700
700
|
.withSystemMode(['off', 'heat', 'auto'], ea.STATE_SET)
|
|
701
701
|
.withPreset(['schedule', 'manual', 'holiday', 'boost']),
|
|
702
702
|
exposes.numeric('detectwindow_temperature', ea.STATE_SET).withUnit('°C').withDescription('Open window detection temperature')
|
package/devices/neo.js
CHANGED
|
@@ -7,8 +7,7 @@ const tuya = require('../lib/tuya');
|
|
|
7
7
|
|
|
8
8
|
module.exports = [
|
|
9
9
|
{
|
|
10
|
-
fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_d0yu2xgi'},
|
|
11
|
-
{modelID: 'TS0601', manufacturerName: '_TZE200_t1blo2bj'}],
|
|
10
|
+
fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_d0yu2xgi'}],
|
|
12
11
|
zigbeeModel: ['0yu2xgi'],
|
|
13
12
|
model: 'NAS-AB02B0',
|
|
14
13
|
vendor: 'Neo',
|
package/devices/philips.js
CHANGED
|
@@ -29,6 +29,15 @@ const hueExtend = {
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
module.exports = [
|
|
32
|
+
{
|
|
33
|
+
zigbeeModel: ['929003054001'],
|
|
34
|
+
model: '929003054001',
|
|
35
|
+
vendor: 'Philips',
|
|
36
|
+
description: 'Hue Wellness table lamp',
|
|
37
|
+
meta: {turnsOffAtBrightness1: true},
|
|
38
|
+
extend: extend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
|
|
39
|
+
ota: ota.zigbeeOTA,
|
|
40
|
+
},
|
|
32
41
|
{
|
|
33
42
|
zigbeeModel: ['4076131P6'],
|
|
34
43
|
model: '4076131P6',
|
|
@@ -1913,6 +1922,39 @@ module.exports = [
|
|
|
1913
1922
|
},
|
|
1914
1923
|
ota: ota.zigbeeOTA,
|
|
1915
1924
|
},
|
|
1925
|
+
{
|
|
1926
|
+
zigbeeModel: ['SML004'],
|
|
1927
|
+
model: '9290030674',
|
|
1928
|
+
vendor: 'Philips',
|
|
1929
|
+
description: 'Hue motion outdoor sensor',
|
|
1930
|
+
fromZigbee: [fz.battery, fz.occupancy, fz.temperature, fz.illuminance, fz.occupancy_timeout,
|
|
1931
|
+
fz.hue_motion_sensitivity, fz.hue_motion_led_indication],
|
|
1932
|
+
exposes: [e.temperature(), e.occupancy(), e.battery(), e.illuminance_lux(), e.illuminance(),
|
|
1933
|
+
exposes.enum('motion_sensitivity', ea.ALL, ['low', 'medium', 'high']),
|
|
1934
|
+
exposes.binary('led_indication', ea.ALL, true, false).withDescription('Blink green LED on motion detection'),
|
|
1935
|
+
exposes.numeric('occupancy_timeout', ea.ALL).withUnit('second').withValueMin(0).withValueMax(65535)],
|
|
1936
|
+
toZigbee: [tz.occupancy_timeout, tz.hue_motion_sensitivity, tz.hue_motion_led_indication],
|
|
1937
|
+
endpoint: (device) => {
|
|
1938
|
+
return {
|
|
1939
|
+
'default': 2, // default
|
|
1940
|
+
'ep1': 1,
|
|
1941
|
+
'ep2': 2, // e.g. for write to msOccupancySensing
|
|
1942
|
+
};
|
|
1943
|
+
},
|
|
1944
|
+
configure: async (device, coordinatorEndpoint, logger) => {
|
|
1945
|
+
const endpoint = device.getEndpoint(2);
|
|
1946
|
+
const binds = ['genPowerCfg', 'msIlluminanceMeasurement', 'msTemperatureMeasurement', 'msOccupancySensing'];
|
|
1947
|
+
await reporting.bind(endpoint, coordinatorEndpoint, binds);
|
|
1948
|
+
await reporting.batteryPercentageRemaining(endpoint);
|
|
1949
|
+
await reporting.occupancy(endpoint);
|
|
1950
|
+
await reporting.temperature(endpoint);
|
|
1951
|
+
await reporting.illuminance(endpoint);
|
|
1952
|
+
// read occupancy_timeout and motion_sensitivity
|
|
1953
|
+
await endpoint.read('msOccupancySensing', ['pirOToUDelay']);
|
|
1954
|
+
await endpoint.read('msOccupancySensing', [48], {manufacturerCode: 4107});
|
|
1955
|
+
},
|
|
1956
|
+
ota: ota.zigbeeOTA,
|
|
1957
|
+
},
|
|
1916
1958
|
{
|
|
1917
1959
|
zigbeeModel: ['LOM001'],
|
|
1918
1960
|
model: '929002240401',
|
package/devices/popp.js
CHANGED
|
@@ -15,14 +15,15 @@ module.exports = [
|
|
|
15
15
|
model: '701721',
|
|
16
16
|
vendor: 'Popp',
|
|
17
17
|
description: 'Smart thermostat',
|
|
18
|
-
fromZigbee: [fz.battery, fz.thermostat, fz.hvac_user_interface, fz.danfoss_thermostat],
|
|
18
|
+
fromZigbee: [fz.battery, fz.thermostat, fz.thermostat_weekly_schedule, fz.hvac_user_interface, fz.danfoss_thermostat],
|
|
19
19
|
toZigbee: [tz.danfoss_thermostat_occupied_heating_setpoint, tz.thermostat_local_temperature, tz.danfoss_mounted_mode_active,
|
|
20
20
|
tz.danfoss_mounted_mode_control, tz.danfoss_thermostat_vertical_orientation, tz.danfoss_algorithm_scale_factor,
|
|
21
21
|
tz.danfoss_heat_available, tz.danfoss_heat_required, tz.danfoss_day_of_week, tz.danfoss_trigger_time,
|
|
22
22
|
tz.danfoss_window_open_internal, tz.danfoss_window_open_external, tz.danfoss_load_estimate,
|
|
23
23
|
tz.danfoss_viewing_direction, tz.danfoss_external_measured_room_sensor, tz.thermostat_keypad_lockout,
|
|
24
|
-
tz.thermostat_system_mode, tz.danfoss_load_balancing_enable, tz.danfoss_load_room_mean
|
|
25
|
-
|
|
24
|
+
tz.thermostat_system_mode, tz.danfoss_load_balancing_enable, tz.danfoss_load_room_mean,
|
|
25
|
+
tz.thermostat_weekly_schedule, tz.thermostat_clear_weekly_schedule, tz.thermostat_programming_operation_mode],
|
|
26
|
+
exposes: [e.battery(), e.keypad_lockout(), e.programming_operation_mode(),
|
|
26
27
|
exposes.binary('mounted_mode_active', ea.STATE_GET, true, false)
|
|
27
28
|
.withDescription('Is the unit in mounting mode. This is set to `false` for mounted (already on ' +
|
|
28
29
|
'the radiator) or `true` for not mounted (after factory reset)'),
|
|
@@ -64,7 +65,7 @@ module.exports = [
|
|
|
64
65
|
'thermostats in the room. The gateway must update load_room_mean if enabled.'),
|
|
65
66
|
exposes.numeric('load_room_mean', ea.ALL)
|
|
66
67
|
.withDescription('Mean radiator load for room calculated by gateway for load balancing purposes (-8000=undefined)')
|
|
67
|
-
.withValueMin(-8000).withValueMax(
|
|
68
|
+
.withValueMin(-8000).withValueMax(2000),
|
|
68
69
|
exposes.numeric('load_estimate', ea.STATE_GET)
|
|
69
70
|
.withDescription('Load estimate on this radiator')],
|
|
70
71
|
ota: ota.zigbeeOTA,
|
|
@@ -283,7 +283,7 @@ module.exports = [
|
|
|
283
283
|
exposes: [e.switch().withEndpoint('l1'), e.switch().withEndpoint('l2'), e.action(['on_s*', 'off_s*'])],
|
|
284
284
|
configure: async (device, coordinatorEndpoint, logger) => {
|
|
285
285
|
device.endpoints.forEach(async (ep) => {
|
|
286
|
-
if (ep.outputClusters.includes(6)) {
|
|
286
|
+
if (ep.outputClusters.includes(6) || ep.ID <= 2) {
|
|
287
287
|
await reporting.bind(ep, coordinatorEndpoint, ['genOnOff']);
|
|
288
288
|
if (ep.ID <= 2) {
|
|
289
289
|
await reporting.onOff(ep);
|
package/devices/sinope.js
CHANGED
|
@@ -151,14 +151,18 @@ module.exports = [
|
|
|
151
151
|
await reporting.thermostatRunningState(endpoint);
|
|
152
152
|
} catch (error) {/* Not all support this */}
|
|
153
153
|
|
|
154
|
-
await reporting.readEletricalMeasurementMultiplierDivisors(endpoint);
|
|
155
154
|
try {
|
|
155
|
+
await endpoint.read('haElectricalMeasurement', ['acPowerMultiplier', 'acPowerDivisor']);
|
|
156
156
|
await reporting.activePower(endpoint, {min: 10, max: 305, change: 1}); // divider 1: 1W
|
|
157
|
-
} catch (error) {
|
|
157
|
+
} catch (error) {
|
|
158
|
+
endpoint.saveClusterAttributeKeyValue('haElectricalMeasurement', {'acPowerMultiplier': 1, 'acPowerDivisor': 1});
|
|
159
|
+
}
|
|
158
160
|
try {
|
|
161
|
+
await endpoint.read('haElectricalMeasurement', ['acCurrentMultiplier', 'acCurrentDivisor']);
|
|
159
162
|
await reporting.rmsCurrent(endpoint, {min: 10, max: 306, change: 100}); // divider 1000: 0.1Arms
|
|
160
163
|
} catch (error) {/* Do nothing*/}
|
|
161
164
|
try {
|
|
165
|
+
await endpoint.read('haElectricalMeasurement', ['acVoltageMultiplier', 'acVoltageDivisor']);
|
|
162
166
|
await reporting.rmsVoltage(endpoint, {min: 10, max: 307, change: 5}); // divider 10: 0.5Vrms
|
|
163
167
|
} catch (error) {/* Do nothing*/}
|
|
164
168
|
|
package/devices/smartthings.js
CHANGED
|
@@ -133,12 +133,18 @@ module.exports = [
|
|
|
133
133
|
model: 'IM6001-OTP05',
|
|
134
134
|
vendor: 'SmartThings',
|
|
135
135
|
description: 'Outlet',
|
|
136
|
-
|
|
136
|
+
fromZigbee: [fz.on_off, fz.electrical_measurement],
|
|
137
|
+
toZigbee: [tz.on_off],
|
|
137
138
|
configure: async (device, coordinatorEndpoint, logger) => {
|
|
138
139
|
const endpoint = device.getEndpoint(1);
|
|
139
|
-
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
|
|
140
|
+
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'haElectricalMeasurement']);
|
|
140
141
|
await reporting.onOff(endpoint);
|
|
142
|
+
await reporting.readEletricalMeasurementMultiplierDivisors(endpoint);
|
|
143
|
+
await reporting.activePower(endpoint);
|
|
144
|
+
await reporting.rmsCurrent(endpoint);
|
|
145
|
+
await reporting.rmsVoltage(endpoint);
|
|
141
146
|
},
|
|
147
|
+
exposes: [e.switch(), e.power(), e.current(), e.voltage()],
|
|
142
148
|
},
|
|
143
149
|
{
|
|
144
150
|
zigbeeModel: ['outletv4'],
|
package/devices/tuya.js
CHANGED
|
@@ -7,12 +7,42 @@ const reporting = require('../lib/reporting');
|
|
|
7
7
|
const extend = require('../lib/extend');
|
|
8
8
|
const e = exposes.presets;
|
|
9
9
|
const ea = exposes.access;
|
|
10
|
-
|
|
10
|
+
const libColor = require('../lib/color');
|
|
11
|
+
const utils = require('../lib/utils');
|
|
11
12
|
|
|
12
13
|
const TS011Fplugs = ['_TZ3000_5f43h46b', '_TZ3000_cphmq0q7', '_TZ3000_dpo1ysak', '_TZ3000_ew3ldmgx', '_TZ3000_gjnozsaz',
|
|
13
14
|
'_TZ3000_jvzvulen', '_TZ3000_mraovvmm', '_TZ3000_nfnmi125', '_TZ3000_ps3dmato', '_TZ3000_w0qqde0g', '_TZ3000_u5u4cakc',
|
|
14
15
|
'_TZ3000_rdtixbnu', '_TZ3000_typdpbpg', '_TZ3000_v1pdxuqq'];
|
|
15
16
|
|
|
17
|
+
const tzLocal = {
|
|
18
|
+
TS0504B_color: {
|
|
19
|
+
key: ['color'],
|
|
20
|
+
convertSet: async (entity, key, value, meta) => {
|
|
21
|
+
const color = libColor.Color.fromConverterArg(value);
|
|
22
|
+
console.log(color);
|
|
23
|
+
const enableWhite =
|
|
24
|
+
(color.isRGB() && (color.rgb.red === 1 && color.rgb.green === 1 && color.rgb.blue === 1)) ||
|
|
25
|
+
// Zigbee2MQTT frontend white value
|
|
26
|
+
(color.isXY() && (color.xy.x === 0.3125 || color.xy.y === 0.32894736842105265)) ||
|
|
27
|
+
// Home Assistant white color picker value
|
|
28
|
+
(color.isXY() && (color.xy.x === 0.323 || color.xy.y === 0.329));
|
|
29
|
+
|
|
30
|
+
if (enableWhite) {
|
|
31
|
+
await entity.command('lightingColorCtrl', 'tuyaRgbMode', {enable: false});
|
|
32
|
+
const newState = {color_mode: 'xy'};
|
|
33
|
+
if (color.isXY()) {
|
|
34
|
+
newState.color = color.xy;
|
|
35
|
+
} else {
|
|
36
|
+
newState.color = color.rgb.gammaCorrected().toXY().rounded(4);
|
|
37
|
+
}
|
|
38
|
+
return {state: libColor.syncColorState(newState, meta.state, entity, meta.options, meta.logger)};
|
|
39
|
+
} else {
|
|
40
|
+
return await tz.light_color.convertSet(entity, key, value, meta);
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
|
|
16
46
|
module.exports = [
|
|
17
47
|
{
|
|
18
48
|
zigbeeModel: ['TS0203'],
|
|
@@ -103,7 +133,8 @@ module.exports = [
|
|
|
103
133
|
{
|
|
104
134
|
fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3000_rk2yzt0u'},
|
|
105
135
|
{modelID: 'TS0001', manufacturerName: '_TZ3000_o4cjetlm'}, {manufacturerName: '_TZ3000_o4cjetlm'},
|
|
106
|
-
{modelID: 'TS0001', manufacturerName: '_TZ3000_iedbgyxt'}
|
|
136
|
+
{modelID: 'TS0001', manufacturerName: '_TZ3000_iedbgyxt'}, {modelID: 'TS0001', manufacturerName: '_TZ3000_h3noz0a5'},
|
|
137
|
+
{modelID: 'TS0001', manufacturerName: '_TYZB01_4tlksk8a'}],
|
|
107
138
|
model: 'ZN231392',
|
|
108
139
|
vendor: 'TuYa',
|
|
109
140
|
description: 'Smart water/gas valve',
|
|
@@ -151,11 +182,13 @@ module.exports = [
|
|
|
151
182
|
meta: {applyRedFix: true, enhancedHue: false},
|
|
152
183
|
},
|
|
153
184
|
{
|
|
154
|
-
fingerprint: [{modelID: 'TS0504B', manufacturerName: '_TZ3000_ukuvyhaa'}
|
|
185
|
+
fingerprint: [{modelID: 'TS0504B', manufacturerName: '_TZ3000_ukuvyhaa'},
|
|
186
|
+
{modelID: 'TS0504B', manufacturerName: '_TZ3210_bfvybixd'}],
|
|
155
187
|
model: 'TS0504B',
|
|
156
188
|
vendor: 'TuYa',
|
|
157
189
|
description: 'Zigbee RGBW light',
|
|
158
190
|
extend: extend.light_onoff_brightness_color(),
|
|
191
|
+
toZigbee: utils.replaceInArray(extend.light_onoff_brightness_color().toZigbee, [tz.light_color], [tzLocal.TS0504B_color]),
|
|
159
192
|
meta: {applyRedFix: true},
|
|
160
193
|
},
|
|
161
194
|
{
|
|
@@ -176,8 +209,10 @@ module.exports = [
|
|
|
176
209
|
{modelID: 'TS0202', manufacturerName: '_TYZB01_qjqgmqxr'},
|
|
177
210
|
{modelID: 'TS0202', manufacturerName: '_TZ3000_mmtwjmaq'},
|
|
178
211
|
{modelID: 'TS0202', manufacturerName: '_TZ3000_kmh5qpmb'},
|
|
212
|
+
{modelID: 'TS0202', manufacturerName: '_TYZB01_zwvaj5wy'},
|
|
179
213
|
{modelID: 'TS0202', manufacturerName: '_TZ3000_mcxw5ehu'},
|
|
180
214
|
{modelID: 'TS0202', manufacturerName: '_TZ3000_msl6wxk9'},
|
|
215
|
+
{modelID: 'TS0202', manufacturerName: '_TYZB01_tv3wxhcz'},
|
|
181
216
|
{modelID: 'TS0202', manufacturerName: '_TYZB01_hqbdru35'},
|
|
182
217
|
{modelID: 'WHD02', manufacturerName: '_TZ3000_hktqahrq'}],
|
|
183
218
|
model: 'TS0202',
|
|
@@ -457,6 +492,7 @@ module.exports = [
|
|
|
457
492
|
{modelID: 'TS0502B', manufacturerName: '_TZ3210_hi1ym4bl'},
|
|
458
493
|
{modelID: 'TS0502B', manufacturerName: '_TZ3210_psgq7ysz'},
|
|
459
494
|
{modelID: 'TS0502B', manufacturerName: '_TZ3000_zw7wr5uo'},
|
|
495
|
+
{modelID: 'TS0502B', manufacturerName: '_TZ3210_pz9zmxjj'},
|
|
460
496
|
],
|
|
461
497
|
model: 'TS0502B',
|
|
462
498
|
vendor: 'TuYa',
|
|
@@ -501,6 +537,15 @@ module.exports = [
|
|
|
501
537
|
toZigbee: [],
|
|
502
538
|
exposes: [e.battery(), e.temperature(), e.humidity(), e.battery_voltage()],
|
|
503
539
|
},
|
|
540
|
+
{
|
|
541
|
+
fingerprint: [{modelID: 'TS0201', manufacturerName: '_TZ3000_bguser20'}],
|
|
542
|
+
model: 'WSD500A',
|
|
543
|
+
vendor: 'TuYa',
|
|
544
|
+
description: 'Temperature & humidity sensor',
|
|
545
|
+
fromZigbee: [fz.battery, fz.temperature, fz.humidity],
|
|
546
|
+
toZigbee: [],
|
|
547
|
+
exposes: [e.battery(), e.temperature(), e.humidity(), e.battery_voltage()],
|
|
548
|
+
},
|
|
504
549
|
{
|
|
505
550
|
fingerprint: [{modelID: 'SM0201', manufacturerName: '_TYZB01_cbiezpds'}],
|
|
506
551
|
model: 'SM0201',
|
|
@@ -769,6 +814,7 @@ module.exports = [
|
|
|
769
814
|
{modelID: 'TS0601', manufacturerName: '_TZE200_fzo2pocs'},
|
|
770
815
|
{modelID: 'TS0601', manufacturerName: '_TZE200_5sbebbzs'},
|
|
771
816
|
{modelID: 'TS0601', manufacturerName: '_TZE200_zuz7f94z'},
|
|
817
|
+
{modelID: 'TS0601', manufakturerName: '_TZE200_iossyxra'},
|
|
772
818
|
],
|
|
773
819
|
model: 'TS0601_cover',
|
|
774
820
|
vendor: 'TuYa',
|
|
@@ -831,7 +877,10 @@ module.exports = [
|
|
|
831
877
|
exposes: [
|
|
832
878
|
e.child_lock(), e.window_detection(), e.battery_low(), e.valve_detection(), e.position(),
|
|
833
879
|
exposes.climate().withSetpoint('current_heating_setpoint', 5, 35, 0.5, ea.STATE_SET)
|
|
834
|
-
.withLocalTemperature(ea.STATE).withSystemMode(['heat', 'auto', 'off'], ea.STATE_SET
|
|
880
|
+
.withLocalTemperature(ea.STATE).withSystemMode(['heat', 'auto', 'off'], ea.STATE_SET,
|
|
881
|
+
'Mode of this device, in the `heat` mode the TS0601 will remain continuously heating, i.e. it does not regulate ' +
|
|
882
|
+
'to the desired temperature. If you want TRV to properly regulate the temperature you need to use mode `auto` ' +
|
|
883
|
+
'instead setting the desired temperature.')
|
|
835
884
|
.withLocalTemperatureCalibration(-30, 30, 0.1, ea.STATE_SET)
|
|
836
885
|
.withAwayMode().withPreset(['schedule', 'manual', 'boost', 'complex', 'comfort', 'eco']),
|
|
837
886
|
e.auto_lock(), e.away_mode(), e.away_preset_days(), e.boost_time(), e.comfort_temperature(), e.eco_temperature(), e.force(),
|
|
@@ -1111,22 +1160,25 @@ module.exports = [
|
|
|
1111
1160
|
exposes: [e.switch().setAccess('state', ea.STATE_SET), e.voltage(), e.power(), e.current(), e.energy()],
|
|
1112
1161
|
},
|
|
1113
1162
|
{
|
|
1114
|
-
fingerprint: [{modelID: 'TS1101', manufacturerName: '
|
|
1115
|
-
|
|
1116
|
-
model: 'TS1101_dimmer_module',
|
|
1163
|
+
fingerprint: [{modelID: 'TS1101', manufacturerName: '_TZ3000_xfs39dbf'}],
|
|
1164
|
+
model: 'TS1101_dimmer_module_1ch',
|
|
1117
1165
|
vendor: 'TuYa',
|
|
1118
|
-
description: '
|
|
1166
|
+
description: 'Zigbee dimmer module 1 channel',
|
|
1167
|
+
fromZigbee: extend.light_onoff_brightness().fromZigbee.concat([fz.tuya_min_brightness]),
|
|
1168
|
+
toZigbee: extend.light_onoff_brightness().toZigbee.concat([tz.tuya_min_brightness]),
|
|
1169
|
+
exposes: [e.light_brightness().withMinBrightness()],
|
|
1170
|
+
extend: extend.light_onoff_brightness(),
|
|
1171
|
+
},
|
|
1172
|
+
{
|
|
1173
|
+
fingerprint: [{modelID: 'TS1101', manufacturerName: '_TZ3000_7ysdnebc'}],
|
|
1174
|
+
model: 'TS1101_dimmer_module_2ch',
|
|
1175
|
+
vendor: 'TuYa',
|
|
1176
|
+
description: 'Zigbee dimmer module 2 channel',
|
|
1119
1177
|
whiteLabel: [{vendor: 'OXT', model: 'SWTZ25'}],
|
|
1120
|
-
fromZigbee: extend.light_onoff_brightness().fromZigbee.concat([
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
tz.tuya_min_brightness,
|
|
1125
|
-
]),
|
|
1126
|
-
exposes: [
|
|
1127
|
-
e.light_brightness().withMinBrightness().withEndpoint('l1'),
|
|
1128
|
-
e.light_brightness().withMinBrightness().withEndpoint('l2'),
|
|
1129
|
-
],
|
|
1178
|
+
fromZigbee: extend.light_onoff_brightness().fromZigbee.concat([fz.tuya_min_brightness]),
|
|
1179
|
+
toZigbee: extend.light_onoff_brightness().toZigbee.concat([tz.tuya_min_brightness]),
|
|
1180
|
+
exposes: [e.light_brightness().withMinBrightness().withEndpoint('l1'),
|
|
1181
|
+
e.light_brightness().withMinBrightness().withEndpoint('l2')],
|
|
1130
1182
|
endpoint: (device) => {
|
|
1131
1183
|
return {'l1': 1, 'l2': 2};
|
|
1132
1184
|
},
|
|
@@ -1631,7 +1683,7 @@ module.exports = [
|
|
|
1631
1683
|
e.illuminance_lux(), e.presence(),
|
|
1632
1684
|
exposes.binary('motion', ea.STATE, [true, false]).withDescription('moving inside the range of the sensor'),
|
|
1633
1685
|
exposes.numeric('motion_speed', ea.STATE).withDescription('Speed of movement'),
|
|
1634
|
-
exposes.enum('motion_direction', ea.STATE, ['
|
|
1686
|
+
exposes.enum('motion_direction', ea.STATE, ['standing_still', 'moving_forward', 'moving_backward'])
|
|
1635
1687
|
.withDescription('direction of movement from the point of view of the radar'),
|
|
1636
1688
|
exposes.numeric('radar_sensitivity', ea.STATE_SET).withValueMin(0).withValueMax(10).withValueStep(1)
|
|
1637
1689
|
.withDescription('sensitivity of the radar'),
|
package/devices/xiaomi.js
CHANGED
|
@@ -47,7 +47,7 @@ module.exports = [
|
|
|
47
47
|
description: 'Aqara E1 door & window contact sensor',
|
|
48
48
|
fromZigbee: [fz.ias_contact_alarm_1, fz.aqara_opple],
|
|
49
49
|
toZigbee: [],
|
|
50
|
-
exposes: [e.contact(), e.battery(), e.battery_voltage()],
|
|
50
|
+
exposes: [e.contact(), e.battery(), e.temperature(), e.battery_voltage()],
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
zigbeeModel: ['lumi.magnet.ac01'],
|
package/devices/ynoa.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const exposes = require('../lib/exposes');
|
|
2
|
+
const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/legacy').fromZigbee};
|
|
3
|
+
const reporting = require('../lib/reporting');
|
|
4
|
+
const e = exposes.presets;
|
|
5
|
+
|
|
6
|
+
module.exports = [
|
|
7
|
+
{
|
|
8
|
+
zigbeeModel: ['ZBT-DIMSwitch-D0000'],
|
|
9
|
+
model: '8718801528334',
|
|
10
|
+
vendor: 'Ynoa',
|
|
11
|
+
description: 'Remote control one button dimmer',
|
|
12
|
+
fromZigbee: [fz.command_on, fz.command_off, fz.command_move, fz.command_stop, fz.battery],
|
|
13
|
+
exposes: [e.action(['on', 'off', 'brightness_move_up', 'brightness_move_down', 'brightness_stop']), e.battery()],
|
|
14
|
+
toZigbee: [],
|
|
15
|
+
configure: async (device, coordinatorEndpoint, logger) => {
|
|
16
|
+
const endpoint = device.getEndpoint(1);
|
|
17
|
+
await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
|
|
18
|
+
await reporting.batteryPercentageRemaining(endpoint);
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
];
|
package/lib/constants.js
CHANGED
|
@@ -21,6 +21,11 @@ const thermostatControlSequenceOfOperations = {
|
|
|
21
21
|
5: 'cooling_and_heating_4-pipes_with_reheat',
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
+
const thermostatProgrammingOperationModes = {
|
|
25
|
+
0: 'setpoint',
|
|
26
|
+
1: 'schedule',
|
|
27
|
+
};
|
|
28
|
+
|
|
24
29
|
const thermostatSystemModes = {
|
|
25
30
|
0: 'off',
|
|
26
31
|
1: 'auto',
|
|
@@ -247,6 +252,7 @@ module.exports = {
|
|
|
247
252
|
repInterval,
|
|
248
253
|
defaultBindGroup,
|
|
249
254
|
thermostatControlSequenceOfOperations,
|
|
255
|
+
thermostatProgrammingOperationModes,
|
|
250
256
|
thermostatSystemModes,
|
|
251
257
|
thermostatRunningStates,
|
|
252
258
|
thermostatRunningMode,
|
package/lib/exposes.js
CHANGED
|
@@ -378,11 +378,11 @@ class Climate extends Base {
|
|
|
378
378
|
return this;
|
|
379
379
|
}
|
|
380
380
|
|
|
381
|
-
withSystemMode(modes, access=a.ALL) {
|
|
381
|
+
withSystemMode(modes, access=a.ALL, description='Mode of this device') {
|
|
382
382
|
assert(!this.endpoint, 'Cannot add feature after adding endpoint');
|
|
383
383
|
const allowed = ['off', 'heat', 'cool', 'auto', 'dry', 'fan_only', 'sleep', 'emergency_heating'];
|
|
384
384
|
modes.forEach((m) => assert(allowed.includes(m)));
|
|
385
|
-
this.features.push(new Enum('system_mode', access, modes).withDescription(
|
|
385
|
+
this.features.push(new Enum('system_mode', access, modes).withDescription(description));
|
|
386
386
|
return this;
|
|
387
387
|
}
|
|
388
388
|
|
|
@@ -574,6 +574,7 @@ module.exports = {
|
|
|
574
574
|
power_outage_memory: () => new Binary('power_outage_memory', access.ALL, true, false).withDescription('Enable/disable the power outage memory, this recovers the on/off mode after power failure'),
|
|
575
575
|
presence: () => new Binary('presence', access.STATE, true, false).withDescription('Indicates whether the device detected presence'),
|
|
576
576
|
pressure: () => new Numeric('pressure', access.STATE).withUnit('hPa').withDescription('The measured atmospheric pressure'),
|
|
577
|
+
programming_operation_mode: () => new Enum('programming_operation_mode', access.ALL, ['setpoint', 'schedule']).withDescription('Controls how programming affects the thermostat. Possible values: setpoint (only use specified setpoint), schedule (follow programmed setpoint schedule). Changing this value does not clear programmed schedules.'),
|
|
577
578
|
smoke: () => new Binary('smoke', access.STATE, true, false).withDescription('Indicates whether the device detected smoke'),
|
|
578
579
|
soil_moisture: () => new Numeric('soil_moisture', access.STATE).withUnit('%').withDescription('Measured soil moisture value'),
|
|
579
580
|
sos: () => new Binary('sos', access.STATE, true, false).withDescription('SOS alarm'),
|