zigbee-herdsman-converters 14.0.440 → 14.0.443
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/converters/fromZigbee.js +24 -4
- package/devices/aurora_lighting.js +1 -1
- package/devices/legrand.js +3 -3
- package/devices/lixee.js +49 -22
- package/devices/onesti.js +1 -1
- package/devices/philips.js +1 -1
- package/devices/schneider_electric.js +16 -0
- package/devices/sengled.js +40 -5
- package/devices/smartwings.js +24 -0
- package/devices/tuya.js +9 -5
- package/devices/woox.js +20 -0
- package/lib/exposes.js +2 -1
- package/lib/utils.js +17 -12
- package/npm-shrinkwrap.json +1 -1
- package/package.json +1 -1
package/converters/fromZigbee.js
CHANGED
|
@@ -423,11 +423,11 @@ const converters = {
|
|
|
423
423
|
// This is for occupancy sensor that send motion start AND stop messages
|
|
424
424
|
cluster: 'msOccupancySensing',
|
|
425
425
|
type: ['attributeReport', 'readResponse'],
|
|
426
|
-
options: [exposes.options.
|
|
426
|
+
options: [exposes.options.no_occupancy_since_false()],
|
|
427
427
|
convert: (model, msg, publish, options, meta) => {
|
|
428
428
|
if (msg.data.hasOwnProperty('occupancy')) {
|
|
429
429
|
const payload = {occupancy: (msg.data.occupancy % 2) > 0};
|
|
430
|
-
utils.noOccupancySince(msg.endpoint, payload, options, publish);
|
|
430
|
+
utils.noOccupancySince(msg.endpoint, payload, options, publish, payload.occupancy ? 'stop' : 'start');
|
|
431
431
|
return payload;
|
|
432
432
|
}
|
|
433
433
|
},
|
|
@@ -438,7 +438,7 @@ const converters = {
|
|
|
438
438
|
// Therefore we need to publish the no_motion detected by ourselves.
|
|
439
439
|
cluster: 'msOccupancySensing',
|
|
440
440
|
type: ['attributeReport', 'readResponse'],
|
|
441
|
-
options: [exposes.options.occupancy_timeout(), exposes.options.
|
|
441
|
+
options: [exposes.options.occupancy_timeout(), exposes.options.no_occupancy_since_true()],
|
|
442
442
|
convert: (model, msg, publish, options, meta) => {
|
|
443
443
|
if (msg.data.occupancy !== 1) {
|
|
444
444
|
// In case of 0 no occupancy is reported.
|
|
@@ -463,7 +463,7 @@ const converters = {
|
|
|
463
463
|
}
|
|
464
464
|
|
|
465
465
|
const payload = {occupancy: true};
|
|
466
|
-
utils.noOccupancySince(msg.endpoint, payload, options, publish);
|
|
466
|
+
utils.noOccupancySince(msg.endpoint, payload, options, publish, 'start');
|
|
467
467
|
return payload;
|
|
468
468
|
},
|
|
469
469
|
},
|
|
@@ -1018,6 +1018,16 @@ const converters = {
|
|
|
1018
1018
|
};
|
|
1019
1019
|
},
|
|
1020
1020
|
},
|
|
1021
|
+
ias_alarm_only_alarm_1: {
|
|
1022
|
+
cluster: 'ssIasZone',
|
|
1023
|
+
type: 'attributeReport',
|
|
1024
|
+
convert: (model, msg, publish, options, meta) => {
|
|
1025
|
+
const zoneStatus = msg.data.zoneStatus;
|
|
1026
|
+
return {
|
|
1027
|
+
alarm: (zoneStatus & 1) > 0,
|
|
1028
|
+
};
|
|
1029
|
+
},
|
|
1030
|
+
},
|
|
1021
1031
|
ias_occupancy_only_alarm_2: {
|
|
1022
1032
|
cluster: 'ssIasZone',
|
|
1023
1033
|
type: 'commandStatusChangeNotification',
|
|
@@ -2595,6 +2605,16 @@ const converters = {
|
|
|
2595
2605
|
return result;
|
|
2596
2606
|
},
|
|
2597
2607
|
},
|
|
2608
|
+
ts0219_power_source: {
|
|
2609
|
+
cluster: 'genBasic',
|
|
2610
|
+
type: 'attributeReport',
|
|
2611
|
+
convert: (model, msg, publish, options, meta) => {
|
|
2612
|
+
const powerSource = msg.data.powerSource;
|
|
2613
|
+
return {
|
|
2614
|
+
ac_connected: powerSource === 2 ? true : false,
|
|
2615
|
+
};
|
|
2616
|
+
},
|
|
2617
|
+
},
|
|
2598
2618
|
tuya_cover_options: {
|
|
2599
2619
|
cluster: 'closuresWindowCovering',
|
|
2600
2620
|
type: ['attributeReport', 'readResponse'],
|
|
@@ -13,7 +13,7 @@ const tzLocal = {
|
|
|
13
13
|
convertSet: async (entity, key, value, meta) => {
|
|
14
14
|
const state = value.toLowerCase();
|
|
15
15
|
utils.validateValue(state, ['toggle', 'off', 'on']);
|
|
16
|
-
const endpoint = meta.device.getEndpoint(3);
|
|
16
|
+
const endpoint = meta.mapped.model === 'AU-A1ZBDSS' ? meta.device.getEndpoint(3) : meta.device.getEndpoint(2);
|
|
17
17
|
await endpoint.command('genOnOff', state, {});
|
|
18
18
|
return {state: {backlight_led: state.toUpperCase()}};
|
|
19
19
|
},
|
package/devices/legrand.js
CHANGED
|
@@ -332,13 +332,13 @@ module.exports = [
|
|
|
332
332
|
exposes.binary('led_when_on', ea.ALL, 'ON', 'OFF').withDescription('Enables the LED when the light is on')],
|
|
333
333
|
meta: {multiEndpoint: true},
|
|
334
334
|
configure: async (device, coordinatorEndpoint, logger) => {
|
|
335
|
-
const endpointLeft = device.getEndpoint(
|
|
335
|
+
const endpointLeft = device.getEndpoint(2);
|
|
336
336
|
await reporting.bind(endpointLeft, coordinatorEndpoint, ['genOnOff']);
|
|
337
|
-
const endpointRight = device.getEndpoint(
|
|
337
|
+
const endpointRight = device.getEndpoint(1);
|
|
338
338
|
await reporting.bind(endpointRight, coordinatorEndpoint, ['genOnOff']);
|
|
339
339
|
},
|
|
340
340
|
endpoint: (device) => {
|
|
341
|
-
return {left:
|
|
341
|
+
return {left: 2, right: 1};
|
|
342
342
|
},
|
|
343
343
|
},
|
|
344
344
|
];
|
package/devices/lixee.js
CHANGED
|
@@ -271,6 +271,30 @@ const tarifsDef = {
|
|
|
271
271
|
'PJOURF+1',
|
|
272
272
|
'PPOINTE1',
|
|
273
273
|
]},
|
|
274
|
+
stand_HPHC: {fname: 'Standard - Heure Pleine Heure Creuse',
|
|
275
|
+
currentTarf: 'H PLEINE/CREUSE', excluded: [
|
|
276
|
+
'EASF03',
|
|
277
|
+
'EASF04',
|
|
278
|
+
'EASF05',
|
|
279
|
+
'EASF06',
|
|
280
|
+
'EASF07',
|
|
281
|
+
'EASF08',
|
|
282
|
+
'EASF09',
|
|
283
|
+
'EASF10',
|
|
284
|
+
'EASD02',
|
|
285
|
+
'EASD03',
|
|
286
|
+
'EASD04',
|
|
287
|
+
'DPM1',
|
|
288
|
+
'DPM2',
|
|
289
|
+
'DPM3',
|
|
290
|
+
'FPM1',
|
|
291
|
+
'FPM2',
|
|
292
|
+
'FPM3',
|
|
293
|
+
'NJOURF',
|
|
294
|
+
'NJOURF+1',
|
|
295
|
+
'PJOURF+1',
|
|
296
|
+
'PPOINTE1',
|
|
297
|
+
]},
|
|
274
298
|
};
|
|
275
299
|
|
|
276
300
|
const linkyModeDef = {
|
|
@@ -301,16 +325,16 @@ const exposedData = [
|
|
|
301
325
|
{cluster: clustersDef._0x0702, att: 'currentSummDelivered', reportable: true, report: {change: 100}, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.legacy, exposes: exposes.numeric('BASE', ea.STATE).withUnit('kWh').withProperty('current_summ_delivered').withDescription('Base index')},
|
|
302
326
|
{cluster: clustersDef._0xFF66, att: 'currentTarif', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.legacy, exposes: exposes.text('OPTARIF', ea.STATE).withProperty('current_tarif').withDescription('Tarif option')},
|
|
303
327
|
{cluster: clustersDef._0x0B01, att: 'availablePower', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.legacy, exposes: exposes.numeric('ISOUSC', ea.STATE).withUnit('A').withProperty('available_power').withDescription('Subscribed intensity level')},
|
|
304
|
-
{cluster: clustersDef._0x0702, att: 'currentTier1SummDelivered', reportable: false, report: {change: 100}, onlyProducer: false, linkyPhase: linkyPhaseDef.
|
|
305
|
-
{cluster: clustersDef._0x0702, att: 'currentTier2SummDelivered', reportable: false, report: {change: 100}, onlyProducer: false, linkyPhase: linkyPhaseDef.
|
|
306
|
-
{cluster: clustersDef._0x0702, att: 'currentTier1SummDelivered', reportable: false, report: {change: 100}, onlyProducer: false, linkyPhase: linkyPhaseDef.
|
|
307
|
-
{cluster: clustersDef._0x0702, att: 'currentTier2SummDelivered', reportable: false, report: {change: 100}, onlyProducer: false, linkyPhase: linkyPhaseDef.
|
|
308
|
-
{cluster: clustersDef._0x0702, att: 'currentTier1SummDelivered', reportable: false, report: {change: 100}, onlyProducer: false, linkyPhase: linkyPhaseDef.
|
|
309
|
-
{cluster: clustersDef._0x0702, att: 'currentTier2SummDelivered', reportable: false, report: {change: 100}, onlyProducer: false, linkyPhase: linkyPhaseDef.
|
|
310
|
-
{cluster: clustersDef._0x0702, att: 'currentTier3SummDelivered', reportable: false, report: {change: 100}, onlyProducer: false, linkyPhase: linkyPhaseDef.
|
|
311
|
-
{cluster: clustersDef._0x0702, att: 'currentTier4SummDelivered', reportable: false, report: {change: 100}, onlyProducer: false, linkyPhase: linkyPhaseDef.
|
|
312
|
-
{cluster: clustersDef._0x0702, att: 'currentTier5SummDelivered', reportable: false, report: {change: 100}, onlyProducer: false, linkyPhase: linkyPhaseDef.
|
|
313
|
-
{cluster: clustersDef._0x0702, att: 'currentTier6SummDelivered', reportable: false, report: {change: 100}, onlyProducer: false, linkyPhase: linkyPhaseDef.
|
|
328
|
+
{cluster: clustersDef._0x0702, att: 'currentTier1SummDelivered', reportable: false, report: {change: 100}, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.legacy, exposes: exposes.numeric('HCHC', ea.STATE).withUnit('kWh').withProperty('current_tier1_summ_delivered').withDescription('HCHC index')},
|
|
329
|
+
{cluster: clustersDef._0x0702, att: 'currentTier2SummDelivered', reportable: false, report: {change: 100}, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.legacy, exposes: exposes.numeric('HCHP', ea.STATE).withUnit('kWh').withProperty('current_tier2_summ_delivered').withDescription('HCHP index')},
|
|
330
|
+
{cluster: clustersDef._0x0702, att: 'currentTier1SummDelivered', reportable: false, report: {change: 100}, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.legacy, exposes: exposes.numeric('EJPHN', ea.STATE).withUnit('kWh').withProperty('current_tier1_summ_delivered').withDescription('EJPHN index')},
|
|
331
|
+
{cluster: clustersDef._0x0702, att: 'currentTier2SummDelivered', reportable: false, report: {change: 100}, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.legacy, exposes: exposes.numeric('EJPHPM', ea.STATE).withUnit('kWh').withProperty('current_tier2_summ_delivered').withDescription('EJPHPM index')},
|
|
332
|
+
{cluster: clustersDef._0x0702, att: 'currentTier1SummDelivered', reportable: false, report: {change: 100}, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.legacy, exposes: exposes.numeric('BBRHCJB', ea.STATE).withUnit('kWh').withProperty('current_tier1_summ_delivered').withDescription('BBRHCJB index')},
|
|
333
|
+
{cluster: clustersDef._0x0702, att: 'currentTier2SummDelivered', reportable: false, report: {change: 100}, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.legacy, exposes: exposes.numeric('BBRHPJB', ea.STATE).withUnit('kWh').withProperty('current_tier2_summ_delivered').withDescription('BBRHPJB index')},
|
|
334
|
+
{cluster: clustersDef._0x0702, att: 'currentTier3SummDelivered', reportable: false, report: {change: 100}, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.legacy, exposes: exposes.numeric('BBRHCJW', ea.STATE).withUnit('kWh').withProperty('current_tier3_summ_delivered').withDescription('BBRHCJW index')},
|
|
335
|
+
{cluster: clustersDef._0x0702, att: 'currentTier4SummDelivered', reportable: false, report: {change: 100}, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.legacy, exposes: exposes.numeric('BBRHPJW', ea.STATE).withUnit('kWh').withProperty('current_tier4_summ_delivered').withDescription('BBRHPJW index')},
|
|
336
|
+
{cluster: clustersDef._0x0702, att: 'currentTier5SummDelivered', reportable: false, report: {change: 100}, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.legacy, exposes: exposes.numeric('BBRHCJR', ea.STATE).withUnit('kWh').withProperty('current_tier5_summ_delivered').withDescription('BBRHCJR index')},
|
|
337
|
+
{cluster: clustersDef._0x0702, att: 'currentTier6SummDelivered', reportable: false, report: {change: 100}, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.legacy, exposes: exposes.numeric('BBRHPJR', ea.STATE).withUnit('kWh').withProperty('current_tier6_summ_delivered').withDescription('BBRHPJR index')},
|
|
314
338
|
{cluster: clustersDef._0x0B04, att: 'rmsCurrent', reportable: true, onlyProducer: false, linkyPhase: linkyPhaseDef.single, linkyMode: linkyModeDef.legacy, exposes: exposes.numeric('IINST', ea.STATE).withUnit('A').withProperty('rms_current').withDescription('RMS current')},
|
|
315
339
|
{cluster: clustersDef._0x0B04, att: 'rmsCurrent', reportable: true, onlyProducer: false, linkyPhase: linkyPhaseDef.three, linkyMode: linkyModeDef.legacy, exposes: exposes.numeric('IINST1', ea.STATE).withUnit('A').withProperty('rms_current').withDescription('RMS current (phase 1)')},
|
|
316
340
|
{cluster: clustersDef._0x0B04, att: 'rmsCurrentPhB', reportable: true, onlyProducer: false, linkyPhase: linkyPhaseDef.three, linkyMode: linkyModeDef.legacy, exposes: exposes.numeric('IINST2', ea.STATE).withUnit('A').withProperty('rms_current_ph_b').withDescription('RMS current (phase 2)')},
|
|
@@ -336,7 +360,7 @@ const exposedData = [
|
|
|
336
360
|
{cluster: clustersDef._0xFF66, att: 'currentIndexTarif', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.standard, exposes: exposes.numeric('NTARF', ea.STATE).withProperty('current_index_tarif').withDescription('Current tariff index number')},
|
|
337
361
|
{cluster: clustersDef._0x0B01, att: 'softwareRevision', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.standard, exposes: exposes.numeric('VTIC', ea.STATE).withProperty('software_revision').withDescription('Customer tele-information protocol version')},
|
|
338
362
|
{cluster: clustersDef._0xFF66, att: 'currentDate', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.standard, exposes: exposes.text('DATE', ea.STATE).withProperty('current_date').withDescription('Current date and time')},
|
|
339
|
-
{cluster: clustersDef._0x0702, att: 'currentSummDelivered', reportable: true, report: {change: 100}, onlyProducer: false, linkyPhase: linkyPhaseDef.
|
|
363
|
+
{cluster: clustersDef._0x0702, att: 'currentSummDelivered', reportable: true, report: {change: 100}, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.standard, exposes: exposes.numeric('EAST', ea.STATE).withUnit('kWh').withProperty('current_summ_delivered').withDescription('Total active power delivered')},
|
|
340
364
|
{cluster: clustersDef._0x0702, att: 'currentTier1SummDelivered', reportable: true, report: {change: 100}, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.standard, exposes: exposes.numeric('EASF01', ea.STATE).withUnit('kWh').withProperty('current_tier1_summ_delivered').withDescription('Total provider active power delivered (index 01)')},
|
|
341
365
|
{cluster: clustersDef._0x0702, att: 'currentTier2SummDelivered', reportable: true, report: {change: 100}, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.standard, exposes: exposes.numeric('EASF02', ea.STATE).withUnit('kWh').withProperty('current_tier2_summ_delivered').withDescription('Total provider active power delivered (index 02)')},
|
|
342
366
|
{cluster: clustersDef._0x0702, att: 'currentTier3SummDelivered', reportable: true, report: {change: 100}, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.standard, exposes: exposes.numeric('EASF03', ea.STATE).withUnit('kWh').withProperty('current_tier3_summ_delivered').withDescription('Total provider active power delivered (index 03)')},
|
|
@@ -390,17 +414,17 @@ const exposedData = [
|
|
|
390
414
|
{cluster: clustersDef._0xFF66, att: 'message1', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.standard, exposes: exposes.text('MSG1', ea.STATE).withProperty('message1').withDescription('Message short')},
|
|
391
415
|
{cluster: clustersDef._0xFF66, att: 'message2', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.standard, exposes: exposes.text('MSG2', ea.STATE).withProperty('message2').withDescription('Message ultra-short')},
|
|
392
416
|
{cluster: clustersDef._0x0702, att: 'siteId', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.standard, exposes: exposes.text('PRM', ea.STATE).withProperty('site_id').withDescription('PRM number')},
|
|
393
|
-
{cluster: clustersDef._0xFF66, att: 'startMobilePoint1', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.
|
|
394
|
-
{cluster: clustersDef._0xFF66, att: 'stopMobilePoint1', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.
|
|
395
|
-
{cluster: clustersDef._0xFF66, att: 'startMobilePoint2', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.
|
|
396
|
-
{cluster: clustersDef._0xFF66, att: 'stopMobilePoint2', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.
|
|
397
|
-
{cluster: clustersDef._0xFF66, att: 'startMobilePoint3', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.
|
|
398
|
-
{cluster: clustersDef._0xFF66, att: 'stopMobilePoint3', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.
|
|
399
|
-
{cluster: clustersDef._0xFF66, att: 'relais', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.
|
|
400
|
-
{cluster: clustersDef._0xFF66, att: 'daysNumberCurrentCalendar', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.
|
|
401
|
-
{cluster: clustersDef._0xFF66, att: 'daysNumberNextCalendar', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.
|
|
402
|
-
{cluster: clustersDef._0xFF66, att: 'daysProfileCurrentCalendar', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.
|
|
403
|
-
{cluster: clustersDef._0xFF66, att: 'daysProfileNextCalendar', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.
|
|
417
|
+
{cluster: clustersDef._0xFF66, att: 'startMobilePoint1', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.standard, exposes: exposes.numeric('DPM1', ea.STATE).withProperty('start_mobile_point1').withDescription('Start mobile point 1')},
|
|
418
|
+
{cluster: clustersDef._0xFF66, att: 'stopMobilePoint1', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.standard, exposes: exposes.numeric('FPM1', ea.STATE).withProperty('stop_mobile_point1').withDescription('Stop mobile point 1')},
|
|
419
|
+
{cluster: clustersDef._0xFF66, att: 'startMobilePoint2', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.standard, exposes: exposes.numeric('DPM2', ea.STATE).withProperty('start_mobile_point2').withDescription('Start mobile point 2')},
|
|
420
|
+
{cluster: clustersDef._0xFF66, att: 'stopMobilePoint2', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.standard, exposes: exposes.numeric('FPM2', ea.STATE).withProperty('stop_mobile_point2').withDescription('Stop mobile point 2')},
|
|
421
|
+
{cluster: clustersDef._0xFF66, att: 'startMobilePoint3', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.standard, exposes: exposes.numeric('DPM3', ea.STATE).withProperty('start_mobile_point3').withDescription('Start mobile point 3')},
|
|
422
|
+
{cluster: clustersDef._0xFF66, att: 'stopMobilePoint3', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.standard, exposes: exposes.numeric('FPM3', ea.STATE).withProperty('stop_mobile_point3').withDescription('Stop mobile point 3')},
|
|
423
|
+
{cluster: clustersDef._0xFF66, att: 'relais', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.standard, exposes: exposes.numeric('RELAIS', ea.STATE).withProperty('relais')},
|
|
424
|
+
{cluster: clustersDef._0xFF66, att: 'daysNumberCurrentCalendar', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.standard, exposes: exposes.numeric('NJOURF', ea.STATE).withProperty('days_number_current_calendar').withDescription('Current day number supplier calendar')},
|
|
425
|
+
{cluster: clustersDef._0xFF66, att: 'daysNumberNextCalendar', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.standard, exposes: exposes.numeric('NJOURF+1', ea.STATE).withProperty('days_number_next_calendar').withDescription('Next day number supplier calendar')},
|
|
426
|
+
{cluster: clustersDef._0xFF66, att: 'daysProfileCurrentCalendar', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.standard, exposes: exposes.text('PJOURF+1', ea.STATE).withProperty('days_profile_current_calendar').withDescription('Profile of the next supplier calendar day')},
|
|
427
|
+
{cluster: clustersDef._0xFF66, att: 'daysProfileNextCalendar', reportable: false, onlyProducer: false, linkyPhase: linkyPhaseDef.all, linkyMode: linkyModeDef.standard, exposes: exposes.text('PPOINTE1', ea.STATE).withProperty('days_profile_next_calendar').withDescription('Profile of the next check-in day')},
|
|
404
428
|
];
|
|
405
429
|
|
|
406
430
|
function getCurrentConfig(device, options, logger=console) {
|
|
@@ -478,6 +502,9 @@ function getCurrentConfig(device, options, logger=console) {
|
|
|
478
502
|
case linkyMode == linkyModeDef.standard && tarifsDef.stand_SEM_WE_MERCR.currentTarf:
|
|
479
503
|
myExpose = myExpose.filter((a) => !tarifsDef.stand_SEM_WE_MERCR.excluded.includes(a.exposes.name));
|
|
480
504
|
break;
|
|
505
|
+
case linkyMode == linkyModeDef.standard && tarifsDef.stand_HPHC.currentTarf:
|
|
506
|
+
myExpose = myExpose.filter((a) => !tarifsDef.stand_HPHC.excluded.includes(a.exposes.name));
|
|
507
|
+
break;
|
|
481
508
|
default:
|
|
482
509
|
break;
|
|
483
510
|
}
|
package/devices/onesti.js
CHANGED
|
@@ -22,7 +22,7 @@ module.exports = [
|
|
|
22
22
|
await reporting.batteryPercentageRemaining(endpoint);
|
|
23
23
|
await endpoint.read('closuresDoorLock', ['lockState', 'soundVolume']);
|
|
24
24
|
},
|
|
25
|
-
exposes: [e.lock(), e.battery(), e.sound_volume(),
|
|
25
|
+
exposes: [e.lock(), e.battery(), e.sound_volume(),
|
|
26
26
|
e.lock_action_source_name(), e.lock_action_source_user(),
|
|
27
27
|
e.action(Array.from(Object.values(constants.easyCodeTouchActions))),
|
|
28
28
|
exposes.binary('auto_relock', ea.STATE_SET, true, false).withDescription('Auto relock after 7 seconds.'),
|
package/devices/philips.js
CHANGED
|
@@ -353,7 +353,7 @@ module.exports = [
|
|
|
353
353
|
model: '929003055901',
|
|
354
354
|
vendor: 'Philips',
|
|
355
355
|
description: 'Hue white ambiance bathroom ceiling light Adore with Bluetooth',
|
|
356
|
-
extend: extend.
|
|
356
|
+
extend: extend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
|
|
357
357
|
ota: ota.zigbeeOTA,
|
|
358
358
|
},
|
|
359
359
|
{
|
|
@@ -678,4 +678,20 @@ module.exports = [
|
|
|
678
678
|
await endpoint37.read('msOccupancySensing', ['pirOToUDelay']);
|
|
679
679
|
},
|
|
680
680
|
},
|
|
681
|
+
{
|
|
682
|
+
zigbeeModel: ['CCT595011_AS'],
|
|
683
|
+
model: 'CCT595011_AS',
|
|
684
|
+
vendor: 'Schneider Electric',
|
|
685
|
+
description: 'Wiser motion sensor',
|
|
686
|
+
fromZigbee: [fz.battery, fz.ias_enroll, fz.ias_occupancy_only_alarm_2, fz.illuminance],
|
|
687
|
+
toZigbee: [],
|
|
688
|
+
configure: async (device, coordinatorEndpoint, logger) => {
|
|
689
|
+
const endpoint = device.getEndpoint(1);
|
|
690
|
+
const binds = ['genPowerCfg', 'msIlluminanceMeasurement'];
|
|
691
|
+
await reporting.bind(endpoint, coordinatorEndpoint, binds);
|
|
692
|
+
await reporting.batteryPercentageRemaining(endpoint);
|
|
693
|
+
await reporting.illuminance(endpoint, {min: 15, max: constants.repInterval.HOUR, change: 500});
|
|
694
|
+
},
|
|
695
|
+
exposes: [e.battery(), e.illuminance(), e.illuminance_lux(), e.occupancy()],
|
|
696
|
+
},
|
|
681
697
|
];
|
package/devices/sengled.js
CHANGED
|
@@ -14,7 +14,8 @@ module.exports = [
|
|
|
14
14
|
description: 'Flood light with motion sensor light outdoor',
|
|
15
15
|
fromZigbee: extend.light_onoff_brightness().fromZigbee.concat([fz.ias_occupancy_alarm_1]),
|
|
16
16
|
toZigbee: extend.light_onoff_brightness().toZigbee,
|
|
17
|
-
exposes:
|
|
17
|
+
exposes: extend.light_onoff_brightness().exposes.concat([e.occupancy()]),
|
|
18
|
+
ota: ota.zigbeeOTA,
|
|
18
19
|
},
|
|
19
20
|
{
|
|
20
21
|
zigbeeModel: ['E21-N13A'],
|
|
@@ -29,7 +30,22 @@ module.exports = [
|
|
|
29
30
|
model: 'E21-N1EA',
|
|
30
31
|
vendor: 'Sengled',
|
|
31
32
|
description: 'Smart LED multicolor A19 bulb',
|
|
32
|
-
|
|
33
|
+
fromZigbee: extend.light_onoff_brightness_colortemp_color({colorTempRange: [154, 500]}).fromZigbee.concat([fz.metering]),
|
|
34
|
+
toZigbee: extend.light_onoff_brightness_colortemp_color({colorTempRange: [154, 500]}).toZigbee,
|
|
35
|
+
exposes: extend.light_onoff_brightness_colortemp_color({colorTempRange: [154, 500]}).exposes.concat([e.power(), e.energy()]),
|
|
36
|
+
ota: ota.zigbeeOTA,
|
|
37
|
+
configure: async (device, coordinatorEndpoint, logger) => {
|
|
38
|
+
await extend.light_onoff_brightness_colortemp_color({colorTempRange: [154, 500]})
|
|
39
|
+
.configure(device, coordinatorEndpoint, logger);
|
|
40
|
+
device.powerSource = 'Mains (single phase)';
|
|
41
|
+
device.save();
|
|
42
|
+
|
|
43
|
+
const endpoint = device.getEndpoint(1);
|
|
44
|
+
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'seMetering']);
|
|
45
|
+
await reporting.readMeteringMultiplierDivisor(endpoint);
|
|
46
|
+
await reporting.currentSummDelivered(endpoint);
|
|
47
|
+
await reporting.instantaneousDemand(endpoint);
|
|
48
|
+
},
|
|
33
49
|
},
|
|
34
50
|
{
|
|
35
51
|
zigbeeModel: ['E12-N1E'],
|
|
@@ -62,6 +78,7 @@ module.exports = [
|
|
|
62
78
|
description: 'Element classic (A19)',
|
|
63
79
|
fromZigbee: extend.light_onoff_brightness().fromZigbee.concat([fz.metering]),
|
|
64
80
|
toZigbee: extend.light_onoff_brightness().toZigbee,
|
|
81
|
+
ota: ota.zigbeeOTA,
|
|
65
82
|
configure: async (device, coordinatorEndpoint, logger) => {
|
|
66
83
|
await extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
|
|
67
84
|
device.powerSource = 'Mains (single phase)';
|
|
@@ -73,7 +90,7 @@ module.exports = [
|
|
|
73
90
|
await reporting.currentSummDelivered(endpoint);
|
|
74
91
|
await reporting.instantaneousDemand(endpoint);
|
|
75
92
|
},
|
|
76
|
-
exposes: [e.power(), e.energy()
|
|
93
|
+
exposes: extend.light_onoff_brightness().exposes.concat([e.power(), e.energy()]),
|
|
77
94
|
},
|
|
78
95
|
{
|
|
79
96
|
zigbeeModel: ['E11-G23', 'E11-G33'],
|
|
@@ -149,8 +166,22 @@ module.exports = [
|
|
|
149
166
|
model: 'E1F-N5E',
|
|
150
167
|
vendor: 'Sengled',
|
|
151
168
|
description: 'Element color plus E12',
|
|
152
|
-
|
|
169
|
+
fromZigbee: extend.light_onoff_brightness_colortemp_color({colorTempRange: [154, 500]}).fromZigbee.concat([fz.metering]),
|
|
170
|
+
toZigbee: extend.light_onoff_brightness_colortemp_color({colorTempRange: [154, 500]}).toZigbee,
|
|
171
|
+
exposes: extend.light_onoff_brightness_colortemp_color({colorTempRange: [154, 500]}).exposes.concat([e.power(), e.energy()]),
|
|
153
172
|
ota: ota.zigbeeOTA,
|
|
173
|
+
configure: async (device, coordinatorEndpoint, logger) => {
|
|
174
|
+
await extend.light_onoff_brightness_colortemp_color({colorTempRange: [154, 500]})
|
|
175
|
+
.configure(device, coordinatorEndpoint, logger);
|
|
176
|
+
device.powerSource = 'Mains (single phase)';
|
|
177
|
+
device.save();
|
|
178
|
+
|
|
179
|
+
const endpoint = device.getEndpoint(1);
|
|
180
|
+
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'seMetering']);
|
|
181
|
+
await reporting.readMeteringMultiplierDivisor(endpoint);
|
|
182
|
+
await reporting.currentSummDelivered(endpoint);
|
|
183
|
+
await reporting.instantaneousDemand(endpoint);
|
|
184
|
+
},
|
|
154
185
|
},
|
|
155
186
|
{
|
|
156
187
|
zigbeeModel: ['E12-N14'],
|
|
@@ -206,15 +237,17 @@ module.exports = [
|
|
|
206
237
|
await reporting.instantaneousDemand(endpoint);
|
|
207
238
|
},
|
|
208
239
|
exposes: [e.switch(), e.power(), e.energy()],
|
|
240
|
+
ota: ota.zigbeeOTA,
|
|
209
241
|
},
|
|
210
242
|
{
|
|
211
243
|
zigbeeModel: ['E1E-G7F'],
|
|
212
244
|
model: 'E1E-G7F',
|
|
213
245
|
vendor: 'Sengled',
|
|
214
|
-
description: 'Smart switch
|
|
246
|
+
description: 'Smart switch',
|
|
215
247
|
fromZigbee: [fz.E1E_G7F_action],
|
|
216
248
|
exposes: [e.action(['on', 'up', 'down', 'off', 'on_double', 'on_long', 'off_double', 'off_long'])],
|
|
217
249
|
toZigbee: [],
|
|
250
|
+
ota: ota.zigbeeOTA,
|
|
218
251
|
},
|
|
219
252
|
{
|
|
220
253
|
zigbeeModel: ['E11-N1G'],
|
|
@@ -222,6 +255,7 @@ module.exports = [
|
|
|
222
255
|
vendor: 'Sengled',
|
|
223
256
|
description: 'Vintage LED edison bulb (ST19)',
|
|
224
257
|
extend: extend.light_onoff_brightness(),
|
|
258
|
+
ota: ota.zigbeeOTA,
|
|
225
259
|
},
|
|
226
260
|
{
|
|
227
261
|
zigbeeModel: ['E1F-N9G'],
|
|
@@ -229,5 +263,6 @@ module.exports = [
|
|
|
229
263
|
vendor: 'Sengled',
|
|
230
264
|
description: 'Smart LED filament candle (E12)',
|
|
231
265
|
extend: extend.light_onoff_brightness(),
|
|
266
|
+
ota: ota.zigbeeOTA,
|
|
232
267
|
},
|
|
233
268
|
];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const exposes = require('../lib/exposes');
|
|
2
|
+
const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/legacy').fromZigbee};
|
|
3
|
+
const tz = require('../converters/toZigbee');
|
|
4
|
+
const reporting = require('../lib/reporting');
|
|
5
|
+
const e = exposes.presets;
|
|
6
|
+
|
|
7
|
+
module.exports = [
|
|
8
|
+
{
|
|
9
|
+
zigbeeModel: ['WM25/L-Z'],
|
|
10
|
+
model: 'WM25L-Z',
|
|
11
|
+
vendor: 'Smartwings',
|
|
12
|
+
description: 'Roller shade',
|
|
13
|
+
fromZigbee: [fz.cover_position_tilt, fz.battery],
|
|
14
|
+
toZigbee: [tz.cover_state, tz.cover_position_tilt],
|
|
15
|
+
meta: {battery: {dontDividePercentage: true}},
|
|
16
|
+
configure: async (device, coordinatorEndpoint, logger) => {
|
|
17
|
+
const endpoint = device.getEndpoint(1);
|
|
18
|
+
await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg', 'closuresWindowCovering']);
|
|
19
|
+
await reporting.batteryPercentageRemaining(endpoint);
|
|
20
|
+
await reporting.currentPositionLiftPercentage(endpoint);
|
|
21
|
+
},
|
|
22
|
+
exposes: [e.cover_position(), e.battery()],
|
|
23
|
+
},
|
|
24
|
+
];
|
package/devices/tuya.js
CHANGED
|
@@ -12,7 +12,7 @@ const utils = require('../lib/utils');
|
|
|
12
12
|
|
|
13
13
|
const TS011Fplugs = ['_TZ3000_5f43h46b', '_TZ3000_cphmq0q7', '_TZ3000_dpo1ysak', '_TZ3000_ew3ldmgx', '_TZ3000_gjnozsaz',
|
|
14
14
|
'_TZ3000_jvzvulen', '_TZ3000_mraovvmm', '_TZ3000_nfnmi125', '_TZ3000_ps3dmato', '_TZ3000_w0qqde0g', '_TZ3000_u5u4cakc',
|
|
15
|
-
'_TZ3000_rdtixbnu', '_TZ3000_typdpbpg', '_TZ3000_kx0pris5'];
|
|
15
|
+
'_TZ3000_rdtixbnu', '_TZ3000_typdpbpg', '_TZ3000_kx0pris5', '_TZ3000_amdymr7l'];
|
|
16
16
|
|
|
17
17
|
const tzLocal = {
|
|
18
18
|
TS0504B_color: {
|
|
@@ -49,7 +49,7 @@ const fzLocal = {
|
|
|
49
49
|
type: ['attributeReport', 'readResponse'],
|
|
50
50
|
convert: (model, msg, publish, options, meta) => {
|
|
51
51
|
// https://github.com/Koenkk/zigbee2mqtt/issues/11470
|
|
52
|
-
if (msg.data.batteryVoltage < 30) return;
|
|
52
|
+
if (msg.data.batteryPercentageRemaining == 200 && msg.data.batteryVoltage < 30) return;
|
|
53
53
|
return fz.battery.convert(model, msg, publish, options, meta);
|
|
54
54
|
},
|
|
55
55
|
},
|
|
@@ -61,9 +61,9 @@ module.exports = [
|
|
|
61
61
|
model: 'TS0204',
|
|
62
62
|
vendor: 'TuYa',
|
|
63
63
|
description: 'Gas sensor',
|
|
64
|
-
fromZigbee: [fz.ias_gas_alarm_1, fz.
|
|
64
|
+
fromZigbee: [fz.ias_gas_alarm_1, fz.ignore_basic_report],
|
|
65
65
|
toZigbee: [],
|
|
66
|
-
exposes: [e.gas(), e.
|
|
66
|
+
exposes: [e.gas(), e.tamper()],
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
69
|
zigbeeModel: ['TS0205'],
|
|
@@ -108,7 +108,8 @@ module.exports = [
|
|
|
108
108
|
},
|
|
109
109
|
},
|
|
110
110
|
{
|
|
111
|
-
fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_bq5c8xfe'}
|
|
111
|
+
fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_bq5c8xfe'},
|
|
112
|
+
{modelID: 'TS0601', manufacturerName: '_TZE200_bjawzodf'}],
|
|
112
113
|
model: 'TS0601_temperature_humidity_sensor',
|
|
113
114
|
vendor: 'TuYa',
|
|
114
115
|
description: 'Temperature & humidity sensor',
|
|
@@ -166,6 +167,7 @@ module.exports = [
|
|
|
166
167
|
fingerprint: [{modelID: 'TS0001', manufacturerName: '_TZ3000_hktqahrq'}, {manufacturerName: '_TZ3000_hktqahrq'},
|
|
167
168
|
{manufacturerName: '_TZ3000_q6a3tepg'}, {modelID: 'TS000F', manufacturerName: '_TZ3000_m9af2l6g'},
|
|
168
169
|
{modelID: 'TS0001', manufacturerName: '_TZ3000_npzfdcof'},
|
|
170
|
+
{modelID: 'TS0001', manufacturerName: '_TZ3000_5ng23zjs'},
|
|
169
171
|
{modelID: 'TS0001', manufacturerName: '_TZ3000_v7gnj3ad'}],
|
|
170
172
|
model: 'WHD02',
|
|
171
173
|
vendor: 'TuYa',
|
|
@@ -227,6 +229,7 @@ module.exports = [
|
|
|
227
229
|
{modelID: 'TS0505B', manufacturerName: '_TZ3210_wslkvrau'},
|
|
228
230
|
{modelID: 'TS0505B', manufacturerName: '_TZ3210_0rn9qhnu'},
|
|
229
231
|
{modelID: 'TS0505B', manufacturerName: '_TZ3210_bicjqpg4'},
|
|
232
|
+
{modelID: 'TS0505B', manufacturerName: '_TZ3210_jmiuubkz'},
|
|
230
233
|
{modelID: 'TS0505B', manufacturerName: '_TZ3000_cmaky9gq'},
|
|
231
234
|
{modelID: 'TS0505B', manufacturerName: '_TZ3000_tza2vjxx'},
|
|
232
235
|
{modelID: 'TS0505B', manufacturerName: '_TZ3210_k1pe6ibm'},
|
|
@@ -399,6 +402,7 @@ module.exports = [
|
|
|
399
402
|
{modelID: 'TS0601', manufacturerName: '_TZE200_ojzhk75b'},
|
|
400
403
|
{modelID: 'TS0601', manufacturerName: '_TZE200_swaamsoy'},
|
|
401
404
|
{modelID: 'TS0601', manufacturerName: '_TZE200_3p5ydos3'},
|
|
405
|
+
{modelID: 'TS0601', manufacturerName: '_TZE200_1agwnems'},
|
|
402
406
|
],
|
|
403
407
|
model: 'TS0601_dimmer',
|
|
404
408
|
vendor: 'TuYa',
|
package/devices/woox.js
CHANGED
|
@@ -5,6 +5,7 @@ const tz = require('../converters/toZigbee');
|
|
|
5
5
|
const tuya = require('../lib/tuya');
|
|
6
6
|
const extend = require('../lib/extend');
|
|
7
7
|
const e = exposes.presets;
|
|
8
|
+
const ea = exposes.access;
|
|
8
9
|
|
|
9
10
|
module.exports = [
|
|
10
11
|
{
|
|
@@ -54,4 +55,23 @@ module.exports = [
|
|
|
54
55
|
onEvent: tuya.onEventsetTime,
|
|
55
56
|
exposes: [e.smoke(), e.battery_low()],
|
|
56
57
|
},
|
|
58
|
+
{
|
|
59
|
+
fingerprint: [{modelID: 'TS0219', manufacturerName: '_TYZB01_ynsiasng'}],
|
|
60
|
+
model: 'R7051',
|
|
61
|
+
vendor: 'Woox',
|
|
62
|
+
description: 'Smart siren',
|
|
63
|
+
fromZigbee: [fz.battery, fz.ts0216_siren, fz.ias_alarm_only_alarm_1, fz.ts0219_power_source],
|
|
64
|
+
toZigbee: [tz.warning, tz.ts0216_volume],
|
|
65
|
+
exposes: [e.battery(), e.battery_voltage(), e.warning(), exposes.binary('alarm', ea.STATE, true, false),
|
|
66
|
+
exposes.binary('ac_connected', ea.STATE, true, false).withDescription('Is the device plugged in'),
|
|
67
|
+
exposes.numeric('volume', ea.ALL).withValueMin(0).withValueMax(100).withDescription('Volume of siren')],
|
|
68
|
+
meta: {disableDefaultResponse: true},
|
|
69
|
+
configure: async (device, coordinatorEndpoint) => {
|
|
70
|
+
const endpoint = device.getEndpoint(1);
|
|
71
|
+
const bindClusters = ['genPowerCfg'];
|
|
72
|
+
await reporting.bind(endpoint, coordinatorEndpoint, bindClusters);
|
|
73
|
+
await reporting.batteryVoltage(endpoint);
|
|
74
|
+
await reporting.batteryPercentageRemaining(endpoint);
|
|
75
|
+
},
|
|
76
|
+
},
|
|
57
77
|
];
|
package/lib/exposes.js
CHANGED
|
@@ -492,7 +492,8 @@ module.exports = {
|
|
|
492
492
|
.withDescription(`Simulate a brightness value. If this device provides a brightness_move_up or brightness_move_down action it is possible to specify the update interval and delta.${extraNote}`)
|
|
493
493
|
.withFeature(new Numeric('delta', access.SET).withValueMin(0).withDescription('Delta per interval, 20 by default'))
|
|
494
494
|
.withFeature(new Numeric('interval', access.SET).withValueMin(0).withUnit('ms').withDescription('Interval duration')),
|
|
495
|
-
|
|
495
|
+
no_occupancy_since_true: () => new List(`no_occupancy_since`, access.SET).withDescription('Sends a message the last time occupancy (occupancy: true) was detected. When setting this for example to [10, 60] a `{"no_occupancy_since": 10}` will be send after 10 seconds and a `{"no_occupancy_since": 60}` after 60 seconds.'),
|
|
496
|
+
no_occupancy_since_false: () => new List(`no_occupancy_since`, access.SET).withDescription('Sends a message after the last time no occupancy (occupancy: false) was detected. When setting this for example to [10, 60] a `{"no_occupancy_since": 10}` will be send after 10 seconds and a `{"no_occupancy_since": 60}` after 60 seconds.'),
|
|
496
497
|
presence_timeout: () => new Numeric(`presence_timeout`).withValueMin(0).withDescription('Time in seconds after which presence is cleared after detecting it (default 100 seconds).'),
|
|
497
498
|
no_position_support: () => new Binary('no_position_support', access.SET, true, false).withDescription('Set to true when your device only reports position 0, 100 and 50 (in this case your device has an older firmware) (default false).'),
|
|
498
499
|
transition: () => new Numeric(`transition`, access.SET).withValueMin(0).withDescription('Controls the transition time (in seconds) of on/off, brightness, color temperature (if applicable) and color (if applicable) changes. Defaults to `0` (no transition).'),
|
package/lib/utils.js
CHANGED
|
@@ -397,18 +397,23 @@ function extendDevice(deviceConfigs, modelName, adjustments) {
|
|
|
397
397
|
return {...baseDevice, ...adjustments};
|
|
398
398
|
}
|
|
399
399
|
|
|
400
|
-
function noOccupancySince(endpoint, newPayload, options, publish) {
|
|
401
|
-
if (options && options.no_occupancy_since
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
400
|
+
function noOccupancySince(endpoint, newPayload, options, publish, action) {
|
|
401
|
+
if (options && options.no_occupancy_since) {
|
|
402
|
+
if (action == 'start') {
|
|
403
|
+
globalStore.getValue(endpoint, 'no_occupancy_since_timers', []).forEach((t) => clearTimeout(t));
|
|
404
|
+
globalStore.putValue(endpoint, 'no_occupancy_since_timers', []);
|
|
405
|
+
|
|
406
|
+
newPayload.no_occupancy_since = 0;
|
|
407
|
+
options.no_occupancy_since.forEach((since) => {
|
|
408
|
+
const timer = setTimeout(() => {
|
|
409
|
+
publish({no_occupancy_since: since});
|
|
410
|
+
}, since * 1000);
|
|
411
|
+
globalStore.getValue(endpoint, 'no_occupancy_since_timers').push(timer);
|
|
412
|
+
});
|
|
413
|
+
} else if (action === 'stop') {
|
|
414
|
+
globalStore.getValue(endpoint, 'no_occupancy_since_timers', []).forEach((t) => clearTimeout(t));
|
|
415
|
+
globalStore.putValue(endpoint, 'no_occupancy_since_timers', []);
|
|
416
|
+
}
|
|
412
417
|
}
|
|
413
418
|
}
|
|
414
419
|
|
package/npm-shrinkwrap.json
CHANGED