zigpy / zha-device-handlers

ZHA device handlers bridge the functionality gap created when manufacturers deviate from the ZCL specification, handling deviations and exceptions by parsing custom messages to and from Zigbee devices.
Apache License 2.0
774 stars 703 forks source link

[BUG] Issues with _TZE200_a7sghmms #2366

Closed mkoppanen closed 1 year ago

mkoppanen commented 1 year ago

Bug description

The device is a GiEX irrigation valve QT06_2 variant (as seen here: https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/devices/giex.js#LL202C17-L202C23)

When adding the device in ZHA only the on/off switch entity is added and the rest of the values (battery level etc) are not properly displayed. After pairing the device the on/off switch works for about few minutes and then stops controlling the valve. My controller is Sonoff Zigbee 3.0 USB Dongle Plus (e-variant).

In order to exclude device faults I installed a standalone zigbee2mqtt using a separate usb dongle and the device stays connected for several hours (that's as long as I tested).

I've enabled debug logging and tried to isolate relevant parts in the message below. However, if there are any other logs I can produce let me know.

Steps to reproduce

  1. Pair device with ZHA
  2. Make sure that on off switch controls the valve
  3. Wait a few minutes
  4. The on/off switch no longer controls the valve

Expected behavior

The valve to work normally and the entities to be added

Screenshots/Video

Screenshots/Video ![Screenshot 2023-04-28 at 17 43 41](https://user-images.githubusercontent.com/90124/235205885-b9367f92-123e-485a-94c6-ff4a162dbaf7.png)

Device signature

Device signature ```json { "node_descriptor": "NodeDescriptor(logical_type=, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=, mac_capability_flags=, manufacturer_code=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)", "endpoints": { "1": { "profile_id": 260, "device_type": "0x0000", "in_clusters": [ "0x0000", "0x0001", "0x0004", "0x0005", "0x0006", "0x0702", "0xef00" ], "out_clusters": [ "0x000a", "0x0019" ] } }, "manufacturer": "_TZE200_a7sghmms", "model": "TS0601", "class": "zhaquirks.tuya.ts0601_valve.GiexValve" } ```

Diagnostic information

Diagnostic information ```json { "home_assistant": { "installation_type": "Home Assistant OS", "version": "2023.4.6", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.10.10", "docker": true, "arch": "x86_64", "timezone": "Europe/London", "os_name": "Linux", "os_version": "6.1.25", "supervisor": "2023.04.1", "host_os": "Home Assistant OS 10.1", "docker_version": "23.0.3", "chassis": "vm", "run_as_root": true }, "custom_components": { "sonoff": { "version": "3.5.1", "requirements": [ "pycryptodome>=3.6.6" ] }, "alexa_media": { "version": "4.6.2", "requirements": [ "alexapy==1.26.5", "packaging>=20.3", "wrapt>=1.12.1" ] }, "garbage_collection": { "version": "4.10.2", "requirements": [ "python-dateutil>=2.8.2" ] }, "localtuya": { "version": "5.0.0", "requirements": [] }, "zha_toolkit": { "version": "v0.8.38", "requirements": [ "packaging>=20.8", "pytz" ] }, "tplink_deco": { "version": "3.3.1", "requirements": [ "pycryptodome>=3.12.0" ] }, "hacs": { "version": "1.32.1", "requirements": [ "aiogithubapi>=22.10.1" ] } }, "integration_manifest": { "domain": "zha", "name": "Zigbee Home Automation", "after_dependencies": [ "onboarding", "usb" ], "codeowners": [ "@dmulcahey", "@adminiuga", "@puddly" ], "config_flow": true, "dependencies": [ "file_upload" ], "documentation": "https://www.home-assistant.io/integrations/zha", "iot_class": "local_polling", "loggers": [ "aiosqlite", "bellows", "crccheck", "pure_pcapy3", "zhaquirks", "zigpy", "zigpy_deconz", "zigpy_xbee", "zigpy_zigate", "zigpy_znp" ], "requirements": [ "bellows==0.35.1", "pyserial==3.5", "pyserial-asyncio==0.6", "zha-quirks==0.0.97", "zigpy-deconz==0.20.0", "zigpy==0.54.1", "zigpy-xbee==0.17.0", "zigpy-zigate==0.10.3", "zigpy-znp==0.10.0" ], "usb": [ { "vid": "10C4", "pid": "EA60", "description": "*2652*", "known_devices": [ "slae.sh cc2652rb stick" ] }, { "vid": "1A86", "pid": "55D4", "description": "*sonoff*plus*", "known_devices": [ "sonoff zigbee dongle plus v2" ] }, { "vid": "10C4", "pid": "EA60", "description": "*sonoff*plus*", "known_devices": [ "sonoff zigbee dongle plus" ] }, { "vid": "10C4", "pid": "EA60", "description": "*tubeszb*", "known_devices": [ "TubesZB Coordinator" ] }, { "vid": "1A86", "pid": "7523", "description": "*tubeszb*", "known_devices": [ "TubesZB Coordinator" ] }, { "vid": "1A86", "pid": "7523", "description": "*zigstar*", "known_devices": [ "ZigStar Coordinators" ] }, { "vid": "1CF1", "pid": "0030", "description": "*conbee*", "known_devices": [ "Conbee II" ] }, { "vid": "10C4", "pid": "8A2A", "description": "*zigbee*", "known_devices": [ "Nortek HUSBZB-1" ] }, { "vid": "0403", "pid": "6015", "description": "*zigate*", "known_devices": [ "ZiGate+" ] }, { "vid": "10C4", "pid": "EA60", "description": "*zigate*", "known_devices": [ "ZiGate" ] }, { "vid": "10C4", "pid": "8B34", "description": "*bv 2010/10*", "known_devices": [ "Bitron Video AV2010/10" ] } ], "zeroconf": [ { "type": "_esphomelib._tcp.local.", "name": "tube*" }, { "type": "_zigate-zigbee-gateway._tcp.local.", "name": "*zigate*" }, { "type": "_zigstar_gw._tcp.local.", "name": "*zigstar*" }, { "type": "_slzb-06._tcp.local.", "name": "slzb-06*" } ], "is_built_in": true }, "data": { "ieee": "**REDACTED**", "nwk": 26677, "manufacturer": "_TZE200_a7sghmms", "model": "TS0601", "name": "_TZE200_a7sghmms TS0601", "quirk_applied": true, "quirk_class": "zhaquirks.tuya.ts0601_valve.GiexValve", "manufacturer_code": 4417, "power_source": "Battery or Unknown", "lqi": 124, "rssi": -69, "last_seen": "2023-04-28T15:03:13", "available": true, "device_type": "EndDevice", "signature": { "node_descriptor": "NodeDescriptor(logical_type=, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=, mac_capability_flags=, manufacturer_code=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)", "endpoints": { "1": { "profile_id": 260, "device_type": "0x0000", "in_clusters": [ "0x0000", "0x0001", "0x0004", "0x0005", "0x0006", "0x0702", "0xef00" ], "out_clusters": [ "0x000a", "0x0019" ] } } }, "active_coordinator": false, "entities": [ { "entity_id": "sensor.tze200_a7sghmms_ts0601_battery", "name": "_TZE200_a7sghmms TS0601" }, { "entity_id": "switch.tze200_a7sghmms_ts0601_switch", "name": "_TZE200_a7sghmms TS0601" } ], "neighbors": [], "routes": [], "endpoint_names": [ { "name": "ON_OFF_SWITCH" } ], "user_given_name": null, "device_reg_id": "5e268404d6fa361d8769fd58b21561c3", "area_id": null, "cluster_details": { "1": { "device_type": { "name": "ON_OFF_SWITCH", "id": 0 }, "profile_id": 260, "in_clusters": { "0x0000": { "endpoint_attribute": "basic", "attributes": {}, "unsupported_attributes": {} }, "0x0004": { "endpoint_attribute": "groups", "attributes": {}, "unsupported_attributes": {} }, "0x0005": { "endpoint_attribute": "scenes", "attributes": {}, "unsupported_attributes": {} }, "0x0006": { "endpoint_attribute": "on_off", "attributes": { "0x0000": { "attribute_name": "on_off", "value": "Bool.true" } }, "unsupported_attributes": { "0x4003": { "attribute_name": "start_up_on_off" } } }, "0x0001": { "endpoint_attribute": "power", "attributes": {}, "unsupported_attributes": { "0x0031": { "attribute_name": "battery_size" }, "0x0033": { "attribute_name": "battery_quantity" } } }, "0x0702": { "endpoint_attribute": "smartenergy_metering", "attributes": { "0x0300": { "attribute_name": "unit_of_measure", "value": 7 }, "0x0306": { "attribute_name": "metering_device_type", "value": 2 } }, "unsupported_attributes": { "0x0301": { "attribute_name": "multiplier" }, "0x0302": { "attribute_name": "divisor" }, "0x0303": { "attribute_name": "summation_formatting" }, "0x0304": { "attribute_name": "demand_formatting" } } }, "0xef00": { "endpoint_attribute": "tuya_manufacturer", "attributes": {}, "unsupported_attributes": {} } }, "out_clusters": { "0x000a": { "endpoint_attribute": "time", "attributes": {}, "unsupported_attributes": {} }, "0x0019": { "endpoint_attribute": "ota", "attributes": {}, "unsupported_attributes": {} } } } } } } ```

Logs

Logs ```python Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0xDFD0), src_ep=1, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=7, profile_id=260, cluster_id=0, data=Serialized[b'\x18\xa8\x01\x04\x00\x00B\x10_TZE200_a7sghmms\x05\x00\x00B\x06TS0601'], tx_options=, radius=0, non_member_radius=0, lqi=128, rssi=-68) Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0xDFD0), src_ep=1, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=7, profile_id=260, cluster_id=0, data=Serialized[b'\x18\xa8\x01\x04\x00\x00B\x10_TZE200_a7sghmms\x05\x00\x00B\x06TS0601'], tx_options=, radius=0, non_member_radius=0, lqi=128, rssi=-68) [0xDFD0:1:0x0000] Received ZCL frame: b'\x18\xa8\x01\x04\x00\x00B\x10_TZE200_a7sghmms\x05\x00\x00B\x06TS0601' [0xDFD0:1:0x0000] Received ZCL frame: b'\x18\xa8\x01\x04\x00\x00B\x10_TZE200_a7sghmms\x05\x00\x00B\x06TS0601' [0xDFD0:1:0x0000] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=0, direction=, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=168, command_id=1, *direction=) [0xDFD0:1:0x0000] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=0, direction=, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=168, command_id=1, *direction=) [0xDFD0:1:0x0000] Decoded ZCL frame: Basic:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x0004, status=, value=TypeValue(type=CharacterString, value='_TZE200_a7sghmms')), ReadAttributeRecord(attrid=0x0005, status=, value=TypeValue(type=CharacterString, value='TS0601'))]) [0xDFD0:1:0x0000] Decoded ZCL frame: Basic:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x0004, status=, value=TypeValue(type=CharacterString, value='_TZE200_a7sghmms')), ReadAttributeRecord(attrid=0x0005, status=, value=TypeValue(type=CharacterString, value='TS0601'))]) [0xdfd0] Read model 'TS0601' and manufacturer '_TZE200_a7sghmms' from > [0xdfd0] Read model 'TS0601' and manufacturer '_TZE200_a7sghmms' from > [0xdfd0] Discovered basic device information for [0xdfd0] Discovered basic device information for Device is initialized Device is initialized Checking quirks for _TZE200_a7sghmms TS0601 (a4:c1:38:2a:6e:02:ff:ed) Checking quirks for _TZE200_a7sghmms TS0601 (a4:c1:38:2a:6e:02:ff:ed) Considering Considering Found custom device replacement for a4:c1:38:2a:6e:02:ff:ed: Found custom device replacement for a4:c1:38:2a:6e:02:ff:ed: 'sensor' component -> 'Battery' using ['power'] 'sensor' component -> 'Battery' using ['power'] 'sensor' component -> 'RSSISensor' using ['basic'] 'sensor' component -> 'RSSISensor' using ['basic'] 'sensor' component -> 'LQISensor' using ['basic'] 'sensor' component -> 'LQISensor' using ['basic'] 'sensor' component -> 'SmartEnergyMetering' using ['smartenergy_metering'] 'sensor' component -> 'SmartEnergyMetering' using ['smartenergy_metering'] 'sensor' component -> 'SmartEnergySummation' using ['smartenergy_metering'] 'sensor' component -> 'SmartEnergySummation' using ['smartenergy_metering'] 'select' component -> 'ZHAStartupOnOffSelectEntity' using ['on_off'] 'select' component -> 'ZHAStartupOnOffSelectEntity' using ['on_off'] device - 0xDFD0:a4:c1:38:2a:6e:02:ff:ed entering async_device_initialized - is_new_join: True device - 0xDFD0:a4:c1:38:2a:6e:02:ff:ed entering async_device_initialized - is_new_join: True device - 0xDFD0:a4:c1:38:2a:6e:02:ff:ed has joined the ZHA zigbee network device - 0xDFD0:a4:c1:38:2a:6e:02:ff:ed has joined the ZHA zigbee network [0xDFD0](TS0601): started configuration [0xDFD0](TS0601): started configuration [0xDFD0:ZDO](TS0601): 'async_configure' stage succeeded [0xDFD0:ZDO](TS0601): 'async_configure' stage succeeded Error handling '_save_attribute' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 0, 4, '_TZE200_a7sghmms') params: FOREIGN KEY constraint failed Error handling '_save_attribute' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 0, 4, '_TZE200_a7sghmms') params: FOREIGN KEY constraint failed [0xDFD0:1:0x0000]: Configuring cluster attribute reporting [0xDFD0:1:0x0000]: Configuring cluster attribute reporting [0xDFD0:1:0x0000]: finished channel configuration [0xDFD0:1:0x0000]: finished channel configuration [0xDFD0:1:0x0702]: Performing cluster binding [0xDFD0:1:0x0702]: Performing cluster binding [0xDFD0:1:0x0702]: bound 'smartenergy_metering' cluster: Status.SUCCESS [0xDFD0:1:0x0702]: bound 'smartenergy_metering' cluster: Status.SUCCESS [0xDFD0:1:0x0702]: Configuring cluster attribute reporting [0xDFD0:1:0x0702]: Configuring cluster attribute reporting [0xDFD0:1:0x0702]: Successfully configured reporting for '{'instantaneous_demand': (5, 900, 1), 'current_summ_delivered': (30, 900, 1), 'current_tier1_summ_delivered': (30, 900, 1)}' on 'smartenergy_metering' cluster: [ConfigureReportingResponseRecord(status=)] [0xDFD0:1:0x0702]: Successfully configured reporting for '{'instantaneous_demand': (5, 900, 1), 'current_summ_delivered': (30, 900, 1), 'current_tier1_summ_delivered': (30, 900, 1)}' on 'smartenergy_metering' cluster: [ConfigureReportingResponseRecord(status=)] [0xDFD0:1:0x0702]: Successfully configured reporting for '{'current_tier2_summ_delivered': (30, 900, 1), 'current_tier3_summ_delivered': (30, 900, 1), 'current_tier4_summ_delivered': (30, 900, 1)}' on 'smartenergy_metering' cluster: [ConfigureReportingResponseRecord(status=)] [0xDFD0:1:0x0702]: Successfully configured reporting for '{'current_tier2_summ_delivered': (30, 900, 1), 'current_tier3_summ_delivered': (30, 900, 1), 'current_tier4_summ_delivered': (30, 900, 1)}' on 'smartenergy_metering' cluster: [ConfigureReportingResponseRecord(status=)] [0xDFD0:1:0x0702]: Successfully configured reporting for '{'current_tier5_summ_delivered': (30, 900, 1), 'current_tier6_summ_delivered': (30, 900, 1), 'status': (1, 900, 1)}' on 'smartenergy_metering' cluster: [ConfigureReportingResponseRecord(status=)] [0xDFD0:1:0x0702]: Successfully configured reporting for '{'current_tier5_summ_delivered': (30, 900, 1), 'current_tier6_summ_delivered': (30, 900, 1), 'status': (1, 900, 1)}' on 'smartenergy_metering' cluster: [ConfigureReportingResponseRecord(status=)] [0xDFD0:1:0x0702]: finished channel configuration [0xDFD0:1:0x0702]: finished channel configuration [0xDFD0:1:0x0001]: Performing cluster binding [0xDFD0:1:0x0001]: Performing cluster binding [0xDFD0:1:0x0001]: bound 'power' cluster: Status.SUCCESS [0xDFD0:1:0x0001]: bound 'power' cluster: Status.SUCCESS [0xDFD0:1:0x0001]: Configuring cluster attribute reporting [0xDFD0:1:0x0001]: Configuring cluster attribute reporting [0xDFD0:1:0x0001]: Successfully configured reporting for '{'battery_voltage': (3600, 10800, 1), 'battery_percentage_remaining': (3600, 10800, 1)}' on 'power' cluster: [ConfigureReportingResponseRecord(status=)] [0xDFD0:1:0x0001]: Successfully configured reporting for '{'battery_voltage': (3600, 10800, 1), 'battery_percentage_remaining': (3600, 10800, 1)}' on 'power' cluster: [ConfigureReportingResponseRecord(status=)] [0xDFD0:1:0x0001]: finished channel configuration [0xDFD0:1:0x0001]: finished channel configuration [0xDFD0:1:0xef00]: Performing cluster binding [0xDFD0:1:0xef00]: Performing cluster binding [0xDFD0:1:0xef00]: bound 'tuya_manufacturer' cluster: Status.SUCCESS [0xDFD0:1:0xef00]: bound 'tuya_manufacturer' cluster: Status.SUCCESS [0xDFD0:1:0xef00]: Configuring cluster attribute reporting [0xDFD0:1:0xef00]: Configuring cluster attribute reporting [0xDFD0:1:0xef00]: finished channel configuration [0xDFD0:1:0xef00]: finished channel configuration [0xDFD0:1:0x0006]: Performing cluster binding [0xDFD0:1:0x0006]: Performing cluster binding [0xDFD0:1:0x0006]: bound 'on_off' cluster: Status.SUCCESS [0xDFD0:1:0x0006]: bound 'on_off' cluster: Status.SUCCESS [0xDFD0:1:0x0006]: Configuring cluster attribute reporting [0xDFD0:1:0x0006]: Configuring cluster attribute reporting [0xDFD0:1:0x0006]: Successfully configured reporting for '{'on_off': (0, 900, 1)}' on 'on_off' cluster: [ConfigureReportingResponseRecord(status=)] [0xDFD0:1:0x0006]: Successfully configured reporting for '{'on_off': (0, 900, 1)}' on 'on_off' cluster: [ConfigureReportingResponseRecord(status=)] [0xDFD0:1:0x0006]: finished channel configuration [0xDFD0:1:0x0006]: finished channel configuration [0xDFD0:1:0x0019]: finished channel configuration [0xDFD0:1:0x0019]: finished channel configuration Error handling '_save_attribute' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 0, 5, 'TS0601') params: FOREIGN KEY constraint failed Error handling '_save_attribute' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 0, 5, 'TS0601') params: FOREIGN KEY constraint failed [0xDFD0:1:0x0000]: 'async_configure' stage succeeded [0xDFD0:1:0x0000]: 'async_configure' stage succeeded [0xDFD0:1:0x0702]: 'async_configure' stage succeeded [0xDFD0:1:0x0702]: 'async_configure' stage succeeded [0xDFD0:1:0x0001]: 'async_configure' stage succeeded [0xDFD0:1:0x0001]: 'async_configure' stage succeeded [0xDFD0:1:0xef00]: 'async_configure' stage succeeded [0xDFD0:1:0xef00]: 'async_configure' stage succeeded [0xDFD0:1:0x0006]: 'async_configure' stage succeeded [0xDFD0:1:0x0006]: 'async_configure' stage succeeded [0xDFD0:1:0x0019]: 'async_configure' stage succeeded [0xDFD0:1:0x0019]: 'async_configure' stage succeeded [0xDFD0](TS0601): completed configuration [0xDFD0](TS0601): completed configuration [0xDFD0](TS0601): started initialization [0xDFD0](TS0601): started initialization [0xDFD0:ZDO](TS0601): 'async_initialize' stage succeeded [0xDFD0:ZDO](TS0601): 'async_initialize' stage succeeded [0xDFD0:1:0x0000]: initializing channel: from_cache: False [0xDFD0:1:0x0000]: initializing channel: from_cache: False [0xDFD0:1:0x0000]: finished channel initialization [0xDFD0:1:0x0000]: finished channel initialization [0xDFD0:1:0x0702]: initializing channel: from_cache: False [0xDFD0:1:0x0702]: initializing channel: from_cache: False [0xDFD0:1:0x0702]: initializing cached channel attributes: ['demand_formatting', 'divisor', 'metering_device_type', 'multiplier', 'summation_formatting', 'unit_of_measure'] [0xDFD0:1:0x0702]: initializing cached channel attributes: ['demand_formatting', 'divisor', 'metering_device_type', 'multiplier', 'summation_formatting', 'unit_of_measure'] [0xDFD0:1:0x0702]: Reading attributes in chunks: ['demand_formatting', 'divisor', 'metering_device_type', 'multiplier', 'summation_formatting'] [0xDFD0:1:0x0702]: Reading attributes in chunks: ['demand_formatting', 'divisor', 'metering_device_type', 'multiplier', 'summation_formatting'] [0xDFD0:1:0x0702]: Reading attributes in chunks: ['unit_of_measure'] [0xDFD0:1:0x0702]: Reading attributes in chunks: ['unit_of_measure'] [0xDFD0:1:0x0702]: initializing uncached channel attributes: ['instantaneous_demand', 'current_summ_delivered', 'current_tier1_summ_delivered', 'current_tier2_summ_delivered', 'current_tier3_summ_delivered', 'current_tier4_summ_delivered', 'current_tier5_summ_delivered', 'current_tier6_summ_delivered', 'status'] - from cache[False] [0xDFD0:1:0x0702]: initializing uncached channel attributes: ['instantaneous_demand', 'current_summ_delivered', 'current_tier1_summ_delivered', 'current_tier2_summ_delivered', 'current_tier3_summ_delivered', 'current_tier4_summ_delivered', 'current_tier5_summ_delivered', 'current_tier6_summ_delivered', 'status'] - from cache[False] [0xDFD0:1:0x0702]: Reading attributes in chunks: ['instantaneous_demand', 'current_summ_delivered', 'current_tier1_summ_delivered', 'current_tier2_summ_delivered', 'current_tier3_summ_delivered'] [0xDFD0:1:0x0702]: Reading attributes in chunks: ['instantaneous_demand', 'current_summ_delivered', 'current_tier1_summ_delivered', 'current_tier2_summ_delivered', 'current_tier3_summ_delivered'] [0xDFD0:1:0x0702]: Reading attributes in chunks: ['current_tier4_summ_delivered', 'current_tier5_summ_delivered', 'current_tier6_summ_delivered', 'status'] [0xDFD0:1:0x0702]: Reading attributes in chunks: ['current_tier4_summ_delivered', 'current_tier5_summ_delivered', 'current_tier6_summ_delivered', 'status'] [0xDFD0:1:0x0702]: Performing channel specific initialization: ['instantaneous_demand', 'current_summ_delivered', 'current_tier1_summ_delivered', 'current_tier2_summ_delivered', 'current_tier3_summ_delivered', 'current_tier4_summ_delivered', 'current_tier5_summ_delivered', 'current_tier6_summ_delivered', 'status'] [0xDFD0:1:0x0702]: Performing channel specific initialization: ['instantaneous_demand', 'current_summ_delivered', 'current_tier1_summ_delivered', 'current_tier2_summ_delivered', 'current_tier3_summ_delivered', 'current_tier4_summ_delivered', 'current_tier5_summ_delivered', 'current_tier6_summ_delivered', 'status'] [0xDFD0:1:0x0702]: finished channel initialization [0xDFD0:1:0x0702]: finished channel initialization [0xDFD0:1:0x0001]: initializing channel: from_cache: False [0xDFD0:1:0x0001]: initializing channel: from_cache: False [0xDFD0:1:0x0001]: initializing uncached channel attributes: ['battery_voltage', 'battery_percentage_remaining'] - from cache[False] [0xDFD0:1:0x0001]: initializing uncached channel attributes: ['battery_voltage', 'battery_percentage_remaining'] - from cache[False] [0xDFD0:1:0x0001]: Reading attributes in chunks: ['battery_voltage', 'battery_percentage_remaining'] [0xDFD0:1:0x0001]: Reading attributes in chunks: ['battery_voltage', 'battery_percentage_remaining'] [0xDFD0:1:0x0001]: Performing channel specific initialization: ['battery_voltage', 'battery_percentage_remaining'] [0xDFD0:1:0x0001]: Performing channel specific initialization: ['battery_voltage', 'battery_percentage_remaining'] [0xDFD0:1:0x0001]: Reading attributes in chunks: ['battery_size', 'battery_quantity'] [0xDFD0:1:0x0001]: Reading attributes in chunks: ['battery_size', 'battery_quantity'] [0xDFD0:1:0x0001]: finished channel initialization [0xDFD0:1:0x0001]: finished channel initialization [0xDFD0:1:0xef00]: initializing channel: from_cache: False [0xDFD0:1:0xef00]: initializing channel: from_cache: False [0xDFD0:1:0xef00]: finished channel initialization [0xDFD0:1:0xef00]: finished channel initialization [0xDFD0:1:0x0006]: initializing channel: from_cache: False [0xDFD0:1:0x0006]: initializing channel: from_cache: False [0xDFD0:1:0x0006]: initializing cached channel attributes: ['start_up_on_off'] [0xDFD0:1:0x0006]: initializing cached channel attributes: ['start_up_on_off'] [0xDFD0:1:0x0006]: Reading attributes in chunks: ['start_up_on_off'] [0xDFD0:1:0x0006]: Reading attributes in chunks: ['start_up_on_off'] [0xDFD0:1:0x0006]: initializing uncached channel attributes: ['on_off'] - from cache[False] [0xDFD0:1:0x0006]: initializing uncached channel attributes: ['on_off'] - from cache[False] [0xDFD0:1:0x0006]: Reading attributes in chunks: ['on_off'] [0xDFD0:1:0x0006]: Reading attributes in chunks: ['on_off'] [0xDFD0:1:0x0006]: finished channel initialization [0xDFD0:1:0x0006]: finished channel initialization [0xDFD0:1:0x0019]: initializing channel: from_cache: False [0xDFD0:1:0x0019]: initializing channel: from_cache: False [0xDFD0:1:0x0019]: finished channel initialization [0xDFD0:1:0x0019]: finished channel initialization [0xDFD0:1:0x0000]: 'async_initialize' stage succeeded [0xDFD0:1:0x0000]: 'async_initialize' stage succeeded [0xDFD0:1:0x0702]: 'async_initialize' stage succeeded [0xDFD0:1:0x0702]: 'async_initialize' stage succeeded [0xDFD0:1:0x0001]: 'async_initialize' stage succeeded [0xDFD0:1:0x0001]: 'async_initialize' stage succeeded [0xDFD0:1:0xef00]: 'async_initialize' stage succeeded [0xDFD0:1:0xef00]: 'async_initialize' stage succeeded [0xDFD0:1:0x0006]: 'async_initialize' stage succeeded [0xDFD0:1:0x0006]: 'async_initialize' stage succeeded [0xDFD0:1:0x0019]: 'async_initialize' stage succeeded [0xDFD0:1:0x0019]: 'async_initialize' stage succeeded [0xDFD0](TS0601): power source: Battery or Unknown [0xDFD0](TS0601): power source: Battery or Unknown [0xDFD0](TS0601): completed initialization [0xDFD0](TS0601): completed initialization start_up_on_off is not supported - skipping ZHAStartupOnOffSelectEntity entity creation start_up_on_off is not supported - skipping ZHAStartupOnOffSelectEntity entity creation Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1794, 772) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1794, 772) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1794, 770) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1794, 770) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1794, 769) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1794, 769) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1794, 771) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1794, 771) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1794, 1024) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1794, 1024) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1794, 0) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1794, 0) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1794, 256) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1794, 256) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1794, 258) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1794, 258) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1794, 260) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1794, 260) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1794, 262) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1794, 262) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1794, 264) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1794, 264) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1794, 266) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1794, 266) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1794, 512) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1794, 512) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1, 32) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1, 32) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1, 33) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1, 33) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1, 49) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1, 49) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1, 51) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 1, 51) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 6, 16387) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 6, 16387) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 6, 0) params: FOREIGN KEY constraint failed Error handling '_unsupported_attribute_added' event with (a4:c1:38:2a:6e:02:ff:ed, 1, 6, 0) params: FOREIGN KEY constraint failed Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0xDFD0), src_ep=0, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=0, source_route=None, extended_timeout=False, tsn=8, profile_id=0, cluster_id=2, data=Serialized[b'\x01\x00\x00'], tx_options=, radius=0, non_member_radius=0, lqi=128, rssi=-68) Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0xDFD0), src_ep=0, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=0, source_route=None, extended_timeout=False, tsn=8, profile_id=0, cluster_id=2, data=Serialized[b'\x01\x00\x00'], tx_options=, radius=0, non_member_radius=0, lqi=128, rssi=-68) [0xdfd0:zdo] ZDO request ZDOCmd.Node_Desc_req: [0x0000] [0xdfd0:zdo] ZDO request ZDOCmd.Node_Desc_req: [0x0000] [0xdfd0:zdo] No handler for ZDO request:ZDOCmd.Node_Desc_req([0x0000]) [0xdfd0:zdo] No handler for ZDO request:ZDOCmd.Node_Desc_req([0x0000]) Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0xDFD0), src_ep=0, dst=AddrModeAddress(addr_mode=, address=), dst_ep=0, source_route=None, extended_timeout=False, tsn=10, profile_id=0, cluster_id=0, data=Serialized[b'\x02\xedT\x88\xfe\xff\x8dy\xe0\x00\x00'], tx_options=, radius=0, non_member_radius=0, lqi=68, rssi=-83) Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0xDFD0), src_ep=0, dst=AddrModeAddress(addr_mode=, address=), dst_ep=0, source_route=None, extended_timeout=False, tsn=10, profile_id=0, cluster_id=0, data=Serialized[b'\x02\xedT\x88\xfe\xff\x8dy\xe0\x00\x00'], tx_options=, radius=0, non_member_radius=0, lqi=68, rssi=-83) [0xdfd0:zdo] ZDO request ZDOCmd.NWK_addr_req: [e0:79:8d:ff:fe:88:54:ed, , 0] [0xdfd0:zdo] ZDO request ZDOCmd.NWK_addr_req: [e0:79:8d:ff:fe:88:54:ed, , 0] [0x5718](RS 225): Device seen - marking the device available and resetting counter [0x5718](RS 225): Device seen - marking the device available and resetting counter [0x5718](RS 225): Update device availability - device available: True - new availability: True - changed: False [0x5718](RS 225): Update device availability - device available: True - new availability: True - changed: False Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0xDFD0), src_ep=0, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=0, source_route=None, extended_timeout=False, tsn=11, profile_id=0, cluster_id=2, data=Serialized[b'\x03\x00\x00'], tx_options=, radius=0, non_member_radius=0, lqi=132, rssi=-67) Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0xDFD0), src_ep=0, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=0, source_route=None, extended_timeout=False, tsn=11, profile_id=0, cluster_id=2, data=Serialized[b'\x03\x00\x00'], tx_options=, radius=0, non_member_radius=0, lqi=132, rssi=-67) [0xdfd0:zdo] ZDO request ZDOCmd.Node_Desc_req: [0x0000] [0xdfd0:zdo] ZDO request ZDOCmd.Node_Desc_req: [0x0000] [0xdfd0:zdo] No handler for ZDO request:ZDOCmd.Node_Desc_req([0x0000]) [0xdfd0:zdo] No handler for ZDO request:ZDOCmd.Node_Desc_req([0x0000]) Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0xEAE4), src_ep=1, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=219, profile_id=260, cluster_id=1280, data=Serialized[b'\tV\x00\x01\x00\x00\x00\x00\x00'], tx_options=, radius=0, non_member_radius=0, lqi=132, rssi=-67) Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=, address=0xEAE4), src_ep=1, dst=AddrModeAddress(addr_mode=, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=219, profile_id=260, cluster_id=1280, data=Serialized[b'\tV\x00\x01\x00\x00\x00\x00\x00'], tx_options=, radius=0, non_member_radius=0, lqi=132, rssi=-67) [0xEAE4:1:0x0500] Received ZCL frame: b'\tV\x00\x01\x00\x00\x00\x00\x00' [0xEAE4:1:0x0500] Received ZCL frame: b'\tV\x00\x01\x00\x00\x00\x00\x00' [0xEAE4:1:0x0500] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=0, direction=, disable_default_response=0, reserved=0, *is_cluster=True, *is_general=False), tsn=86, command_id=0, *direction=) [0xEAE4:1:0x0500] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=0, direction=, disable_default_response=0, reserved=0, *is_cluster=True, *is_general=False), tsn=86, command_id=0, *direction=) [0xEAE4:1:0x0500] Sending reply header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=False, direction=, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=86, command_id=, *direction=) [0xEAE4:1:0x0500] Sending reply header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=False, direction=, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True), tsn=86, command_id=, *direction=) [0xEAE4:1:0x0500] Sending reply: Default_Response(command_id=0, status=) [0xEAE4:1:0x0500] Sending reply: Default_Response(command_id=0, status=) ```

Additional information

No response

mkoppanen commented 1 year ago

Some additional information: I've been running a lot of tests with this device and zha. The behaviour seems to be consistent: When I pair the device it keeps working for a couple of minutes and then the HA switch stops controlling the valve.

After 6 hours of pairing the device becomes unavailable (6 hours is my configured time for battery powered devices to be seen offline).

I don't know whether it's relevant but during the time the device is connected it keeps changing id (Log entries about device changed id).

I've tried to see if there are any debug logging events around the time when the valve becomes unresponsive but I cannot see anything relevant.

Any tips for debugging this issue further?

github-actions[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

MartinNeurol commented 4 months ago

Hi, Martin here. I know this is a while ago, but... I own three of those valves and am facing the same issue, they are unusable with ZHA. Have you been able to solve this last year, or gave up? Thank you, Martin

mkoppanen commented 4 months ago

@MartinNeurol I switched to zigbee2mqtt and haven't had similar issues since.

MartinNeurol commented 4 months ago

oh, I see... thank you...