zigbee-herdsman-converters 25.32.0 → 25.34.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.
- package/CHANGELOG.md +38 -0
- package/dist/devices/develco.d.ts.map +1 -1
- package/dist/devices/develco.js +4 -2
- package/dist/devices/develco.js.map +1 -1
- package/dist/devices/eurotronic.d.ts.map +1 -1
- package/dist/devices/eurotronic.js +1 -0
- package/dist/devices/eurotronic.js.map +1 -1
- package/dist/devices/heiman.d.ts.map +1 -1
- package/dist/devices/heiman.js +14 -0
- package/dist/devices/heiman.js.map +1 -1
- package/dist/devices/ikea.d.ts.map +1 -1
- package/dist/devices/ikea.js +1 -0
- package/dist/devices/ikea.js.map +1 -1
- package/dist/devices/lumi.d.ts.map +1 -1
- package/dist/devices/lumi.js +216 -0
- package/dist/devices/lumi.js.map +1 -1
- package/dist/devices/mazda.js +2 -2
- package/dist/devices/mazda.js.map +1 -1
- package/dist/devices/miboxer.d.ts.map +1 -1
- package/dist/devices/miboxer.js +246 -31
- package/dist/devices/miboxer.js.map +1 -1
- package/dist/devices/namron.js +1 -1
- package/dist/devices/namron.js.map +1 -1
- package/dist/devices/shelly.d.ts.map +1 -1
- package/dist/devices/shelly.js +9 -2
- package/dist/devices/shelly.js.map +1 -1
- package/dist/devices/somfy.d.ts.map +1 -1
- package/dist/devices/somfy.js +7 -0
- package/dist/devices/somfy.js.map +1 -1
- package/dist/devices/third_reality.d.ts.map +1 -1
- package/dist/devices/third_reality.js +17 -5
- package/dist/devices/third_reality.js.map +1 -1
- package/dist/devices/tuya.d.ts.map +1 -1
- package/dist/devices/tuya.js +105 -5
- package/dist/devices/tuya.js.map +1 -1
- package/dist/lib/lumi.d.ts +33 -0
- package/dist/lib/lumi.d.ts.map +1 -1
- package/dist/lib/lumi.js +237 -7
- package/dist/lib/lumi.js.map +1 -1
- package/dist/models-index.json +1 -1
- package/package.json +3 -3
package/dist/lib/lumi.d.ts
CHANGED
|
@@ -203,6 +203,26 @@ export declare const lumiModernExtend: {
|
|
|
203
203
|
lumiOverloadProtection: (args?: Partial<modernExtend.NumericArgs<"manuSpecificLumi">>) => ModernExtend;
|
|
204
204
|
lumiLedIndicator: (args?: Partial<modernExtend.BinaryArgs<"manuSpecificLumi">>) => ModernExtend;
|
|
205
205
|
lumiLedDisabledNight: (args?: Partial<modernExtend.BinaryArgs<"manuSpecificLumi">>) => ModernExtend;
|
|
206
|
+
lumiLedDisabledNightTime: () => {
|
|
207
|
+
isModernExtend: true;
|
|
208
|
+
exposes: exposes.Text[];
|
|
209
|
+
fromZigbee: {
|
|
210
|
+
cluster: string;
|
|
211
|
+
type: string[];
|
|
212
|
+
convert: (model: Definition, msg: Fz.Message<any, any, any>, publish: import("./types").Publish, options: KeyValue, meta: Fz.Meta) => {
|
|
213
|
+
schedule_start_time: string;
|
|
214
|
+
schedule_end_time: string;
|
|
215
|
+
schedule_time_raw: any;
|
|
216
|
+
};
|
|
217
|
+
}[];
|
|
218
|
+
toZigbee: {
|
|
219
|
+
key: string[];
|
|
220
|
+
convertSet: (entity: import("zigbee-herdsman/dist/controller/model").Group | import("zigbee-herdsman/dist/controller/model").Endpoint, key: string, value: unknown, meta: Tz.Meta) => Promise<{
|
|
221
|
+
state: KeyValue;
|
|
222
|
+
}>;
|
|
223
|
+
convertGet: (entity: import("zigbee-herdsman/dist/controller/model").Group | import("zigbee-herdsman/dist/controller/model").Endpoint, key: string, meta: Tz.Meta) => Promise<void>;
|
|
224
|
+
}[];
|
|
225
|
+
};
|
|
206
226
|
lumiButtonLock: (args?: Partial<modernExtend.BinaryArgs<"manuSpecificLumi">>) => ModernExtend;
|
|
207
227
|
lumiFlipIndicatorLight: (args?: Partial<modernExtend.BinaryArgs<"manuSpecificLumi">>) => ModernExtend;
|
|
208
228
|
lumiPreventReset: () => ModernExtend;
|
|
@@ -232,6 +252,19 @@ export declare const lumiModernExtend: {
|
|
|
232
252
|
percentageAtrribute?: number;
|
|
233
253
|
voltageAttribute?: number;
|
|
234
254
|
}) => ModernExtend;
|
|
255
|
+
fp300PIRDetection: () => ModernExtend;
|
|
256
|
+
fp300DetectionRange: (args?: {
|
|
257
|
+
rangeOffset: number;
|
|
258
|
+
rangesCount: number;
|
|
259
|
+
}) => ModernExtend;
|
|
260
|
+
fp300TrackDistance: () => {
|
|
261
|
+
isModernExtend: true;
|
|
262
|
+
exposes: exposes.Enum[];
|
|
263
|
+
toZigbee: {
|
|
264
|
+
key: string[];
|
|
265
|
+
convertSet: (entity: import("zigbee-herdsman/dist/controller/model").Group | import("zigbee-herdsman/dist/controller/model").Endpoint, key: string, value: unknown, meta: Tz.Meta) => Promise<void>;
|
|
266
|
+
}[];
|
|
267
|
+
};
|
|
235
268
|
fp1ePresence: () => ModernExtend;
|
|
236
269
|
fp1eMovement: () => ModernExtend;
|
|
237
270
|
fp1eTargetDistance: () => ModernExtend;
|
package/dist/lib/lumi.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lumi.d.ts","sourceRoot":"","sources":["../../src/lib/lumi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAGnC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAE/C,OAAO,KAAK,EACR,oBAAoB,EACpB,uBAAuB,EAEvB,UAAU,EAEV,EAAE,EACF,QAAQ,EACR,WAAW,EAEX,YAAY,EACZ,KAAK,EACL,EAAE,EACL,MAAM,SAAS,CAAC;AA0BjB,OAAO,MAAM,GAAG,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAEzE,MAAM,WAAW,sBAAsB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,GAAG,EA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AiB1C,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+JA6rCyB,WAAW;;;;;;;CAiH1D,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2lDpB,CAAC"}
|
package/dist/lib/lumi.js
CHANGED
|
@@ -267,7 +267,7 @@ msg, meta, model, options, dataObject) => {
|
|
|
267
267
|
if (["ZNXDD01LM"].includes(model.model)) {
|
|
268
268
|
// We don't know what the value means for these devices.
|
|
269
269
|
}
|
|
270
|
-
else if (["ZNCLBL01LM"].includes(model.model)) {
|
|
270
|
+
else if (["ZNCLBL01LM", "PS-S04D"].includes(model.model)) {
|
|
271
271
|
// Overwrite version advertised by `genBasic` and `genOta` with correct version:
|
|
272
272
|
// https://github.com/Koenkk/zigbee2mqtt/issues/15745
|
|
273
273
|
(0, utils_1.assertNumber)(value);
|
|
@@ -411,7 +411,7 @@ msg, meta, model, options, dataObject) => {
|
|
|
411
411
|
const battery = value / 2;
|
|
412
412
|
payload.battery = (0, utils_1.precisionRound)(battery, 2);
|
|
413
413
|
}
|
|
414
|
-
else if (["RTCZCGQ11LM"].includes(model.model)) {
|
|
414
|
+
else if (["RTCZCGQ11LM", "PS-S04D"].includes(model.model)) {
|
|
415
415
|
payload.presence = (0, utils_1.getFromLookup)(value, { 0: false, 1: true, 255: null });
|
|
416
416
|
}
|
|
417
417
|
else if (["ZNXDD01LM"].includes(model.model)) {
|
|
@@ -460,6 +460,9 @@ msg, meta, model, options, dataObject) => {
|
|
|
460
460
|
// const color_temp_min = (value & 0xffff); // 2700
|
|
461
461
|
// const color_temp_max = (value >> 16) & 0xffff; // 6500
|
|
462
462
|
}
|
|
463
|
+
else if (["PS-S04D"].includes(model.model)) {
|
|
464
|
+
payload.pir_detection = value === 1;
|
|
465
|
+
}
|
|
463
466
|
break;
|
|
464
467
|
case "105":
|
|
465
468
|
if (["RTCGQ13LM"].includes(model.model)) {
|
|
@@ -642,7 +645,7 @@ msg, meta, model, options, dataObject) => {
|
|
|
642
645
|
payload.detection_interval = value;
|
|
643
646
|
break;
|
|
644
647
|
case "268":
|
|
645
|
-
if (["RTCGQ13LM", "RTCGQ14LM", "RTCZCGQ11LM"].includes(model.model)) {
|
|
648
|
+
if (["RTCGQ13LM", "RTCGQ14LM", "RTCZCGQ11LM", "PS-S04D"].includes(model.model)) {
|
|
646
649
|
payload.motion_sensitivity = (0, utils_1.getFromLookup)(value, { 1: "low", 2: "medium", 3: "high" });
|
|
647
650
|
}
|
|
648
651
|
else if (["JT-BZ-01AQ/A"].includes(model.model)) {
|
|
@@ -712,7 +715,7 @@ msg, meta, model, options, dataObject) => {
|
|
|
712
715
|
}
|
|
713
716
|
break;
|
|
714
717
|
case "322":
|
|
715
|
-
if (["RTCZCGQ11LM"].includes(model.model)) {
|
|
718
|
+
if (["RTCZCGQ11LM", "PS-S04D"].includes(model.model)) {
|
|
716
719
|
payload.presence = (0, utils_1.getFromLookup)(value, { 0: false, 1: true, 255: null });
|
|
717
720
|
}
|
|
718
721
|
break;
|
|
@@ -1146,23 +1149,71 @@ function writeTime(buffer, offset, time, isNextDay) {
|
|
|
1146
1149
|
/**
|
|
1147
1150
|
* Formats a number of minutes into a user-readable 24-hour time notation in the form hh:mm.
|
|
1148
1151
|
*/
|
|
1149
|
-
function formatTime(timeMinutes) {
|
|
1152
|
+
function formatTime(timeMinutes, padHour = false) {
|
|
1150
1153
|
const hours = Math.floor(timeMinutes / 60);
|
|
1151
1154
|
const minutes = timeMinutes % 60;
|
|
1155
|
+
if (padHour)
|
|
1156
|
+
return `${String(hours).padStart(2, "0")}:${String(minutes).padStart(2, "0")}`;
|
|
1152
1157
|
return `${hours}:${String(minutes).padStart(2, "0")}`;
|
|
1153
1158
|
}
|
|
1154
1159
|
/**
|
|
1155
1160
|
* Parses a 24-hour time notation string in the form hh:mm into a number of minutes.
|
|
1156
1161
|
*/
|
|
1157
1162
|
function parseTime(timeString) {
|
|
1158
|
-
const
|
|
1163
|
+
const trimmedTimeString = timeString.trim();
|
|
1164
|
+
if (!trimmedTimeString.match(/^\d{1,2}:\d{1,2}$/)) {
|
|
1165
|
+
throw new Error(`Invalid time format: ${trimmedTimeString}. Expected HH:MM format (eg. "21:30")`);
|
|
1166
|
+
}
|
|
1167
|
+
const parts = trimmedTimeString.split(":");
|
|
1159
1168
|
if (parts.length !== 2) {
|
|
1160
|
-
throw new Error(`Cannot parse time string ${
|
|
1169
|
+
throw new Error(`Cannot parse time string ${trimmedTimeString}`);
|
|
1161
1170
|
}
|
|
1162
1171
|
const hours = Number.parseInt(parts[0], 10);
|
|
1163
1172
|
const minutes = Number.parseInt(parts[1], 10);
|
|
1173
|
+
if (hours < 0 || hours > 23) {
|
|
1174
|
+
throw new Error(`Invalid time format: ${trimmedTimeString}. Hours out of bounds - should be between 0 and 23.`);
|
|
1175
|
+
}
|
|
1176
|
+
if (minutes < 0 || minutes > 59) {
|
|
1177
|
+
throw new Error(`Invalid time format: ${trimmedTimeString}. Minutes out of bounds - should be between 0 and 59.`);
|
|
1178
|
+
}
|
|
1164
1179
|
return hours * 60 + minutes;
|
|
1165
1180
|
}
|
|
1181
|
+
// Time encoding & decoding (used eg in Aqara FP300) (0xMMHHmmhh)
|
|
1182
|
+
function encodeTimeFormat(startTime, endTime) {
|
|
1183
|
+
const start = parseTime(startTime);
|
|
1184
|
+
const end = parseTime(endTime);
|
|
1185
|
+
return Math.floor(start / 60) | ((start % 60) << 8) | (Math.floor(end / 60) << 16) | ((end % 60) << 24);
|
|
1186
|
+
}
|
|
1187
|
+
function decodeTimeFormat(value) {
|
|
1188
|
+
if (value < 0 || value > 0xffffffff)
|
|
1189
|
+
return null;
|
|
1190
|
+
const startHour = value & 0xff;
|
|
1191
|
+
const startMin = (value >>> 8) & 0xff;
|
|
1192
|
+
const endHour = (value >>> 16) & 0xff;
|
|
1193
|
+
const endMin = (value >>> 24) & 0xff;
|
|
1194
|
+
if (startHour > 23 || startMin > 59 || endHour > 23 || endMin > 59)
|
|
1195
|
+
return null;
|
|
1196
|
+
return {
|
|
1197
|
+
startTime: formatTime(startHour * 60 + startMin, true),
|
|
1198
|
+
endTime: formatTime(endHour * 60 + endMin, true),
|
|
1199
|
+
};
|
|
1200
|
+
}
|
|
1201
|
+
// Encodes and decodes detection range composite value (used in FP300) from/to int
|
|
1202
|
+
function encodeDetectionRangeComposite(detectionRangeValue, rangeCount) {
|
|
1203
|
+
const composite_values = {};
|
|
1204
|
+
for (let i = 0; i < rangeCount; ++i) {
|
|
1205
|
+
composite_values[`detection_range_${i}`] = ((detectionRangeValue >>> i) & 1) === 1;
|
|
1206
|
+
}
|
|
1207
|
+
return composite_values;
|
|
1208
|
+
}
|
|
1209
|
+
function decodeDetectionRangeComposite(compositeValues, rangeCount) {
|
|
1210
|
+
let intValue = 0;
|
|
1211
|
+
for (let i = 0; i < rangeCount; ++i) {
|
|
1212
|
+
if (compositeValues[`detection_range_${i}`])
|
|
1213
|
+
intValue |= 1 << i;
|
|
1214
|
+
}
|
|
1215
|
+
return intValue;
|
|
1216
|
+
}
|
|
1166
1217
|
const stringifiedScheduleFragmentSeparator = "|";
|
|
1167
1218
|
const stringifiedScheduleValueSeparator = ",";
|
|
1168
1219
|
exports.trv = {
|
|
@@ -1786,6 +1837,60 @@ exports.lumiModernExtend = {
|
|
|
1786
1837
|
reporting: false,
|
|
1787
1838
|
...args,
|
|
1788
1839
|
}),
|
|
1840
|
+
lumiLedDisabledNightTime: () => {
|
|
1841
|
+
return {
|
|
1842
|
+
isModernExtend: true,
|
|
1843
|
+
exposes: [
|
|
1844
|
+
e.text("schedule_start_time", ea.ALL).withDescription("LED disable schedule start time (HH:MM format)"),
|
|
1845
|
+
e.text("schedule_end_time", ea.ALL).withDescription("LED disable schedule end time (HH:MM format)"),
|
|
1846
|
+
],
|
|
1847
|
+
fromZigbee: [
|
|
1848
|
+
{
|
|
1849
|
+
cluster: "manuSpecificLumi",
|
|
1850
|
+
type: ["attributeReport", "readResponse"],
|
|
1851
|
+
convert: (model, msg, publish, options, meta) => {
|
|
1852
|
+
if (msg.data["574"] !== undefined) {
|
|
1853
|
+
const rawValue = msg.data["574"];
|
|
1854
|
+
const decoded = decodeTimeFormat(rawValue);
|
|
1855
|
+
return {
|
|
1856
|
+
schedule_start_time: decoded ? decoded.startTime : "--:--",
|
|
1857
|
+
schedule_end_time: decoded ? decoded.endTime : "--:--",
|
|
1858
|
+
schedule_time_raw: rawValue,
|
|
1859
|
+
};
|
|
1860
|
+
}
|
|
1861
|
+
},
|
|
1862
|
+
},
|
|
1863
|
+
],
|
|
1864
|
+
toZigbee: [
|
|
1865
|
+
{
|
|
1866
|
+
key: ["schedule_start_time", "schedule_end_time"],
|
|
1867
|
+
convertSet: async (entity, key, value, meta) => {
|
|
1868
|
+
(0, utils_1.assertString)(value);
|
|
1869
|
+
// Read current and replace the attribute being edited
|
|
1870
|
+
const newData = {
|
|
1871
|
+
schedule_start_time: meta.state?.schedule_start_time,
|
|
1872
|
+
schedule_end_time: meta.state?.schedule_end_time,
|
|
1873
|
+
schedule_time_raw: meta.state?.schedule_time_raw,
|
|
1874
|
+
};
|
|
1875
|
+
newData[key] = value;
|
|
1876
|
+
const startTime = newData.schedule_start_time != null && typeof newData.schedule_start_time === "string"
|
|
1877
|
+
? newData.schedule_start_time
|
|
1878
|
+
: "00:00";
|
|
1879
|
+
const endTime = newData.schedule_end_time != null && typeof newData.schedule_end_time === "string" ? newData.schedule_end_time : "00:00";
|
|
1880
|
+
// Encode and write
|
|
1881
|
+
const encodedValue = encodeTimeFormat(startTime, endTime);
|
|
1882
|
+
newData.schedule_time_raw = encodedValue;
|
|
1883
|
+
await entity.write("manuSpecificLumi", { 574: { value: encodedValue, type: 0x0023 } }, { manufacturerCode: exports.manufacturerCode });
|
|
1884
|
+
return { state: newData };
|
|
1885
|
+
},
|
|
1886
|
+
convertGet: async (entity, key, meta) => {
|
|
1887
|
+
const endpoint = meta.device.getEndpoint(1);
|
|
1888
|
+
await endpoint.read("manuSpecificLumi", [0x023e], { manufacturerCode: exports.manufacturerCode });
|
|
1889
|
+
},
|
|
1890
|
+
},
|
|
1891
|
+
],
|
|
1892
|
+
};
|
|
1893
|
+
},
|
|
1789
1894
|
lumiButtonLock: (args) => modernExtend.binary({
|
|
1790
1895
|
name: "button_lock",
|
|
1791
1896
|
cluster: "manuSpecificLumi",
|
|
@@ -2107,6 +2212,131 @@ exports.lumiModernExtend = {
|
|
|
2107
2212
|
];
|
|
2108
2213
|
return { exposes, fromZigbee, isModernExtend: true };
|
|
2109
2214
|
},
|
|
2215
|
+
fp300PIRDetection: () => {
|
|
2216
|
+
const attribute = { ID: 0x014d, type: 0x20 }; // Attribute: 333
|
|
2217
|
+
return modernExtend.binary({
|
|
2218
|
+
name: "pir_detection",
|
|
2219
|
+
valueOn: [true, 1],
|
|
2220
|
+
valueOff: [false, 0],
|
|
2221
|
+
access: "STATE_GET",
|
|
2222
|
+
cluster: "manuSpecificLumi",
|
|
2223
|
+
attribute: attribute,
|
|
2224
|
+
description: "Indicates whether the PIR sensor detects motion (in mmWave + PIR mode after mmWave presence detection PIR sensors gets turned off so this attribute might change to false although the presence is detected).",
|
|
2225
|
+
});
|
|
2226
|
+
},
|
|
2227
|
+
fp300DetectionRange: (args) => {
|
|
2228
|
+
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
|
|
2229
|
+
args = {
|
|
2230
|
+
rangeOffset: 0.25,
|
|
2231
|
+
rangesCount: 24,
|
|
2232
|
+
...args,
|
|
2233
|
+
};
|
|
2234
|
+
let detectionRangeComposite = e
|
|
2235
|
+
.composite("detection_range_composite", "detection_range_composite", ea.ALL)
|
|
2236
|
+
.withDescription("Specifies the detection range using set of boolean settings.");
|
|
2237
|
+
for (let i = 0; i < args.rangesCount; ++i) {
|
|
2238
|
+
detectionRangeComposite = detectionRangeComposite.withFeature(e
|
|
2239
|
+
.binary(`detection_range_${i}`, ea.SET, true, false)
|
|
2240
|
+
.withDescription(`${(i * args.rangeOffset).toFixed(2)}m - ${(i * args.rangeOffset + 1).toFixed(2)}m`));
|
|
2241
|
+
}
|
|
2242
|
+
return {
|
|
2243
|
+
isModernExtend: true,
|
|
2244
|
+
exposes: [
|
|
2245
|
+
e
|
|
2246
|
+
.numeric("detection_range", ea.ALL)
|
|
2247
|
+
.withValueMin(0)
|
|
2248
|
+
.withValueMax((1 << 24) - 1)
|
|
2249
|
+
.withValueStep(1)
|
|
2250
|
+
.withDescription("Specifies the range that is being detected. Requires mmWave radar mode. Press the on-device button to wake the device up and refresh its' settings."),
|
|
2251
|
+
detectionRangeComposite,
|
|
2252
|
+
],
|
|
2253
|
+
fromZigbee: [
|
|
2254
|
+
{
|
|
2255
|
+
cluster: "manuSpecificLumi",
|
|
2256
|
+
type: ["attributeReport", "readResponse"],
|
|
2257
|
+
convert: (model, msg, publish, options, meta) => {
|
|
2258
|
+
if (msg.data["410"] && node_buffer_1.Buffer.isBuffer(msg.data["410"])) {
|
|
2259
|
+
const buffer = msg.data["410"];
|
|
2260
|
+
const detection_range_value = buffer.length > 0 ? buffer.readUIntLE(2, 3) : 0xffffff;
|
|
2261
|
+
return {
|
|
2262
|
+
detection_range_prefix: buffer.length > 0 ? buffer.readUIntLE(0, 2) : 0x0300,
|
|
2263
|
+
detection_range: detection_range_value,
|
|
2264
|
+
detection_range_composite: encodeDetectionRangeComposite(detection_range_value, args.rangesCount),
|
|
2265
|
+
};
|
|
2266
|
+
}
|
|
2267
|
+
},
|
|
2268
|
+
},
|
|
2269
|
+
],
|
|
2270
|
+
toZigbee: [
|
|
2271
|
+
{
|
|
2272
|
+
key: ["detection_range"],
|
|
2273
|
+
convertSet: async (entity, key, value, meta) => {
|
|
2274
|
+
(0, utils_1.assertNumber)(value);
|
|
2275
|
+
const detection_range_prefix = meta.state?.detection_range_prefix != null && typeof meta.state?.detection_range_prefix === "number"
|
|
2276
|
+
? meta.state?.detection_range_prefix
|
|
2277
|
+
: 0x0300;
|
|
2278
|
+
const buffer = node_buffer_1.Buffer.allocUnsafe(5);
|
|
2279
|
+
buffer.writeUIntLE(detection_range_prefix, 0, 2);
|
|
2280
|
+
buffer.writeUIntLE(value, 2, 3);
|
|
2281
|
+
await entity.write("manuSpecificLumi", {
|
|
2282
|
+
410: { value: buffer, type: 0x41 },
|
|
2283
|
+
}, { manufacturerCode: exports.manufacturerCode });
|
|
2284
|
+
return {
|
|
2285
|
+
state: {
|
|
2286
|
+
detection_range: value,
|
|
2287
|
+
detection_range_composite: encodeDetectionRangeComposite(value, args.rangesCount),
|
|
2288
|
+
},
|
|
2289
|
+
};
|
|
2290
|
+
},
|
|
2291
|
+
convertGet: async (entity, key, meta) => {
|
|
2292
|
+
const endpoint = meta.device.getEndpoint(1);
|
|
2293
|
+
await endpoint.read("manuSpecificLumi", [0x019a], { manufacturerCode: exports.manufacturerCode });
|
|
2294
|
+
},
|
|
2295
|
+
},
|
|
2296
|
+
{
|
|
2297
|
+
key: ["detection_range_composite"],
|
|
2298
|
+
convertSet: async (entity, key, value, meta) => {
|
|
2299
|
+
(0, utils_1.assertObject)(value);
|
|
2300
|
+
const detection_range_prefix = meta.state?.detection_range_prefix != null && typeof meta.state?.detection_range_prefix === "number"
|
|
2301
|
+
? meta.state?.detection_range_prefix
|
|
2302
|
+
: 0x0300;
|
|
2303
|
+
const detection_range_value = decodeDetectionRangeComposite(value, args.rangesCount);
|
|
2304
|
+
const buffer = node_buffer_1.Buffer.allocUnsafe(5);
|
|
2305
|
+
buffer.writeUIntLE(detection_range_prefix, 0, 2);
|
|
2306
|
+
buffer.writeUIntLE(detection_range_value, 2, 3);
|
|
2307
|
+
await entity.write("manuSpecificLumi", { 410: { value: buffer, type: 0x41 } }, { manufacturerCode: exports.manufacturerCode });
|
|
2308
|
+
return {
|
|
2309
|
+
state: {
|
|
2310
|
+
detection_range: detection_range_value,
|
|
2311
|
+
detection_range_composite: value,
|
|
2312
|
+
},
|
|
2313
|
+
};
|
|
2314
|
+
},
|
|
2315
|
+
convertGet: async (entity, key, meta) => {
|
|
2316
|
+
const endpoint = meta.device.getEndpoint(1);
|
|
2317
|
+
await endpoint.read("manuSpecificLumi", [0x019a], { manufacturerCode: exports.manufacturerCode });
|
|
2318
|
+
},
|
|
2319
|
+
},
|
|
2320
|
+
],
|
|
2321
|
+
};
|
|
2322
|
+
},
|
|
2323
|
+
fp300TrackDistance: () => {
|
|
2324
|
+
return {
|
|
2325
|
+
isModernExtend: true,
|
|
2326
|
+
exposes: [
|
|
2327
|
+
e.enum("track_target_distance", ea.SET, ["start_tracking_distance"]).withDescription("Initiate current target distance tracking."),
|
|
2328
|
+
],
|
|
2329
|
+
toZigbee: [
|
|
2330
|
+
{
|
|
2331
|
+
key: ["track_target_distance"],
|
|
2332
|
+
convertSet: async (entity, key, value, meta) => {
|
|
2333
|
+
// Uint8: 1 (0x08) attribute 0x0198 (attribute: 408)
|
|
2334
|
+
await entity.write("manuSpecificLumi", { 408: { value: 1, type: 0x20 } }, { manufacturerCode: exports.manufacturerCode });
|
|
2335
|
+
},
|
|
2336
|
+
},
|
|
2337
|
+
],
|
|
2338
|
+
};
|
|
2339
|
+
},
|
|
2110
2340
|
fp1ePresence: () => {
|
|
2111
2341
|
const attribute = { ID: 0x0142, type: 0x20 };
|
|
2112
2342
|
return modernExtend.binary({
|