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
752 stars 689 forks source link

[Device Support Request] TS0601 _TZE200_a4bpgplm tuya trv #1159

Closed joaoasilva closed 1 year ago

joaoasilva commented 2 years ago

Is your feature request related to a problem? Please describe. Bought this thermostat from AliExpress looking at this https://zigbee.blakadder.com/Haozee_TRV601.html that says it works with ZHA but it doesn't. It's possible to get the temperature and set but most of the stuff doesn't work.

Describe the solution you'd like For it to work ex: window status, schedule, turn on/off.

Someone already converted it successfully to work on HA but I don't understand how can I port that to ZHA here: https://github.com/Koenkk/zigbee-herdsman-converters/blob/245fc8273e3afac8d71ec196d0e3ae71e413cba9/lib/tuya.js#L426

Please help. Thanks

jacekk015 commented 1 year ago

@berowicz @alessioprescenzo Try newest quirk ts0601_trv_rtitek.py file from https://github.com/jacekk015/zha_quirks HA restart is mandatory after file replacement.

berowicz commented 1 year ago

@jacekk015 Thank you for your help.

After adding the quirk its looking line this:

TRVquirk

When I change the temperature, I hear the TRV for a very short time. So its reacting. But in HA the temperature gets back to 15 degree. Also the "connected" logo is blinking in the display the whole time. Its looking like the pairing process.

Also the temperature is everytime the same. Only after pairing its right. But after this, it doesnt change.

I dont have any idea, what Im making wrong

jacekk015 commented 1 year ago

Logs needed. Change the temp. Wait up to 10 minutes. Post logs as file

berowicz commented 1 year ago

Here is my log:

https://pastebin.com/xvvZpUgw

I put the newest quirk from your github into /config/zha_quirks/ts0601_trv_rtitek.py

In the configuration.yaml I add:

zha:
  database_path: /config/zigbee.db 
  enable_quirks: true
  custom_quirks_path: /config/zha_quirks/

After this I restartet HA and start to search for new devices. I used a brandnew and newer paired TRV (I have 3pcs of them)

When I change the temperature in HA, I see it in the OLED Display that it change. But in HA the temperature gets back to the old value (20 degree) and dont show me that its heating.

Maybe you see something in the log

jacekk015 commented 1 year ago

Your log contains no HA->TRV data. You've posted only 2 minutes of the log - I've asked for 10 minutes.

Again Restart HA. Change temp in HA for only one TRV. Wait up to 10 minutes. Post HA logs as a file.

berowicz commented 1 year ago

@jacekk015 , here is my log. I restartet HA, waited some minutes that everything start, and change the temperature of the TRV

https://pastes.io/qljxryuowm

jacekk015 commented 1 year ago

Do you have DEBUG log level enabled like in the link? https://github.com/jacekk015/zha_quirks#in-case-of-errors-or-to-support-new-function

I don't see some entries which should be in the logs. If not change that debug level and do same again. Log looks OK. I see sending data to TRV, but TRV should respond with confirmation of the temp change. Without that confirmation from TRV HA sets the temp back - it treats it like the TRV didn't get it.

You LQI[Link quality] is kinda strange. 255 that's max. Like the TRV is just next to Zigbee coordinator antenna. Is that correct?

berowicz commented 1 year ago

Yes, its enabled:

config

Yes, its next to the raspberry (2m)

https://user-images.githubusercontent.com/131204280/234385249-f6544bf5-d266-448e-98c1-3fed9826adf1.mp4

@jacekk015 , please look on the video. This is my problem. The temperature that I set is going back to 15 degree every time after I set in. But in the display of the TRV it changes. So its working.

I tried an other browser and with my phone (HA app) but its everytime the same problem.

Also the temperature is not right. Only after repairing its reading the actual temperature but then it freez

jacekk015 commented 1 year ago

Only errors that I see in the logs are that the TRV ask for time update again and again. It's possible that because of that initialization process didn't end well on pairing process. So replace quirk with newest version. Restart HA. Remove TRV from HA Pair like a brand new. Wait 10 minutes. Post the logs from HA We will see if the pairing process is OK.

alessioprescenzo commented 1 year ago

Only errors that I see in the logs are that the TRV ask for time update again and again.

It's possible that because of that initialization process didn't end well on pairing process.

So replace quirk with newest version.

Restart HA.

Remove TRV from HA

Pair like a brand new.

Wait 10 minutes.

Post the logs from HA

We will see if the pairing process is OK.

Hi, I think I can add some useful infos, the time initialization seems to cause some problem, as I (think) I stated above, when I pair the TRV with zha the time isn't set (on the device) tho I see the entities but interaction with them doesn't work, with z2m the time is set the entities are loaded and I can interact with them normally.

alessioprescenzo commented 1 year ago

Hi, @jacekk015 I tried the latest quirk from your repo, indeed now the time is set, and the TRV is responsive, I didn't even need to re-pair the device.

jacekk015 commented 1 year ago

Nice to hear that! It's because those Chinese create a firmware that sends wrong Manufacturer ID. So when HA send a command, using that ID, TRV responds with Unsupported Cluster error.

berowicz commented 1 year ago

@jacekk015 , its working now with your newest quirk. Thank you soooo much ! I have three of the TRV's. Now I want add the two other ones too. Its the same procedure ? Only searching for new devices in ZHA ?

jacekk015 commented 1 year ago

Yes. But on normal HA work remember to disable that DEBUG logging and restart HA. Without that your log will by crazy big after a week.

berowicz commented 1 year ago

@jacekk015 , okay thank you.

Is it possible that there is another bug ? When I change the temperature, only the the TRV refresh the actual temperature (20,1 degree). I ask because I set to 25 degree an wait for some minutes and nothing change. After I set the temperature to 26 degree then actual temperature change to 20,5 degree. How often HA refresh the temperature in the dashboard ? Maybe I should wait longer ?

jacekk015 commented 1 year ago

TRV updates room temperature as often as Chinese engineer wrote it in the firmware. HA has nothing to do. HA is just hearing. If TRV say's nothing HA can't hear it. There were some TRVs that updated room temp after hours. They are battery operated so you know how it goes.

With debug level enabled you can check itself in the logs. Search for attribute: 0x0203 The line should look like the line below - that's 23,5 degrees [divide by 10]

2021-11-19 16:53:37 DEBUG (MainThread) [zhaquirks.tuya] [0xeb37:1:0xef00] Received value [0, 0, 0, 235] for attribute 0x0203 (command 0x0001)
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.