I’ve fiddled around with ZHA toolkit, and disabled the reporting for the available power metrics attributes. I wasn’t able to remove the bindings. Toolkit dropped an “Unknown error” on me. Looking in the logs I saw the following message:
AttributeError: 'ControllerApplication' object has no attribute 'ieee'
Either way. Even though I disabled the reporting (and did not see reporting coming in). Something is still requesting or giving an update, even after I disabled the metric sensors. As shown in the ZHA logs
2024-01-08 02:35:52.733 DEBUG (MainThread) [zigpy.zcl] [0x7258:1:0x0b04] Received ZCL frame: b'\x18\xb2\x07\x00\x00\x08\x05'
2024-01-08 02:35:52.736 DEBUG (MainThread) [zigpy.zcl] [0x7258:1:0x0b04] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=178, command_id=7, *direction=<Direction.Client_to_Server: 1>)
2024-01-08 02:35:52.738 DEBUG (MainThread) [zigpy.zcl] [0x7258:1:0x0b04] Decoded ZCL frame: TuyaZBElectricalMeasurement:Configure_Reporting_rsp(status_records=[ConfigureReportingResponseRecord(status=<Status.SUCCESS: 0>)])
2024-01-08 02:35:52.741 DEBUG (Thread-3358) [aiosqlite] executing functools.partial(<built-in method execute of sqlite3.Connection object at 0x7f77929300>, 'UPDATE devices_v12\n SET last_seen=:ts\n WHERE ieee=:ieee AND :ts - last_seen > :min_update_delta', {'ts': 1704677752.731597, 'ieee': a4:c1:38:5f:ac:e4:7a:4b, 'min_update_delta': 30.0})
2024-01-08 02:35:52.743 DEBUG (Thread-3358) [aiosqlite] operation functools.partial(<built-in method execute of sqlite3.Connection object at 0x7f77929300>, 'UPDATE devices_v12\n SET last_seen=:ts\n WHERE ieee=:ieee AND :ts - last_seen > :min_update_delta', {'ts': 1704677752.731597, 'ieee': a4:c1:38:5f:ac:e4:7a:4b, 'min_update_delta': 30.0}) completed
2024-01-08 02:35:52.744 DEBUG (Thread-3358) [aiosqlite] executing functools.partial(<built-in method commit of sqlite3.Connection object at 0x7f77929300>)
2024-01-08 02:35:52.744 DEBUG (Thread-3358) [aiosqlite] operation functools.partial(<built-in method commit of sqlite3.Connection object at 0x7f77929300>) completed
2024-01-08 02:35:53.770 DEBUG (MainThread) [zigpy.zcl] [0x7258:1:0x0b04] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, direction=<Direction.Server_to_Client: 0>, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=179, command_id=<GeneralCommand.Configure_Reporting: 6>, *direction=<Direction.Server_to_Client: 0>)
2024-01-08 02:35:53.770 DEBUG (MainThread) [zigpy.zcl] [0x7258:1:0x0b04] Sending request: Configure_Reporting(config_records=[AttributeReportingConfig(direction=0, attrid=0x050B, datatype=41, min_interval=0, max_interval=65535, reportable_change=0)])
And another
2024-01-08 02:39:36.293 DEBUG (MainThread) [zigpy.zcl] [0xBDFB:1:0x0b04] Received ZCL frame: b'\x08i\n\x05\x05!\xe9\x00\x08\x05!\x00\x00\x0b\x05)\x00\x00'
2024-01-08 02:39:36.295 DEBUG (MainThread) [zigpy.zcl] [0xBDFB:1:0x0b04] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), tsn=105, command_id=10, *direction=<Direction.Client_to_Server: 1>)
2024-01-08 02:39:36.297 DEBUG (MainThread) [zigpy.zcl] [0xBDFB:1:0x0b04] Decoded ZCL frame: TuyaZBElectricalMeasurement:Report_Attributes(attribute_reports=[Attribute(attrid=0x0505, value=TypeValue(type=uint16_t, value=233)), Attribute(attrid=0x0508, value=TypeValue(type=uint16_t, value=0)), Attribute(attrid=0x050B, value=TypeValue(type=int16s, value=0))])
2024-01-08 02:39:36.298 DEBUG (MainThread) [zigpy.zcl] [0xBDFB:1:0x0b04] Received command 0x0A (TSN 105): Report_Attributes(attribute_reports=[Attribute(attrid=0x0505, value=TypeValue(type=uint16_t, value=233)), Attribute(attrid=0x0508, value=TypeValue(type=uint16_t, value=0)), Attribute(attrid=0x050B, value=TypeValue(type=int16s, value=0))])
2024-01-08 02:39:36.299 DEBUG (MainThread) [zigpy.zcl] [0xBDFB:1:0x0b04] Attribute report received: rms_voltage=233, rms_current=0, active_power=0
2024-01-08 02:39:36.301 DEBUG (MainThread) [zigpy.zcl] [0xBDFB:1:0x0b04] Sending reply header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=False, direction=<Direction.Client_to_Server: 1>, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=105, command_id=<GeneralCommand.Default_Response: 11>, *direction=<Direction.Client_to_Server: 1>)
2024-01-08 02:39:36.302 DEBUG (MainThread) [zigpy.zcl] [0xBDFB:1:0x0b04] Sending reply: Default_Response(command_id=10, status=<Status.SUCCESS: 0>)
Which repeats every minute.
If I were able to bash these out, I think I’m on the right track. Didn’t imagine it would be so much work to just disable a feature…
EDIT:
For now I have created a custom quirk whose do not import the measurement cluster. This seems to have disabled the reporting altogether. For the few plugs we do want monitoring to be available on we’ll get another brand, hopefully that will resort to another quirk.