zigbee-herdsman-converters 21.23.0 → 21.25.0

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.
Files changed (76) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/converters/toZigbee.d.ts.map +1 -1
  3. package/converters/toZigbee.js +29 -14
  4. package/converters/toZigbee.js.map +1 -1
  5. package/devices/avatto.d.ts.map +1 -1
  6. package/devices/avatto.js +150 -0
  7. package/devices/avatto.js.map +1 -1
  8. package/devices/direct_signs.d.ts +4 -0
  9. package/devices/direct_signs.d.ts.map +1 -0
  10. package/devices/direct_signs.js +48 -0
  11. package/devices/direct_signs.js.map +1 -0
  12. package/devices/heiman.d.ts.map +1 -1
  13. package/devices/heiman.js +0 -1
  14. package/devices/heiman.js.map +1 -1
  15. package/devices/index.d.ts.map +1 -1
  16. package/devices/index.js +4 -0
  17. package/devices/index.js.map +1 -1
  18. package/devices/legrand.js +1 -1
  19. package/devices/legrand.js.map +1 -1
  20. package/devices/lixee.d.ts.map +1 -1
  21. package/devices/lixee.js +10 -2
  22. package/devices/lixee.js.map +1 -1
  23. package/devices/lumi.d.ts.map +1 -1
  24. package/devices/lumi.js +3 -1
  25. package/devices/lumi.js.map +1 -1
  26. package/devices/namron.d.ts.map +1 -1
  27. package/devices/namron.js +132 -0
  28. package/devices/namron.js.map +1 -1
  29. package/devices/niko.d.ts.map +1 -1
  30. package/devices/niko.js +193 -55
  31. package/devices/niko.js.map +1 -1
  32. package/devices/nous.d.ts.map +1 -1
  33. package/devices/nous.js +18 -1
  34. package/devices/nous.js.map +1 -1
  35. package/devices/robb.d.ts.map +1 -1
  36. package/devices/robb.js +11 -0
  37. package/devices/robb.js.map +1 -1
  38. package/devices/simon.d.ts +4 -0
  39. package/devices/simon.d.ts.map +1 -0
  40. package/devices/simon.js +15 -0
  41. package/devices/simon.js.map +1 -0
  42. package/devices/smartthings.js +4 -4
  43. package/devices/smartthings.js.map +1 -1
  44. package/devices/smartwings.d.ts.map +1 -1
  45. package/devices/smartwings.js +13 -1
  46. package/devices/smartwings.js.map +1 -1
  47. package/devices/sonoff.d.ts.map +1 -1
  48. package/devices/sonoff.js +69 -1
  49. package/devices/sonoff.js.map +1 -1
  50. package/devices/sunricher.d.ts.map +1 -1
  51. package/devices/sunricher.js +20 -9
  52. package/devices/sunricher.js.map +1 -1
  53. package/devices/tuya.d.ts.map +1 -1
  54. package/devices/tuya.js +219 -24
  55. package/devices/tuya.js.map +1 -1
  56. package/devices/ubisys.d.ts.map +1 -1
  57. package/devices/ubisys.js +39 -128
  58. package/devices/ubisys.js.map +1 -1
  59. package/lib/exposes.d.ts +2 -1
  60. package/lib/exposes.d.ts.map +1 -1
  61. package/lib/exposes.js +3 -4
  62. package/lib/exposes.js.map +1 -1
  63. package/lib/lumi.d.ts +1 -1
  64. package/lib/lumi.js +5 -4
  65. package/lib/lumi.js.map +1 -1
  66. package/lib/modernExtend.js +1 -1
  67. package/lib/modernExtend.js.map +1 -1
  68. package/lib/namron.d.ts +56 -0
  69. package/lib/namron.d.ts.map +1 -0
  70. package/lib/namron.js +434 -0
  71. package/lib/namron.js.map +1 -0
  72. package/lib/tuya.d.ts +26 -8
  73. package/lib/tuya.d.ts.map +1 -1
  74. package/lib/tuya.js +43 -40
  75. package/lib/tuya.js.map +1 -1
  76. package/package.json +8 -8
package/lib/tuya.js CHANGED
@@ -314,7 +314,7 @@ const tuyaExposes = {
314
314
  .binary('frost_protection', ea.STATE_SET, 'ON', 'OFF')
315
315
  .withDescription(`When Anti-Freezing function is activated, the temperature in the house is kept at 8 °C.${extraNote}`),
316
316
  errorStatus: () => e.numeric('error_status', ea.STATE).withDescription('Error status'),
317
- scheduleAllDays: (access, format) => ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'].map((day) => e.text(`schedule_${day}`, access).withDescription(`Schedule for ${day}, format: "${format}"`)),
317
+ scheduleAllDays: (access, example) => ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'].map((day) => e.text(`schedule_${day}`, access).withDescription(`Schedule for ${day}, example: "${example}"`)),
318
318
  temperatureUnit: () => e.enum('temperature_unit', ea.STATE_SET, ['celsius', 'fahrenheit']).withDescription('Temperature unit'),
319
319
  temperatureCalibration: () => e
320
320
  .numeric('temperature_calibration', ea.STATE_SET)
@@ -330,6 +330,34 @@ const tuyaExposes = {
330
330
  .withValueStep(1)
331
331
  .withUnit('%')
332
332
  .withDescription('Humidity calibration'),
333
+ soilCalibration: () => e
334
+ .numeric('soil_calibration', ea.STATE_SET)
335
+ .withValueMin(-30)
336
+ .withValueMax(30)
337
+ .withValueStep(1)
338
+ .withUnit('%')
339
+ .withDescription('Soil Humidity calibration'),
340
+ temperatureSampling: () => e
341
+ .numeric('temperature_sampling', ea.STATE_SET)
342
+ .withValueMin(5)
343
+ .withValueMax(3600)
344
+ .withValueStep(1)
345
+ .withUnit('s')
346
+ .withDescription('Air temperature and humidity sampling'),
347
+ soilSampling: () => e
348
+ .numeric('soil_sampling', ea.STATE_SET)
349
+ .withValueMin(5)
350
+ .withValueMax(3600)
351
+ .withValueStep(1)
352
+ .withUnit('s')
353
+ .withDescription('Soil humidity sampling'),
354
+ soilWarning: () => e
355
+ .numeric('soil_warning', ea.STATE_SET)
356
+ .withValueMin(0)
357
+ .withValueMax(100)
358
+ .withValueStep(1)
359
+ .withUnit('%')
360
+ .withDescription('Soil water shortage humidity value'),
333
361
  gasValue: () => e.numeric('gas_value', ea.STATE).withDescription('Measured gas concentration'),
334
362
  energyWithPhase: (phase) => e.numeric(`energy_${phase}`, ea.STATE).withUnit('kWh').withDescription(`Sum of consumed energy (phase ${phase.toUpperCase()})`),
335
363
  energyProducedWithPhase: (phase) => e.numeric(`energy_produced_${phase}`, ea.STATE).withUnit('kWh').withDescription(`Sum of produced energy (phase ${phase.toUpperCase()})`),
@@ -994,7 +1022,7 @@ exports.valueConverter = {
994
1022
  const hour = parseInt(hourMin[0]);
995
1023
  const min = parseInt(hourMin[1]);
996
1024
  const temperature = Math.floor(parseFloat(timeTemp[1]) * 10);
997
- if (hour < 0 || hour > 24 || min < 0 || min > 60 || temperature < 50 || temperature > 300) {
1025
+ if (hour < 0 || hour > 24 || min < 0 || min > 60 || temperature < 50 || temperature > 350) {
998
1026
  throw new Error('Invalid hour, minute or temperature of: ' + transition);
999
1027
  }
1000
1028
  payload.push(hour, min, (temperature & 0xff00) >> 8, temperature & 0xff);
@@ -1089,6 +1117,7 @@ exports.valueConverter = {
1089
1117
  },
1090
1118
  };
1091
1119
  },
1120
+ /** @deprecated left for compatibility, use {@link thermostatSystemModeAndPresetMap} */
1092
1121
  thermostatSystemModeAndPreset: (toKey) => {
1093
1122
  return {
1094
1123
  from: (v) => {
@@ -1105,44 +1134,6 @@ exports.valueConverter = {
1105
1134
  },
1106
1135
  };
1107
1136
  },
1108
- thermostatGtz10SystemModeAndPreset: (toKey) => {
1109
- return {
1110
- from: (v) => {
1111
- utils.assertNumber(v, 'system_mode');
1112
- const presetLookup = {
1113
- 0: 'manual',
1114
- 1: 'auto',
1115
- 2: 'holiday',
1116
- 3: 'comfort',
1117
- 4: 'eco',
1118
- 5: 'off',
1119
- };
1120
- const systemModeLookup = {
1121
- 0: 'heat',
1122
- 1: 'auto',
1123
- 5: 'off',
1124
- };
1125
- return { preset: presetLookup[v], system_mode: systemModeLookup[v] };
1126
- },
1127
- to: (v) => {
1128
- const presetLookup = {
1129
- manual: new Enum(0),
1130
- auto: new Enum(1),
1131
- holiday: new Enum(2),
1132
- comfort: new Enum(3),
1133
- eco: new Enum(4),
1134
- off: new Enum(5),
1135
- };
1136
- const systemModeLookup = {
1137
- heat: new Enum(0),
1138
- auto: new Enum(1),
1139
- off: new Enum(5),
1140
- };
1141
- const lookup = toKey === 'preset' ? presetLookup : systemModeLookup;
1142
- return utils.getFromLookup(v, lookup);
1143
- },
1144
- };
1145
- },
1146
1137
  ZWT198_schedule: {
1147
1138
  from: (value, meta, options) => {
1148
1139
  const programmingMode = [];
@@ -1432,6 +1423,18 @@ exports.valueConverter = {
1432
1423
  return data;
1433
1424
  },
1434
1425
  },
1426
+ /** @param toMap the key is 'system_mode' or 'preset' related value */
1427
+ thermostatSystemModeAndPresetMap: ({ fromMap = {}, toMap = {}, }) => {
1428
+ return {
1429
+ from: (v) => {
1430
+ utils.assertNumber(v, 'system_mode');
1431
+ return { running_mode: fromMap[v].device_mode, system_mode: fromMap[v].system_mode, preset: fromMap[v].preset };
1432
+ },
1433
+ to: (v) => {
1434
+ return utils.getFromLookup(v, toMap);
1435
+ },
1436
+ };
1437
+ },
1435
1438
  };
1436
1439
  const tuyaTz = {
1437
1440
  power_on_behavior_1: {