zigbee-herdsman-converters 25.71.0 → 25.73.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 +37 -0
- package/dist/devices/ikea.d.ts.map +1 -1
- package/dist/devices/ikea.js +21 -3
- package/dist/devices/ikea.js.map +1 -1
- package/dist/devices/lumi.d.ts.map +1 -1
- package/dist/devices/lumi.js +78 -10
- package/dist/devices/lumi.js.map +1 -1
- package/dist/devices/multir.d.ts.map +1 -1
- package/dist/devices/multir.js +15 -6
- package/dist/devices/multir.js.map +1 -1
- package/dist/devices/namron.d.ts.map +1 -1
- package/dist/devices/namron.js +100 -0
- package/dist/devices/namron.js.map +1 -1
- package/dist/devices/ozsmartthings.js +1 -1
- package/dist/devices/ozsmartthings.js.map +1 -1
- package/dist/devices/philips.d.ts.map +1 -1
- package/dist/devices/philips.js +186 -0
- package/dist/devices/philips.js.map +1 -1
- package/dist/devices/shinasystem.d.ts.map +1 -1
- package/dist/devices/shinasystem.js +99 -0
- package/dist/devices/shinasystem.js.map +1 -1
- package/dist/devices/slacky_diy.d.ts.map +1 -1
- package/dist/devices/slacky_diy.js +9 -1
- package/dist/devices/slacky_diy.js.map +1 -1
- package/dist/devices/smarli.d.ts.map +1 -1
- package/dist/devices/smarli.js +51 -0
- package/dist/devices/smarli.js.map +1 -1
- package/dist/devices/third_reality.d.ts.map +1 -1
- package/dist/devices/third_reality.js +27 -24
- package/dist/devices/third_reality.js.map +1 -1
- package/dist/devices/tuya.d.ts.map +1 -1
- package/dist/devices/tuya.js +129 -99
- package/dist/devices/tuya.js.map +1 -1
- package/dist/devices/woolley.d.ts.map +1 -1
- package/dist/devices/woolley.js +12 -0
- package/dist/devices/woolley.js.map +1 -1
- package/dist/lib/ikea.d.ts +5 -0
- package/dist/lib/ikea.d.ts.map +1 -1
- package/dist/lib/ikea.js +70 -1
- package/dist/lib/ikea.js.map +1 -1
- package/dist/lib/lumi.d.ts +42 -12
- package/dist/lib/lumi.d.ts.map +1 -1
- package/dist/lib/lumi.js +401 -116
- package/dist/lib/lumi.js.map +1 -1
- package/dist/models-index.json +1 -1
- package/package.json +1 -1
package/dist/devices/philips.js
CHANGED
|
@@ -41,8 +41,138 @@ const exposes = __importStar(require("../lib/exposes"));
|
|
|
41
41
|
const m = __importStar(require("../lib/modernExtend"));
|
|
42
42
|
const philips = __importStar(require("../lib/philips"));
|
|
43
43
|
const reporting = __importStar(require("../lib/reporting"));
|
|
44
|
+
const utils = __importStar(require("../lib/utils"));
|
|
44
45
|
const e = exposes.presets;
|
|
45
46
|
const ea = exposes.access;
|
|
47
|
+
const HUE_CHIME_META = {
|
|
48
|
+
manufacturerCode: zigbee_herdsman_1.Zcl.ManufacturerCode.SIGNIFY_NETHERLANDS_B_V,
|
|
49
|
+
disableDefaultResponse: true,
|
|
50
|
+
};
|
|
51
|
+
const tzLocal = {
|
|
52
|
+
play_sound: {
|
|
53
|
+
key: ["play_sound"],
|
|
54
|
+
convertSet: async (entity, key, value, meta) => {
|
|
55
|
+
utils.assertObject(value);
|
|
56
|
+
// payload: {"sound": <key from sounds dict>, "volume": <0-100>}
|
|
57
|
+
const sounds = {
|
|
58
|
+
triple_beep: 1,
|
|
59
|
+
bleep: 2,
|
|
60
|
+
ding_dong_classic: 3,
|
|
61
|
+
ding_dong_modern: 4,
|
|
62
|
+
rise: 5,
|
|
63
|
+
// the siren appears to be sound ID 6, but it can only be triggered with a separate command
|
|
64
|
+
westminster_classic: 7,
|
|
65
|
+
westminster_modern: 8,
|
|
66
|
+
ding_dong_xylo: 9,
|
|
67
|
+
hue_default: 10,
|
|
68
|
+
sonar: 11,
|
|
69
|
+
swing: 12,
|
|
70
|
+
bright: 13,
|
|
71
|
+
glow: 14, // sounds 14-21 are only available in firmware version >= 1.123.13
|
|
72
|
+
bounce: 15,
|
|
73
|
+
reveal: 16,
|
|
74
|
+
welcome: 17,
|
|
75
|
+
bright_modern: 18,
|
|
76
|
+
fairy: 19,
|
|
77
|
+
galaxy: 20,
|
|
78
|
+
echo: 21,
|
|
79
|
+
};
|
|
80
|
+
const volume_int = Math.round(value.volume * 2.53); // convert from 0-100 to 0-253
|
|
81
|
+
const payload = Buffer.from([
|
|
82
|
+
0x01, // constant
|
|
83
|
+
utils.getFromLookup(value.sound, sounds, 10), // sound ID
|
|
84
|
+
0x00, // constant
|
|
85
|
+
0x00, // constant
|
|
86
|
+
0x00, // constant
|
|
87
|
+
volume_int ?? 0xfd, // volume
|
|
88
|
+
]);
|
|
89
|
+
if (value.sound === "triple_beep") {
|
|
90
|
+
// This sound can only be triggered with a separate command that doesn't appear to
|
|
91
|
+
// support volume. It's unclear how to trigger this from the Hue bridge, and the
|
|
92
|
+
// identify command blinks the LED, so I'm not sure what this is actually used for.
|
|
93
|
+
// I figured having this sound available only at max volume is better than not
|
|
94
|
+
// having it available at all.
|
|
95
|
+
await entity.command("customHueChime", "playTripleBeep",
|
|
96
|
+
// @ts-expect-error no typing yet for toZigbee converters
|
|
97
|
+
{ data: "ffffff" }, // value doesn't appear to matter as long as it's 3 bytes
|
|
98
|
+
HUE_CHIME_META);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
// @ts-expect-error no typing yet for toZigbee converters
|
|
102
|
+
await entity.command("customHueChime", "playSound", { data: payload }, HUE_CHIME_META);
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
trigger_siren: {
|
|
107
|
+
key: ["trigger_siren"],
|
|
108
|
+
convertSet: async (entity, key, value, meta) => {
|
|
109
|
+
utils.assertObject(value);
|
|
110
|
+
const duration_ms = Math.round(value.duration * 1000);
|
|
111
|
+
const duration_bytes = [duration_ms & 0xff, (duration_ms >> 8) & 0xff, (duration_ms >> 16) & 0xff];
|
|
112
|
+
// payload: {"duration": <0-16777>} (seconds) (but please don't trigger the siren for 4+ hours)
|
|
113
|
+
const payload = Buffer.from([
|
|
114
|
+
0x02, // constant
|
|
115
|
+
0x06, // constant
|
|
116
|
+
0x00, // constant
|
|
117
|
+
0x00, // constant
|
|
118
|
+
0x00, // constant
|
|
119
|
+
duration_bytes[0],
|
|
120
|
+
duration_bytes[1],
|
|
121
|
+
duration_bytes[2], // duration converted to ms, little endian
|
|
122
|
+
0x00, // constant
|
|
123
|
+
]);
|
|
124
|
+
// @ts-expect-error no typing yet for toZigbee converters
|
|
125
|
+
await entity.command("customHueChime", "triggerSiren", { data: payload }, HUE_CHIME_META);
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
mute_unmute: {
|
|
129
|
+
key: ["state"],
|
|
130
|
+
convertSet: async (entity, key, value, meta) => {
|
|
131
|
+
if (value === "ON") {
|
|
132
|
+
// @ts-expect-error no typing yet for toZigbee converters
|
|
133
|
+
await entity.command("customHueChime", "unmute", {}, HUE_CHIME_META);
|
|
134
|
+
}
|
|
135
|
+
else if (value === "OFF") {
|
|
136
|
+
// @ts-expect-error no typing yet for toZigbee converters
|
|
137
|
+
await entity.command("customHueChime", "mute", {}, HUE_CHIME_META);
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
convertGet: async (entity, key, meta) => {
|
|
141
|
+
// @ts-expect-error no typing yet for toZigbee converters
|
|
142
|
+
await entity.read("customHueChime", ["sirenIsMuted"], HUE_CHIME_META);
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
const fzLocal = {
|
|
147
|
+
siren_is_muted: {
|
|
148
|
+
cluster: "customHueChime",
|
|
149
|
+
type: ["attributeReport", "readResponse"],
|
|
150
|
+
convert: (model, msg, publish, options, meta) => {
|
|
151
|
+
if ("sirenIsMuted" in msg.data) {
|
|
152
|
+
return { state: msg.data.sirenIsMuted ? "OFF" : "ON" };
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
};
|
|
157
|
+
const extendLocal = {
|
|
158
|
+
addCustomClusterHueChime: () => m.deviceAddCustomCluster("customHueChime", {
|
|
159
|
+
ID: 0xfc07,
|
|
160
|
+
manufacturerCode: zigbee_herdsman_1.Zcl.ManufacturerCode.SIGNIFY_NETHERLANDS_B_V,
|
|
161
|
+
attributes: {
|
|
162
|
+
sirenIsMuted: { ID: 0x0000, type: zigbee_herdsman_1.Zcl.DataType.BOOLEAN },
|
|
163
|
+
soundIDPlaying: { ID: 0x0001, type: zigbee_herdsman_1.Zcl.DataType.UINT32 },
|
|
164
|
+
unknownAttr: { ID: 0x0002, type: zigbee_herdsman_1.Zcl.DataType.UINT32 },
|
|
165
|
+
},
|
|
166
|
+
commands: {
|
|
167
|
+
mute: { ID: 0x00, parameters: [] },
|
|
168
|
+
unmute: { ID: 0x01, parameters: [] },
|
|
169
|
+
triggerSiren: { ID: 0x02, parameters: [{ name: "data", type: zigbee_herdsman_1.Zcl.BuffaloZclDataType.BUFFER }] },
|
|
170
|
+
playSound: { ID: 0x03, parameters: [{ name: "data", type: zigbee_herdsman_1.Zcl.BuffaloZclDataType.BUFFER }] },
|
|
171
|
+
playTripleBeep: { ID: 0x04, parameters: [{ name: "data", type: zigbee_herdsman_1.Zcl.BuffaloZclDataType.BUFFER }] },
|
|
172
|
+
},
|
|
173
|
+
commandsResponse: {},
|
|
174
|
+
}),
|
|
175
|
+
};
|
|
46
176
|
exports.definitions = [
|
|
47
177
|
{
|
|
48
178
|
zigbeeModel: ["929004610602"],
|
|
@@ -4464,5 +4594,61 @@ exports.definitions = [
|
|
|
4464
4594
|
description: "Hue smart button",
|
|
4465
4595
|
extend: [m.battery(), m.commandsOnOff(), m.commandsLevelCtrl()],
|
|
4466
4596
|
},
|
|
4597
|
+
{
|
|
4598
|
+
zigbeeModel: ["COM001"],
|
|
4599
|
+
model: "8720169277243",
|
|
4600
|
+
vendor: "Philips",
|
|
4601
|
+
description: "Hue Secure siren and chime",
|
|
4602
|
+
extend: [extendLocal.addCustomClusterHueChime(), m.identify()],
|
|
4603
|
+
toZigbee: [tzLocal.play_sound, tzLocal.trigger_siren, tzLocal.mute_unmute],
|
|
4604
|
+
fromZigbee: [fzLocal.siren_is_muted],
|
|
4605
|
+
ota: true,
|
|
4606
|
+
configure: async (device, coordinatorEndpoint) => {
|
|
4607
|
+
const endpoint = device.getEndpoint(11);
|
|
4608
|
+
await reporting.bind(endpoint, coordinatorEndpoint, ["customHueChime"]);
|
|
4609
|
+
await endpoint.configureReporting("customHueChime", [
|
|
4610
|
+
{ attribute: "sirenIsMuted", minimumReportInterval: 0, maximumReportInterval: 300, reportableChange: 0 },
|
|
4611
|
+
{ attribute: "soundIDPlaying", minimumReportInterval: 0, maximumReportInterval: 300, reportableChange: 0 },
|
|
4612
|
+
{ attribute: "unknownAttr", minimumReportInterval: 0, maximumReportInterval: 300, reportableChange: 0 },
|
|
4613
|
+
]);
|
|
4614
|
+
},
|
|
4615
|
+
exposes: [
|
|
4616
|
+
exposes.switch().withState("state", false, "Mute/unmute siren (off = muted)"),
|
|
4617
|
+
exposes
|
|
4618
|
+
.composite("play_sound", "play_sound", ea.SET)
|
|
4619
|
+
.withFeature(exposes.enum("sound", ea.SET, [
|
|
4620
|
+
"bleep",
|
|
4621
|
+
"bounce",
|
|
4622
|
+
"bright",
|
|
4623
|
+
"bright_modern",
|
|
4624
|
+
"ding_dong_classic",
|
|
4625
|
+
"ding_dong_modern",
|
|
4626
|
+
"ding_dong_xylo",
|
|
4627
|
+
"echo",
|
|
4628
|
+
"fairy",
|
|
4629
|
+
"galaxy",
|
|
4630
|
+
"glow",
|
|
4631
|
+
"hue_default",
|
|
4632
|
+
"reveal",
|
|
4633
|
+
"rise",
|
|
4634
|
+
"sonar",
|
|
4635
|
+
"swing",
|
|
4636
|
+
"triple_beep",
|
|
4637
|
+
"welcome",
|
|
4638
|
+
"westminster_classic",
|
|
4639
|
+
"westminster_modern",
|
|
4640
|
+
]))
|
|
4641
|
+
.withFeature(exposes.numeric("volume", ea.SET).withValueMin(0).withValueMax(100).withDescription("Volume 0-100")),
|
|
4642
|
+
exposes
|
|
4643
|
+
.composite("trigger_siren", "trigger_siren", ea.SET)
|
|
4644
|
+
.withFeature(exposes
|
|
4645
|
+
.numeric("duration", ea.SET)
|
|
4646
|
+
.withUnit("seconds")
|
|
4647
|
+
.withValueMin(0)
|
|
4648
|
+
.withValueMax(600)
|
|
4649
|
+
.withValueStep(1)
|
|
4650
|
+
.withPreset("stop", 0, "Stop the siren")),
|
|
4651
|
+
],
|
|
4652
|
+
},
|
|
4467
4653
|
];
|
|
4468
4654
|
//# sourceMappingURL=philips.js.map
|