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
773 stars 703 forks source link

[BUG] Elko Super TR thermostat not working. #1585

Closed bendikrb closed 2 years ago

bendikrb commented 2 years ago

Describe the bug See attached screenshots. Related to;

1520

999

Screenshots Screenshot_20220525_161521 Screenshot_20220525_161329

Device signature ```yaml { "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=4919, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)", "endpoints": { "1": { "profile_id": 260, "device_type": "0x0301", "in_clusters": [ "0x0000", "0x0003", "0x0004", "0x0005", "0x0201", "0x0204", "0x0b04" ], "out_clusters": [ "0x0003", "0x0019" ] } }, "manufacturer": "ELKO", "model": "Super TR", "class": "zhaquirks.elko.smart_super_thermostat.ElkoSuperTRThermostat" } ```
Diagnostic information ```yaml { "home_assistant": { "installation_type": "Home Assistant Supervised", "version": "2022.5.5", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.9.9", "docker": true, "arch": "x86_64", "timezone": "Europe/Oslo", "os_name": "Linux", "os_version": "5.13.0-41-generic", "supervisor": "2022.05.3", "host_os": "Ubuntu 21.10", "docker_version": "20.10.8", "chassis": "desktop", "run_as_root": true }, "custom_components": { "fontawesome": { "version": "2.1.5", "requirements": [] }, "eventsensor": { "version": "3.0.0", "requirements": [] }, "average": { "version": "2.2.3", "requirements": [] }, "metnowcast": { "version": "2.0.2", "requirements": [] }, "zaptec": { "version": "0.0.5", "requirements": [ "azure-servicebus==7.0.1" ] }, "priceanalyzer": { "version": "0.0.10", "requirements": [ "nordpool>=0.2" ] }, "cover_rf_time_based": { "version": "1.0.8", "requirements": [ "xknx==0.9.4" ] }, "favicon": { "version": "10.4", "requirements": [] }, "attributes": { "version": "1.2.0", "requirements": [] }, "mass": { "version": "1.1.16", "requirements": [ "music-assistant==1.1.16" ] }, "auto_areas": { "version": "1.0.0", "requirements": [] }, "simpleicons": { "version": "v2.0.0", "requirements": [ "simpleicons==6.16.0" ] }, "ui_lovelace_minimalist": { "version": "v0.0.8", "requirements": [] }, "google_home": { "version": "1.9.10", "requirements": [ "glocaltokens==0.6.3", "google-api-python-client==2.38.0" ] }, "entities_calendar": { "version": "0.0.8", "requirements": [] }, "reversotts": { "version": "1.0.2", "requirements": [ "pyttsreverso==0.4" ] }, "unifi_network": { "version": "0.4.0", "requirements": [ "pyunifi==2.21" ] }, "programmable_thermostat": { "version": "8.1", "requirements": [] }, "browser_mod": { "version": "1.5.3", "requirements": [] }, "scheduler": { "version": "v0.0.0", "requirements": [] }, "watchman": { "version": "0.5.1", "requirements": [ "prettytable==3.0.0" ] }, "weatherapi": { "version": "0.8", "requirements": [] }, "mjpeg_timelapse": { "version": "2021.12.30", "requirements": [] }, "plex_recently_added": { "version": "0.3.8", "requirements": [] }, "jellyfin": { "version": "1.1.0", "requirements": [ "jellyfin-apiclient-python==1.7.2" ] }, "hacs": { "version": "1.25.1", "requirements": [ "aiogithubapi>=22.2.4" ] }, "tgtg": { "version": "4.0.3", "requirements": [ "tgtg>=0.11.3" ] }, "pid_controller": { "version": "v1.1.3", "requirements": [] }, "hifiberry": { "version": "0.0.3", "requirements": [ "pyhifiberry>=0.1.1" ] }, "variable": { "version": "2.2.2", "requirements": [] }, "nordpool": { "version": "0.0.7", "requirements": [ "nordpool>=0.2" ] }, "mopidy": { "version": "1.4.6", "requirements": [ "mopidyapi==1.0.0" ] }, "blitzortung": { "version": "1.0.1", "requirements": [ "paho-mqtt>=1.5.0" ] }, "webrtc": { "version": "v2.3.0", "requirements": [] }, "remote_homeassistant": { "version": "3.6", "requirements": [] }, "energidataservice": { "version": "v0.2.0", "requirements": [ "CurrencyConverter==0.16.11" ] }, "pyscript": { "version": "1.3.3", "requirements": [ "croniter==1.3.4", "watchdog==2.1.6" ] }, "files": { "version": "1.5", "requirements": [] }, "climate_template": { "version": "0.2.0", "requirements": [] }, "google_keep": { "version": "v1.1.4", "requirements": [ "gkeepapi==0.11.16" ] }, "spacex": { "version": "029", "requirements": [ "spacexpypi==0.0.12" ] }, "spotcast": { "version": "v3.6.29", "requirements": [ "spotify_token==1.0.0" ] }, "sbanken": { "version": "2.1.1", "requirements": [ "oauthlib==3.2.0", "requests-oauthlib==1.3.1" ] }, "zha_toolkit": { "version": "v0.8.8", "requirements": [] }, "openhasp": { "version": "0.6.3", "requirements": [ "jsonschema>=3.2.0" ] }, "frigate": { "version": "2.3", "requirements": [] } }, "integration_manifest": { "domain": "zha", "name": "Zigbee Home Automation", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/zha", "requirements": [ "bellows==0.29.0", "pyserial==3.5", "pyserial-asyncio==0.6", "zha-quirks==0.0.73", "zigpy-deconz==0.16.0", "zigpy==0.45.1", "zigpy-xbee==0.14.0", "zigpy-zigate==0.7.4", "zigpy-znp==0.7.0" ], "usb": [ { "vid": "10C4", "pid": "EA60", "description": "*2652*", "known_devices": [ "slae.sh cc2652rb stick" ] }, { "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": "10C4", "pid": "8B34", "description": "*bv 2010/10*", "known_devices": [ "Bitron Video AV2010/10" ] } ], "codeowners": [ "@dmulcahey", "@adminiuga" ], "zeroconf": [ { "type": "_esphomelib._tcp.local.", "name": "tube*" } ], "after_dependencies": [ "usb", "zeroconf" ], "iot_class": "local_polling", "loggers": [ "aiosqlite", "bellows", "crccheck", "pure_pcapy3", "zhaquirks", "zigpy", "zigpy_deconz", "zigpy_xbee", "zigpy_zigate", "zigpy_znp" ], "is_built_in": true }, "data": { "ieee": "**REDACTED**", "nwk": 10848, "manufacturer": "ELKO", "model": "Super TR", "name": "ELKO Super TR", "quirk_applied": true, "quirk_class": "zhaquirks.elko.smart_super_thermostat.ElkoSuperTRThermostat", "manufacturer_code": 4919, "power_source": "Mains", "lqi": 255, "rssi": -31, "last_seen": "2022-05-25T16:06:18", "available": true, "device_type": "Router", "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=4919, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)", "endpoints": { "1": { "profile_id": 260, "device_type": "0x0301", "in_clusters": [ "0x0000", "0x0003", "0x0004", "0x0005", "0x0201", "0x0204", "0x0b04" ], "out_clusters": [ "0x0003", "0x0019" ] } } }, "entities": [ { "entity_id": "button.elko_super_tr_344b22fe_identify", "name": "ELKO Super TR" }, { "entity_id": "climate.elko_super_tr_344b22fe_thermostat", "name": "ELKO Super TR" }, { "entity_id": "sensor.elko_super_tr_344b22fe_electrical_measurement", "name": "ELKO Super TR" }, { "entity_id": "sensor.elko_super_tr_344b22fe_electrical_measurement_apparent_power", "name": "ELKO Super TR" }, { "entity_id": "sensor.elko_super_tr_344b22fe_electrical_measurement_rms_current", "name": "ELKO Super TR" }, { "entity_id": "sensor.elko_super_tr_344b22fe_electrical_measurement_rms_voltage", "name": "ELKO Super TR" }, { "entity_id": "sensor.elko_super_tr_344b22fe_electrical_measurement_ac_frequency", "name": "ELKO Super TR" }, { "entity_id": "sensor.elko_super_tr_344b22fe_electrical_measurement_power_factor", "name": "ELKO Super TR" }, { "entity_id": "sensor.elko_super_tr_344b22fe_thermostat_hvac_action", "name": "ELKO Super TR" } ], "neighbors": [ { "device_type": "Coordinator", "rx_on_when_idle": "On", "relationship": "Parent", "extended_pan_id": "**REDACTED**", "ieee": "**REDACTED**", "nwk": "0x0000", "permit_joining": "Unknown", "depth": "0", "lqi": "255" }, { "device_type": "Router", "rx_on_when_idle": "On", "relationship": "Sibling", "extended_pan_id": "**REDACTED**", "ieee": "**REDACTED**", "nwk": "0x2DEA", "permit_joining": "Unknown", "depth": "15", "lqi": "125" }, { "device_type": "Router", "rx_on_when_idle": "On", "relationship": "Sibling", "extended_pan_id": "**REDACTED**", "ieee": "**REDACTED**", "nwk": "0x7947", "permit_joining": "Unknown", "depth": "15", "lqi": "118" }, { "device_type": "Router", "rx_on_when_idle": "On", "relationship": "Sibling", "extended_pan_id": "**REDACTED**", "ieee": "**REDACTED**", "nwk": "0x79E5", "permit_joining": "Unknown", "depth": "15", "lqi": "72" }, { "device_type": "Router", "rx_on_when_idle": "On", "relationship": "Sibling", "extended_pan_id": "**REDACTED**", "ieee": "**REDACTED**", "nwk": "0x8241", "permit_joining": "Unknown", "depth": "15", "lqi": "81" }, { "device_type": "Router", "rx_on_when_idle": "On", "relationship": "Sibling", "extended_pan_id": "**REDACTED**", "ieee": "**REDACTED**", "nwk": "0x8888", "permit_joining": "Unknown", "depth": "15", "lqi": "151" }, { "device_type": "Router", "rx_on_when_idle": "On", "relationship": "Sibling", "extended_pan_id": "**REDACTED**", "ieee": "**REDACTED**", "nwk": "0x88DE", "permit_joining": "Unknown", "depth": "15", "lqi": "93" }, { "device_type": "Router", "rx_on_when_idle": "On", "relationship": "Sibling", "extended_pan_id": "**REDACTED**", "ieee": "**REDACTED**", "nwk": "0x97C9", "permit_joining": "Unknown", "depth": "15", "lqi": "100" }, { "device_type": "Router", "rx_on_when_idle": "On", "relationship": "Sibling", "extended_pan_id": "**REDACTED**", "ieee": "**REDACTED**", "nwk": "0xC253", "permit_joining": "Unknown", "depth": "15", "lqi": "90" } ], "endpoint_names": [ { "name": "THERMOSTAT" } ], "user_given_name": null, "device_reg_id": "22dc4bbe60414a0ebda147336f27daea", "area_id": "4504c49c9cab4ee9a2baaae74ae35325" } } ```
Additional logs ``` 2022-05-25 16:19:33 WARNING (MainThread) [homeassistant.components.zha.entity] climate.elko_super_tr_344b22fe_thermostat: can't set 'heat' mode. Supported modes are: [] ```

Additional context Add any other context about the problem here.

thgjerde commented 2 years ago

Broken for me too.

Debug log ``` 2022-06-12 22:50:46 DEBUG (MainThread) [homeassistant.core] Bus:Handling 2022-06-12 22:50:46 DEBUG (MainThread) [zigpy.zcl] [0xE3AC:1:0x0201] Sending request header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=True, is_reply=0, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), manufacturer=0, tsn=19, command_id=, *is_reply=False) 2022-06-12 22:50:46 DEBUG (MainThread) [zigpy.zcl] [0xE3AC:1:0x0201] Sending request: Write_Attributes(attributes=[Attribute(attrid=0x001C, value=TypeValue(type=SystemMode, value=)), Attribute(attrid=0x0406, value=TypeValue(type=Bool, value=)), Attribute(attrid=0x0411, value=TypeValue(type=Bool, value=))]) 2022-06-12 22:50:46 DEBUG (MainThread) [zigpy_znp.api] Sending request: AF.DataRequestExt.Req(DstAddrModeAddress=AddrModeAddress(mode=, address=0xE3AC), DstEndpoint=1, DstPanId=0x0000, SrcEndpoint=1, ClusterId=513, TSN=19, Options=, Radius=30, Data=b'\x04\x00\x00\x13\x02\x1C\x00\x30\x04\x06\x04\x10\x01\x11\x04\x10\x00') 2022-06-12 22:50:46 DEBUG (MainThread) [zigpy_znp.api] Received command: AF.DataRequestExt.Rsp(Status=) 2022-06-12 22:50:46 DEBUG (MainThread) [zigpy_znp.api] Received command: AF.DataConfirm.Callback(Status=, Endpoint=1, TSN=19) 2022-06-12 22:50:46 DEBUG (MainThread) [zigpy_znp.api] Received command: AF.IncomingMsg.Callback(GroupId=0x0000, ClusterId=513, SrcAddr=0xE3AC, SrcEndpoint=1, DstEndpoint=1, WasBroadcast=, LQI=138, SecurityUse=, TimeStamp=5550473, TSN=0, Data=b'\x0C\x00\x00\x13\x0B\x02\x84', MacSrcAddr=0xE3AC, MsgResultRadius=29) 2022-06-12 22:50:46 DEBUG (MainThread) [zigpy.zcl] [0xE3AC:1:0x0201] Received ZCL frame: b'\x0C\x00\x00\x13\x0B\x02\x84' 2022-06-12 22:50:46 DEBUG (MainThread) [zigpy.zcl] [0xE3AC:1:0x0201] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=, is_manufacturer_specific=True, is_reply=1, disable_default_response=0, reserved=0, *is_cluster=False, *is_general=True), manufacturer=0, tsn=19, command_id=11, *is_reply=True) 2022-06-12 22:50:46 DEBUG (MainThread) [zigpy.zcl] [0xE3AC:1:0x0201] Decoded ZCL frame: ElkoSuperTRThermostatCluster:Default_Response(command_id=2, status=) 2022-06-12 22:50:46 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0xE3AC:1:0x0201]: wrote {'system_mode': , 'device_on': 1, 'night_lowering': 0} attrs, Status: Default_Response(command_id=2, status=) 2022-06-12 22:50:46 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140601249930496] 'uint8_t' object is not iterable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 193, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1704, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1741, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service await service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 680, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 964, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 717, in _handle_entity_call await result File "/usr/src/homeassistant/homeassistant/components/zha/climate.py", line 413, in async_set_hvac_mode if await self._thrm.async_set_operation_mode(HVAC_MODE_2_SYSTEM[hvac_mode]): File "/usr/src/homeassistant/homeassistant/components/zha/core/channels/hvac.py", line 243, in async_set_operation_mode if not await self.write_attributes({"system_mode": mode}): File "/usr/src/homeassistant/homeassistant/components/zha/core/channels/hvac.py", line 298, in write_attributes return self.check_result(res) File "/usr/src/homeassistant/homeassistant/components/zha/core/channels/hvac.py", line 306, in check_result return all(record.status == Status.SUCCESS for record in res[0]) TypeError: 'uint8_t' object is not iterable 2022-06-12 22:50:47 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0xD789](Super TR): Device seen - marking the device available and resetting counter 2022-06-12 22:50:47 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0xD789](Super TR): Update device availability - device available: True - new availability: True - changed: False ```

The Status.UNSUP_MANUF_GENERAL_COMMAND seems suspect to me.

torge70 commented 2 years ago

I have just added this thermostat to HA. Only 2 sensors showed up, all unavailable. I have downloaded the quirk from #1638 above and installed it in custom_zha_quirks folder. HA now shows 7 sensors but they are all unknown/unavailable.

image

torge70 commented 2 years ago

I have installed the latest "smart_super_thermostat.py" from github in custom_zha_quirks. I can control the device from HA but reading data does not work correctly. Most entities returns no correct data and if i toggle og change setting on the thermostat, it's not updated in HA. I have tried to read the code or find documentation on how quirks work but I'm stuck.

How can I help getting the thermostat to work in HA?

bendikrb commented 2 years ago

Still not working after #1638 (I have tried removing the device, restarting and then re-added it). The climate entity now shows hvac state/mode and temperature, but I'm not able to adjust temperature or set hvac mode.

Screenshot_20220711-192319_Home Assistant

Screenshot_20220711-192925_Home Assistant