2022-12-01 21:03:52.052 DEBUG (MainThread) [zigpy.appdb] [0x1c87:1:0x0000] Attribute id: 4 value: _TZE204_cjbofhxw 2022-12-01 21:03:52.052 DEBUG (MainThread) [zigpy.appdb] [0x1c87:1:0x0000] Attribute id: 5 value: TS0601 2022-12-01 21:03:57.241 DEBUG (MainThread) [zigpy.appdb] [0x1c87:1:0x0000] Attribute id: 4 value: _TZE204_cjbofhxw 2022-12-01 21:03:57.241 DEBUG (MainThread) [zigpy.appdb] [0x1c87:1:0x0000] Attribute id: 5 value: TS0601 2022-12-01 21:03:57.241 DEBUG (MainThread) [zigpy.appdb] [0x1c87:1:0x0b04] Attribute id: 1539 value: 1000 2022-12-01 21:03:57.241 DEBUG (MainThread) [zigpy.appdb] [0x1c87:1:0x0b04] Attribute id: 1538 value: 1 2022-12-01 21:03:57.241 DEBUG (MainThread) [zigpy.appdb] [0x1c87:1:0x0b04] Attribute id: 1536 value: 2 2022-12-01 21:03:57.241 DEBUG (MainThread) [zigpy.appdb] [0x1c87:1:0x0702] Attribute id: 768 value: 0 2022-12-01 21:03:57.242 DEBUG (MainThread) [zigpy.appdb] [0x1c87:1:0x0000] Attribute id: 1 value: 70 2022-12-01 21:03:57.242 DEBUG (MainThread) [zigpy.appdb] [0x1c87:1:0x0000] Attribute id: 65506 value: 31 2022-12-01 21:03:57.242 DEBUG (MainThread) [zigpy.appdb] [0x1c87:1:0x0000] Attribute id: 65508 value: 0 2022-12-01 21:03:57.242 DEBUG (MainThread) [zigpy.appdb] [0x1c87:1:0x0000] Attribute id: 65503 value: t�+��+e��+��+ 2022-12-01 21:04:01.505 DEBUG (MainThread) [homeassistant.components.zha.core.gateway] [0x1C87](_TZE204_cjbofhxw TS0601) restored as 'available', last seen: 0:01:34 ago, consider_unavailable_time: 7200 seconds 2022-12-01 21:04:01.530 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x1C87](TS0601): started initialization 2022-12-01 21:04:01.530 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:ZDO](TS0601): 'async_initialize' stage succeeded 2022-12-01 21:04:01.664 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0006]: initializing channel: from_cache: True 2022-12-01 21:04:01.664 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0006]: initializing cached channel attributes: ['start_up_on_off'] 2022-12-01 21:04:01.664 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0006]: Reading attributes in chunks: ['start_up_on_off'] 2022-12-01 21:04:01.664 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0006]: initializing uncached channel attributes: ['on_off'] - from cache[True] 2022-12-01 21:04:01.664 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0006]: Reading attributes in chunks: ['on_off'] 2022-12-01 21:04:01.664 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0006]: finished channel initialization 2022-12-01 21:04:01.665 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0b04]: initializing channel: from_cache: True 2022-12-01 21:04:01.665 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0b04]: initializing cached channel attributes: ['ac_current_divisor', 'ac_current_multiplier', 'ac_power_divisor', 'ac_power_multiplier', 'ac_voltage_divisor', 'ac_voltage_multiplier', 'ac_frequency_divisor', 'ac_frequency_multiplier', 'measurement_type', 'power_divisor', 'power_multiplier'] 2022-12-01 21:04:01.665 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0b04]: Reading attributes in chunks: ['ac_current_divisor', 'ac_current_multiplier', 'ac_power_divisor', 'ac_power_multiplier', 'ac_voltage_divisor'] 2022-12-01 21:04:01.665 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0b04]: Reading attributes in chunks: ['ac_voltage_multiplier', 'ac_frequency_divisor', 'ac_frequency_multiplier', 'measurement_type', 'power_divisor'] 2022-12-01 21:04:01.665 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0b04]: Reading attributes in chunks: ['power_multiplier'] 2022-12-01 21:04:01.665 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0b04]: initializing uncached channel attributes: ['active_power', 'active_power_max', 'apparent_power', 'rms_current', 'rms_current_max', 'rms_voltage', 'rms_voltage_max', 'ac_frequency', 'ac_frequency_max'] - from cache[True] 2022-12-01 21:04:01.665 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0b04]: Reading attributes in chunks: ['active_power', 'active_power_max', 'apparent_power', 'rms_current', 'rms_current_max'] 2022-12-01 21:04:01.666 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0b04]: Reading attributes in chunks: ['rms_voltage', 'rms_voltage_max', 'ac_frequency', 'ac_frequency_max'] 2022-12-01 21:04:01.666 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0b04]: finished channel initialization 2022-12-01 21:04:01.666 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0000]: initializing channel: from_cache: True 2022-12-01 21:04:01.666 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0000]: finished channel initialization 2022-12-01 21:04:01.666 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0702]: initializing channel: from_cache: True 2022-12-01 21:04:01.666 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0702]: initializing cached channel attributes: ['demand_formatting', 'divisor', 'metering_device_type', 'multiplier', 'summation_formatting', 'unit_of_measure'] 2022-12-01 21:04:01.666 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0702]: Reading attributes in chunks: ['demand_formatting', 'divisor', 'metering_device_type', 'multiplier', 'summation_formatting'] 2022-12-01 21:04:01.666 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0702]: Reading attributes in chunks: ['unit_of_measure'] 2022-12-01 21:04:01.667 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0702]: initializing uncached channel attributes: ['instantaneous_demand', 'current_summ_delivered', 'status'] - from cache[True] 2022-12-01 21:04:01.667 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0702]: Reading attributes in chunks: ['instantaneous_demand', 'current_summ_delivered', 'status'] 2022-12-01 21:04:01.667 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0702]: Performing channel specific initialization: ['instantaneous_demand', 'current_summ_delivered', 'status'] 2022-12-01 21:04:01.667 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0702]: finished channel initialization 2022-12-01 21:04:01.667 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0xef00]: initializing channel: from_cache: True 2022-12-01 21:04:01.667 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0xef00]: finished channel initialization 2022-12-01 21:04:01.667 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0019]: initializing channel: from_cache: True 2022-12-01 21:04:01.667 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0019]: finished channel initialization 2022-12-01 21:04:01.701 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0006]: 'async_initialize' stage succeeded 2022-12-01 21:04:01.701 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0b04]: 'async_initialize' stage succeeded 2022-12-01 21:04:01.701 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0000]: 'async_initialize' stage succeeded 2022-12-01 21:04:01.701 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0702]: 'async_initialize' stage succeeded 2022-12-01 21:04:01.701 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0xef00]: 'async_initialize' stage succeeded 2022-12-01 21:04:01.701 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0019]: 'async_initialize' stage succeeded 2022-12-01 21:04:01.719 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x1C87](TS0601): power source: Mains 2022-12-01 21:04:01.719 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x1C87](TS0601): completed initialization 2022-12-01 21:04:01.732 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x1C87](TS0601): started initialization 2022-12-01 21:04:01.732 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:ZDO](TS0601): 'async_initialize' stage succeeded 2022-12-01 21:04:01.859 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0006]: initializing channel: from_cache: False 2022-12-01 21:04:01.859 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0006]: initializing cached channel attributes: ['start_up_on_off'] 2022-12-01 21:04:01.859 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0006]: Reading attributes in chunks: ['start_up_on_off'] 2022-12-01 21:04:01.860 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0x0006] 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, *is_reply=False), tsn=59, command_id=<GeneralCommand.Read_Attributes: 0>, *direction=<Direction.Server_to_Client: 0>, *is_reply=False) 2022-12-01 21:04:01.860 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0x0006] Sending request: Read_Attributes(attribute_ids=[16387]) 2022-12-01 21:04:01.861 DEBUG (MainThread) [bellows.zigbee.application] Sending packet ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x1C87), dst_ep=1, source_route=None, extended_timeout=False, tsn=59, profile_id=260, cluster_id=6, data=Serialized[b'\x00;\x00\x03@'], tx_options=<TransmitOptions.NONE: 0>, radius=0, non_member_radius=0, lqi=None, rssi=None) 2022-12-01 21:04:01.863 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0b04]: initializing channel: from_cache: False 2022-12-01 21:04:01.863 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0b04]: initializing cached channel attributes: ['ac_current_divisor', 'ac_current_multiplier', 'ac_power_divisor', 'ac_power_multiplier', 'ac_voltage_divisor', 'ac_voltage_multiplier', 'ac_frequency_divisor', 'ac_frequency_multiplier', 'measurement_type', 'power_divisor', 'power_multiplier'] 2022-12-01 21:04:01.863 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0b04]: Reading attributes in chunks: ['ac_current_divisor', 'ac_current_multiplier', 'ac_power_divisor', 'ac_power_multiplier', 'ac_voltage_divisor'] 2022-12-01 21:04:01.864 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0b04]: Reading attributes in chunks: ['ac_voltage_multiplier', 'ac_frequency_divisor', 'ac_frequency_multiplier', 'measurement_type', 'power_divisor'] 2022-12-01 21:04:01.865 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0b04]: Reading attributes in chunks: ['power_multiplier'] 2022-12-01 21:04:01.865 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0b04]: initializing uncached channel attributes: ['active_power', 'active_power_max', 'apparent_power', 'rms_current', 'rms_current_max', 'rms_voltage', 'rms_voltage_max', 'ac_frequency', 'ac_frequency_max'] - from cache[False] 2022-12-01 21:04:01.866 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0b04]: Reading attributes in chunks: ['active_power', 'active_power_max', 'apparent_power', 'rms_current', 'rms_current_max'] 2022-12-01 21:04:01.866 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0b04]: Reading attributes in chunks: ['rms_voltage', 'rms_voltage_max', 'ac_frequency', 'ac_frequency_max'] 2022-12-01 21:04:01.867 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0b04]: finished channel initialization 2022-12-01 21:04:01.868 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0000]: initializing channel: from_cache: False 2022-12-01 21:04:01.868 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0000]: finished channel initialization 2022-12-01 21:04:01.868 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0702]: initializing channel: from_cache: False 2022-12-01 21:04:01.868 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0702]: initializing cached channel attributes: ['demand_formatting', 'divisor', 'metering_device_type', 'multiplier', 'summation_formatting', 'unit_of_measure'] 2022-12-01 21:04:01.868 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0702]: Reading attributes in chunks: ['demand_formatting', 'divisor', 'metering_device_type', 'multiplier', 'summation_formatting'] 2022-12-01 21:04:01.869 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0702]: Reading attributes in chunks: ['unit_of_measure'] 2022-12-01 21:04:01.869 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0702]: initializing uncached channel attributes: ['instantaneous_demand', 'current_summ_delivered', 'status'] - from cache[False] 2022-12-01 21:04:01.870 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0702]: Reading attributes in chunks: ['instantaneous_demand', 'current_summ_delivered', 'status'] 2022-12-01 21:04:01.870 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0702]: Performing channel specific initialization: ['instantaneous_demand', 'current_summ_delivered', 'status'] 2022-12-01 21:04:01.870 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0702]: finished channel initialization 2022-12-01 21:04:01.870 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0xef00]: initializing channel: from_cache: False 2022-12-01 21:04:01.871 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0xef00]: finished channel initialization 2022-12-01 21:04:01.871 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0019]: initializing channel: from_cache: False 2022-12-01 21:04:01.871 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1C87:1:0x0019]: finished channel initialization 2022-12-01 21:04:03.328 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=61184, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY: 256>, groupId=0, sequence=22), 203, -47, 0x1c87, 255, 255, b'\t\x1b%\xf1\x00'] 2022-12-01 21:04:03.328 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x1C87), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=22, profile_id=260, cluster_id=61184, data=Serialized[b'\t\x1b%\xf1\x00'], tx_options=<TransmitOptions.NONE: 0>, radius=0, non_member_radius=0, lqi=203, rssi=-47) 2022-12-01 21:04:03.329 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] Received ZCL frame: b'\t\x1b%\xf1\x00' 2022-12-01 21:04:03.330 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.CLUSTER_COMMAND: 1>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=0, reserved=0, *is_cluster=True, *is_general=False, *is_reply=True), tsn=27, command_id=37, *direction=<Direction.Client_to_Server: 1>, *is_reply=True) 2022-12-01 21:04:03.331 WARNING (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] Unknown cluster command 37 b'\xf1\x00' 2022-12-01 21:04:03.351 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] Received command 0x25 (TSN 27): b'\xf1\x00' 2022-12-01 21:04:03.352 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] No explicit handler for cluster command 0x25: b'\xf1\x00' 2022-12-01 21:04:03.633 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=61184, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY: 256>, groupId=0, sequence=23), 208, -46, 0x1c87, 255, 255, b'\t\x1b%\xf1\x00'] 2022-12-01 21:04:03.633 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x1C87), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=23, profile_id=260, cluster_id=61184, data=Serialized[b'\t\x1b%\xf1\x00'], tx_options=<TransmitOptions.NONE: 0>, radius=0, non_member_radius=0, lqi=208, rssi=-46) 2022-12-01 21:04:03.634 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] Received ZCL frame: b'\t\x1b%\xf1\x00' 2022-12-01 21:04:03.635 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.CLUSTER_COMMAND: 1>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=0, reserved=0, *is_cluster=True, *is_general=False, *is_reply=True), tsn=27, command_id=37, *direction=<Direction.Client_to_Server: 1>, *is_reply=True) 2022-12-01 21:04:03.635 WARNING (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] Unknown cluster command 37 b'\xf1\x00' 2022-12-01 21:04:03.638 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] Received command 0x25 (TSN 27): b'\xf1\x00' 2022-12-01 21:04:03.639 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] No explicit handler for cluster command 0x25: b'\xf1\x00' 2022-12-01 21:04:03.787 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=61184, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY: 256>, groupId=0, sequence=24), 208, -46, 0x1c87, 255, 255, b'\t\x1b%\xf1\x00'] 2022-12-01 21:04:03.788 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x1C87), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=24, profile_id=260, cluster_id=61184, data=Serialized[b'\t\x1b%\xf1\x00'], tx_options=<TransmitOptions.NONE: 0>, radius=0, non_member_radius=0, lqi=208, rssi=-46) 2022-12-01 21:04:03.788 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] Received ZCL frame: b'\t\x1b%\xf1\x00' 2022-12-01 21:04:03.789 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.CLUSTER_COMMAND: 1>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=0, reserved=0, *is_cluster=True, *is_general=False, *is_reply=True), tsn=27, command_id=37, *direction=<Direction.Client_to_Server: 1>, *is_reply=True) 2022-12-01 21:04:03.789 WARNING (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] Unknown cluster command 37 b'\xf1\x00' 2022-12-01 21:04:03.803 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] Received command 0x25 (TSN 27): b'\xf1\x00' 2022-12-01 21:04:03.804 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] No explicit handler for cluster command 0x25: b'\xf1\x00' 2022-12-01 21:04:03.937 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=61184, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY: 256>, groupId=0, sequence=25), 208, -46, 0x1c87, 255, 255, b'\t\x1b%\xf1\x00'] 2022-12-01 21:04:03.938 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x1C87), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=25, profile_id=260, cluster_id=61184, data=Serialized[b'\t\x1b%\xf1\x00'], tx_options=<TransmitOptions.NONE: 0>, radius=0, non_member_radius=0, lqi=208, rssi=-46) 2022-12-01 21:04:03.938 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] Received ZCL frame: b'\t\x1b%\xf1\x00' 2022-12-01 21:04:03.939 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.CLUSTER_COMMAND: 1>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=0, reserved=0, *is_cluster=True, *is_general=False, *is_reply=True), tsn=27, command_id=37, *direction=<Direction.Client_to_Server: 1>, *is_reply=True) 2022-12-01 21:04:03.940 WARNING (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] Unknown cluster command 37 b'\xf1\x00' 2022-12-01 21:04:03.948 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] Received command 0x25 (TSN 27): b'\xf1\x00' 2022-12-01 21:04:03.948 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] No explicit handler for cluster command 0x25: b'\xf1\x00' 2022-12-01 21:04:05.948 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=61184, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY: 256>, groupId=0, sequence=26), 208, -46, 0x1c87, 255, 255, b'\t\x1b%\xf1\x00'] 2022-12-01 21:04:05.948 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x1C87), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=26, profile_id=260, cluster_id=61184, data=Serialized[b'\t\x1b%\xf1\x00'], tx_options=<TransmitOptions.NONE: 0>, radius=0, non_member_radius=0, lqi=208, rssi=-46) 2022-12-01 21:04:05.949 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] Received ZCL frame: b'\t\x1b%\xf1\x00' 2022-12-01 21:04:05.950 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.CLUSTER_COMMAND: 1>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=0, reserved=0, *is_cluster=True, *is_general=False, *is_reply=True), tsn=27, command_id=37, *direction=<Direction.Client_to_Server: 1>, *is_reply=True) 2022-12-01 21:04:05.950 WARNING (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] Unknown cluster command 37 b'\xf1\x00' 2022-12-01 21:04:06.016 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] Received command 0x25 (TSN 27): b'\xf1\x00' 2022-12-01 21:04:06.016 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] No explicit handler for cluster command 0x25: b'\xf1\x00' 2022-12-01 21:04:07.778 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=61184, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY: 256>, groupId=0, sequence=27), 208, -46, 0x1c87, 255, 255, b'\t\x1c%\xf3\x00'] 2022-12-01 21:04:07.779 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x1C87), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=27, profile_id=260, cluster_id=61184, data=Serialized[b'\t\x1c%\xf3\x00'], tx_options=<TransmitOptions.NONE: 0>, radius=0, non_member_radius=0, lqi=208, rssi=-46) 2022-12-01 21:04:07.779 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] Received ZCL frame: b'\t\x1c%\xf3\x00' 2022-12-01 21:04:07.783 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.CLUSTER_COMMAND: 1>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=0, reserved=0, *is_cluster=True, *is_general=False, *is_reply=True), tsn=28, command_id=37, *direction=<Direction.Client_to_Server: 1>, *is_reply=True) 2022-12-01 21:04:07.784 WARNING (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] Unknown cluster command 37 b'\xf3\x00' 2022-12-01 21:04:07.802 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] Received command 0x25 (TSN 28): b'\xf3\x00' 2022-12-01 21:04:07.802 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] No explicit handler for cluster command 0x25: b'\xf3\x00' 2022-12-01 21:04:07.925 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=61184, sourceEndpoint=1, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_ENABLE_ROUTE_DISCOVERY: 256>, groupId=0, sequence=28), 213, -45, 0x1c87, 255, 255, b'\t\x1c%\xf3\x00'] 2022-12-01 21:04:07.927 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x1C87), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=28, profile_id=260, cluster_id=61184, data=Serialized[b'\t\x1c%\xf3\x00'], tx_options=<TransmitOptions.NONE: 0>, radius=0, non_member_radius=0, lqi=213, rssi=-45) 2022-12-01 21:04:07.927 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] Received ZCL frame: b'\t\x1c%\xf3\x00' 2022-12-01 21:04:07.928 DEBUG (MainThread) [zigpy.zcl] [0x1C87:1:0xef00] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.CLUSTER_COMMAND: 1>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=0, reserved=0, *is_cluster=True, *is_general=False, *is_reply=True), tsn=28, command_id=37, *direction=<Direction.Client_to_Server: 1>, *is_reply=True)

Hi
Are there any updates on this request?
I have the same device installed yesterday but can't get it to work.
From what I understand ZHA needs to send a a reply on command 0x25 to confirm that there is a cloud connection, before it starts sending any data, as described here https://github.com/Koenkk/zigbee2mqtt/issues/15359#issuecomment-1342957715
I have some programming skills, but this is too difficult for me to figure out, can someone help with this?
Big chance that the rest of the ts0601_din_power.py quirk works as soon as that this command is send. (if not, big chance that I can figure out the attributes and map it correctly as soon as it is being send by the device)

@javicalle Look in the link in the post before its very interesting and the "found" is implanted and tested by the same user as was doing the same with our "tuya magic" casting for Hubitat and Z2M and ZHA (deCONZ not) have implanting it from his work.
I think "tuya cloud service status" need being implanted in your MCU commands and i think some other devices can needing it 2 (the LCD temperature sensors and some TRVs that  is not reporting with very long intervals or not at all).
Thanks for digging and implanting your findings in Hubitat so other open system can using it @kkossev (our tuya magician) !!!

From https://developer.tuya.com/en/docs/iot/tuya-zigbee-module-uart-communication-protocol?id=K9ear5khsqoty#title-32-MCU requests gateway connection status (0x25).
Command 0x25 = Tuya gateway connection status
And command 0x26 = Configure Zigbee network policy is interesting.

Ok, let's try it...
That's my (quick & dirty) proposal:

copy the current ts0601_din_power.py file:

https://github.com/zigpy/zha-device-handlers/blob/dev/zhaquirks/tuya/ts0601_din_power.py

edit the HikingManufClusterDinPower and add the following code (ie: between attributes declaration and the _update_attribute method):

        .../...
        HIKING_POWER_FACTOR_ATTR: ("power_factor", t.uint16_t, True),
    }

    client_commands = TuyaManufClusterAttributes.client_commands.copy()
    client_commands.update(
        {
            0x25: foundation.ZCLCommandDef(
                "mcu_connection_status",
                {},
                True,
                is_manufacturer_specific=True,
            ),
        }
    )

    def handle_mcu_connection_status(self) -> foundation.Status:
        """Handle gateway connection status requests (0x25)."""

        payload_rsp = 0x01  # 0x00 not connected to internet | 0x01 connected to internet | 0x02 time out

        self.create_catching_task(
            super().command(0x25, payload_rsp, expect_reply=False)
        )

        return foundation.Status.SUCCESS

    def _update_attribute(self, attrid, value):
        super()._update_attribute(attrid, value)
        .../...

add the import foundation statement at the top of file:

import zigpy.types as t
from zigpy.zcl import foundation
from zigpy.zcl.clusters.general import Basic, Groups, Ota, Scenes, Time

Save changes, restart HA and repair the device.
There is some instructions:

https://github.com/zigpy/zha-device-handlers/issues/1973#issuecomment-1331903614

If something isn't working, enable the debug logs and attach the relevant info.
Put the logs between ``` marks or as attached file to easy reading.

Hi,
Thank you for the quick response, your help is much apperciated.
I made the necessary changes to the custom quirk, however, there still seems to be an issue with the 0x25 command.
since the warning changed, I'm quite sure the changes had an effect.
Now I get WARNING (MainThread) [zigpy.zcl] [0x93D7:1:0xef00] Data remains after deserializing ZCL frame: b'\xb9\x00'
I copied the most relevant lines from the debug log and pasted them below.
If you need the complete file, happy to include this.
 2022-12-15 23:46:50.850 DEBUG (MainThread) [zigpy_znp.api] Received command: AF.IncomingMsg.Callback(GroupId=0x0000, ClusterId=61184, SrcAddr=0x93D7, SrcEndpoint=1, DstEndpoint=1, WasBroadcast=<Bool.false: 0>, LQI=40, SecurityUse=<Bool.false: 0>, TimeStamp=1369556, TSN=0, Data=b'\x09\x40\x25\xB9\x00', MacSrcAddr=0x93D7, MsgResultRadius=29) 2022-12-15 23:46:50.855 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x93D7), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=0, profile_id=260, cluster_id=61184, data=Serialized[b'\t@%\xb9\x00'], tx_options=<TransmitOptions.NONE: 0>, radius=29, non_member_radius=0, lqi=40, rssi=None) 2022-12-15 23:46:50.857 DEBUG (MainThread) [zigpy.zcl] [0x93D7:1:0xef00] Received ZCL frame: b'\t@%\xb9\x00' 2022-12-15 23:46:50.859 DEBUG (MainThread) [zigpy.zcl] [0x93D7:1:0xef00] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.CLUSTER_COMMAND: 1>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=0, reserved=0, *is_cluster=True, *is_general=False, *is_reply=True), tsn=64, command_id=37, *direction=<Direction.Client_to_Server: 1>, *is_reply=True) 2022-12-15 23:46:50.862 DEBUG (MainThread) [zigpy.zcl] [0x93D7:1:0xef00] Decoded ZCL frame: HikingManufClusterDinPower:mcu_connection_status() 2022-12-15 23:46:50.863 WARNING (MainThread) [zigpy.zcl] [0x93D7:1:0xef00] Data remains after deserializing ZCL frame: b'\xb9\x00' 2022-12-15 23:46:50.873 DEBUG (MainThread) [zigpy.zcl] [0x93D7:1:0xef00] Received command 0x25 (TSN 64): mcu_connection_status() 2022-12-15 23:46:50.874 DEBUG (MainThread) [zigpy.zcl] [0x93D7:1:0xef00] No explicit handler for cluster command 0x25: mcu_connection_status()

The warnings are gone now, but the device is still only sending the x25 messages.
I also see the "no explicit handler" message at the bottom of the log.
not sure if it helps, but here is the debug log where i got below snippet from.
home-assistant_zha_2022-12-16T00-39-37.512Z.log.txt
2022-12-16 01:39:24.728 DEBUG (MainThread) [zigpy_znp.api] Received command: AF.IncomingMsg.Callback(GroupId=0x0000, ClusterId=61184, SrcAddr=0x3DFB, SrcEndpoint=1, DstEndpoint=1, WasBroadcast=<Bool.false: 0>, LQI=40, SecurityUse=<Bool.false: 0>, TimeStamp=501062, TSN=0, Data=b'\x09\x3B\x25\x5D\x00', MacSrcAddr=0x3DFB, MsgResultRadius=29)
2022-12-16 01:39:24.732 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x3DFB), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=0, profile_id=260, cluster_id=61184, data=Serialized[b'\t;%]\x00'], tx_options=<TransmitOptions.NONE: 0>, radius=29, non_member_radius=0, lqi=40, rssi=None)
2022-12-16 01:39:24.734 DEBUG (MainThread) [zigpy.zcl] [0x3DFB:1:0xef00] Received ZCL frame: b'\t;%]\x00'
2022-12-16 01:39:24.737 DEBUG (MainThread) [zigpy.zcl] [0x3DFB:1:0xef00] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.CLUSTER_COMMAND: 1>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=0, reserved=0, *is_cluster=True, *is_general=False, *is_reply=True), tsn=59, command_id=37, *direction=<Direction.Client_to_Server: 1>, *is_reply=True)
2022-12-16 01:39:24.740 DEBUG (MainThread) [zigpy.zcl] [0x3DFB:1:0xef00] Decoded ZCL frame: HikingManufClusterDinPower:mcu_connection_status(data=TuyaTsn(status=93, tsn=0))
2022-12-16 01:39:24.741 DEBUG (MainThread) [zigpy.zcl] [0x3DFB:1:0xef00] Received command 0x25 (TSN 59): mcu_connection_status(data=TuyaTsn(status=93, tsn=0))
2022-12-16 01:39:24.743 DEBUG (MainThread) [zigpy.zcl] [0x3DFB:1:0xef00] No explicit handler for cluster command 0x25: mcu_connection_status(data=TuyaTsn(status=93, tsn=0))

Not sure if related but it lacks an break like before the _update_attribute method.
I'll check later.

Hi, @javicalle have you been able to take a look?
I had another look over the weekend, but I can't figure out why the handle is not recognized.
If I base myself on the  handle_mcu_version_response in this ini.py, as far as I can tell everything looks ok.
The only thing I see, is that in this comand the client_commands are copied from the  TuyaNewManufCluster class instead of the TuyaManufClusterAttributes class. so I copied the command from the TuyaManufCluster class, (that seemed the most logic position to me) but the results are the same.

ok, I think I got the handle working, based on the logs below.
However the device is still repeating the x25 command, so the exepected response does not seem correct.
here you find the complete custom quirk file. Below the lines I changed to get it working.
from zhaquirks.tuya import TuyaManufClusterAttributes, TuyaOnOff, TuyaSwitch, TuyaNewManufCluster

class HikingManufClusterDinPower(TuyaManufClusterAttributes, TuyaNewManufCluster):

client_commands = TuyaNewManufCluster.client_commands.copy()

2022-12-19 09:34:14.694 DEBUG (MainThread) [zigpy_znp.api] Received command: AF.IncomingMsg.Callback(GroupId=0x0000, ClusterId=61184, SrcAddr=0x3DFB, SrcEndpoint=1, DstEndpoint=1, WasBroadcast=<Bool.false: 0>, LQI=40, SecurityUse=<Bool.false: 0>, TimeStamp=9681462, TSN=0, Data=b'\x09\x27\x25\x11\x00', MacSrcAddr=0x3DFB, MsgResultRadius=29)
2022-12-19 09:34:14.699 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x3DFB), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=0, profile_id=260, cluster_id=61184, data=Serialized[b"\t'%\x11\x00"], tx_options=<TransmitOptions.NONE: 0>, radius=29, non_member_radius=0, lqi=40, rssi=None)
2022-12-19 09:34:14.702 DEBUG (MainThread) [zigpy.zcl] [0x3DFB:1:0xef00] Received ZCL frame: b"\t'%\x11\x00"
2022-12-19 09:34:14.704 DEBUG (MainThread) [zigpy.zcl] [0x3DFB:1:0xef00] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.CLUSTER_COMMAND: 1>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=0, reserved=0, *is_cluster=True, *is_general=False, *is_reply=True), tsn=39, command_id=37, *direction=<Direction.Client_to_Server: 1>, *is_reply=True)
2022-12-19 09:34:14.706 DEBUG (MainThread) [zigpy.zcl] [0x3DFB:1:0xef00] Decoded ZCL frame: HikingManufClusterDinPower:mcu_thisisatest(data=TuyaTsn(status=17, tsn=0))
2022-12-19 09:34:14.707 DEBUG (MainThread) [zigpy.zcl] [0x3DFB:1:0xef00] Received command 0x25 (TSN 39): mcu_thisisatest(data=TuyaTsn(status=17, tsn=0))
2022-12-19 09:34:14.723 ERROR (MainThread) [zigpy.zcl] [0x3DFB:1:0xef00] Traceback (most recent call last):
2022-12-19 09:34:14.734 DEBUG (MainThread) [zigpy.zcl] [0x3DFB:1:0xef00] 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, *is_reply=True), tsn=39, command_id=<GeneralCommand.Default_Response: 11>, *direction=<Direction.Client_to_Server: 1>, *is_reply=True)
2022-12-19 09:34:14.736 DEBUG (MainThread) [zigpy.zcl] [0x3DFB:1:0xef00] Sending reply: Default_Response(command_id=37, status=<Status.SUCCESS: 0>)
2022-12-19 09:34:14.738 DEBUG (MainThread) [zigpy_znp.zigbee.application] Sending packet ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x3DFB), dst_ep=1, source_route=None, extended_timeout=False, tsn=39, profile_id=260, cluster_id=61184, data=Serialized[b"\x18'\x0b%\x00"], tx_options=<TransmitOptions.ACK: 1>, radius=0, non_member_radius=0, lqi=None, rssi=None)
2022-12-19 09:34:14.742 DEBUG (MainThread) [zigpy_znp.api] Sending request: AF.DataRequestExt.Req(DstAddrModeAddress=AddrModeAddress(mode=<AddrMode.NWK: 2>, address=0x3DFB), DstEndpoint=1, DstPanId=0x0000, SrcEndpoint=1, ClusterId=61184, TSN=39, Options=<TransmitOptions.SUPPRESS_ROUTE_DISC_NETWORK|ACK_REQUEST: 48>, Radius=0, Data=b'\x18\x27\x0B\x25\x00')

However the device is still repeating the 0x25 command, so the exepected response does not seem correct
The payload for the 0x25 command answer should be 3 bytes - the previously received serial number (2 bytes) plus 0x01. See the sniffed communication to Tuya gateway. So either the Tuya documentation or the MatSee Plus implementation for this device may be wrong,

However, even with the correct answer to 0x25 command, the device will still continue to query the ZIgbee coordinator every 5 seconds.
The LED will blink shortly every 3 seconds if the 0x25 command answer was OK. Otherwise will stay constantly lit.

Thank you for the info.
The LED does not blink, it is permanent on, and In the logs I only see the x25 command coming trough in the form of Data=b'\x09\x27\x25\x11\x00'
I'm way over my head here, so below logic could be totatly wrong.
To get a specific example, I'll use the data in the logs of above comment.
If the received string is Data=b'\x09\x27\x25\x11\x00'  then, from what I understand, I have to reply with x27\x11\x01.
Now my question is how do I build this reply?
The data received from the device is stored via  the class TuyaTsn(t.Struct):
If I check the status: t.uint8_t I get x11
If I check the tsn: t.uint8_t  I always get 0
Based on that, I think only the second part of the data string (x25\x11\x00) is stored.
For now this is my code, but I'm quite sure the payload_rsp needs to be defined differently.
p.s. in this comment the code block is colorcoded, How do I do that? I can't find this in the Github documentation. 😅
    class TuyaTsn(t.Struct):
        """Tuya request data."""

        status: t.uint8_t
        tsn: t.uint8_t

    client_commands = TuyaNewManufCluster.client_commands.copy()
    client_commands.update(
        {
            0x25: foundation.ZCLCommandDef(
                "mcu_thisisatest",
                {"data": TuyaTsn},
                True,
                is_manufacturer_specific=True,
            ),
        }
    )

    def handle_mcu_thisisatest(self, payload: TuyaTsn) -> foundation.Status:
        """Handle gateway connection status requests (0x25)."""
        payload_rsp: t.uint32_t
        payload_rsp = payload.status, payload.tsn, 0x01  # 0x00 not connected to internet | 0x01 connected to internet | 0x02 time out

        self.debug("handle_mcu_thisisatest response: %s", payload_rsp)

        self.create_catching_task(
            super().command(0x25, payload_rsp, expect_reply=False)
        )

        return foundation.Status.SUCCESS

2022-12-21 09:42:14.966 DEBUG (MainThread) [zigpy_znp.api] Received command: AF.IncomingMsg.Callback(GroupId=0x0000, ClusterId=61184, SrcAddr=0xC817, SrcEndpoint=1, DstEndpoint=1, WasBroadcast=<Bool.false: 0>, LQI=76, SecurityUse=<Bool.false: 0>, TimeStamp=3890105, TSN=0, Data=b'\x09\x53\x25\xEC\x00', MacSrcAddr=0xDF0C, MsgResultRadius=28)
2022-12-21 09:42:14.967 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xC817), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=0, profile_id=260, cluster_id=61184, data=Serialized[b'\tS%\xec\x00'], tx_options=<TransmitOptions.NONE: 0>, radius=28, non_member_radius=0, lqi=76, rssi=None)
2022-12-21 09:42:14.968 DEBUG (MainThread) [zigpy.zcl] [0xC817:1:0xef00] Received ZCL frame: b'\tS%\xec\x00'
2022-12-21 09:42:14.968 DEBUG (MainThread) [zigpy.zcl] [0xC817:1:0xef00] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.CLUSTER_COMMAND: 1>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=0, reserved=0, *is_cluster=True, *is_general=False, *is_reply=True), tsn=83, command_id=37, *direction=<Direction.Client_to_Server: 1>, *is_reply=True)
2022-12-21 09:42:14.970 DEBUG (MainThread) [zigpy.zcl] [0xC817:1:0xef00] Decoded ZCL frame: HikingManufClusterDinPower:mcu_thisisatest(data=TuyaTsn(status=236, tsn=0))
2022-12-21 09:42:14.970 DEBUG (MainThread) [zigpy.zcl] [0xC817:1:0xef00] Received command 0x25 (TSN 83): mcu_thisisatest(data=TuyaTsn(status=236, tsn=0))
2022-12-21 09:42:14.971 DEBUG (MainThread) [zigpy.zcl] [0xC817:1:0xef00] handle_mcu_thisisatest response: (0, 236, 1)
2022-12-21 09:42:14.974 ERROR (MainThread) [zigpy.zcl] [0xC817:1:0xef00] Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/zigpy/quirks/__init__.py", line 173, in command
    command = self.server_commands[command_id]
KeyError: 37

2022-12-21 09:42:14.975 DEBUG (Thread-13) [aiosqlite] executing functools.partial(<built-in method execute of sqlite3.Connection object at 0x7f32d0ec5540>, 'UPDATE devices_v11\n                    SET last_seen=:ts\n                    WHERE ieee=:ieee AND :ts - last_seen > :min_last_seen_delta', {'ts':<PHONE_NUMBER>.967824, 'ieee': e0:79:8d:ff:fe:de:3b:71, 'min_last_seen_delta': 30.0})
2022-12-21 09:42:14.979 DEBUG (Thread-13) [aiosqlite] operation functools.partial(<built-in method execute of sqlite3.Connection object at 0x7f32d0ec5540>, 'UPDATE devices_v11\n                    SET last_seen=:ts\n                    WHERE ieee=:ieee AND :ts - last_seen > :min_last_seen_delta', {'ts':<PHONE_NUMBER>.967824, 'ieee': e0:79:8d:ff:fe:de:3b:71, 'min_last_seen_delta': 30.0}) completed
2022-12-21 09:42:14.982 DEBUG (MainThread) [zigpy.zcl] [0xC817:1:0xef00] 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, *is_reply=True), tsn=83, command_id=<GeneralCommand.Default_Response: 11>, *direction=<Direction.Client_to_Server: 1>, *is_reply=True)
2022-12-21 09:42:14.982 DEBUG (MainThread) [zigpy.zcl] [0xC817:1:0xef00] Sending reply: Default_Response(command_id=37, status=<Status.SUCCESS: 0>)
2022-12-21 09:42:14.983 DEBUG (MainThread) [zigpy_znp.zigbee.application] Sending packet ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xC817), dst_ep=1, source_route=None, extended_timeout=False, tsn=83, profile_id=260, cluster_id=61184, data=Serialized[b'\x18S\x0b%\x00'], tx_options=<TransmitOptions.ACK: 1>, radius=0, non_member_radius=0, lqi=None, rssi=None)
2022-12-21 09:42:14.986 DEBUG (MainThread) [zigpy_znp.api] Sending request: AF.DataRequestExt.Req(DstAddrModeAddress=AddrModeAddress(mode=<AddrMode.NWK: 2>, address=0xC817), DstEndpoint=1, DstPanId=0x0000, SrcEndpoint=1, ClusterId=61184, TSN=83, Options=<TransmitOptions.SUPPRESS_ROUTE_DISC_NETWORK|ACK_REQUEST: 48>, Radius=0, Data=b'\x18\x53\x0B\x25\x00')
2022-12-21 09:42:14.988 DEBUG (Thread-13) [aiosqlite] executing functools.partial(<built-in method commit of sqlite3.Connection object at 0x7f32d0ec5540>)
2022-12-21 09:42:14.990 DEBUG (Thread-13) [aiosqlite] operation functools.partial(<built-in method commit of sqlite3.Connection object at 0x7f32d0ec5540>) completed
2022-12-21 09:42:15.007 DEBUG (MainThread) [zigpy_znp.api] Received command: AF.DataRequestExt.Rsp(Status=<Status.SUCCESS: 0>)
2022-12-21 09:42:15.053 DEBUG (MainThread) [zigpy_znp.api] Received command: AF.DataConfirm.Callback(Status=<Status.SUCCESS: 0>, Endpoint=1, TSN=83)

Sorry for the late response.

The only thing I see, is that in this comand the client_commands are copied from the TuyaNewManufCluster class instead of the TuyaManufClusterAttributes class. so I copied the command from the TuyaManufCluster class, (that seemed the most logic position to me) but the results are the same.

No, that is not correct. The TuyaNewManufCluster is another diferent approach (for the same target) but don't apply here.

However the device is still repeating the x25 command

Repeating from time to time is not a problem. The problem is if there are retries (with the same tsn number). Can you check it?
In any case, the response message (Data=b'\x18\x27\x0B\x25\x00') is not what I would expect.

2022-12-21 09:42:14.974 ERROR (MainThread) [zigpy.zcl] [0xC817:1:0xef00] Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/zigpy/quirks/__init__.py", line 173, in command
    command = self.server_commands[command_id]
KeyError: 37

That's interesting...
We need to define also the server_commands to be able to send the response.
Putting all together that would be:
"""Tuya Din Power Meter."""
from zigpy.profiles import zha
import zigpy.types as t
from zigpy.zcl import foundation
from zigpy.zcl.clusters.general import Basic, Groups, Ota, Scenes, Time
from zigpy.zcl.clusters.homeautomation import ElectricalMeasurement
from zigpy.zcl.clusters.smartenergy import Metering

from zhaquirks import Bus, LocalDataCluster
from zhaquirks.const import (
    DEVICE_TYPE,
    ENDPOINTS,
    INPUT_CLUSTERS,
    MODELS_INFO,
    OUTPUT_CLUSTERS,
    PROFILE_ID,
)
from zhaquirks.tuya import TuyaManufClusterAttributes, TuyaOnOff, TuyaSwitch

TUYA_TOTAL_ENERGY_ATTR = 0x0211
TUYA_CURRENT_ATTR = 0x0212
TUYA_POWER_ATTR = 0x0213
TUYA_VOLTAGE_ATTR = 0x0214
TUYA_DIN_SWITCH_ATTR = 0x0101

SWITCH_EVENT = "switch_event"

"""Hiking Power Meter Attributes"""
HIKING_DIN_SWITCH_ATTR = 0x0110
HIKING_TOTAL_ENERGY_DELIVERED_ATTR = 0x0201
HIKING_TOTAL_ENERGY_RECEIVED_ATTR = 0x0266
HIKING_VOLTAGE_CURRENT_ATTR = 0x0006
HIKING_POWER_ATTR = 0x0267
HIKING_FREQUENCY_ATTR = 0x0269
HIKING_POWER_FACTOR_ATTR = 0x026F
HIKING_TOTAL_REACTIVE_ATTR = 0x026D
HIKING_REACTIVE_POWER_ATTR = 0x026E

class TuyaManufClusterDinPower(TuyaManufClusterAttributes):
    """Manufacturer Specific Cluster of the Tuya Power Meter device."""

    attributes = {
        TUYA_TOTAL_ENERGY_ATTR: ("energy", t.uint16_t, True),
        TUYA_CURRENT_ATTR: ("current", t.int16s, True),
        TUYA_POWER_ATTR: ("power", t.uint16_t, True),
        TUYA_VOLTAGE_ATTR: ("voltage", t.uint16_t, True),
        TUYA_DIN_SWITCH_ATTR: ("switch", t.uint8_t, True),
    }

    def _update_attribute(self, attrid, value):
        super()._update_attribute(attrid, value)
        if attrid == TUYA_TOTAL_ENERGY_ATTR:
            self.endpoint.smartenergy_metering.energy_deliver_reported(value / 100)
        elif attrid == TUYA_CURRENT_ATTR:
            self.endpoint.electrical_measurement.current_reported(value)
        elif attrid == TUYA_POWER_ATTR:
            self.endpoint.electrical_measurement.power_reported(value / 10)
        elif attrid == TUYA_VOLTAGE_ATTR:
            self.endpoint.electrical_measurement.voltage_reported(value / 10)
        elif attrid == TUYA_DIN_SWITCH_ATTR:
            self.endpoint.device.switch_bus.listener_event(
                SWITCH_EVENT, self.endpoint.endpoint_id, value
            )

class TuyaPowerMeasurement(LocalDataCluster, ElectricalMeasurement):
    """Custom class for power, voltage and current measurement."""

    cluster_id = ElectricalMeasurement.cluster_id

    POWER_ID = 0x050B
    VOLTAGE_ID = 0x0505
    CURRENT_ID = 0x0508
    REACTIVE_POWER_ID = 0x050E
    AC_FREQUENCY_ID = 0x0300
    TOTAL_REACTIVE_POWER_ID = 0x0305
    POWER_FACTOR_ID = 0x0510

    AC_CURRENT_MULTIPLIER = 0x0602
    AC_CURRENT_DIVISOR = 0x0603
    AC_FREQUENCY_MULTIPLIER = 0x0400
    AC_FREQUENCY_DIVISOR = 0x0401

    _CONSTANT_ATTRIBUTES = {
        AC_CURRENT_MULTIPLIER: 1,
        AC_CURRENT_DIVISOR: 1000,
        AC_FREQUENCY_MULTIPLIER: 1,
        AC_FREQUENCY_DIVISOR: 100,
    }

    def voltage_reported(self, value):
        """Voltage reported."""
        self._update_attribute(self.VOLTAGE_ID, value)

    def power_reported(self, value):
        """Power reported."""
        self._update_attribute(self.POWER_ID, value)

    def power_factor_reported(self, value):
        """Power Factor reported."""
        self._update_attribute(self.POWER_FACTOR_ID, value)

    def reactive_power_reported(self, value):
        """Reactive Power reported."""
        self._update_attribute(self.REACTIVE_POWER_ID, value)

    def current_reported(self, value):
        """Ampers reported."""
        self._update_attribute(self.CURRENT_ID, value)

    def frequency_reported(self, value):
        """AC Frequency reported."""
        self._update_attribute(self.AC_FREQUENCY_ID, value)

    def reactive_energy_reported(self, value):
        """Summation Reactive Energy reported."""
        self._update_attribute(self.TOTAL_REACTIVE_POWER_ID, value)

class TuyaElectricalMeasurement(LocalDataCluster, Metering):
    """Custom class for total energy measurement."""

    cluster_id = Metering.cluster_id
    CURRENT_DELIVERED_ID = 0x0000
    CURRENT_RECEIVED_ID = 0x0001
    POWER_WATT = 0x0000

    """Setting unit of measurement."""
    _CONSTANT_ATTRIBUTES = {0x0300: POWER_WATT}

    def energy_deliver_reported(self, value):
        """Summation Energy Deliver reported."""
        self._update_attribute(self.CURRENT_DELIVERED_ID, value)

    def energy_receive_reported(self, value):
        """Summation Energy Receive reported."""
        self._update_attribute(self.CURRENT_RECEIVED_ID, value)

class HikingManufClusterDinPower(TuyaManufClusterAttributes):
    """Manufacturer Specific Cluster of the Hiking Power Meter device."""

    attributes = {
        HIKING_DIN_SWITCH_ATTR: ("switch", t.uint8_t, True),
        HIKING_TOTAL_ENERGY_DELIVERED_ATTR: ("energy_delivered", t.uint16_t, True),
        HIKING_TOTAL_ENERGY_RECEIVED_ATTR: ("energy_received", t.uint16_t, True),
        HIKING_VOLTAGE_CURRENT_ATTR: ("voltage_current", t.uint32_t, True),
        HIKING_POWER_ATTR: ("power", t.uint16_t, True),
        HIKING_FREQUENCY_ATTR: ("frequency", t.uint16_t, True),
        HIKING_TOTAL_REACTIVE_ATTR: ("total_reactive_energy", t.int32s, True),
        HIKING_REACTIVE_POWER_ATTR: ("reactive_power", t.int16s, True),
        HIKING_POWER_FACTOR_ATTR: ("power_factor", t.uint16_t, True),
    }

    class TuyaConnectionStatus(t.Struct):
        """Tuya request data."""

        data_1: t.uint8_t
        data_2: t.uint8_t

    client_commands = TuyaManufClusterAttributes.client_commands.copy()
    client_commands.update(
        {
            0x25: foundation.ZCLCommandDef(
                "mcu_connection_status",
                {"payload": TuyaConnectionStatus},
                True,
                is_manufacturer_specific=True,
            ),
        }
    )

    class TuyaConnectionStatusRsp(t.Struct):
        """Tuya request data."""

        data_1: t.uint8_t
        data_2: t.uint8_t
        data_3: t.uint8_t

    server_commands = TuyaManufClusterAttributes.server_commands.copy()
    server_commands.update(
        {
            0x25: foundation.ZCLCommandDef(
                "mcu_connection_status_rsp",
                {"payload": TuyaConnectionStatusRsp},
                True,
                is_manufacturer_specific=True,
            ),
        }
    )

    def handle_mcu_connection_status(self, payload: TuyaTsn) -> foundation.Status:
        """Handle gateway connection status requests (0x25)."""

        payload_rsp = TuyaConnectionStatusRsp()
        payload_rsp.data_1 = payload.data_1
        payload_rsp.data_2 = payload.data_2  # If this is data length would be 0x01
        payload_rsp.data_3 = 0x01  # 0x00 not connected to internet | 0x01 connected to internet | 0x02 time out

        self.create_catching_task(
            super().command(0x25, payload_rsp, expect_reply=False)
        )

        return foundation.Status.SUCCESS

    def _update_attribute(self, attrid, value):
        super()._update_attribute(attrid, value)
        if attrid == HIKING_DIN_SWITCH_ATTR:
            self.endpoint.device.switch_bus.listener_event(SWITCH_EVENT, 16, value)
        elif attrid == HIKING_TOTAL_ENERGY_DELIVERED_ATTR:
            self.endpoint.smartenergy_metering.energy_deliver_reported(value / 100)
        elif attrid == HIKING_TOTAL_ENERGY_RECEIVED_ATTR:
            self.endpoint.smartenergy_metering.energy_receive_reported(value / 100)
        elif attrid == HIKING_VOLTAGE_CURRENT_ATTR:
            self.endpoint.electrical_measurement.current_reported(value >> 16)
            self.endpoint.electrical_measurement.voltage_reported(
                (value & 0x0000FFFF) / 10
            )
        elif attrid == HIKING_POWER_ATTR:
            self.endpoint.electrical_measurement.power_reported(value)
        elif attrid == HIKING_FREQUENCY_ATTR:
            self.endpoint.electrical_measurement.frequency_reported(value)
        elif attrid == HIKING_TOTAL_REACTIVE_ATTR:
            self.endpoint.electrical_measurement.reactive_energy_reported(value)
        elif attrid == HIKING_REACTIVE_POWER_ATTR:
            self.endpoint.electrical_measurement.reactive_power_reported(value)
        elif attrid == HIKING_POWER_FACTOR_ATTR:
            self.endpoint.electrical_measurement.power_factor_reported(value / 10)

class TuyaPowerMeter(TuyaSwitch):
    """Tuya power meter device."""

    def __init__(self, *args, **kwargs):
        """Init device."""
        self.switch_bus = Bus()
        super().__init__(*args, **kwargs)

    signature = {
        # "node_descriptor": "<NodeDescriptor byte1=1 byte2=64 mac_capability_flags=142 manufacturer_code=4098
        #                       maximum_buffer_size=82 maximum_incoming_transfer_size=82 server_mask=11264
        #                       maximum_outgoing_transfer_size=82 descriptor_capability_field=0>",
        # device_version=1
        # input_clusters=[0x0000, 0x0004, 0x0005, 0xef00]
        # output_clusters=[0x000a, 0x0019]
        MODELS_INFO: [
            ("_TZE200_byzdayie", "TS0601"),
            ("_TZE200_ewxhg6o9", "TS0601"),
        ],
        ENDPOINTS: {
            # <SimpleDescriptor endpoint=1 profile=260 device_type=51
            # device_version=1
            # input_clusters=[0, 4, 5, 61184]
            # output_clusters=[10, 25]>
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    TuyaManufClusterAttributes.cluster_id,
                ],
                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
            }
        },
    }

    replacement = {
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    TuyaManufClusterDinPower,
                    TuyaPowerMeasurement,
                    TuyaElectricalMeasurement,
                    TuyaOnOff,
                ],
                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
            }
        }
    }

class HikingPowerMeter(TuyaSwitch):
    """Hiking Power Meter Device - DDS238-2."""

    signature = {
        # "node_descriptor": "<NodeDescriptor byte1=1 byte2=64 mac_capability_flags=142 manufacturer_code=4098
        #                       maximum_buffer_size=82 maximum_incoming_transfer_size=82 server_mask=11264
        #                       maximum_outgoing_transfer_size=82 descriptor_capability_field=0>",
        # device_version=1
        # input_clusters=[0x0000, 0x0004, 0x0005, 0xef00]
        # output_clusters=[0x000a, 0x0019]
        MODELS_INFO: [
            ("_TZE200_bkkmqmyo", "TS0601"),
            ("_TZE204_cjbofhxw", "TS0601"),
        ],
        ENDPOINTS: {
            # <SimpleDescriptor endpoint=1 profile=260 device_type=51
            # device_version=1
            # input_clusters=[0, 4, 5, 61184]
            # output_clusters=[10, 25]>
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    TuyaManufClusterAttributes.cluster_id,
                ],
                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
            }
        },
    }

    replacement = {
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    HikingManufClusterDinPower,
                    TuyaElectricalMeasurement,
                    TuyaPowerMeasurement,
                ],
                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
            },
            16: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
                INPUT_CLUSTERS: [
                    TuyaOnOff,
                ],
                OUTPUT_CLUSTERS: [],
            },
        }
    }

PS: you can color your code with:
```python
YOUR CODE HERE
```

If I check the status: t.uint8_t I get x11

This value change over time? Or is exactly x11 always?

The message is repeated five times,  then there is a timeout of 5 seconds, and then the  TSN number goes up with one decimal, and the status number goes up with two decimals.
Below an example.
With the code above the No explicit handler for cluster command 0x25: mcu_connection_status  pops up.
2022-12-21 22:56:28.421 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xC817), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=0, profile_id=260, cluster_id=61184, data=Serialized[b'\tu%\xd4\x00'], tx_options=<TransmitOptions.NONE: 0>, radius=28, non_member_radius=0, lqi=127, rssi=None)
2022-12-21 22:56:28.423 DEBUG (MainThread) [zigpy.zcl] [0xC817:1:0xef00] Received ZCL frame: b'\tu%\xd4\x00'
2022-12-21 22:56:28.427 DEBUG (MainThread) [zigpy.zcl] [0xC817:1:0xef00] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.CLUSTER_COMMAND: 1>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=0, reserved=0, *is_cluster=True, *is_general=False, *is_reply=True), tsn=117, command_id=37, *direction=<Direction.Client_to_Server: 1>, *is_reply=True)
2022-12-21 22:56:28.431 DEBUG (MainThread) [zigpy.zcl] [0xC817:1:0xef00] Decoded ZCL frame: HikingManufClusterDinPower:mcu_connection_status(payload=TuyaConnectionStatus(data_1=212, data_2=0))
2022-12-21 22:56:28.434 DEBUG (MainThread) [zigpy.zcl] [0xC817:1:0xef00] Received command 0x25 (TSN 117): mcu_connection_status(payload=TuyaConnectionStatus(data_1=212, data_2=0))
2022-12-21 22:56:28.441 DEBUG (MainThread) [zigpy.zcl] [0xC817:1:0xef00] No explicit handler for cluster command 0x25: mcu_connection_status(payload=TuyaConnectionStatus(data_1=212, data_2=0))
------------------------------------------------------------------------------------------------------------------------------------
2022-12-21 22:56:32.082 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xC817), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=0, profile_id=260, cluster_id=61184, data=Serialized[b'\tv%\xd6\x00'], tx_options=<TransmitOptions.NONE: 0>, radius=28, non_member_radius=0, lqi=127, rssi=None)
2022-12-21 22:56:32.083 DEBUG (MainThread) [zigpy.zcl] [0xC817:1:0xef00] Received ZCL frame: b'\tv%\xd6\x00'
2022-12-21 22:56:32.084 DEBUG (MainThread) [zigpy.zcl] [0xC817:1:0xef00] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.CLUSTER_COMMAND: 1>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=0, reserved=0, *is_cluster=True, *is_general=False, *is_reply=True), tsn=118, command_id=37, *direction=<Direction.Client_to_Server: 1>, *is_reply=True)
2022-12-21 22:56:32.085 DEBUG (MainThread) [zigpy.zcl] [0xC817:1:0xef00] Decoded ZCL frame: HikingManufClusterDinPower:mcu_connection_status(payload=TuyaConnectionStatus(data_1=214, data_2=0))
2022-12-21 22:56:32.086 DEBUG (MainThread) [zigpy.zcl] [0xC817:1:0xef00] Received command 0x25 (TSN 118): mcu_connection_status(payload=TuyaConnectionStatus(data_1=214, data_2=0))
2022-12-21 22:56:32.087 DEBUG (MainThread) [zigpy.zcl] [0xC817:1:0xef00] No explicit handler for cluster command 0x25: mcu_connection_status(payload=TuyaConnectionStatus(data_1=214, data_2=0))

If one unicats is not being acked the sender is sending it with the same TSN after some hundred millS.
Id the system (the Zibee stack if ZCL or the quirk id not ZCL) sending one default resonance to the device ?
If not is the device doing right and the the system is doing wrong.
Default response from quirk is implanted in tuya INIT must only using the right device class for using it.

Thanks for testing.
I'm a bit confused here.
Can you try replacing the copy() parr like this?
client_commands = TuyaManufCluster.client_commands.copy()

server_commands = TuyaManufCluster.server_commands.copy()

Hi javicalle, That gives me the same error message.
If I use the TuyaNewManufCluster , the handle is recognized, but now I get a traceback.
I had to import the class and define it like described here
Below you find the log, and the adapted code that generated this log.
My reasoning is that the 'TuyaNewManufCluster' contains a similar error handling message as I see in the logs except it specifically says  tuya handler.
In the code I also changed
def handle_mcu_connection_status(self, payload: TuyaTsn)  -> foundation.Status:

to
def handle_mcu_connection_status(self, payload: TuyaConnectionStatus) -> foundation.Status:

2022-12-22 08:29:11.019 DEBUG (MainThread) [zigpy_znp.api] Received command: AF.IncomingMsg.Callback(GroupId=0x0000, ClusterId=61184, SrcAddr=0xC817, SrcEndpoint=1, DstEndpoint=1, WasBroadcast=<Bool.false: 0>, LQI=58, SecurityUse=<Bool.false: 0>, TimeStamp=1497354, TSN=0, Data=b'\x09\x6C\x25\x1E\x00', MacSrcAddr=0xA4E2, MsgResultRadius=28)
2022-12-22 08:29:11.023 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xC817), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=0, profile_id=260, cluster_id=61184, data=Serialized[b'\tl%\x1e\x00'], tx_options=<TransmitOptions.NONE: 0>, radius=28, non_member_radius=0, lqi=58, rssi=None)
2022-12-22 08:29:11.026 DEBUG (MainThread) [zigpy.zcl] [0xC817:1:0xef00] Received ZCL frame: b'\tl%\x1e\x00'
2022-12-22 08:29:11.030 DEBUG (MainThread) [zigpy.zcl] [0xC817:1:0xef00] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.CLUSTER_COMMAND: 1>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=0, reserved=0, *is_cluster=True, *is_general=False, *is_reply=True), tsn=108, command_id=37, *direction=<Direction.Client_to_Server: 1>, *is_reply=True)
2022-12-22 08:29:11.036 DEBUG (MainThread) [zigpy.zcl] [0xC817:1:0xef00] Decoded ZCL frame: HikingManufClusterDinPower:mcu_connection_status(payload=TuyaConnectionStatus(data_1=30, data_2=0))
2022-12-22 08:29:11.038 DEBUG (MainThread) [zigpy.zcl] [0xC817:1:0xef00] Received command 0x25 (TSN 108): mcu_connection_status(payload=TuyaConnectionStatus(data_1=30, data_2=0))
2022-12-22 08:29:11.040 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/zigpy_znp/zigbee/application.py", line 588, in on_af_message
    self.packet_received(
  File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 855, in packet_received
    self.handle_message(
  File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 361, in handle_message
    return sender.handle_message(
  File "/usr/local/lib/python3.10/site-packages/zigpy/device.py", line 370, in handle_message
    return endpoint.handle_message(
  File "/usr/local/lib/python3.10/site-packages/zigpy/endpoint.py", line 224, in handle_message
    handler(hdr, args, dst_addressing=dst_addressing)
  File "/usr/local/lib/python3.10/site-packages/zigpy/zcl/__init__.py", line 373, in handle_message
    self.handle_cluster_request(hdr, args, dst_addressing=dst_addressing)
  File "/usr/local/lib/python3.10/site-packages/zhaquirks/tuya/__init__.py", line 429, in handle_cluster_request
    return super().handle_cluster_request(
  File "/usr/local/lib/python3.10/site-packages/zhaquirks/tuya/__init__.py", line 377, in handle_cluster_request
    return super().handle_cluster_request(
  File "/usr/local/lib/python3.10/site-packages/zhaquirks/tuya/__init__.py", line 1431, in handle_cluster_request
    status = getattr(self, handler_name)(*args)
  File "/config/custom_zha_quirks/ts0601_din_power.py", line 198, in handle_mcu_connection_status
    payload_rsp = TuyaConnectionStatusRsp()
NameError: name 'TuyaConnectionStatusRsp' is not defined

"""Tuya Din Power Meter."""
from zigpy.profiles import zha
import zigpy.types as t
from zigpy.zcl import foundation
from zigpy.zcl.clusters.general import Basic, Groups, Ota, Scenes, Time
from zigpy.zcl.clusters.homeautomation import ElectricalMeasurement
from zigpy.zcl.clusters.smartenergy import Metering

from zhaquirks import Bus, LocalDataCluster
from zhaquirks.const import (
    DEVICE_TYPE,
    ENDPOINTS,
    INPUT_CLUSTERS,
    MODELS_INFO,
    OUTPUT_CLUSTERS,
    PROFILE_ID,
)
from zhaquirks.tuya import TuyaManufClusterAttributes, TuyaOnOff, TuyaSwitch, TuyaNewManufCluster

TUYA_TOTAL_ENERGY_ATTR = 0x0211
TUYA_CURRENT_ATTR = 0x0212
TUYA_POWER_ATTR = 0x0213
TUYA_VOLTAGE_ATTR = 0x0214
TUYA_DIN_SWITCH_ATTR = 0x0101

SWITCH_EVENT = "switch_event"

"""Hiking Power Meter Attributes"""
HIKING_DIN_SWITCH_ATTR = 0x0110
HIKING_TOTAL_ENERGY_DELIVERED_ATTR = 0x0201
HIKING_TOTAL_ENERGY_RECEIVED_ATTR = 0x0266
HIKING_VOLTAGE_CURRENT_ATTR = 0x0006
HIKING_POWER_ATTR = 0x0267
HIKING_FREQUENCY_ATTR = 0x0269
HIKING_POWER_FACTOR_ATTR = 0x026F
HIKING_TOTAL_REACTIVE_ATTR = 0x026D
HIKING_REACTIVE_POWER_ATTR = 0x026E

class TuyaManufClusterDinPower(TuyaManufClusterAttributes):
    """Manufacturer Specific Cluster of the Tuya Power Meter device."""

    attributes = {
        TUYA_TOTAL_ENERGY_ATTR: ("energy", t.uint16_t, True),
        TUYA_CURRENT_ATTR: ("current", t.int16s, True),
        TUYA_POWER_ATTR: ("power", t.uint16_t, True),
        TUYA_VOLTAGE_ATTR: ("voltage", t.uint16_t, True),
        TUYA_DIN_SWITCH_ATTR: ("switch", t.uint8_t, True),
    }

    def _update_attribute(self, attrid, value):
        super()._update_attribute(attrid, value)
        if attrid == TUYA_TOTAL_ENERGY_ATTR:
            self.endpoint.smartenergy_metering.energy_deliver_reported(value / 100)
        elif attrid == TUYA_CURRENT_ATTR:
            self.endpoint.electrical_measurement.current_reported(value)
        elif attrid == TUYA_POWER_ATTR:
            self.endpoint.electrical_measurement.power_reported(value / 10)
        elif attrid == TUYA_VOLTAGE_ATTR:
            self.endpoint.electrical_measurement.voltage_reported(value / 10)
        elif attrid == TUYA_DIN_SWITCH_ATTR:
            self.endpoint.device.switch_bus.listener_event(
                SWITCH_EVENT, self.endpoint.endpoint_id, value
            )

class TuyaPowerMeasurement(LocalDataCluster, ElectricalMeasurement):
    """Custom class for power, voltage and current measurement."""

    cluster_id = ElectricalMeasurement.cluster_id

    POWER_ID = 0x050B
    VOLTAGE_ID = 0x0505
    CURRENT_ID = 0x0508
    REACTIVE_POWER_ID = 0x050E
    AC_FREQUENCY_ID = 0x0300
    TOTAL_REACTIVE_POWER_ID = 0x0305
    POWER_FACTOR_ID = 0x0510

    AC_CURRENT_MULTIPLIER = 0x0602
    AC_CURRENT_DIVISOR = 0x0603
    AC_FREQUENCY_MULTIPLIER = 0x0400
    AC_FREQUENCY_DIVISOR = 0x0401

    _CONSTANT_ATTRIBUTES = {
        AC_CURRENT_MULTIPLIER: 1,
        AC_CURRENT_DIVISOR: 1000,
        AC_FREQUENCY_MULTIPLIER: 1,
        AC_FREQUENCY_DIVISOR: 100,
    }

    def voltage_reported(self, value):
        """Voltage reported."""
        self._update_attribute(self.VOLTAGE_ID, value)

    def power_reported(self, value):
        """Power reported."""
        self._update_attribute(self.POWER_ID, value)

    def power_factor_reported(self, value):
        """Power Factor reported."""
        self._update_attribute(self.POWER_FACTOR_ID, value)

    def reactive_power_reported(self, value):
        """Reactive Power reported."""
        self._update_attribute(self.REACTIVE_POWER_ID, value)

    def current_reported(self, value):
        """Ampers reported."""
        self._update_attribute(self.CURRENT_ID, value)

    def frequency_reported(self, value):
        """AC Frequency reported."""
        self._update_attribute(self.AC_FREQUENCY_ID, value)

    def reactive_energy_reported(self, value):
        """Summation Reactive Energy reported."""
        self._update_attribute(self.TOTAL_REACTIVE_POWER_ID, value)

class TuyaElectricalMeasurement(LocalDataCluster, Metering):
    """Custom class for total energy measurement."""

    cluster_id = Metering.cluster_id
    CURRENT_DELIVERED_ID = 0x0000
    CURRENT_RECEIVED_ID = 0x0001
    POWER_WATT = 0x0000

    """Setting unit of measurement."""
    _CONSTANT_ATTRIBUTES = {0x0300: POWER_WATT}

    def energy_deliver_reported(self, value):
        """Summation Energy Deliver reported."""
        self._update_attribute(self.CURRENT_DELIVERED_ID, value)

    def energy_receive_reported(self, value):
        """Summation Energy Receive reported."""
        self._update_attribute(self.CURRENT_RECEIVED_ID, value)

class HikingManufClusterDinPower(TuyaManufClusterAttributes, TuyaNewManufCluster):
    """Manufacturer Specific Cluster of the Hiking Power Meter device."""

    attributes = {
        HIKING_DIN_SWITCH_ATTR: ("switch", t.uint8_t, True),
        HIKING_TOTAL_ENERGY_DELIVERED_ATTR: ("energy_delivered", t.uint16_t, True),
        HIKING_TOTAL_ENERGY_RECEIVED_ATTR: ("energy_received", t.uint16_t, True),
        HIKING_VOLTAGE_CURRENT_ATTR: ("voltage_current", t.uint32_t, True),
        HIKING_POWER_ATTR: ("power", t.uint16_t, True),
        HIKING_FREQUENCY_ATTR: ("frequency", t.uint16_t, True),
        HIKING_TOTAL_REACTIVE_ATTR: ("total_reactive_energy", t.int32s, True),
        HIKING_REACTIVE_POWER_ATTR: ("reactive_power", t.int16s, True),
        HIKING_POWER_FACTOR_ATTR: ("power_factor", t.uint16_t, True),
    }

    class TuyaConnectionStatus(t.Struct):
        """Tuya request data."""

        data_1: t.uint8_t
        data_2: t.uint8_t

    client_commands = TuyaNewManufCluster.client_commands.copy()

    client_commands.update(
        {
            0x25: foundation.ZCLCommandDef(
                "mcu_connection_status",
                {"payload": TuyaConnectionStatus},
                True,
                is_manufacturer_specific=True,
            ),
        }
    )

    class TuyaConnectionStatusRsp(t.Struct):
        """Tuya request data."""

        data_1: t.uint8_t
        data_2: t.uint8_t
        data_3: t.uint8_t

    server_commands = TuyaNewManufCluster.server_commands.copy()
    server_commands.update(
        {
            0x25: foundation.ZCLCommandDef(
                "mcu_connection_status_rsp",
                {"payload": TuyaConnectionStatusRsp},
                True,
                is_manufacturer_specific=True,
            ),
        }
    )

    def handle_mcu_connection_status(self, payload: TuyaConnectionStatus) -> foundation.Status:
        """Handle gateway connection status requests (0x25)."""

        payload_rsp = TuyaConnectionStatusRsp()
        payload_rsp.data_1 = payload.data_1
        payload_rsp.data_2 = payload.data_2  # If this is data length would be 0x01
        payload_rsp.data_3 = 0x01  # 0x00 not connected to internet | 0x01 connected to internet | 0x02 time out

        self.create_catching_task(
            super().command(0x25, payload_rsp, expect_reply=False)
        )

        return foundation.Status.SUCCESS

    def _update_attribute(self, attrid, value):
        super()._update_attribute(attrid, value)
        if attrid == HIKING_DIN_SWITCH_ATTR:
            self.endpoint.device.switch_bus.listener_event(SWITCH_EVENT, 16, value)
        elif attrid == HIKING_TOTAL_ENERGY_DELIVERED_ATTR:
            self.endpoint.smartenergy_metering.energy_deliver_reported(value / 100)
        elif attrid == HIKING_TOTAL_ENERGY_RECEIVED_ATTR:
            self.endpoint.smartenergy_metering.energy_receive_reported(value / 100)
        elif attrid == HIKING_VOLTAGE_CURRENT_ATTR:
            self.endpoint.electrical_measurement.current_reported(value >> 16)
            self.endpoint.electrical_measurement.voltage_reported(
                (value & 0x0000FFFF) / 10
            )
        elif attrid == HIKING_POWER_ATTR:
            self.endpoint.electrical_measurement.power_reported(value)
        elif attrid == HIKING_FREQUENCY_ATTR:
            self.endpoint.electrical_measurement.frequency_reported(value)
        elif attrid == HIKING_TOTAL_REACTIVE_ATTR:
            self.endpoint.electrical_measurement.reactive_energy_reported(value)
        elif attrid == HIKING_REACTIVE_POWER_ATTR:
            self.endpoint.electrical_measurement.reactive_power_reported(value)
        elif attrid == HIKING_POWER_FACTOR_ATTR:
            self.endpoint.electrical_measurement.power_factor_reported(value / 10)

class TuyaPowerMeter(TuyaSwitch):
    """Tuya power meter device."""

    def __init__(self, *args, **kwargs):
        """Init device."""
        self.switch_bus = Bus()
        super().__init__(*args, **kwargs)

    signature = {
        # "node_descriptor": "<NodeDescriptor byte1=1 byte2=64 mac_capability_flags=142 manufacturer_code=4098
        #                       maximum_buffer_size=82 maximum_incoming_transfer_size=82 server_mask=11264
        #                       maximum_outgoing_transfer_size=82 descriptor_capability_field=0>",
        # device_version=1
        # input_clusters=[0x0000, 0x0004, 0x0005, 0xef00]
        # output_clusters=[0x000a, 0x0019]
        MODELS_INFO: [
            ("_TZE200_byzdayie", "TS0601"),
            ("_TZE200_ewxhg6o9", "TS0601"),
        ],
        ENDPOINTS: {
            # <SimpleDescriptor endpoint=1 profile=260 device_type=51
            # device_version=1
            # input_clusters=[0, 4, 5, 61184]
            # output_clusters=[10, 25]>
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    TuyaManufClusterAttributes.cluster_id,
                ],
                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
            }
        },
    }

    replacement = {
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    TuyaManufClusterDinPower,
                    TuyaPowerMeasurement,
                    TuyaElectricalMeasurement,
                    TuyaOnOff,
                ],
                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
            }
        }
    }

class HikingPowerMeter(TuyaSwitch):
    """Hiking Power Meter Device - DDS238-2."""

    signature = {
        # "node_descriptor": "<NodeDescriptor byte1=1 byte2=64 mac_capability_flags=142 manufacturer_code=4098
        #                       maximum_buffer_size=82 maximum_incoming_transfer_size=82 server_mask=11264
        #                       maximum_outgoing_transfer_size=82 descriptor_capability_field=0>",
        # device_version=1
        # input_clusters=[0x0000, 0x0004, 0x0005, 0xef00]
        # output_clusters=[0x000a, 0x0019]
        MODELS_INFO: [
            ("_TZE200_bkkmqmyo", "TS0601"),
            ("_TZE204_cjbofhxw", "TS0601"),
        ],
        ENDPOINTS: {
            # <SimpleDescriptor endpoint=1 profile=260 device_type=51
            # device_version=1
            # input_clusters=[0, 4, 5, 61184]
            # output_clusters=[10, 25]>
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    TuyaManufClusterAttributes.cluster_id,
                ],
                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
            }
        },
    }

    replacement = {
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    HikingManufClusterDinPower,
                    TuyaElectricalMeasurement,
                    TuyaPowerMeasurement,
                ],
                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
            },
            16: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
                INPUT_CLUSTERS: [
                    TuyaOnOff,
                ],
                OUTPUT_CLUSTERS: [],
            },
        }
    }

To fix the exception replace at handle_mcu_connection_status this part:
        payload_rsp = HikingManufClusterDinPower.TuyaConnectionStatusRsp()

Also, update to false the new command definition at the server_commands like this:
    server_commands.update(
        {
            0x25: foundation.ZCLCommandDef(
                "mcu_connection_status_rsp",
                {"payload": TuyaConnectionStatusRsp},
                False,
                is_manufacturer_specific=True,
            ),
        }
    )

Z2M support for command here:
https://github.com/Koenkk/zigbee-herdsman/commit/22c41a81f4f6ef49538f2ea2cae27bdbe69a6b0b
Not sure about attributes meanings, but match with our proposal.

Ok I think we are getting somewhere.
I see different packets in the logs coming from the device now, and the LED blinks every few seconds.
As @MattWestb described this should be the expected behaviour.
I see a traceback on command 0x02 though, and I still don't see the correct entities on the device page.
I'll start with re-pairing the device, and then I'll try to figure out what the different messages mean, or at least filter the log a bit post the relevant lines here.
2022-12-22 16:40:26.803 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xC817), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=0, profile_id=260, cluster_id=61184, data=Serialized[b'\tO\x02\x00\xbc\x13\x02\x00\x04\x00\x00\t\x01'], tx_options=<TransmitOptions.NONE: 0>, radius=28, non_member_radius=0, lqi=80, rssi=None)
2022-12-22 16:40:26.808 DEBUG (MainThread) [zigpy.zcl] [0xC817:1:0xef00] Received ZCL frame: b'\tO\x02\x00\xbc\x13\x02\x00\x04\x00\x00\t\x01'
2022-12-22 16:40:26.814 DEBUG (MainThread) [zigpy.zcl] [0xC817:1:0xef00] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.CLUSTER_COMMAND: 1>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=0, reserved=0, *is_cluster=True, *is_general=False, *is_reply=True), tsn=79, command_id=2, *direction=<Direction.Client_to_Server: 1>, *is_reply=True)
2022-12-22 16:40:26.818 DEBUG (MainThread) [zigpy.zcl] [0xC817:1:0xef00] Decoded ZCL frame: HikingManufClusterDinPower:set_data_response(data=TuyaCommand(status=0, tsn=188, datapoints=[TuyaDatapointData(dp=19, data=TuyaData(dp_type=<TuyaDPType.VALUE: 2>, function=0, raw=b'\x01\t\x00\x00', *payload=2305))]))
2022-12-22 16:40:26.823 DEBUG (MainThread) [zigpy.zcl] [0xC817:1:0xef00] Received command 0x02 (TSN 79): set_data_response(data=TuyaCommand(status=0, tsn=188, datapoints=[TuyaDatapointData(dp=19, data=TuyaData(dp_type=<TuyaDPType.VALUE: 2>, function=0, raw=b'\x01\t\x00\x00', *payload=2305))]))
2022-12-22 16:40:26.829 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/zigpy_znp/zigbee/application.py", line 588, in on_af_message
    self.packet_received(
  File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 855, in packet_received
    self.handle_message(
  File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 361, in handle_message
    return sender.handle_message(
  File "/usr/local/lib/python3.10/site-packages/zigpy/device.py", line 370, in handle_message
    return endpoint.handle_message(
  File "/usr/local/lib/python3.10/site-packages/zigpy/endpoint.py", line 224, in handle_message
    handler(hdr, args, dst_addressing=dst_addressing)
  File "/usr/local/lib/python3.10/site-packages/zigpy/zcl/__init__.py", line 373, in handle_message
    self.handle_cluster_request(hdr, args, dst_addressing=dst_addressing)
  File "/usr/local/lib/python3.10/site-packages/zhaquirks/tuya/__init__.py", line 437, in handle_cluster_request
    tuya_cmd = args[0].command_id
AttributeError: 'TuyaCommand' object has no attribute 'command_id'

Feliz navidad @javicalle !!!

That error comes from putting the TuyaManufClusterAttributes and TuyaNewManufCluster together.

Ok I found three datapoints in the logs for this device.
Following datapoints should be mapped:
dp=18  ==>  ampere/1000   ==>(payload=8487 with a stovetop on with the stovetop off it is  1395)
dp=19  ==>  wattage/10    ==>(payload=19306 with a stovetop on, with the stovetop off it is 1668)
dp=20  ==>  volts/10      ==>(payload=2315 with a stovetop on, with the stopvetop off it is 2337)

They all reported an unsupported attribute of 134 with `command id 2
I think that is all the data needed to add it to the quirk, but I need some help to do so.
I made an attempt, but that didn't work out so well. 😅
Below four snippets of the received messages.

I'm working in another approach for the quirk.
Totally experimental and barelly tested.

ts0601_din_power_mcu.py
"""Tuya Din Power Meter."""
from typing import Dict

from zigpy.profiles import zha
from zigpy.quirks import CustomDevice
import zigpy.types as t
from zigpy.zcl import foundation
from zigpy.zcl.clusters.general import Basic, Groups, Ota, Scenes, Time
from zigpy.zcl.clusters.homeautomation import ElectricalMeasurement
from zigpy.zcl.clusters.smartenergy import Metering

from zhaquirks import LocalDataCluster
from zhaquirks.const import (
    DEVICE_TYPE,
    ENDPOINTS,
    INPUT_CLUSTERS,
    MODELS_INFO,
    OUTPUT_CLUSTERS,
    PROFILE_ID,
)
from zhaquirks.tuya.mcu import (
    DPToAttributeMapping,
    TuyaDPType,
    TuyaMCUCluster,
    TuyaOnOff,
)

class TuyaPowerMeasurement(LocalDataCluster, ElectricalMeasurement):
    """Custom class for power, voltage and current measurement."""

    AC_CURRENT_MULTIPLIER = 0x0602
    AC_CURRENT_DIVISOR = 0x0603

    _CONSTANT_ATTRIBUTES = {AC_CURRENT_MULTIPLIER: 1, AC_CURRENT_DIVISOR: 1000}

class TuyaElectricalMeasurement(LocalDataCluster, Metering):
    """Custom class for total energy measurement."""

    POWER_WATT = 0x0000

    _CONSTANT_ATTRIBUTES = {
        0x0300: POWER_WATT,  # unit_of_measure
        0x0302: 100,  # divisor
    }

class DinPowerManufCluster(TuyaMCUCluster):
    """Tuya Manufacturer Cluster with din power datapoints."""

    class TuyaConnectionStatus(t.Struct):
        """Tuya request data."""

        tsn: t.uint8_t
        status: t.LVBytes

    client_commands = TuyaMCUCluster.client_commands.copy()
    client_commands.update(
        {
            0x25: foundation.ZCLCommandDef(
                "mcu_connection_status",
                {"payload": TuyaConnectionStatus},
                True,
                is_manufacturer_specific=True,
            ),
        }
    )

    server_commands = TuyaMCUCluster.server_commands.copy()
    server_commands.update(
        {
            0x25: foundation.ZCLCommandDef(
                "mcu_connection_status_rsp",
                {"payload": TuyaConnectionStatus},
                False,
                is_manufacturer_specific=True,
            ),
        }
    )

    def handle_mcu_connection_status(
        self, payload: TuyaConnectionStatus
    ) -> foundation.Status:
        """Handle gateway connection status requests (0x25)."""

        payload_rsp = DinPowerManufCluster.TuyaConnectionStatus()
        payload_rsp.tsn = payload.tsn
        payload_rsp.status = b"\x01"  # 0x00 not connected to internet | 0x01 connected to internet | 0x02 time out

        self.create_catching_task(
            super().command(0x25, payload_rsp, expect_reply=False)
        )

        return foundation.Status.SUCCESS

    dp_to_attribute: Dict[int, DPToAttributeMapping] = {
        0x01: DPToAttributeMapping(
            TuyaElectricalMeasurement.ep_attribute,
            "current_summ_delivered",
            dp_type=TuyaDPType.VALUE,
        ),
        0x06: DPToAttributeMapping(
            TuyaPowerMeasurement.ep_attribute,
            ("rms_current", "rms_voltage"),
            dp_type=TuyaDPType.RAW,
            converter=lambda x: (x >> 16, (x & 0x0000FFFF) / 10),
        ),
        0x10: DPToAttributeMapping(
            TuyaOnOff.ep_attribute,
            "on_off",
            dp_type=TuyaDPType.BOOL,
        ),
        0x66: DPToAttributeMapping(
            TuyaElectricalMeasurement.ep_attribute,
            "current_summ_received",
            dp_type=TuyaDPType.VALUE,
        ),
        0x67: DPToAttributeMapping(
            TuyaPowerMeasurement.ep_attribute,
            "active_power",
            dp_type=TuyaDPType.VALUE,
        ),
        0x69: DPToAttributeMapping(
            TuyaPowerMeasurement.ep_attribute,
            "ac_frequency",
            dp_type=TuyaDPType.VALUE,
        ),
        0x6D: DPToAttributeMapping(
            TuyaPowerMeasurement.ep_attribute,
            "total_reactive_power",
            dp_type=TuyaDPType.VALUE,
        ),
        0x6E: DPToAttributeMapping(
            TuyaPowerMeasurement.ep_attribute,
            "reactive_power",
            dp_type=TuyaDPType.VALUE,
        ),
        0x6F: DPToAttributeMapping(
            TuyaPowerMeasurement.ep_attribute,
            "power_factor",
            dp_type=TuyaDPType.VALUE,
        ),
    }

    data_point_handlers = {
        0x01: "_dp_2_attr_update",
        0x10: "_dp_2_attr_update",
        0x66: "_dp_2_attr_update",
        0x67: "_dp_2_attr_update",
        0x69: "_dp_2_attr_update",
        0x6D: "_dp_2_attr_update",
        0x6E: "_dp_2_attr_update",
        0x6F: "_dp_2_attr_update",
    }

class HikingPowerMeter(CustomDevice):
    """Hiking Power Meter Device - DDS238-2."""

    signature = {
        # "node_descriptor": "<NodeDescriptor byte1=1 byte2=64 mac_capability_flags=142 manufacturer_code=4098
        #                       maximum_buffer_size=82 maximum_incoming_transfer_size=82 server_mask=11264
        #                       maximum_outgoing_transfer_size=82 descriptor_capability_field=0>",
        # device_version=1
        # input_clusters=[0x0000, 0x0004, 0x0005, 0xef00]
        # output_clusters=[0x000a, 0x0019]
        MODELS_INFO: [
            ("_TZE200_bkkmqmyo", "TS0601"),
            ("_TZE204_cjbofhxw", "TS0601"),
        ],
        ENDPOINTS: {
            # <SimpleDescriptor endpoint=1 profile=260 device_type=51
            # device_version=1
            # input_clusters=[0, 4, 5, 61184]
            # output_clusters=[10, 25]>
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    DinPowerManufCluster.cluster_id,
                ],
                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
            }
        },
    }

    replacement = {
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    DinPowerManufCluster,
                    TuyaElectricalMeasurement,
                    TuyaPowerMeasurement,
                ],
                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
            },
            16: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
                INPUT_CLUSTERS: [
                    TuyaOnOff,
                ],
                OUTPUT_CLUSTERS: [],
            },
        }
    }

This quirk would replace the previous one. If you want to try you can rename the file extension from the previous one and create a new one, this way you can return to the previous quirk at any moment.

yeah I just removed TuyaManufClusterAttributes from the class, that seemed to do the job.

How have you fixed the previous error?
I'm working in another approach for the quirk. Totally experimental and barelly tested.
ts0601_din_power_mcu.py
This quirk would replace the previous one. If you want to try you can rename the file extension from the previous one and create a new one, this way you can return to the previous quirk at any moment.

The new quirk works looks good, the output is exactly the same as in the previous logs.

Have the quirk created any entity in HA?
Reading at Z2M don't seems match the DPs from quirk

Nope no new entities.
I think that is what I see in the logs, shouldn't they be mapped like this? https://github.com/zigpy/zha-device-handlers/issues/1973#issuecomment-1363379122
I'm just not sure where/how to define this in the quirk though.

And the old ones which are?

Below the entities, but the device does not have a switch.
The power factor reports permanent unkown state if I enable it.
I can try and re-pair the device, and see what happens with the new quirk, one sec.

I am facing the same issue, with the same adapter, how can I help?
This one is mine, I get the same results as @Warre118:
("_TZE204_cjbofhxw", "TS0601")

Every time you made changes in a quirk, you need to delete any __pycache__ folder from your local quirk installation, restart HA and re pair the device.

How have you fixed the previous error?
I'm working in another approach for the quirk. Totally experimental and barelly tested.
ts0601_din_power_mcu.py
This quirk would replace the previous one. If you want to try you can rename the file extension from the previous one and create a new one, this way you can return to the previous quirk at any moment.

Here are the log files trying the latest version (cache folder deleted and HA restarted).
home-assistant_2022-12-22T22-37-42.241Z.log

That would be the quirk for _TZE204_cjbofhxw according to Z2M:

ts0601_din_power_mcu.py
"""Tuya Din Power Meter."""
from typing import Dict

from zigpy.profiles import zha
from zigpy.quirks import CustomDevice
import zigpy.types as t
from zigpy.zcl import foundation
from zigpy.zcl.clusters.general import Basic, Groups, Ota, Scenes, Time
from zigpy.zcl.clusters.homeautomation import ElectricalMeasurement
from zigpy.zcl.clusters.smartenergy import Metering

from zhaquirks import LocalDataCluster
from zhaquirks.const import (
    DEVICE_TYPE,
    ENDPOINTS,
    INPUT_CLUSTERS,
    MODELS_INFO,
    OUTPUT_CLUSTERS,
    PROFILE_ID,
)
from zhaquirks.tuya.mcu import (
    DPToAttributeMapping,
    TuyaDPType,
    TuyaMCUCluster,
    TuyaOnOff,
)

class TuyaPowerMeasurement(LocalDataCluster, ElectricalMeasurement):
    """Custom class for power, voltage and current measurement."""

    AC_CURRENT_MULTIPLIER = 0x0602
    AC_CURRENT_DIVISOR = 0x0603

    _CONSTANT_ATTRIBUTES = {AC_CURRENT_MULTIPLIER: 1, AC_CURRENT_DIVISOR: 1000}

class TuyaElectricalMeasurement(LocalDataCluster, Metering):
    """Custom class for total energy measurement."""

    POWER_WATT = 0x0000

    _CONSTANT_ATTRIBUTES = {
        0x0300: POWER_WATT,  # unit_of_measure
        0x0302: 1000,  # divisor
    }

class DinPowerManufCluster(TuyaMCUCluster):
    """Tuya Manufacturer Cluster with din power datapoints."""

    class TuyaConnectionStatus(t.Struct):
        """Tuya request data."""

        tsn: t.uint8_t
        status: t.LVBytes

    client_commands = TuyaMCUCluster.client_commands.copy()
    client_commands.update(
        {
            0x25: foundation.ZCLCommandDef(
                "mcu_connection_status",
                {"payload": TuyaConnectionStatus},
                True,
                is_manufacturer_specific=True,
            ),
        }
    )

    server_commands = TuyaMCUCluster.server_commands.copy()
    server_commands.update(
        {
            0x25: foundation.ZCLCommandDef(
                "mcu_connection_status_rsp",
                {"payload": TuyaConnectionStatus},
                False,
                is_manufacturer_specific=True,
            ),
        }
    )

    def handle_mcu_connection_status(
        self, payload: TuyaConnectionStatus
    ) -> foundation.Status:
        """Handle gateway connection status requests (0x25)."""

        payload_rsp = DinPowerManufCluster.TuyaConnectionStatus()
        payload_rsp.tsn = payload.tsn
        payload_rsp.status = b"\x01"  # 0x00 not connected to internet | 0x01 connected to internet | 0x02 time out

        self.create_catching_task(
            super().command(0x25, payload_rsp, expect_reply=False)
        )

        return foundation.Status.SUCCESS

    dp_to_attribute: Dict[int, DPToAttributeMapping] = {
        0x01: DPToAttributeMapping(
            TuyaElectricalMeasurement.ep_attribute,
            "current_summ_delivered",
            dp_type=TuyaDPType.VALUE,
        ),
        0x06: DPToAttributeMapping(
            TuyaPowerMeasurement.ep_attribute,
            ("rms_current", "rms_voltage"),
            dp_type=TuyaDPType.RAW,
            converter=lambda x: (x >> 16, (x & 0x0000FFFF) / 10),
        ),
        0x10: DPToAttributeMapping(
            TuyaOnOff.ep_attribute,
            "on_off",
            dp_type=TuyaDPType.BOOL,
        ),
        0x66: DPToAttributeMapping(
            TuyaElectricalMeasurement.ep_attribute,
            "current_summ_received",
            dp_type=TuyaDPType.VALUE,
        ),
        0x67: DPToAttributeMapping(
            TuyaPowerMeasurement.ep_attribute,
            "active_power",
            dp_type=TuyaDPType.VALUE,
        ),
        0x69: DPToAttributeMapping(
            TuyaPowerMeasurement.ep_attribute,
            "ac_frequency",
            dp_type=TuyaDPType.VALUE,
        ),
        0x6D: DPToAttributeMapping(
            TuyaPowerMeasurement.ep_attribute,
            "total_reactive_power",
            dp_type=TuyaDPType.VALUE,
        ),
        0x6E: DPToAttributeMapping(
            TuyaPowerMeasurement.ep_attribute,
            "reactive_power",
            dp_type=TuyaDPType.VALUE,
        ),
        0x6F: DPToAttributeMapping(
            TuyaPowerMeasurement.ep_attribute,
            "power_factor",
            dp_type=TuyaDPType.VALUE,
        ),
    }

    data_point_handlers = {
        0x01: "_dp_2_attr_update",
        0x06: "_dp_2_attr_update",
        0x10: "_dp_2_attr_update",
        0x66: "_dp_2_attr_update",
        0x67: "_dp_2_attr_update",
        0x69: "_dp_2_attr_update",
        0x6D: "_dp_2_attr_update",
        0x6E: "_dp_2_attr_update",
        0x6F: "_dp_2_attr_update",
    }

class TuyaManufClusterDinPower(DinPowerManufCluster):
    """Manufacturer Specific Cluster of the Tuya Power Meter device."""

    dp_to_attribute: Dict[int, DPToAttributeMapping] = {
        17: DPToAttributeMapping(
            TuyaElectricalMeasurement.ep_attribute,
            "current_summ_delivered",
            dp_type=TuyaDPType.VALUE,
        ),
        18: DPToAttributeMapping(
            TuyaPowerMeasurement.ep_attribute,
            "rms_current",
            dp_type=TuyaDPType.VALUE,
        ),
        19: DPToAttributeMapping(
            TuyaPowerMeasurement.ep_attribute,
            "active_power",
            dp_type=TuyaDPType.VALUE,
            converter=lambda x: x // 10,
        ),
        20: DPToAttributeMapping(
            TuyaPowerMeasurement.ep_attribute,
            "rms_voltage",
            dp_type=TuyaDPType.VALUE,
            converter=lambda x: x // 10,
        ),
    }

    data_point_handlers = {
        17: "_dp_2_attr_update",
        18: "_dp_2_attr_update",
        19: "_dp_2_attr_update",
        20: "_dp_2_attr_update",
    }

class TuyaPowerMeter(CustomDevice):
    """Tuya power meter device."""

    signature = {
        # "node_descriptor": "<NodeDescriptor byte1=1 byte2=64 mac_capability_flags=142 manufacturer_code=4098
        #                       maximum_buffer_size=82 maximum_incoming_transfer_size=82 server_mask=11264
        #                       maximum_outgoing_transfer_size=82 descriptor_capability_field=0>",
        # device_version=1
        # input_clusters=[0x0000, 0x0004, 0x0005, 0xef00]
        # output_clusters=[0x000a, 0x0019]
        MODELS_INFO: [
            ("_TZE204_cjbofhxw", "TS0601"),
        ],
        ENDPOINTS: {
            # <SimpleDescriptor endpoint=1 profile=260 device_type=51
            # device_version=1
            # input_clusters=[0, 4, 5, 61184]
            # output_clusters=[10, 25]>
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    TuyaManufClusterDinPower.cluster_id,
                ],
                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
            }
        },
    }

    replacement = {
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    TuyaManufClusterDinPower,
                    TuyaPowerMeasurement,
                    TuyaElectricalMeasurement,
                ],
                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
            }
        }
    }

class HikingPowerMeter(CustomDevice):
    """Hiking Power Meter Device - DDS238-2."""

    signature = {
        # "node_descriptor": "<NodeDescriptor byte1=1 byte2=64 mac_capability_flags=142 manufacturer_code=4098
        #                       maximum_buffer_size=82 maximum_incoming_transfer_size=82 server_mask=11264
        #                       maximum_outgoing_transfer_size=82 descriptor_capability_field=0>",
        # device_version=1
        # input_clusters=[0x0000, 0x0004, 0x0005, 0xef00]
        # output_clusters=[0x000a, 0x0019]
        MODELS_INFO: [
            ("_TZE200_bkkmqmyo", "TS0601"),
            ("ffffffffffffffff", "TS0601"),
        ],
        ENDPOINTS: {
            # <SimpleDescriptor endpoint=1 profile=260 device_type=51
            # device_version=1
            # input_clusters=[0, 4, 5, 61184]
            # output_clusters=[10, 25]>
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    DinPowerManufCluster.cluster_id,
                ],
                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
            }
        },
    }

    replacement = {
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    DinPowerManufCluster,
                    TuyaElectricalMeasurement,
                    TuyaPowerMeasurement,
                ],
                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
            },
            16: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
                INPUT_CLUSTERS: [
                    TuyaOnOff,
                ],
                OUTPUT_CLUSTERS: [],
            },
        }
    }

Reference:

https://gist.github.com/Koenkk/8fc146f998e2bd9986df783164f4f3df

okay I removed the device from HA,  removed the __pycache__, restarted HA, and re-paired the device.

That would be the quirk for _TZE204_cjbofhxw according to Z2M:
ts0601_din_power_mcu.py
Reference:

https://gist.github.com/Koenkk/8fc146f998e2bd9986df783164f4f3df

:/
Still not working.
I also tried removing and re-pairing it.
home-assistant_2022-12-22T22-44-16.860Z.log
zha-a9bb694b462bbe34a98b8c714d6263f1-_TZE204_cjbofhxw TS0601-e22ad2f4ef65be0dff13126b521f13a8.json.txt

okay, I removed the device, then removed the __pycache__, restarted HA, and re-paired the device.
The switch is gone now, but the rest remains the same.
I don't get the No datapoint handler for TuyaDatapointData messages anymore though.
Below the logs of an incoming message for datapoint 19
2022-12-22 23:49:18.203 DEBUG (MainThread) [zigpy_znp.api] Received command: AF.IncomingMsg.Callback(GroupId=0x0000, ClusterId=61184, SrcAddr=0xA3CF, SrcEndpoint=1, DstEndpoint=1, WasBroadcast=<Bool.false: 0>, LQI=7, SecurityUse=<Bool.false: 0>, TimeStamp=14670277, TSN=0, Data=b'\x09\x74\x02\x00\x8A\x13\x02\x00\x04\x00\x00\x07\x85', MacSrcAddr=0xA3CF, MsgResultRadius=29)
2022-12-22 23:49:18.207 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xA3CF), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=0, profile_id=260, cluster_id=61184, data=Serialized[b'\tt\x02\x00\x8a\x13\x02\x00\x04\x00\x00\x07\x85'], tx_options=<TransmitOptions.NONE: 0>, radius=29, non_member_radius=0, lqi=7, rssi=None)
2022-12-22 23:49:18.210 DEBUG (MainThread) [zigpy.zcl] [0xA3CF:1:0xef00] Received ZCL frame: b'\tt\x02\x00\x8a\x13\x02\x00\x04\x00\x00\x07\x85'
2022-12-22 23:49:18.214 DEBUG (MainThread) [zigpy.zcl] [0xA3CF:1:0xef00] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.CLUSTER_COMMAND: 1>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=0, reserved=0, *is_cluster=True, *is_general=False, *is_reply=True), tsn=116, command_id=2, *direction=<Direction.Client_to_Server: 1>, *is_reply=True)
2022-12-22 23:49:18.220 DEBUG (MainThread) [zigpy.zcl] [0xA3CF:1:0xef00] Decoded ZCL frame: TuyaManufClusterDinPower:set_data_response(data=TuyaCommand(status=0, tsn=138, datapoints=[TuyaDatapointData(dp=19, data=TuyaData(dp_type=<TuyaDPType.VALUE: 2>, function=0, raw=b'\x85\x07\x00\x00', *payload=1925))]))
2022-12-22 23:49:18.224 DEBUG (MainThread) [zigpy.zcl] [0xA3CF:1:0xef00] Received command 0x02 (TSN 116): set_data_response(data=TuyaCommand(status=0, tsn=138, datapoints=[TuyaDatapointData(dp=19, data=TuyaData(dp_type=<TuyaDPType.VALUE: 2>, function=0, raw=b'\x85\x07\x00\x00', *payload=1925))]))
2022-12-22 23:49:18.235 DEBUG (Thread-3) [aiosqlite] executing functools.partial(<built-in method execute of sqlite3.Connection object at 0x7f0d1cccf040>, 'UPDATE devices_v11\n                    SET last_seen=:ts\n                    WHERE ieee=:ieee AND :ts - last_seen > :min_last_seen_delta', {'ts':<PHONE_NUMBER>.209509, 'ieee': e0:79:8d:ff:fe:de:3b:71, 'min_last_seen_delta': 30.0})
2022-12-22 23:49:18.233 DEBUG (MainThread) [zigpy.zcl] [0xA3CF:1:0xef00] 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, *is_reply=True), tsn=116, command_id=<GeneralCommand.Default_Response: 11>, *direction=<Direction.Client_to_Server: 1>, *is_reply=True)
2022-12-22 23:49:18.238 DEBUG (MainThread) [zigpy.zcl] [0xA3CF:1:0xef00] Sending reply: Default_Response(command_id=2, status=<Status.SUCCESS: 0>)
2022-12-22 23:49:18.241 DEBUG (MainThread) [zigpy_znp.zigbee.application] Sending packet ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xA3CF), dst_ep=1, source_route=None, extended_timeout=False, tsn=116, profile_id=260, cluster_id=61184, data=Serialized[b'\x18t\x0b\x02\x00'], tx_options=<TransmitOptions.ACK: 1>, radius=0, non_member_radius=0, lqi=None, rssi=None)
2022-12-22 23:49:18.248 DEBUG (MainThread) [zigpy_znp.api] Sending request: AF.DataRequestExt.Req(DstAddrModeAddress=AddrModeAddress(mode=<AddrMode.NWK: 2>, address=0xA3CF), DstEndpoint=1, DstPanId=0x0000, SrcEndpoint=1, ClusterId=61184, TSN=116, Options=<TransmitOptions.SUPPRESS_ROUTE_DISC_NETWORK|ACK_REQUEST: 48>, Radius=0, Data=b'\x18\x74\x0B\x02\x00')

Could you check if the DEBUG logs for zhaquirks are enabled?
Refernce:

https://www.home-assistant.io/integrations/zha#debug-logging

I had forgotten about the EnchantedDevice 🤦🏻♂
I have updated the quirk from my previous comment. Just the new import and the hierarchy in class TuyaPowerMeter(EnchantedDevice):.
Update, save, delete, restart & repair.

zha-a9bb694b462bbe34a98b8c714d6263f1-_TZE204_cjbofhxw TS0601-e22ad2f4ef65be0dff13126b521f13a8.json (2).txt
home-assistant_2022-12-23T00-50-38.283Z.log
Debug logs enabled.
Still not working, but I seriously appreciate your help.

I'm at work right now, so I couldn't re-pair the device.
In the device Diagnostics however I see the datapoints supported and getting updates now.
I even managed to add the entities by writing a way out of spec number(just to make sure it gets updated correctly) to the atribute, and then reload ZHA.
After doing so, the device reports the values just fine.

it's just a guess, but Could it be that the device is not "ready"  when it has to generate the entities?
Can we find that back in the logs?
The device only starts sending data, after it gets a positive 0x25 response. I can imagine it messes with things during initialization.
Nonetheless, during noon, I'll clean the cache, and re-pair the device.
Then we'll see from there.
         "0x0b04": {
            "endpoint_attribute": "electrical_measurement",
            "attributes": {
              "0x0505": {
                "attribute_name": "rms_voltage",
                "value": 235
              },
              "0x0508": {
                "attribute_name": "rms_current",
                "value": 946
              },
              "0x050b": {
                "attribute_name": "active_power",
                "value": 75
              },
              "0x0602": {
                "attribute_name": "ac_current_multiplier",
                "value": 1
              },
              "0x0603": {
                "attribute_name": "ac_current_divisor",
                "value": 1000
              }
            },

So, the seller suggests using z2m instead of zha, as it apparently works there.
He pointed me at:
https://github.com/Koenkk/zigbee2mqtt/issues/15359
But I would prefer sticking with zha :/

And it now works.
Not sure what did the trick, a couple of HA restarts and device re-configurations were involved, but I now get data from the device.
I am know trying to figure out a way to reset the energy counter, but the quirk seems to work just fine.
Any idea if I will will I have to disable the quirk once the driver hits the main release?

For resetting the energy counter i think one reset of the device is needed.
I suggesting delete the device and resenting it and restart HA if doing it very well re power the host  system. Then HA is stable deleting the __pycache__ folder in your local quirk directors and then joining the device and see if its working OK.
Then the quirk is merged in the main ZHA you dont need the local quirk so deleting it in the local quirk folder and / or in the HA config for not getting problem in the future then ZHA is getting updates that can braking your local quirk.

I am not sure this is the proper place to post this, but i am getting a statistics_not_defined warning when i try to setup power in the energy dashboard. Is that something declared in the quirk?
I did use the power value in a Riemann sum integral, then that into a utility meter helper, and then that in the energy dashboard.

Greetings.
Any update on this issue? I have tried all the quirks but never managed to get it working. The last quirk causes my Tuya smart plugs (TS011F by_TZ3000_gvn91tmx) to give out wrong power measurements.

@01fr I really can't recall all the info from this issue.
I would suggest to try with the quirk from here:

https://github.com/zigpy/zha-device-handlers/issues/1973#issuecomment-1363412395

You would need to add your device in the MODELS_INFO like this:
        MODELS_INFO: [
            ("_TZE200_bkkmqmyo", "TS0601"),
            ("_TZ3000_gvn91tmx", "TS0601"),
        ],

but just in one device at time (TuyaPowerMeter or HikingPowerMeter).
If not working, I would suggest to create a new issue with all the device info: signature (without any quirk loaded), logs, vendor page...

Here is the one that made mine (TZE204_cjbofhxw) work.
It didnt seem to work at first (even though it paired successfully, check messages above), but a couple of reboots seemed to do the trick. 0 issues since then.
`"""Tuya Din Power Meter."""
from typing import Dict
from zigpy.profiles import zha
from zigpy.quirks import CustomDevice
import zigpy.types as t
from zigpy.zcl import foundation
from zigpy.zcl.clusters.general import Basic, Groups, Ota, Scenes, Time
from zigpy.zcl.clusters.homeautomation import ElectricalMeasurement
from zigpy.zcl.clusters.smartenergy import Metering
from zhaquirks import LocalDataCluster
from zhaquirks.const import (
DEVICE_TYPE,
ENDPOINTS,
INPUT_CLUSTERS,
MODELS_INFO,
OUTPUT_CLUSTERS,
PROFILE_ID,
)
from zhaquirks.tuya import TuyaLocalCluster
from zhaquirks.tuya.mcu import (
DPToAttributeMapping,
EnchantedDevice,
TuyaDPType,
TuyaMCUCluster,
TuyaOnOff,
)
class TuyaPowerMeasurement(TuyaLocalCluster, ElectricalMeasurement):
"""Custom class for power, voltage and current measurement."""
AC_CURRENT_MULTIPLIER = 0x0602
AC_CURRENT_DIVISOR = 0x0603

_CONSTANT_ATTRIBUTES = {AC_CURRENT_MULTIPLIER: 1, AC_CURRENT_DIVISOR: 1000}

class TuyaElectricalMeasurement(TuyaLocalCluster, Metering):
"""Custom class for total energy measurement."""
POWER_WATT = 0x0000

_CONSTANT_ATTRIBUTES = {
    0x0300: POWER_WATT,  # unit_of_measure
    0x0302: 1000,  # divisor
}

class DinPowerManufCluster(TuyaMCUCluster):
"""Tuya Manufacturer Cluster with din power datapoints."""
class TuyaConnectionStatus(t.Struct):
    """Tuya request data."""

    tsn: t.uint8_t
    status: t.LVBytes

client_commands = TuyaMCUCluster.client_commands.copy()
client_commands.update(
    {
        0x25: foundation.ZCLCommandDef(
            "mcu_connection_status",
            {"payload": TuyaConnectionStatus},
            True,
            is_manufacturer_specific=True,
        ),
    }
)

server_commands = TuyaMCUCluster.server_commands.copy()
server_commands.update(
    {
        0x25: foundation.ZCLCommandDef(
            "mcu_connection_status_rsp",
            {"payload": TuyaConnectionStatus},
            False,
            is_manufacturer_specific=True,
        ),
    }
)

def handle_mcu_connection_status(
    self, payload: TuyaConnectionStatus
) -> foundation.Status:
    """Handle gateway connection status requests (0x25)."""

    payload_rsp = DinPowerManufCluster.TuyaConnectionStatus()
    payload_rsp.tsn = payload.tsn
    payload_rsp.status = b"\x01"  # 0x00 not connected to internet | 0x01 connected to internet | 0x02 time out

    self.create_catching_task(
        super().command(0x25, payload_rsp, expect_reply=False)
    )

    return foundation.Status.SUCCESS

dp_to_attribute: Dict[int, DPToAttributeMapping] = {
    0x01: DPToAttributeMapping(
        TuyaElectricalMeasurement.ep_attribute,
        "current_summ_delivered",
        dp_type=TuyaDPType.VALUE,
    ),
    0x06: DPToAttributeMapping(
        TuyaPowerMeasurement.ep_attribute,
        ("rms_current", "rms_voltage"),
        dp_type=TuyaDPType.RAW,
        converter=lambda x: (x >> 16, (x & 0x0000FFFF) / 10),
    ),
    0x10: DPToAttributeMapping(
        TuyaOnOff.ep_attribute,
        "on_off",
        dp_type=TuyaDPType.BOOL,
    ),
    0x66: DPToAttributeMapping(
        TuyaElectricalMeasurement.ep_attribute,
        "current_summ_received",
        dp_type=TuyaDPType.VALUE,
    ),
    0x67: DPToAttributeMapping(
        TuyaPowerMeasurement.ep_attribute,
        "active_power",
        dp_type=TuyaDPType.VALUE,
    ),
    0x69: DPToAttributeMapping(
        TuyaPowerMeasurement.ep_attribute,
        "ac_frequency",
        dp_type=TuyaDPType.VALUE,
    ),
    0x6D: DPToAttributeMapping(
        TuyaPowerMeasurement.ep_attribute,
        "total_reactive_power",
        dp_type=TuyaDPType.VALUE,
    ),
    0x6E: DPToAttributeMapping(
        TuyaPowerMeasurement.ep_attribute,
        "reactive_power",
        dp_type=TuyaDPType.VALUE,
    ),
    0x6F: DPToAttributeMapping(
        TuyaPowerMeasurement.ep_attribute,
        "power_factor",
        dp_type=TuyaDPType.VALUE,
    ),
}

data_point_handlers = {
    0x01: "_dp_2_attr_update",
    0x06: "_dp_2_attr_update",
    0x10: "_dp_2_attr_update",
    0x66: "_dp_2_attr_update",
    0x67: "_dp_2_attr_update",
    0x69: "_dp_2_attr_update",
    0x6D: "_dp_2_attr_update",
    0x6E: "_dp_2_attr_update",
    0x6F: "_dp_2_attr_update",
}

class TuyaManufClusterDinPower(DinPowerManufCluster):
"""Manufacturer Specific Cluster of the Tuya Power Meter device."""
dp_to_attribute: Dict[int, DPToAttributeMapping] = {
    17: DPToAttributeMapping(
        TuyaElectricalMeasurement.ep_attribute,
        "current_summ_delivered",
        dp_type=TuyaDPType.VALUE,
    ),
    18: DPToAttributeMapping(
        TuyaPowerMeasurement.ep_attribute,
        "rms_current",
        dp_type=TuyaDPType.VALUE,
    ),
    19: DPToAttributeMapping(
        TuyaPowerMeasurement.ep_attribute,
        "active_power",
        dp_type=TuyaDPType.VALUE,
        converter=lambda x: x // 10,
    ),
    20: DPToAttributeMapping(
        TuyaPowerMeasurement.ep_attribute,
        "rms_voltage",
        dp_type=TuyaDPType.VALUE,
        converter=lambda x: x // 10,
    ),
}

data_point_handlers = {
    17: "_dp_2_attr_update",
    18: "_dp_2_attr_update",
    19: "_dp_2_attr_update",
    20: "_dp_2_attr_update",
}

class TuyaPowerMeter(EnchantedDevice):
"""Tuya power meter device."""
signature = {
    # "node_descriptor": "<NodeDescriptor byte1=1 byte2=64 mac_capability_flags=142 manufacturer_code=4098
    #                       maximum_buffer_size=82 maximum_incoming_transfer_size=82 server_mask=11264
    #                       maximum_outgoing_transfer_size=82 descriptor_capability_field=0>",
    # device_version=1
    # input_clusters=[0x0000, 0x0004, 0x0005, 0xef00]
    # output_clusters=[0x000a, 0x0019]
    MODELS_INFO: [
        ("_TZE204_cjbofhxw", "TS0601"),
    ],
    ENDPOINTS: {
        # <SimpleDescriptor endpoint=1 profile=260 device_type=51
        # device_version=1
        # input_clusters=[0, 4, 5, 61184]
        # output_clusters=[10, 25]>
        1: {
            PROFILE_ID: zha.PROFILE_ID,
            DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
            INPUT_CLUSTERS: [
                Basic.cluster_id,
                Groups.cluster_id,
                Scenes.cluster_id,
                TuyaManufClusterDinPower.cluster_id,
            ],
            OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
        }
    },
}

replacement = {
    ENDPOINTS: {
        1: {
            PROFILE_ID: zha.PROFILE_ID,
            DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
            INPUT_CLUSTERS: [
                Basic.cluster_id,
                Groups.cluster_id,
                Scenes.cluster_id,
                TuyaManufClusterDinPower,
                TuyaPowerMeasurement,
                TuyaElectricalMeasurement,
            ],
            OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
        }
    }
}

class HikingPowerMeter(CustomDevice):
"""Hiking Power Meter Device - DDS238-2."""
signature = {
    # "node_descriptor": "<NodeDescriptor byte1=1 byte2=64 mac_capability_flags=142 manufacturer_code=4098
    #                       maximum_buffer_size=82 maximum_incoming_transfer_size=82 server_mask=11264
    #                       maximum_outgoing_transfer_size=82 descriptor_capability_field=0>",
    # device_version=1
    # input_clusters=[0x0000, 0x0004, 0x0005, 0xef00]
    # output_clusters=[0x000a, 0x0019]
    MODELS_INFO: [
        ("_TZE200_bkkmqmyo", "TS0601"),
        ("ffffffffffffffff", "TS0601"),
    ],
    ENDPOINTS: {
        # <SimpleDescriptor endpoint=1 profile=260 device_type=51
        # device_version=1
        # input_clusters=[0, 4, 5, 61184]
        # output_clusters=[10, 25]>
        1: {
            PROFILE_ID: zha.PROFILE_ID,
            DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
            INPUT_CLUSTERS: [
                Basic.cluster_id,
                Groups.cluster_id,
                Scenes.cluster_id,
                DinPowerManufCluster.cluster_id,
            ],
            OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
        }
    },
}

replacement = {
    ENDPOINTS: {
        1: {
            PROFILE_ID: zha.PROFILE_ID,
            DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
            INPUT_CLUSTERS: [
                Basic.cluster_id,
                Groups.cluster_id,
                Scenes.cluster_id,
                DinPowerManufCluster,
                TuyaElectricalMeasurement,
                TuyaPowerMeasurement,
            ],
            OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
        },
        16: {
            PROFILE_ID: zha.PROFILE_ID,
            DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
            INPUT_CLUSTERS: [
                TuyaOnOff,
            ],
            OUTPUT_CLUSTERS: [],
        },
    }
}`

Great help, the quirk works!
Thank you so much!

sry guys, I have the same device, I add the quirk above ts0601_din_power.zip but ZHA fails to start:
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 313, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/zha/__init__.py", line 99, in async_setup_entry
    setup_quirks(config)
  File "/usr/local/lib/python3.9/site-packages/zhaquirks/__init__.py", line 403, in setup
    importer.find_module(modname).load_module(modname)
  File "<frozen importlib._bootstrap_external>", line 529, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 1029, in load_module
  File "<frozen importlib._bootstrap_external>", line 854, in load_module
  File "<frozen importlib._bootstrap>", line 274, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 711, in _load
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/config/custom_quirks/ts0601_din_power.py", line 22, in <module>
    from zhaquirks.tuya.mcu import (
ModuleNotFoundError: No module named 'zhaquirks.tuya.mcu'

I also put in the same custom directory this: https://github.com/zigpy/zha-device-handlers/blob/dev/zhaquirks/tuya/mcu/init.py  but no change :(
What am I doing wrong? (I'm completely new to ZHA quirks)

Hi
I have the quirk installed and it works (except the total SUM, which is not visible to me), but didn't have to copy the file you mention in your post. Just create the ZHA quirks folder and copied the quirk file in to it. Reboot and voila!
Suggest you delete everything in the custom quirk folder (using the terminal or SSH, because some files are visible with the file editor add on) and reboot.

What am I doing wrong? (I'm completely new to ZHA quirks)

Which HA version do you have?

Can someone create the PR for that quirk?

ok, so I'll remove __init__.py.
I'm running it on docker, homeassistant/home-assistant:2021.12.8. It's already on python3. I would prefer not update HA version.
bash-5.1# pip3 show zha-quirks
Name: zha-quirks
Version: 0.0.65

I'll update this package first directly in the container and see if anything changes.

That is a very old version.
I can't guarantee that you won't have problems in HA if you update only the library because of dependencies.

I've updated zha-quirks and zigpy but still same problem. I've even tried other quirks but no luck.
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 313, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/zha/__init__.py", line 99, in async_setup_entry
    setup_quirks(config)
  File "/usr/local/lib/python3.9/site-packages/zhaquirks/__init__.py", line 403, in setup
    importer.find_module(modname).load_module(modname)
  File "<frozen importlib._bootstrap_external>", line 529, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 1029, in load_module
  File "<frozen importlib._bootstrap_external>", line 854, in load_module
  File "<frozen importlib._bootstrap>", line 274, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 711, in _load
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed

Probably something to do with /usr/src/homeassistant/homeassistant/components/zha. I'll try again some other time with a new installation.

You shouldn't use a Home Assistant version that's over a year old (if you're expecting support at all).
This will cause nothing but trouble for you and maintainers.
You also shouldn't install newer libraries on older Home Assistant versions, as there will be conflicts.

Thanks, got my "_TZE204_cjbofhxw" working with your quirk :)
I can see Active power, Power factor, RMS current and RMS voltage :

But unlike other current meter sensors I own (Shelly, Zigbee plug), I don't see any "summation_delivered" sensor, to use with utilty_meter to obtain hourly, daily, monthly and annually power consumption. Did you manage to get it working ?

I don't see any "summation_delivered" sensor, to use with utilty_meter to obtain hourly, daily, monthly and annually power consumption. Did you manage to get it working ?

Does your device support that functionality?
If it implements it, maybe it can be fixed but if not it will not.

I did use the power value in a Riemann sum integral, then that into a utility meter helper, and then that in the energy dashboard.

Device doesnt have to support it, you set it up yourself.
You need a helper to convert Watts to kWh (riemann), and use that into another helper (utility meter), which you then use to bring it into the energy dashboard.

Thanks @cryptocelt now it's okay with a helper that converts W yo kWh (riemann - left) :)

Hi everyone :)