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
734 stars 673 forks source link

End device temperature value not being updated in ZHA #2881

Closed AussieSusan closed 2 months ago

AussieSusan commented 9 months ago

Problem description

(Please also see https://community.home-assistant.io/t/zigbee-not-updating-value-in-ui/664374 and https://community.home-assistant.io/t/not-updating-value-in-ui/661259 where I've previously raised this problem) I have an ESP32-H2 end device running the latest Espressif Zigbee SDK versions using the Espressif HA_on_off_light example as the basis. The end device defines 2 end points: 1 with the basic information and an on-off switch clusters, and 2 with a Temperature Measurement cluster. I have a custom quirk that (at this stage of the overall development) is supposed to do nothing - and also not having a quirk displays the same issue. The end device connects to the SkyConnect ZHA coordinator and shows the switch control and temperature measurement sensor. The end device is set up to update the temperature value every 2 seconds (as I said - this is a test situation) with a value ranging from the defined minimum to the defined maximum temperature values as defined in the cluster. The displayed temperature value is always the value defined when the end device connects and does not update even though I can see the ZHA reacting to the 'write attribute' packet from the end device. Also when I do a 'read attributes' on the temperature measurement attribute, it is always the initial value.

Solution description

How can I get the updated value being sent from the end device to be displayed?

Screenshots/Video

Screenshots/Video [Paste/upload your media here]

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=4660, maximum_buffer_size=108, maximum_incoming_transfer_size=0, server_mask=11264, maximum_outgoing_transfer_size=0, 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=True, *is_receiver_on_when_idle=True, *is_router=False, *is_security_capable=False)", "endpoints": { "1": { "profile_id": "0x0104", "device_type": "0x0002", "input_clusters": [ "0x0000", "0x0006" ], "output_clusters": [] }, "2": { "profile_id": "0x0104", "device_type": "0x0302", "input_clusters": [ "0x0402" ], "output_clusters": [] } }, "manufacturer": "ConMac", "model": "Weather2", "class": "weather2_quirk.ConMacWeather2" } ```

Diagnostic information

Diagnostic information ```json [Paste the diagnostic information here] ```

Logs

Logs ```python [Paste the logs here] ```

Custom quirk

Custom quirk ```python """ Custom quirk for the ConMac Weather2 zigbee device""" from zigpy.profiles import zha from zigpy.quirks import CustomDevice from zhaquirks.const import ( DEVICE_TYPE, ENDPOINTS, INPUT_CLUSTERS, OUTPUT_CLUSTERS, PROFILE_ID, ) from zigpy.zcl.clusters.general import ( # AnalogInput, # AnalogOutput, Basic, OnOff, ) from zigpy.zcl.clusters.measurement import ( TemperatureMeasurement, ) # class AnalogInputCluster( CustomCluster, AnalogInput): # cluster_id = AnalogInput.cluster_id # def __init__(self,*args, **kwargs): # self.current_state = {} # super().__init__(*args, **kwargs) # def _update_attribute( self, attrid, value): # super()._update_attribute( attrid, value) # if value is not None and value >= 0: # self.endpoint.device.power_bus.listener_even(POWER_REPORTED, value) class ConMacWeather2( CustomDevice): def __init__(self, *args, **kwargs): """Init,""" super().__init__(*args, **kwargs) signature = { # MODELS_INFO: [("Weather2", "manuforte.org")], ENDPOINTS: { # < SimpleDescriptor endpoint=2 profile=0x0104 device_type=0x0002 # device_version=1 # input_clusters=[0,6] # output_clusters=[]> 1: { PROFILE_ID: 0x0104, DEVICE_TYPE: 0x0002, INPUT_CLUSTERS: [ Basic.cluster_id, OnOff.cluster_id, ], OUTPUT_CLUSTERS: [], }, # < SimpleDescriptor endpoint=2 profile=0x0104 device_type=0x0007 # device_version=1 # input_clusters=[12] # output_clusters=[13]> 2: { PROFILE_ID: 0x0104, DEVICE_TYPE: 0x0302, INPUT_CLUSTERS: [ TemperatureMeasurement.cluster_id, ], OUTPUT_CLUSTERS: [ # TemperatureMeasurement.cluster_id, ], }, }, } replacement = { # SKIP_CONFIGURATION: True, ENDPOINTS: { 1: { PROFILE_ID: 0x0104, DEVICE_TYPE: 0x0002, INPUT_CLUSTERS: [ Basic.cluster_id, OnOff.cluster_id, ], OUTPUT_CLUSTERS: [], }, 2: { PROFILE_ID: 0x0104, DEVICE_TYPE: 0x0302, INPUT_CLUSTERS: [ TemperatureMeasurement.cluster_id ], OUTPUT_CLUSTERS: [ # TemperatureMeasurement.cluster_id, ], }, }, "manufacturer": "ConMac", "model": "Weather2", } ```

Additional information

Please see the linked pages above for the logs etc.

github-actions[bot] commented 3 months 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.