1
1
import { Zcl } from 'zigbee-herdsman' ;
2
2
import { ClusterDefinition } from 'zigbee-herdsman/dist/zspec/zcl/definition/tstype' ;
3
3
4
+ import tz from '../converters/toZigbee' ;
4
5
import * as exposes from '../lib/exposes' ;
5
6
import { logger } from '../lib/logger' ;
6
7
import * as m from '../lib/modernExtend' ;
@@ -1400,6 +1401,22 @@ const yokisCommandsExtend = {
1400
1401
} ,
1401
1402
} ;
1402
1403
1404
+ // Yokis specific definition
1405
+
1406
+ // Yokis does not support the timer OnOff cluster. It uses a custom cluster instead.
1407
+ // Dereferencing the `on_time` and `off_wait_time` from the keys of the converter.
1408
+ const yokisTz = {
1409
+ on_off : {
1410
+ ...tz . on_off ,
1411
+ key : [ 'state' ] ,
1412
+ } satisfies Tz . Converter ,
1413
+ } ;
1414
+
1415
+ function YokisOnOff ( args ?: m . OnOffArgs ) : ModernExtend {
1416
+ const result : ModernExtend = { ...m . onOff ( args ) , toZigbee : [ yokisTz . on_off ] } ;
1417
+ return result ;
1418
+ }
1419
+
1403
1420
// Custom cluster exposition
1404
1421
const YokisDeviceExtend : ModernExtend [ ] = [
1405
1422
// ConfigurationChanged => This attribute is used by Yokis-based controller and probably not very useful at the moment, as we don't know which configuration was changed.
@@ -2296,7 +2313,7 @@ const definitions: DefinitionWithExtend[] = [
2296
2313
m . deviceAddCustomCluster ( 'manuSpecificYokisLoadManager' , YokisClustersDefinition [ 'manuSpecificYokisLoadManager' ] ) , // Pending implementation
2297
2314
m . deviceAddCustomCluster ( 'manuSpecificYokisLightControl' , YokisClustersDefinition [ 'manuSpecificYokisLightControl' ] ) ,
2298
2315
m . deviceAddCustomCluster ( 'manuSpecificYokisStats' , YokisClustersDefinition [ 'manuSpecificYokisStats' ] ) , // Pending implementation
2299
- m . onOff ( { powerOnBehavior : false } ) , // StartupOnOff is not supported
2316
+ YokisOnOff ( { powerOnBehavior : false } ) , // StartupOnOff is not supported
2300
2317
m . identify ( ) ,
2301
2318
...YokisSubSystemExtend ,
2302
2319
...yokisLightControlExtend ,
@@ -2309,10 +2326,18 @@ const definitions: DefinitionWithExtend[] = [
2309
2326
} ,
2310
2327
{
2311
2328
// MTR1300E-UP
2312
- zigbeeModel : [ 'MTR1300E-UP' ] ,
2329
+ zigbeeModel : [ 'MTR1300E-UP' , 'MTR1300EB-UP' ] ,
2313
2330
model : 'MTR1300E-UP' ,
2314
2331
vendor : 'YOKIS' ,
2315
2332
description : 'Remote power switch with timer 1300W' ,
2333
+ whiteLabel : [
2334
+ {
2335
+ model : 'MTR1300EB-UP' ,
2336
+ vendor : 'YOKIS' ,
2337
+ description : 'Remote power switch with timer 1300W' ,
2338
+ fingerprint : [ { modelID : 'MTR1300EB-UP' } ] ,
2339
+ } ,
2340
+ ] ,
2316
2341
extend : [
2317
2342
m . deviceAddCustomCluster ( 'manuSpecificYokisDevice' , YokisClustersDefinition [ 'manuSpecificYokisDevice' ] ) ,
2318
2343
m . deviceAddCustomCluster ( 'manuSpecificYokisInput' , YokisClustersDefinition [ 'manuSpecificYokisInput' ] ) ,
@@ -2321,7 +2346,7 @@ const definitions: DefinitionWithExtend[] = [
2321
2346
m . deviceAddCustomCluster ( 'manuSpecificYokisLoadManager' , YokisClustersDefinition [ 'manuSpecificYokisLoadManager' ] ) , // Pending implementation
2322
2347
m . deviceAddCustomCluster ( 'manuSpecificYokisLightControl' , YokisClustersDefinition [ 'manuSpecificYokisLightControl' ] ) ,
2323
2348
m . deviceAddCustomCluster ( 'manuSpecificYokisStats' , YokisClustersDefinition [ 'manuSpecificYokisStats' ] ) , // Pending implementation
2324
- m . onOff ( { powerOnBehavior : false } ) , // StartupOnOff is not supported
2349
+ YokisOnOff ( { powerOnBehavior : false } ) , // StartupOnOff is not supported
2325
2350
m . identify ( ) ,
2326
2351
...YokisSubSystemExtend ,
2327
2352
...yokisLightControlExtend ,
@@ -2346,7 +2371,7 @@ const definitions: DefinitionWithExtend[] = [
2346
2371
m . deviceAddCustomCluster ( 'manuSpecificYokisLoadManager' , YokisClustersDefinition [ 'manuSpecificYokisLoadManager' ] ) , // Pending implementation
2347
2372
m . deviceAddCustomCluster ( 'manuSpecificYokisLightControl' , YokisClustersDefinition [ 'manuSpecificYokisLightControl' ] ) ,
2348
2373
m . deviceAddCustomCluster ( 'manuSpecificYokisStats' , YokisClustersDefinition [ 'manuSpecificYokisStats' ] ) , // Pending implementation
2349
- m . onOff ( { powerOnBehavior : false } ) , // StartupOnOff is not supported
2374
+ YokisOnOff ( { powerOnBehavior : false } ) , // StartupOnOff is not supported
2350
2375
m . identify ( ) ,
2351
2376
...YokisSubSystemExtend ,
2352
2377
...yokisLightControlExtend ,
@@ -2372,7 +2397,11 @@ const definitions: DefinitionWithExtend[] = [
2372
2397
m . deviceAddCustomCluster ( 'manuSpecificYokisLightControl' , YokisClustersDefinition [ 'manuSpecificYokisLightControl' ] ) ,
2373
2398
m . deviceAddCustomCluster ( 'manuSpecificYokisDimmer' , YokisClustersDefinition [ 'manuSpecificYokisDimmer' ] ) ,
2374
2399
m . deviceAddCustomCluster ( 'manuSpecificYokisStats' , YokisClustersDefinition [ 'manuSpecificYokisStats' ] ) , // Pending implementation
2375
- m . light ( { configureReporting : true , powerOnBehavior : false } ) , // StartupOnOff is not supported, TODO: review dimmer cluster instead
2400
+ m . light ( {
2401
+ effect : false , // related to the identify cluster
2402
+ configureReporting : true ,
2403
+ powerOnBehavior : false ,
2404
+ } ) , // StartupOnOff is not supported, TODO: review dimmer cluster instead
2376
2405
m . identify ( ) ,
2377
2406
...yokisLightControlExtend ,
2378
2407
...YokisSubSystemExtend ,
@@ -2411,8 +2440,8 @@ const definitions: DefinitionWithExtend[] = [
2411
2440
] ,
2412
2441
} ,
2413
2442
{
2414
- // E2BPA -UP
2415
- zigbeeModel : [ 'E2BPA-UP' , ' E2BP-UP'] ,
2443
+ // E2BP -UP
2444
+ zigbeeModel : [ 'E2BP-UP' ] ,
2416
2445
model : 'E2BP-UP' ,
2417
2446
vendor : 'YOKIS' ,
2418
2447
description : 'Flush-mounted independent 2-channel transmitter' ,
@@ -2436,8 +2465,33 @@ const definitions: DefinitionWithExtend[] = [
2436
2465
] ,
2437
2466
} ,
2438
2467
{
2439
- // E4BPA-UP
2440
- zigbeeModel : [ 'E4BPA-UP' , 'E4BP-UP' , 'E4BPX-UP' ] ,
2468
+ // E2BPA-UP
2469
+ zigbeeModel : [ 'E2BPA-UP' ] ,
2470
+ model : 'E2BPA-UP' ,
2471
+ vendor : 'YOKIS' ,
2472
+ description : 'Flush-mounted independent 2-channel transmitter (main powered)' ,
2473
+ extend : [
2474
+ m . deviceAddCustomCluster ( 'manuSpecificYokisDevice' , YokisClustersDefinition [ 'manuSpecificYokisDevice' ] ) ,
2475
+ m . deviceAddCustomCluster ( 'manuSpecificYokisInput' , YokisClustersDefinition [ 'manuSpecificYokisInput' ] ) ,
2476
+ m . deviceAddCustomCluster ( 'manuSpecificYokisLightControl' , YokisClustersDefinition [ 'manuSpecificYokisLightControl' ] ) ,
2477
+ m . deviceAddCustomCluster ( 'manuSpecificYokisDimmer' , YokisClustersDefinition [ 'manuSpecificYokisDimmer' ] ) ,
2478
+ m . deviceAddCustomCluster ( 'manuSpecificYokisWindowCovering' , YokisClustersDefinition [ 'manuSpecificYokisWindowCovering' ] ) , // Pending implementation
2479
+ m . deviceAddCustomCluster ( 'manuSpecificYokisChannel' , YokisClustersDefinition [ 'manuSpecificYokisChannel' ] ) ,
2480
+ m . deviceAddCustomCluster ( 'manuSpecificYokisPilotWire' , YokisClustersDefinition [ 'manuSpecificYokisPilotWire' ] ) , // Pending implementation
2481
+ m . deviceEndpoints ( { endpoints : { '1' : 1 , '2' : 2 } } ) ,
2482
+ m . identify ( ) ,
2483
+ m . commandsOnOff ( ) ,
2484
+ m . commandsLevelCtrl ( ) ,
2485
+ m . commandsWindowCovering ( ) ,
2486
+ // ...YokisDeviceExtend,
2487
+ // ...YokisInputExtend,
2488
+ // ...YokisChannelExtend,
2489
+ ...YokisPilotWireExtend ,
2490
+ ] ,
2491
+ } ,
2492
+ {
2493
+ // E4BP-UP
2494
+ zigbeeModel : [ 'E4BP-UP' ] ,
2441
2495
model : 'E4BP-UP' ,
2442
2496
vendor : 'YOKIS' ,
2443
2497
description : 'Flush-mounted independent 4-channel transmitter' ,
@@ -2460,6 +2514,31 @@ const definitions: DefinitionWithExtend[] = [
2460
2514
...YokisPilotWireExtend ,
2461
2515
] ,
2462
2516
} ,
2517
+ {
2518
+ // E4BPX-UP
2519
+ zigbeeModel : [ 'E4BPX-UP' ] ,
2520
+ model : 'E4BPX-UP' ,
2521
+ vendor : 'YOKIS' ,
2522
+ description : 'Flush-mounted independent 4-channel transmitter (with antenna)' ,
2523
+ extend : [
2524
+ m . deviceAddCustomCluster ( 'manuSpecificYokisDevice' , YokisClustersDefinition [ 'manuSpecificYokisDevice' ] ) ,
2525
+ m . deviceAddCustomCluster ( 'manuSpecificYokisInput' , YokisClustersDefinition [ 'manuSpecificYokisInput' ] ) ,
2526
+ m . deviceAddCustomCluster ( 'manuSpecificYokisLightControl' , YokisClustersDefinition [ 'manuSpecificYokisLightControl' ] ) ,
2527
+ m . deviceAddCustomCluster ( 'manuSpecificYokisDimmer' , YokisClustersDefinition [ 'manuSpecificYokisDimmer' ] ) ,
2528
+ m . deviceAddCustomCluster ( 'manuSpecificYokisWindowCovering' , YokisClustersDefinition [ 'manuSpecificYokisWindowCovering' ] ) , // Pending implementation
2529
+ m . deviceAddCustomCluster ( 'manuSpecificYokisChannel' , YokisClustersDefinition [ 'manuSpecificYokisChannel' ] ) ,
2530
+ m . deviceAddCustomCluster ( 'manuSpecificYokisPilotWire' , YokisClustersDefinition [ 'manuSpecificYokisPilotWire' ] ) , // Pending implementation
2531
+ m . deviceEndpoints ( { endpoints : { '1' : 1 , '2' : 2 , '3' : 3 , '4' : 4 } } ) ,
2532
+ m . identify ( ) ,
2533
+ m . commandsOnOff ( ) ,
2534
+ m . commandsLevelCtrl ( ) ,
2535
+ m . commandsWindowCovering ( ) ,
2536
+ // ...YokisDeviceExtend,
2537
+ // ...YokisInputExtend,
2538
+ // ...YokisChannelExtend,
2539
+ ...YokisPilotWireExtend ,
2540
+ ] ,
2541
+ } ,
2463
2542
{
2464
2543
// TLC1-UP
2465
2544
zigbeeModel : [ 'TLC1-UP' ] ,
0 commit comments