zigbee-herdsman-converters 15.0.11 → 15.0.12

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/devices/namron.js CHANGED
@@ -305,6 +305,7 @@ module.exports = [
305
305
  description: 'Zigbee 4 channel remote control',
306
306
  fromZigbee: [fz.command_on, fz.command_off, fz.battery, fz.command_move, fz.command_stop, fz.command_recall],
307
307
  toZigbee: [],
308
+ ota: ota.zigbeeOTA,
308
309
  exposes: [e.battery(), e.action([
309
310
  'on_l1', 'off_l1', 'brightness_move_up_l1', 'brightness_move_down_l1', 'brightness_stop_l1',
310
311
  'on_l2', 'off_l2', 'brightness_move_up_l2', 'brightness_move_down_l2', 'brightness_stop_l2',
package/devices/tuya.js CHANGED
@@ -1696,6 +1696,24 @@ module.exports = [
1696
1696
  toZigbee: [],
1697
1697
  exposes: [e.battery(), e.temperature(), e.humidity(), e.battery_voltage()],
1698
1698
  },
1699
+ {
1700
+ fingerprint: tuya.fingerprint('TS0601', ['_TZE200_yjjdcqsq']),
1701
+ model: 'ZTH01',
1702
+ vendor: 'TuYa',
1703
+ description: 'Temperature and humidity sensor',
1704
+ fromZigbee: [tuya.fz.datapoints, tuya.fz.gateway_connection_status],
1705
+ toZigbee: [tuya.tz.datapoints],
1706
+ configure: tuya.configureMagicPacket,
1707
+ exposes: [e.temperature(), e.humidity(), tuya.exposes.batteryState(), e.battery_low()],
1708
+ meta: {
1709
+ tuyaDatapoints: [
1710
+ [1, 'temperature', tuya.valueConverter.divideBy10],
1711
+ [2, 'humidity', tuya.valueConverter.raw],
1712
+ [3, 'battery_state', tuya.valueConverter.batteryState],
1713
+ // [9, 'temperature_unit', tuya.valueConverter.raw], This DP is not properly supported by the device
1714
+ ],
1715
+ },
1716
+ },
1699
1717
  {
1700
1718
  fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3000_3zofvcaa'}],
1701
1719
  model: 'TS011F_2_gang_2_usb_wall',
package/lib/philips.js CHANGED
@@ -30,6 +30,17 @@ const decodeScaledGradientToRGB = (p) => {
30
30
  const COLOR_MODE_GRADIENT = '4b01';
31
31
  const COLOR_MODE_COLOR_XY = '0b00';
32
32
  const COLOR_MODE_COLOR_TEMP = '0f00';
33
+ const COLOR_MODE_EFFECT = 'ab00';
34
+ const COLOR_MODE_BRIGHTNESS = '0300';
35
+
36
+ const knownEffects = {
37
+ '0180': 'candle',
38
+ '0280': 'fireplace',
39
+ '0380': 'colorloop',
40
+ '0980': 'sunrise',
41
+ '0a80': 'sparkle',
42
+ };
43
+
33
44
 
34
45
  // decoder for manuSpecificPhilips2.state
35
46
  function decodeGradientColors(input, opts) {
@@ -60,6 +71,20 @@ function decodeGradientColors(input, opts) {
60
71
  // 01 - on/off (2)
61
72
  // 04 - brightness (2)
62
73
  // 60b09c4e - color (8) (xLow, xHigh, yLow, yHigh)
74
+ //
75
+ // Effect mode (ab00)
76
+ // Example: ab000153df7e446a0180
77
+ // ab00 - mode (4)
78
+ // 01 - on/off (2)
79
+ // 53 - brightness (2)
80
+ // df7e446a - XY Color (8)
81
+ // 0180 - effect (4)
82
+ //
83
+ // On/off/brightness mode (0003) – For devices that only support on/off and brightness
84
+ // Example: 030001b2
85
+ // 0300 - mode (4)
86
+ // 01 - on/off (2)
87
+ // b2 - brightness (2)
63
88
 
64
89
  // Device color mode
65
90
  const mode = input.slice(0, 4);
@@ -112,7 +137,7 @@ function decodeGradientColors(input, opts) {
112
137
  brightness,
113
138
  on,
114
139
  };
115
- } else if (mode === COLOR_MODE_COLOR_XY) {
140
+ } else if (mode === COLOR_MODE_COLOR_XY || mode === COLOR_MODE_EFFECT) {
116
141
  // XY Color mode
117
142
  const xLow = parseInt(input.slice(0, 2), 16);
118
143
  input = input.slice(2);
@@ -123,15 +148,26 @@ function decodeGradientColors(input, opts) {
123
148
  const yLow = parseInt(input.slice(0, 2), 16) << 8;
124
149
  input = input.slice(2);
125
150
 
126
- const x = xHigh | xLow;
127
- const y = yHigh | yLow;
128
151
 
152
+ const x = Math.round((xHigh | xLow) / 65535 * 10000) / 10000;
153
+ const y = Math.round((yHigh | yLow) / 65535 * 10000) / 10000;
154
+
155
+ if (mode === COLOR_MODE_COLOR_XY) {
156
+ return {
157
+ color_mode: 'xy',
158
+ x, y,
159
+ brightness, on,
160
+ };
161
+ }
162
+
163
+ // Effect mode
164
+ const effect = input.slice(0, 4);
165
+ const name = knownEffects[effect] || `unknown_${effect}`;
129
166
  return {
130
167
  color_mode: 'xy',
131
- x: Math.round(x / 65535 * 10000) / 10000,
132
- y: Math.round(y / 65535 * 10000) / 10000,
133
- brightness,
134
- on,
168
+ x, y,
169
+ brightness, on,
170
+ name,
135
171
  };
136
172
  } else if (mode === COLOR_MODE_COLOR_TEMP) {
137
173
  // Color temperature mode
@@ -148,6 +184,11 @@ function decodeGradientColors(input, opts) {
148
184
  brightness,
149
185
  on,
150
186
  };
187
+ } else if (mode === COLOR_MODE_BRIGHTNESS) {
188
+ return {
189
+ brightness,
190
+ on,
191
+ };
151
192
  }
152
193
 
153
194
  // Unknown mode
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "15.0.11",
3
+ "version": "15.0.12",
4
4
  "description": "Collection of device converters to be used with zigbee-herdsman",
5
5
  "main": "index.js",
6
6
  "files": [