1
1
import { Zcl } from 'zigbee-herdsman' ;
2
2
3
+ import { repInterval } from '../lib/constants' ;
3
4
import {
4
5
addCustomClusterManuSpecificIkeaAirPurifier ,
5
6
addCustomClusterManuSpecificIkeaUnknown ,
@@ -608,7 +609,7 @@ const definitions: DefinitionWithExtend[] = [
608
609
// Enable reporting of powerDivisor, needs to change dynamically with the amount of power
609
610
// For details, see: https://github.com/Koenkk/zigbee2mqtt/issues/23961#issuecomment-2366733453
610
611
await endpoint . configureReporting ( 'haElectricalMeasurement' , [
611
- { attribute : 'acPowerDivisor' , minimumReportInterval : 10 , maximumReportInterval : 65000 , reportableChange : 1 } ,
612
+ { attribute : 'acPowerDivisor' , minimumReportInterval : 10 , maximumReportInterval : repInterval . MAX , reportableChange : 1 } ,
612
613
] ) ;
613
614
} ,
614
615
} ,
@@ -926,7 +927,12 @@ const definitions: DefinitionWithExtend[] = [
926
927
addCustomClusterManuSpecificIkeaUnknown ( ) ,
927
928
deviceEndpoints ( { endpoints : { '1' : 1 , '2' : 2 } } ) ,
928
929
bindCluster ( { cluster : 'ssIasZone' , clusterType : 'input' , endpointNames : [ '2' ] } ) ,
929
- iasZoneAlarm ( { zoneType : 'contact' , zoneAttributes : [ 'alarm_1' ] } ) ,
930
+ iasZoneAlarm ( {
931
+ zoneType : 'contact' ,
932
+ zoneAttributes : [ 'alarm_1' ] ,
933
+ // This is required to prevent the device's reported state being stuck after it quickly changed back and forth:
934
+ zoneStatusReporting : true ,
935
+ } ) ,
930
936
identify ( { isSleepy : true } ) ,
931
937
battery ( ) ,
932
938
ikeaOta ( ) ,
@@ -940,7 +946,12 @@ const definitions: DefinitionWithExtend[] = [
940
946
extend : [
941
947
addCustomClusterManuSpecificIkeaUnknown ( ) ,
942
948
bindCluster ( { cluster : 'ssIasZone' , clusterType : 'input' } ) ,
943
- iasZoneAlarm ( { zoneType : 'water_leak' , zoneAttributes : [ 'alarm_1' ] } ) ,
949
+ iasZoneAlarm ( {
950
+ zoneType : 'water_leak' ,
951
+ zoneAttributes : [ 'alarm_1' ] ,
952
+ // This is required to prevent the device's reported state being stuck after it quickly changed back and forth:
953
+ zoneStatusReporting : true ,
954
+ } ) ,
944
955
identify ( { isSleepy : true } ) ,
945
956
battery ( ) ,
946
957
ikeaOta ( ) ,
0 commit comments