Skip to content

Commit 694707b

Browse files
authored
Merge branch 'Koenkk:master' into tuya
2 parents c87c49d + fac4196 commit 694707b

6 files changed

Lines changed: 216 additions & 12 deletions

File tree

src/devices/acova.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as fz from "../converters/fromZigbee";
22
import * as tz from "../converters/toZigbee";
33
import * as exposes from "../lib/exposes";
4+
import * as m from "../lib/modernExtend";
45
import * as reporting from "../lib/reporting";
56
import type {DefinitionWithExtend} from "../lib/types";
67

@@ -87,4 +88,25 @@ export const definitions: DefinitionWithExtend[] = [
8788
await reporting.occupancy(endpoint2);
8889
},
8990
},
91+
{
92+
zigbeeModel: ["IHC-Enki"],
93+
model: "IHC-Enki",
94+
vendor: "Acova",
95+
description: "Acova Madras IHC towel radiator (Zigbee thermostat)",
96+
extend: [
97+
m.thermostat({
98+
setpoints: {values: {occupiedHeatingSetpoint: {min: 7, max: 30, step: 0.5}}},
99+
localTemperatureCalibration: {values: {min: -5, max: 5, step: 0.1}},
100+
systemMode: {values: ["off", "heat", "auto"]},
101+
}),
102+
],
103+
exposes: [
104+
e
105+
.climate()
106+
.withLocalTemperature()
107+
.withSetpoint("occupied_heating_setpoint", 7, 30, 0.5)
108+
.withSystemMode(["off", "heat", "auto"])
109+
.withLocalTemperatureCalibration(),
110+
],
111+
},
90112
];

src/devices/inovelli.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ interface Inovelli {
3939
quickStartLevel: number;
4040
higherOutputInNonNeutral: number;
4141
dimmingMode: number;
42+
dimmingAlgorithm: number;
43+
auxDetectionLevel: number;
4244
nonNeutralAuxMediumGear: number;
4345
nonNeutralAuxLowGear: number;
4446
internalTemperature: number;
@@ -376,6 +378,8 @@ const inovelliExtend = {
376378
quickStartLevel: {name: "quickStartLevel", ID: 0x0018, type: Zcl.DataType.UINT8, write: true, max: 0xff},
377379
higherOutputInNonNeutral: {name: "higherOutputInNonNeutral", ID: 0x0019, type: Zcl.DataType.BOOLEAN, write: true},
378380
dimmingMode: {name: "dimmingMode", ID: 0x001a, type: Zcl.DataType.UINT8, write: true, max: 0xff},
381+
dimmingAlgorithm: {name: "dimmingAlgorithm", ID: 0x001b, type: Zcl.DataType.UINT8, write: true, max: 0xff},
382+
auxDetectionLevel: {name: "auxDetectionLevel", ID: 0x007c, type: Zcl.DataType.UINT8, write: true, max: 0xff},
379383
nonNeutralAuxMediumGear: {name: "nonNeutralAuxMediumGear", ID: 0x001e, type: Zcl.DataType.UINT8, write: true, max: 0xff},
380384
nonNeutralAuxLowGear: {name: "nonNeutralAuxLowGear", ID: 0x001f, type: Zcl.DataType.UINT8, write: true, max: 0xff},
381385
internalTemperature: {name: "internalTemperature", ID: 0x0020, type: Zcl.DataType.INT8, write: true, max: 0xff},
@@ -1698,6 +1702,27 @@ const VZM31_ATTRIBUTES: {[s: string]: Attribute} = {
16981702
values: {"Disabled (Click Sound On)": 0, "Enabled (Click Sound Off)": 1},
16991703
displayType: "enum",
17001704
},
1705+
dimmingAlgorithm: {
1706+
ID: 27,
1707+
dataType: Zcl.DataType.UINT8,
1708+
displayType: "enum",
1709+
values: {"Old dimming algorithm (v2.18)": 0, "New dimming algorithm (v3.04)": 1},
1710+
min: 0,
1711+
max: 1,
1712+
description:
1713+
"Switches the dimming algorithm from old to new. When switching the algorithm, the switch will restart. " +
1714+
"Some non-neutral setups may not support the new algorithm, in which case you can use the old algorithm." +
1715+
"0 = old dimming algorithm (v2.18), 1 = new dimming algorithm (v3.04+) (default).",
1716+
},
1717+
auxDetectionLevel: {
1718+
ID: 124,
1719+
dataType: Zcl.DataType.UINT8,
1720+
min: 0,
1721+
max: 4,
1722+
description:
1723+
"Aux detection level (P124). Range: 0-4, default: 1. " +
1724+
"If you are having issues with the aux function, start setting from 0 and continue until the aux function operates normally.",
1725+
},
17011726
};
17021727

17031728
const VZM32_ATTRIBUTES: {[s: string]: Attribute} = {

src/devices/muller_licht.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,4 +330,11 @@ export const definitions: DefinitionWithExtend[] = [
330330
description: "tint Smart Socket Tower Outdoor",
331331
extend: [m.onOff({powerOnBehavior: false})],
332332
},
333+
{
334+
zigbeeModel: ["tint Retro Bulb white+ambiance"],
335+
model: "404114",
336+
vendor: "MLI",
337+
description: "Tint LED Bulb, E27, 806 lumen, CCT, clear",
338+
extend: [m.light({colorTemp: {range: [153, 555]}})],
339+
},
333340
];

src/devices/schneider_electric.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3031,4 +3031,14 @@ export const definitions: DefinitionWithExtend[] = [
30313031
e.numeric("current_phase_l3", ea.STATE).withUnit("A").withDescription("Instantaneous measured electrical current on phase L3"),
30323032
],
30333033
},
3034+
{
3035+
zigbeeModel: ["UFH"],
3036+
model: "CCTFR6000",
3037+
vendor: "Schneider Electric",
3038+
description: "6 Channel Boiler Actuator",
3039+
extend: [
3040+
m.deviceEndpoints({endpoints: {"1": 1, "2": 2, "3": 3, "4": 4, "5": 5, "6": 6, "7": 7, "8": 8}}),
3041+
m.onOff({powerOnBehavior: false, endpointNames: ["1", "2", "3", "4", "5", "6", "7", "8"]}),
3042+
],
3043+
},
30343044
];

src/devices/third_reality.ts

Lines changed: 76 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,21 @@ interface ThirdMotionSensor {
4040
commandResponses: never;
4141
}
4242

43-
interface ThirdRadarSpecialCluster {
43+
interface Third60gRadarSensor {
4444
attributes: {
45-
volatileCrganiccCompounds: number;
45+
totalVolatileOrganicCompounds: number;
46+
presenceSensorSensitivity: number;
47+
airThreshold: number;
48+
tvocSensorCalibration: number;
49+
};
50+
commands: never;
51+
commandResponses: never;
52+
}
53+
54+
interface ThirdWateringKit {
55+
attributes: {
56+
wateringTimes: number;
57+
intervalDay: number;
4658
};
4759
commands: never;
4860
commandResponses: never;
@@ -312,25 +324,55 @@ export const definitions: DefinitionWithExtend[] = [
312324
ID: 0x042e,
313325
manufacturerCode: 0x1407,
314326
attributes: {
315-
volatileCrganiccCompounds: {
327+
totalVolatileOrganicCompounds: {
316328
name: "volatileCrganiccCompounds",
317329
ID: 0x0000,
318330
type: Zcl.DataType.UINT32,
319331
write: true,
320332
max: 0xffffffff,
321333
},
334+
presenceSensorSensitivity: {name: "presenceSensorSensitivity", ID: 0xf002, type: Zcl.DataType.UINT8, write: true, min: 1, max: 6},
335+
tvocSensorCalibration: {name: "tvocSensorCalibration", ID: 0xf001, type: Zcl.DataType.UINT8, write: true, min: 1, max: 1},
336+
airThreshold: {name: "airThreshold", ID: 0xf003, type: Zcl.DataType.UINT16, write: true, min: 3000, max: 15000},
322337
},
323338
commands: {},
324339
commandsResponse: {},
325340
}),
326-
m.numeric<"3r60gRadarSpecialCluster", ThirdRadarSpecialCluster>({
327-
name: "volatile_organic_compounds",
341+
m.numeric<"3r60gRadarSpecialCluster", Third60gRadarSensor>({
342+
name: "total_volatile_organic_compounds",
328343
cluster: "3r60gRadarSpecialCluster",
329-
attribute: "volatileCrganiccCompounds",
344+
attribute: "totalVolatileOrganicCompounds",
330345
unit: "ppb",
331-
description: "Measured VOC value",
346+
description: "Measured TVOC value",
332347
access: "STATE_GET",
333348
}),
349+
m.enumLookup<"3r60gRadarSpecialCluster", Third60gRadarSensor>({
350+
name: "tvoc_sensor_calibration",
351+
lookup: {Reset: 1},
352+
cluster: "3r60gRadarSpecialCluster",
353+
attribute: "tvocSensorCalibration",
354+
description: "TVOC sensor calibration",
355+
access: "ALL",
356+
}),
357+
m.numeric<"3r60gRadarSpecialCluster", Third60gRadarSensor>({
358+
name: "presence_sensor_sensitivity",
359+
valueMin: 1,
360+
valueMax: 6,
361+
cluster: "3r60gRadarSpecialCluster",
362+
attribute: "presenceSensorSensitivity",
363+
description: "Presence sensor sensitivity",
364+
access: "ALL",
365+
}),
366+
m.numeric<"3r60gRadarSpecialCluster", Third60gRadarSensor>({
367+
name: "air_threshold",
368+
valueMin: 3000,
369+
valueMax: 15000,
370+
cluster: "3r60gRadarSpecialCluster",
371+
attribute: "airThreshold",
372+
unit: "ppb",
373+
description: "Air threshold",
374+
access: "ALL",
375+
}),
334376
m.light({
335377
color: {modes: ["xy"], enhancedHue: true},
336378
}),
@@ -741,17 +783,42 @@ export const definitions: DefinitionWithExtend[] = [
741783
extend: [
742784
m.battery({percentage: true, voltage: true, lowStatus: true, percentageReporting: true}),
743785
m.onOff({powerOnBehavior: false}),
786+
m.iasZoneAlarm({
787+
zoneType: "generic",
788+
zoneAttributes: ["alarm_1"],
789+
description: "Water shortage warning",
790+
}),
744791
m.deviceAddCustomCluster("3rWateringSpecialCluster", {
745792
name: "3rWateringSpecialCluster",
746793
ID: 0xfff2,
747794
manufacturerCode: 0x1407,
748795
attributes: {
749-
wateringTimes: {name: "wateringTimes", ID: 0x0000, type: Zcl.DataType.UINT16, write: true, max: 0xffff},
750-
intervalDay: {name: "intervalDay", ID: 0x0001, type: Zcl.DataType.UINT8, write: true, max: 0xff},
796+
wateringTimes: {name: "wateringTimes", ID: 0x0000, type: Zcl.DataType.UINT16, write: true, min: 1, max: 1800},
797+
intervalDay: {name: "intervalDay", ID: 0x0001, type: Zcl.DataType.UINT8, write: true, min: 0, max: 30},
751798
},
752799
commands: {},
753800
commandsResponse: {},
754801
}),
802+
m.numeric<"3rWateringSpecialCluster", ThirdWateringKit>({
803+
name: "watering_times",
804+
cluster: "3rWateringSpecialCluster",
805+
attribute: "wateringTimes",
806+
valueMin: 1,
807+
valueMax: 1800,
808+
unit: "s",
809+
description: "watering times",
810+
access: "ALL",
811+
}),
812+
m.numeric<"3rWateringSpecialCluster", ThirdWateringKit>({
813+
name: "interval_day",
814+
cluster: "3rWateringSpecialCluster",
815+
attribute: "intervalDay",
816+
valueMin: 0,
817+
valueMax: 30,
818+
unit: "Day",
819+
description: "interval day",
820+
access: "ALL",
821+
}),
755822
],
756823
ota: true,
757824
},

src/devices/tuya.ts

Lines changed: 76 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3419,7 +3419,9 @@ export const definitions: DefinitionWithExtend[] = [
34193419
// https://github.com/Koenkk/zigbee2mqtt/issues/30584
34203420
meta: {
34213421
moveToLevelWithOnOffDisable: (e) =>
3422-
e.getDevice().manufacturerName === "_TZB210_uoiqhjqe" || e.getDevice().manufacturerName === "_TZB210_417ikxay",
3422+
e.getDevice().manufacturerName === "_TZB210_uoiqhjqe" ||
3423+
e.getDevice().manufacturerName === "_TZB210_417ikxay" ||
3424+
e.getDevice().manufacturerName === "_TZB210_qzsxaqqe",
34233425
},
34243426
toZigbee: [tzLocal.TS0505B_1_transitionFixesOnOffBrightness],
34253427
configure: (device, coordinatorEndpoint) => {
@@ -3998,9 +4000,9 @@ export const definitions: DefinitionWithExtend[] = [
39984000
},
39994001
{
40004002
fingerprint: tuya.fingerprint("TS0601", ["_TZE284_noixx2uz"]),
4001-
model: "TRV603",
4003+
model: "AR331",
40024004
vendor: "Tuya",
4003-
description: "Thermostatic Radiator Valve",
4005+
description: "Thermostatic radiator valve",
40044006
extend: [tuya.modernExtend.tuyaBase({dp: true, timeStart: "1970"})],
40054007
exposes: [
40064008
e.battery().withUnit("%"),
@@ -4936,6 +4938,8 @@ export const definitions: DefinitionWithExtend[] = [
49364938
tuya.exposes.switch().withEndpoint("l4"),
49374939
tuya.exposes.switch().withEndpoint("l5"),
49384940
tuya.exposes.switch().withEndpoint("l6"),
4941+
tuya.exposes.powerOnBehavior(),
4942+
tuya.exposes.indicatorModeNoneRelayPos(),
49394943
],
49404944
endpoint: (device) => {
49414945
return {l1: 1, l2: 1, l3: 1, l4: 1, l5: 1, l6: 1};
@@ -4949,6 +4953,24 @@ export const definitions: DefinitionWithExtend[] = [
49494953
[4, "state_l4", tuya.valueConverter.onOff],
49504954
[5, "state_l5", tuya.valueConverter.onOff],
49514955
[6, "state_l6", tuya.valueConverter.onOff],
4956+
[
4957+
14,
4958+
"power_on_behavior",
4959+
tuya.valueConverterBasic.lookup({
4960+
off: tuya.enum(0),
4961+
on: tuya.enum(1),
4962+
memory: tuya.enum(2),
4963+
}),
4964+
],
4965+
[
4966+
15,
4967+
"indicator_mode",
4968+
tuya.valueConverterBasic.lookup({
4969+
none: tuya.enum(0),
4970+
relay: tuya.enum(1),
4971+
pos: tuya.enum(2),
4972+
}),
4973+
],
49524974
],
49534975
},
49544976
whiteLabel: [
@@ -14805,6 +14827,7 @@ export const definitions: DefinitionWithExtend[] = [
1480514827
e.power_factor().withUnit("%").withDescription("Total power factor"),
1480614828
e.power().withDescription("Total active power"),
1480714829
e.ac_frequency(),
14830+
e.numeric("data_report_duration", ea.SET).withValueMin(30).withValueMax(3600),
1480814831
tuya.exposes.energyWithPhase("a"),
1480914832
tuya.exposes.energyWithPhase("b"),
1481014833
tuya.exposes.energyWithPhase("c"),
@@ -14820,6 +14843,56 @@ export const definitions: DefinitionWithExtend[] = [
1482014843
[1, "energy", tuya.valueConverter.divideBy100],
1482114844
[2, "produced_energy", tuya.valueConverter.divideBy100],
1482214845
[15, "power_factor", tuya.valueConverter.raw],
14846+
[
14847+
18,
14848+
"data_report_duration",
14849+
{
14850+
to: (v: number) => {
14851+
const value = Math.max(30, Math.min(3600, Math.round(v))) * 2;
14852+
// The reporting logic of this device is: for example, if 30 is input, it will report twice within 30 seconds,
14853+
// Which means reporting once every 15 seconds. Therefore, the input data needs to be multiplied by 2.
14854+
const byte1 = (value >> 8) & 0xff;
14855+
const byte2 = value & 0xff;
14856+
return [
14857+
// Other settings of the device
14858+
0x01,
14859+
0x01,
14860+
0x00,
14861+
0x3c,
14862+
0x02,
14863+
0x00,
14864+
0x00,
14865+
0x0a,
14866+
0x03,
14867+
0x01,
14868+
0x00,
14869+
0xfd,
14870+
0x04,
14871+
0x00,
14872+
0x00,
14873+
0xb4,
14874+
0x05,
14875+
0x01,
14876+
0x00,
14877+
0x00,
14878+
0x07,
14879+
0x01,
14880+
0x00,
14881+
0x00,
14882+
0x08,
14883+
0x01,
14884+
// Report duration
14885+
byte1,
14886+
byte2,
14887+
// Only modify the report duration
14888+
0x09,
14889+
0x00,
14890+
0x00,
14891+
0x00,
14892+
];
14893+
},
14894+
},
14895+
],
1482314896
[101, "ac_frequency", tuya.valueConverter.divideBy100],
1482414897
[102, "voltage_a", tuya.valueConverter.divideBy10],
1482514898
[103, "current_a", tuya.valueConverter.divideBy1000],

0 commit comments

Comments
 (0)