zigbee-herdsman-converters 25.113.0 → 25.115.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.
@@ -106,49 +106,171 @@ const tzLocal = {
106
106
  },
107
107
  };
108
108
  const sonoffExtend = {
109
- addCustomClusterEwelink: () => m.deviceAddCustomCluster("customClusterEwelink", {
110
- ID: 0xfc11,
111
- attributes: {
112
- networkLed: { ID: 0x0001, type: zigbee_herdsman_1.Zcl.DataType.BOOLEAN, write: true },
113
- backLight: { ID: 0x0002, type: zigbee_herdsman_1.Zcl.DataType.BOOLEAN, write: true },
114
- faultCode: { ID: 0x0010, type: zigbee_herdsman_1.Zcl.DataType.INT32, write: true, min: -2147483648 },
115
- radioPower: { ID: 0x0012, type: zigbee_herdsman_1.Zcl.DataType.INT16, write: true, min: -32768 },
116
- radioPowerWithManuCode: {
117
- ID: 0x0012,
118
- type: zigbee_herdsman_1.Zcl.DataType.INT16,
119
- manufacturerCode: zigbee_herdsman_1.Zcl.ManufacturerCode.SHENZHEN_COOLKIT_TECHNOLOGY_CO_LTD,
120
- write: true,
121
- min: -32768,
109
+ addCustomClusterEwelink: () => {
110
+ return m.deviceAddCustomCluster("customClusterEwelink", {
111
+ ID: 0xfc11,
112
+ attributes: {
113
+ networkLed: { ID: 0x0001, type: zigbee_herdsman_1.Zcl.DataType.BOOLEAN, write: true },
114
+ backLight: { ID: 0x0002, type: zigbee_herdsman_1.Zcl.DataType.BOOLEAN, write: true },
115
+ faultCode: { ID: 0x0010, type: zigbee_herdsman_1.Zcl.DataType.INT32, write: true, min: -2147483648 },
116
+ radioPower: { ID: 0x0012, type: zigbee_herdsman_1.Zcl.DataType.INT16, write: true, min: -32768 },
117
+ radioPowerWithManuCode: {
118
+ ID: 0x0012,
119
+ type: zigbee_herdsman_1.Zcl.DataType.INT16,
120
+ manufacturerCode: zigbee_herdsman_1.Zcl.ManufacturerCode.SHENZHEN_COOLKIT_TECHNOLOGY_CO_LTD,
121
+ write: true,
122
+ min: -32768,
123
+ },
124
+ delayedPowerOnState: { ID: 0x0014, type: zigbee_herdsman_1.Zcl.DataType.BOOLEAN, write: true },
125
+ delayedPowerOnTime: { ID: 0x0015, type: zigbee_herdsman_1.Zcl.DataType.UINT16, write: true, max: 0xffff },
126
+ externalTriggerMode: { ID: 0x0016, type: zigbee_herdsman_1.Zcl.DataType.UINT8, write: true, max: 0xff },
127
+ detachRelayMode: { ID: 0x0017, type: zigbee_herdsman_1.Zcl.DataType.BOOLEAN, write: true },
128
+ deviceWorkMode: { ID: 0x0018, type: zigbee_herdsman_1.Zcl.DataType.UINT8, write: true, max: 0xff },
129
+ detachRelayMode2: { ID: 0x0019, type: zigbee_herdsman_1.Zcl.DataType.BITMAP8, write: true },
130
+ motorTravelCalibrationAction: { ID: 0x5001, type: zigbee_herdsman_1.Zcl.DataType.UINT8, write: true, max: 0xff },
131
+ lackWaterCloseValveTimeout: { ID: 0x5011, type: zigbee_herdsman_1.Zcl.DataType.UINT16, write: true, max: 0xffff },
132
+ motorTravelCalibrationStatus: { ID: 0x5012, type: zigbee_herdsman_1.Zcl.DataType.UINT8, write: true, max: 0xff },
133
+ motorRunStatus: { ID: 0x5013, type: zigbee_herdsman_1.Zcl.DataType.UINT8, write: true, max: 0xff },
134
+ acCurrentCurrentValue: { ID: 0x7004, type: zigbee_herdsman_1.Zcl.DataType.UINT32, write: true, max: 0xffffffff },
135
+ acCurrentVoltageValue: { ID: 0x7005, type: zigbee_herdsman_1.Zcl.DataType.UINT32, write: true, max: 0xffffffff },
136
+ acCurrentPowerValue: { ID: 0x7006, type: zigbee_herdsman_1.Zcl.DataType.UINT32, write: true, max: 0xffffffff },
137
+ outlet_control_protect: { ID: 0x7007, type: zigbee_herdsman_1.Zcl.DataType.UINT8, write: true, max: 0xff },
138
+ energyToday: { ID: 0x7009, type: zigbee_herdsman_1.Zcl.DataType.UINT32, write: true, max: 0xffffffff },
139
+ energyMonth: { ID: 0x700a, type: zigbee_herdsman_1.Zcl.DataType.UINT32, write: true, max: 0xffffffff },
140
+ energyYesterday: { ID: 0x700b, type: zigbee_herdsman_1.Zcl.DataType.UINT32, write: true, max: 0xffffffff },
141
+ setCalibrationAction: { ID: 0x001d, type: zigbee_herdsman_1.Zcl.DataType.CHAR_STR, write: true },
142
+ calibrationStatus: { ID: 0x001e, type: zigbee_herdsman_1.Zcl.DataType.UINT8, write: true, max: 0xff },
143
+ calibrationProgress: { ID: 0x0020, type: zigbee_herdsman_1.Zcl.DataType.UINT8, write: true, max: 0xff },
144
+ minBrightnessThreshold: { ID: 0x4001, type: zigbee_herdsman_1.Zcl.DataType.UINT8, write: true, max: 0xff },
145
+ dimmingLightRate: { ID: 0x4003, type: zigbee_herdsman_1.Zcl.DataType.UINT8, write: true, max: 0xff },
146
+ transitionTime: { ID: 0x001f, type: zigbee_herdsman_1.Zcl.DataType.UINT32, write: true, max: 0xffffffff },
147
+ programmableStepperSequence: { ID: 0x0022, type: zigbee_herdsman_1.Zcl.DataType.ARRAY, write: true },
122
148
  },
123
- delayedPowerOnState: { ID: 0x0014, type: zigbee_herdsman_1.Zcl.DataType.BOOLEAN, write: true },
124
- delayedPowerOnTime: { ID: 0x0015, type: zigbee_herdsman_1.Zcl.DataType.UINT16, write: true, max: 0xffff },
125
- externalTriggerMode: { ID: 0x0016, type: zigbee_herdsman_1.Zcl.DataType.UINT8, write: true, max: 0xff },
126
- detachRelayMode: { ID: 0x0017, type: zigbee_herdsman_1.Zcl.DataType.BOOLEAN, write: true },
127
- deviceWorkMode: { ID: 0x0018, type: zigbee_herdsman_1.Zcl.DataType.UINT8, write: true, max: 0xff },
128
- detachRelayMode2: { ID: 0x0019, type: zigbee_herdsman_1.Zcl.DataType.BITMAP8, write: true },
129
- motorTravelCalibrationAction: { ID: 0x5001, type: zigbee_herdsman_1.Zcl.DataType.UINT8, write: true, max: 0xff },
130
- lackWaterCloseValveTimeout: { ID: 0x5011, type: zigbee_herdsman_1.Zcl.DataType.UINT16, write: true, max: 0xffff },
131
- motorTravelCalibrationStatus: { ID: 0x5012, type: zigbee_herdsman_1.Zcl.DataType.UINT8, write: true, max: 0xff },
132
- motorRunStatus: { ID: 0x5013, type: zigbee_herdsman_1.Zcl.DataType.UINT8, write: true, max: 0xff },
133
- acCurrentCurrentValue: { ID: 0x7004, type: zigbee_herdsman_1.Zcl.DataType.UINT32, write: true, max: 0xffffffff },
134
- acCurrentVoltageValue: { ID: 0x7005, type: zigbee_herdsman_1.Zcl.DataType.UINT32, write: true, max: 0xffffffff },
135
- acCurrentPowerValue: { ID: 0x7006, type: zigbee_herdsman_1.Zcl.DataType.UINT32, write: true, max: 0xffffffff },
136
- outlet_control_protect: { ID: 0x7007, type: zigbee_herdsman_1.Zcl.DataType.UINT8, write: true, max: 0xff },
137
- energyToday: { ID: 0x7009, type: zigbee_herdsman_1.Zcl.DataType.UINT32, write: true, max: 0xffffffff },
138
- energyMonth: { ID: 0x700a, type: zigbee_herdsman_1.Zcl.DataType.UINT32, write: true, max: 0xffffffff },
139
- energyYesterday: { ID: 0x700b, type: zigbee_herdsman_1.Zcl.DataType.UINT32, write: true, max: 0xffffffff },
140
- setCalibrationAction: { ID: 0x001d, type: zigbee_herdsman_1.Zcl.DataType.CHAR_STR, write: true },
141
- calibrationStatus: { ID: 0x001e, type: zigbee_herdsman_1.Zcl.DataType.UINT8, write: true, max: 0xff },
142
- calibrationProgress: { ID: 0x0020, type: zigbee_herdsman_1.Zcl.DataType.UINT8, write: true, max: 0xff },
143
- minBrightnessThreshold: { ID: 0x4001, type: zigbee_herdsman_1.Zcl.DataType.UINT8, write: true, max: 0xff },
144
- dimmingLightRate: { ID: 0x4003, type: zigbee_herdsman_1.Zcl.DataType.UINT8, write: true, max: 0xff },
145
- transitionTime: { ID: 0x001f, type: zigbee_herdsman_1.Zcl.DataType.UINT32, write: true, max: 0xffffffff },
146
- },
147
- commands: {
148
- protocolData: { ID: 0x01, parameters: [{ name: "data", type: zigbee_herdsman_1.Zcl.BuffaloZclDataType.LIST_UINT8 }] },
149
- },
150
- commandsResponse: {},
151
- }),
149
+ commands: {
150
+ protocolData: { ID: 0x01, parameters: [{ name: "data", type: zigbee_herdsman_1.Zcl.BuffaloZclDataType.LIST_UINT8 }] },
151
+ },
152
+ commandsResponse: {},
153
+ });
154
+ },
155
+ programmableStepperSequence(sequences) {
156
+ const stepComposite = (n) => {
157
+ return e
158
+ .composite(`step_${n}`, `step_${n}`, ea.ALL)
159
+ .withFeature(e.binary("enable_step", ea.ALL, true, false).withDescription("Enable/disable this step."))
160
+ .withFeature(e.binary("relay_outlet_1", ea.ALL, true, false).withDescription("Outlet 1 relay state."))
161
+ .withFeature(e.binary("relay_outlet_2", ea.ALL, true, false).withDescription("Outlet 2 relay state."));
162
+ };
163
+ const exposes = sequences.map((seq) => {
164
+ return e
165
+ .composite(`programmable_stepper_seq${seq}`, `programmable_stepper_seq${seq}`, ea.ALL)
166
+ .withDescription(`Configure programmable stepper sequence ${seq}.`)
167
+ .withFeature(e.binary("enable_stepper", ea.ALL, true, false).withDescription("Enable/disable the stepper sequence."))
168
+ .withFeature(e
169
+ .numeric("switch_outlet", ea.ALL)
170
+ .withValueMin(1)
171
+ .withValueMax(2)
172
+ .withValueStep(1)
173
+ .withDescription("The outlet channel of the external trigger switch bound to this sequence."))
174
+ .withFeature(e.binary("enable_double_press", ea.ALL, true, false).withDescription("Enable/disable double press to switch steps."))
175
+ .withFeature(e
176
+ .numeric("double_press_interval", ea.ALL)
177
+ .withValueMin(0)
178
+ .withValueMax(32767)
179
+ .withValueStep(1)
180
+ .withUnit("ms")
181
+ .withDescription("Set the double press interval for step switching."))
182
+ .withFeature(stepComposite(1))
183
+ .withFeature(stepComposite(2))
184
+ .withFeature(stepComposite(3))
185
+ .withFeature(stepComposite(4));
186
+ });
187
+ const toZigbee = [
188
+ {
189
+ key: [...sequences.map((seq) => `programmable_stepper_seq${seq}`)],
190
+ convertSet: async (entity, key, value, meta) => {
191
+ utils.assertObject(value, key);
192
+ const array = new Uint8Array(11);
193
+ // ZCL Array
194
+ array[0] = 0x01;
195
+ array[1] = 9;
196
+ array[2] = 1;
197
+ // Sequence configs
198
+ const seqStr = key.replace("programmable_stepper_seq", "");
199
+ const seqIndex = Number.parseInt(seqStr, 10) - 1;
200
+ array[3] = (value.enable_stepper ? 0x80 : 0x00) | (seqIndex & 0x7f);
201
+ array[4] = (value.switch_outlet - 1) & 0xff;
202
+ array[5] = (value.enable_double_press ? 0x80 : 0x00) | ((value.double_press_interval >> 8) & 0x7f);
203
+ array[6] = value.double_press_interval & 0xff;
204
+ // Steps
205
+ for (let i = 0; i < 4; i++) {
206
+ const step = value[`step_${i + 1}`] ?? {};
207
+ array[7 + i] = (step.enable_step ? 0x80 : 0x00) | (step.relay_outlet_1 ? 0x01 : 0x00) | (step.relay_outlet_2 ? 0x02 : 0x00);
208
+ }
209
+ await entity.write("customClusterEwelink", {
210
+ [0x0022]: {
211
+ value: {
212
+ elementType: 0x20,
213
+ elements: array,
214
+ },
215
+ type: 0x48,
216
+ },
217
+ }, utils.getOptions(meta.mapped, entity));
218
+ return {
219
+ state: {
220
+ [key]: value,
221
+ },
222
+ };
223
+ },
224
+ },
225
+ ];
226
+ const fromZigbee = [
227
+ {
228
+ cluster: "customClusterEwelink",
229
+ type: ["attributeReport"],
230
+ convert: (model, msg) => {
231
+ if (!msg.data?.programmableStepperSequence) {
232
+ return;
233
+ }
234
+ const array = new Uint8Array(msg.data.programmableStepperSequence);
235
+ if (array[0] !== 0x01) {
236
+ return;
237
+ }
238
+ const seqCount = array[2];
239
+ const seqDataOffset = 3;
240
+ const result = {};
241
+ for (let i = 0; i < seqCount; i++) {
242
+ const offset = seqDataOffset + i * 8;
243
+ // Steps
244
+ const steps = {};
245
+ for (let j = 0; j < 4; j++) {
246
+ const currentBuffer = array[offset + 4 + j];
247
+ steps[`step_${j + 1}`] = {
248
+ enable_step: !!(currentBuffer & 0x80),
249
+ relay_outlet_1: !!(currentBuffer & 0x01),
250
+ relay_outlet_2: !!(currentBuffer & 0x02),
251
+ };
252
+ }
253
+ // Sequence configs
254
+ const seqNum = (array[offset] & 0x7f) + 1;
255
+ result[`programmable_stepper_seq${seqNum}`] = {
256
+ enable_stepper: !!(array[offset] & 0x80),
257
+ switch_outlet: array[offset + 1] + 1,
258
+ enable_double_press: !!(array[offset + 2] & 0x80),
259
+ double_press_interval: ((array[offset + 2] & 0x7f) << 8) | array[offset + 3],
260
+ ...steps,
261
+ };
262
+ }
263
+ return result;
264
+ },
265
+ },
266
+ ];
267
+ return {
268
+ exposes,
269
+ fromZigbee,
270
+ toZigbee,
271
+ isModernExtend: true,
272
+ };
273
+ },
152
274
  inchingControlSet: (args = {}, maxTime = 3599.5) => {
153
275
  const { endpointNames = undefined } = args;
154
276
  const clusterName = "customClusterEwelink";
@@ -1357,6 +1479,7 @@ exports.definitions = [
1357
1479
  model: "SNZB-02WD",
1358
1480
  vendor: "SONOFF",
1359
1481
  description: "Waterproof (IP65) temperature and humidity sensor with screen",
1482
+ ota: true,
1360
1483
  extend: [
1361
1484
  m.deviceAddCustomCluster("customSonoffSnzb02wd", {
1362
1485
  ID: 0xfc11,
@@ -2283,6 +2406,7 @@ exports.definitions = [
2283
2406
  description: "Enable/disable Radio power turbo mode",
2284
2407
  valueOff: [false, 0x09],
2285
2408
  valueOn: [true, 0x14],
2409
+ entityCategory: "config",
2286
2410
  }),
2287
2411
  sonoffExtend.inchingControlSet(),
2288
2412
  ],
@@ -2722,6 +2846,7 @@ exports.definitions = [
2722
2846
  scale: 2,
2723
2847
  endpointNames: ["l1", "l2"],
2724
2848
  }),
2849
+ sonoffExtend.programmableStepperSequence(["1", "2", "3", "4"]),
2725
2850
  ],
2726
2851
  configure: async (device, coordinatorEndpoint) => {
2727
2852
  const endpoint1 = device.getEndpoint(1);