jacekk015 / zha_quirks

All quirks in one place
MIT License
144 stars 20 forks source link

Cannot change temperature in _TZE200_z1tyspqw #51

Closed Vindigo19 closed 1 month ago

Vindigo19 commented 8 months ago

Recently I updated custom quirk for the device and it looks like cannot change temperature. Here are my logs from HA (integration under ZHA):

2024-03-12 16:40:37.644 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [2756668008] Failed to send request: Request failed after 5 attempts: <Status.NWK_NO_ROUTE: 205> Traceback (most recent call last): File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/components/zha/core/cluster_handlers/init.py", line 64, in wrap_zigpy_exceptions yield File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/components/zha/core/cluster_handlers/init.py", line 84, in wrapper return await RETRYABLE_REQUEST_DECORATOR(func)(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/srv/homeassistant/lib/python3.12/site-packages/zigpy/util.py", line 138, in retry return await func() ^^^^^^^^^^^^ File "/srv/homeassistant/lib/python3.12/site-packages/zhaquirks/tuya/init.py", line 739, in write_attributes await self.endpoint.tuya_manufacturer.write_attributes( File "/srv/homeassistant/lib/python3.12/site-packages/zhaquirks/tuya/init.py", line 518, in write_attributes await super().command( File "/srv/homeassistant/lib/python3.12/site-packages/zigpy/quirks/init.py", line 199, in command return await self.request( ^^^^^^^^^^^^^^^^^^^ File "/srv/homeassistant/lib/python3.12/site-packages/zigpy/zcl/init.py", line 377, in request return await self._endpoint.request( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/srv/homeassistant/lib/python3.12/site-packages/zigpy/endpoint.py", line 253, in request return await self.device.request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/srv/homeassistant/lib/python3.12/site-packages/zigpy/device.py", line 299, in request await self._application.request( File "/srv/homeassistant/lib/python3.12/site-packages/zigpy/application.py", line 829, in request await self.send_packet( File "/srv/homeassistant/lib/python3.12/site-packages/zigpy_znp/zigbee/application.py", line 1097, in send_packet raise DeliveryError( zigpy.exceptions.DeliveryError: Request failed after 5 attempts: <Status.NWK_NO_ROUTE: 205>

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/components/websocket_api/commands.py", line 238, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/core.py", line 2067, in async_call response_data = await coro ^^^^^^^^^^ File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/core.py", line 2104, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/entity_component.py", line 272, in handle_service return await service.entity_service_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/service.py", line 878, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/service.py", line 948, in _handle_entity_call result = await task ^^^^^^^^^^ File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/components/climate/init.py", line 632, in async_service_temperature_set await entity.async_set_temperature(**kwargs) File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/components/zha/climate.py", line 459, in async_set_temperature await self._thrm.async_set_heating_setpoint( File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/components/zha/core/cluster_handlers/hvac.py", line 251, in async_set_heating_setpoint await self.write_attributes_safe({attr: temperature}) File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/components/zha/core/cluster_handlers/init.py", line 518, in write_attributes_safe res = await self.write_attributes(attributes, manufacturer=manufacturer) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/components/zha/core/cluster_handlers/init.py", line 83, in wrapper with wrap_zigpy_exceptions(): File "/usr/local/lib/python3.12/contextlib.py", line 155, in exit self.gen.throw(value) File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/components/zha/core/cluster_handlers/init.py", line 75, in wrap_zigpy_exceptions raise HomeAssistantError(message) from exc homeassistant.exceptions.HomeAssistantError: Failed to send request: Request failed after 5 attempts: <Status.NWK_NO_ROUTE: 205>

jacekk015 commented 8 months ago

Quirk has nothing to do with that error Failed to send request: Request failed after 5 attempts: <Status.NWK_NO_ROUTE: 205> Zigbee coordinator says that there's no route to the device. First try to pair device again without removing from the ZHA network. If that doesn't help you need to remove device first and pair it like a brand new.

MattWestb commented 8 months ago

If that doesn't help you need to remove device first and pair it like a brand new.

Wait one minute after deleting the device so ZHA is writing the changes in the database or restart HA (you see if its being added new if doing one real initiating then its pairing) or ZHA is using the old cashed information = not being good.

Also look on the zigbee map witch parent the device is having and if its one good or bad router (Bad = Osram plugs).

Vindigo19 commented 8 months ago

Thanks for advices :) I did restart and repairing between coordinator and device. Finally connected, but on the way there were many notices and I'm not sure if everything is set correctly.

Logs in attachment.

logs__TZE200_z1tyspqw.txt

jacekk015 commented 8 months ago

Errors come from SQL recorder - you've got some database issues, duplicates somewhere. Maybe Developer Tools -> Statistics can show something to Repair.

For the TRV - you just have a very, very bad signal LQI=25. LQI=18 and 21 was also seen in the logs. Probably min is something 60-80, best to keep over 100.

2024-03-12 16:58:15.007 DEBUG (MainThread) [zigpy_znp.api] Received command: AF.IncomingMsg.Callback(GroupId=0x0000, ClusterId=61184, SrcAddr=0x2E19, SrcEndpoint=1, DstEndpoint=1, WasBroadcast=<Bool.false: 0>, LQI=25, SecurityUse=<Bool.false: 0>, TimeStamp=1732545, TSN=0, Data=b'\x09\x39\x02\x00\x1E\x0F\x02\x00\x04\x00\x00\x00\x96', MacSrcAddr=0x2E19, MsgResultRadius=29)

Router device[mains powered] or repeater is needed. I'm using 2 of these IKEA repeaters https://www.ikea.com/pl/pl/p/tradfri-wzmacniacz-sygnalu-10400408/ You just pair it to closest Zigbee device[or coordinator] and that's it. You also have an USB charger, if needed.