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
725 stars 672 forks source link

[BUG] Aqara Smart Radiator Thermostat E1 (configuration for external Sensor) #2618

Closed 0Styless closed 11 months ago

0Styless commented 11 months ago

Bug description

Hey there,

I bought the Aqara Smart Radiator Thermostat (E1) and everything works fine so far, but I'm not sure how to configure an external sensor for temperature measurement. I can see that the entity for external sensor is already there under diagnostic:

image

They are a few topics in the Home-Assistant community forum where solutions for Zigbee2Mqtt are provided, but nothing that works with the ZHA integration.

It would be nice if at least there is a way to inject the temperature from an external sensor into the E1 with some Automation/Script/you name it.

Steps to reproduce

  1. Add Aqara Smart Radiator Thermostat (E1) with ZHA integration
  2. Wait for pairing process to complete
  3. Go to new device
  4. See the 'External sensor' information (but no configuration option)

Expected behavior

Integration should allow (or at least describe some workaround) to define an external sensor for the Aqara Smart Radiator Thermostat (E1).

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=4447, maximum_buffer_size=127, maximum_incoming_transfer_size=100, server_mask=11264, maximum_outgoing_transfer_size=100, 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": "0x0104", "device_type": "0x0301", "input_clusters": [ "0x0000", "0x0001", "0x0003", "0x000a", "0x0201", "0xfcc0" ], "output_clusters": [ "0x0003", "0x0019", "0x0201", "0xfcc0" ] } }, "manufacturer": "LUMI", "model": "lumi.airrtc.agl001", "class": "zhaquirks.xiaomi.aqara.thermostat_agl001.AGL001" } ```

Diagnostic information

Diagnostic information Can't download for that device (but works for other ZHA devices (e.g. LEDVANCE)). See log from HA: ``` Oct 03 19:52:10 acepc docker[183954]: home-assistant | 2023-10-03 19:52:10.035 ERROR (MainThread) [aiohttp.server] Error handling request Oct 03 19:52:10 acepc docker[183954]: home-assistant | Traceback (most recent call last): Oct 03 19:52:10 acepc docker[183954]: home-assistant | File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request Oct 03 19:52:10 acepc docker[183954]: home-assistant | resp = await request_handler(request) Oct 03 19:52:10 acepc docker[183954]: home-assistant | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Oct 03 19:52:10 acepc docker[183954]: home-assistant | File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle Oct 03 19:52:10 acepc docker[183954]: home-assistant | resp = await handler(request) Oct 03 19:52:10 acepc docker[183954]: home-assistant | ^^^^^^^^^^^^^^^^^^^^^^ Oct 03 19:52:10 acepc docker[183954]: home-assistant | File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 117, in impl Oct 03 19:52:10 acepc docker[183954]: home-assistant | return await handler(request) Oct 03 19:52:10 acepc docker[183954]: home-assistant | ^^^^^^^^^^^^^^^^^^^^^^ Oct 03 19:52:10 acepc docker[183954]: home-assistant | File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware Oct 03 19:52:10 acepc docker[183954]: home-assistant | return await handler(request) Oct 03 19:52:10 acepc docker[183954]: home-assistant | ^^^^^^^^^^^^^^^^^^^^^^ Oct 03 19:52:10 acepc docker[183954]: home-assistant | File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 227, in forwarded_middleware Oct 03 19:52:10 acepc docker[183954]: home-assistant | return await handler(request) Oct 03 19:52:10 acepc docker[183954]: home-assistant | ^^^^^^^^^^^^^^^^^^^^^^ Oct 03 19:52:10 acepc docker[183954]: home-assistant | File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware Oct 03 19:52:10 acepc docker[183954]: home-assistant | return await handler(request) Oct 03 19:52:10 acepc docker[183954]: home-assistant | ^^^^^^^^^^^^^^^^^^^^^^ Oct 03 19:52:10 acepc docker[183954]: home-assistant | File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware Oct 03 19:52:10 acepc docker[183954]: home-assistant | return await handler(request) Oct 03 19:52:10 acepc docker[183954]: home-assistant | ^^^^^^^^^^^^^^^^^^^^^^ Oct 03 19:52:10 acepc docker[183954]: home-assistant | File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware Oct 03 19:52:10 acepc docker[183954]: home-assistant | return await handler(request) Oct 03 19:52:10 acepc docker[183954]: home-assistant | ^^^^^^^^^^^^^^^^^^^^^^ Oct 03 19:52:10 acepc docker[183954]: home-assistant | File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware Oct 03 19:52:10 acepc docker[183954]: home-assistant | response = await handler(request) Oct 03 19:52:10 acepc docker[183954]: home-assistant | ^^^^^^^^^^^^^^^^^^^^^^ Oct 03 19:52:10 acepc docker[183954]: home-assistant | File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 148, in handle Oct 03 19:52:10 acepc docker[183954]: home-assistant | result = await handler(request, **request.match_info) Oct 03 19:52:10 acepc docker[183954]: home-assistant | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Oct 03 19:52:10 acepc docker[183954]: home-assistant | File "/usr/src/homeassistant/homeassistant/components/diagnostics/__init__.py", line 268, in get Oct 03 19:52:10 acepc docker[183954]: home-assistant | data = await info.device_diagnostics(hass, config_entry, device) Oct 03 19:52:10 acepc docker[183954]: home-assistant | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Oct 03 19:52:10 acepc docker[183954]: home-assistant | File "/usr/src/homeassistant/homeassistant/components/zha/diagnostics.py", line 104, in async_get_device_diagnostics Oct 03 19:52:10 acepc docker[183954]: home-assistant | device_info[CLUSTER_DETAILS] = get_endpoint_cluster_attr_data(zha_device) Oct 03 19:52:10 acepc docker[183954]: home-assistant | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Oct 03 19:52:10 acepc docker[183954]: home-assistant | File "/usr/src/homeassistant/homeassistant/components/zha/diagnostics.py", line 126, in get_endpoint_cluster_attr_data Oct 03 19:52:10 acepc docker[183954]: home-assistant | ATTR_IN_CLUSTERS: { Oct 03 19:52:10 acepc docker[183954]: home-assistant | ^ Oct 03 19:52:10 acepc docker[183954]: home-assistant | File "/usr/src/homeassistant/homeassistant/components/zha/diagnostics.py", line 129, in Oct 03 19:52:10 acepc docker[183954]: home-assistant | **get_cluster_attr_data(cluster), Oct 03 19:52:10 acepc docker[183954]: home-assistant | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Oct 03 19:52:10 acepc docker[183954]: home-assistant | File "/usr/src/homeassistant/homeassistant/components/zha/diagnostics.py", line 155, in get_cluster_attr_data Oct 03 19:52:10 acepc docker[183954]: home-assistant | UNSUPPORTED_ATTRIBUTES: { Oct 03 19:52:10 acepc docker[183954]: home-assistant | ^ Oct 03 19:52:10 acepc docker[183954]: home-assistant | File "/usr/src/homeassistant/homeassistant/components/zha/diagnostics.py", line 156, in Oct 03 19:52:10 acepc docker[183954]: home-assistant | f"0x{cluster.find_attribute(u_attr).id:04x}": { Oct 03 19:52:10 acepc docker[183954]: home-assistant | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Oct 03 19:52:10 acepc docker[183954]: home-assistant | File "/usr/local/lib/python3.11/site-packages/zigpy/zcl/__init__.py", line 233, in find_attribute Oct 03 19:52:10 acepc docker[183954]: home-assistant | return self.attributes[name_or_id] Oct 03 19:52:10 acepc docker[183954]: home-assistant | ~~~~~~~~~~~~~~~^^^^^^^^^^^^ Oct 03 19:52:10 acepc docker[183954]: home-assistant | KeyError: 900 ```

Logs

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

Additional information

0Styless commented 11 months ago

Closing this issue - it's not resolved, but I found that the integration Better Thermostat does exactly what I want. So this is a nice workaround.