-
-
Notifications
You must be signed in to change notification settings - Fork 29.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZHA Tuya attribute missing in TS130F curtain module #46146
Comments
Hi, |
Same thing here, not possible to make any calibration without this feature implemented :-( |
Same here. The modul is unusefull if cannot be calibrated. |
Same here, looking forward to updates! |
Same issue here, without calibration I don't know were my cover position is. |
If i understand the quirks documentation, we need to modify this file : i try to edit the line 71 to add ("_TZ3000_vd43bbfq", "TS130F"), but the quirks don't look like to be used. any idea how to check if quirks are used ? |
All information in the On the device card and the last line of the device info you is getting the quirk is one is loaded or not: |
If you is getting it working with adding the model id to the signature and its working OK pleas do one PR for adding it in the quirk so other user can using there device 2 :-)) I can being that you need splitting the line to one record / line like this (example from valve.py):
|
For testing quirks look in the wiki how to using / editing local quirks zigpy/zha-device-handlers#693 (comment). Its looks like @moritan was using this quirk #46146 (comment) and fixing the signature and it was working for him. |
Sorry, i didn't have time to give news. And according to this one (zigpy/zha-device-handlers#902), there is 4 differents type of model; I will try to confirm it later( because i don't test this version) but this file should be ok |
can't get this working, did add to config:
Add file /config/custom_zha_quirks/tuya/ts130f.py with your adjustment, but when I restart has I don't get the calibration option my signature is:
|
I didn't have used the "custom_quirks_path". Based on this wiki [ here ] :
Hope this will help |
i confirm the previous procedure work for me |
thank, I use OS 6.1 on a blue, can't find the site-packages folder. |
The good news is that all the action can be done from the same screen. So :
It's done. |
Sorry but what is a blue ? |
@ViperRNMC in you configure folder its in the |
it looks like it's a standard installation, so you should be able to ssh in the system and open a docker bash console. |
found it, but... OS 6.1 has Python 3.7.3 and I found in de folder deps after install zha-quirks package /config/deps/lib/python3.8/site-packages/zhaquirks/ and no folder Tuya |
Then you is in the OS (rasbian or woth they is running on the blue have older python then the HA container). If you have portainer installed then is the homeassiistant container you shall open the CLI in. Containers is virtual so they can having complete different things installed also different versions of files then the OS or other containers. |
Just wanted to confirm that the modified quirk works for me too. |
Thank you! |
Hello, and thanks everybody for the contribution on this topic. Thanks, Àngel |
thank you so much |
I have a problem with this device, I do not know if it also happens to you, I have it calibrated, and it works correctly sometimes, but for example if I tell Google to open at 50%, it opens it, it stops but nevertheless in the HA interface it still appears to me that it continues to rise, I have to press manual STOP so that it appears open at 50%, does it also happen to you? |
I have not tested with google yet, that is to be done when possible. But i got mine perfectly working and calibrated. |
Can you tell me the firmware version you have installed on the module? |
I would also appreciate the firmware version, as I would like to buy some zigbee blind actors and they all seem to use the same tuya module which has this weird flaw that it doesn't compensate for longer opening times as opposed to closing, therefore not opening all the way. Not looking forward to waiting weeks for them to ship, just to find out they don't work correctly :D |
This drives me mad aswell, there are few interesting parameters in ToyaCoveringCluster - did you give any of them a try?
|
I cannot set acceleration_time_lift or velocity_lift. They seem to be read only. Maybe this was planned and never implemented. |
I'm using a Nous L12Z Curtain Module. It shows up as TS130F in ZHA, so I guess it is a duplicate model. I don't see a way to calibrate it in the cluster settings. Any idea what I could try to make it work? This is the signature:
I see the following in debug:
All help appreciated! |
@Braintelligence The Nous L12Z (_TZ3000_jwv3cwak) seems to work (got the TuyaCoveringCluster and was able to calibrate) with the following custom quirk:
|
That sounds awesome. Will try it out later. Do you think it might be included in a future update? |
Thanks @etienn01 Here is my minimal working custom quirk script for reference if anyone wants to set it up as well: """Device handler for loratap TS130F smart curtain switch."""
from zigpy.profiles import zha#, zgp
from zigpy.quirks import CustomCluster, CustomDevice
import zigpy.types as t
from zigpy.zcl.clusters.closures import WindowCovering
from zigpy.zcl.clusters.general import (
Basic,
GreenPowerProxy,
Groups,
OnOff,
Ota,
Scenes,
Time,
Identify,
)
from zhaquirks.const import (
DEVICE_TYPE,
ENDPOINTS,
INPUT_CLUSTERS,
MODEL,
OUTPUT_CLUSTERS,
PROFILE_ID,
)
from zhaquirks.tuya import SwitchBackLight, TuyaZBExternalSwitchTypeCluster
ATTR_CURRENT_POSITION_LIFT_PERCENTAGE = 0x0008
CMD_GO_TO_LIFT_PERCENTAGE = 0x0005
class MotorMode(t.enum8):
"""Tuya motor mode enum."""
STRONG_MOTOR = 0x00
WEAK_MOTOR = 0x01
class TuyaCoveringCluster(CustomCluster, WindowCovering):
"""TuyaSmartCurtainWindowCoveringCluster: Allow to setup Window covering tuya devices."""
attributes = WindowCovering.attributes.copy()
attributes.update({0x8000: ("motor_mode", MotorMode)})
attributes.update({0xF000: ("tuya_moving_state", t.enum8)})
attributes.update({0xF001: ("calibration", t.enum8)})
attributes.update({0xF002: ("motor_reversal", t.enum8)})
attributes.update({0xF003: ("calibration_time", t.uint16_t)})
def _update_attribute(self, attrid, value):
if attrid == ATTR_CURRENT_POSITION_LIFT_PERCENTAGE:
# Invert the percentage value (cf https://github.com/dresden-elektronik/deconz-rest-plugin/issues/3757)
value = 100 - value
super()._update_attribute(attrid, value)
async def command(
self, command_id, *args, manufacturer=None, expect_reply=True, tsn=None
):
"""Override default command to invert percent lift value."""
if command_id == CMD_GO_TO_LIFT_PERCENTAGE:
percent = args[0]
# Invert the percentage value (cf https://github.com/dresden-elektronik/deconz-rest-plugin/issues/3757)
percent = 100 - percent
v = (percent,)
return await super().command(command_id, *v)
return await super().command(
command_id,
*args,
manufacturer=manufacturer,
expect_reply=expect_reply,
tsn=tsn
)
class TuyaNousTS130F(CustomDevice):
"""Tuya Nous smart curtain roller shutter."""
signature = {
MODEL: "TS130F",
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.WINDOW_COVERING_DEVICE,
INPUT_CLUSTERS: [
Basic.cluster_id,
Identify.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
WindowCovering.cluster_id,
],
OUTPUT_CLUSTERS: [Ota.cluster_id],
},
},
}
replacement = {
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.WINDOW_COVERING_DEVICE,
INPUT_CLUSTERS: [
Basic.cluster_id,
Identify.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
TuyaCoveringCluster,
],
OUTPUT_CLUSTERS: [Ota.cluster_id],
},
},
} I hope this might find its way into the base code soon as well. The Nous L12Z seems to be the cheapest zigbee curtain module I could find in my country. |
I am trying to calibrate the Nous L12Z. Using the custom quirk script I was able to access the TuyaCoveringCluster for the first time. I am also able to read the calibration time. However, it seems to be a read only value. How can the calibration be accomplished? In addition, some attribute values seem odd, e.g. calibration. I would expect a 1 or 0. |
@nilsharm ignore calibration, you need to set calibration time. Works just fine for me. |
@Braintelligence thanks for replying so quickly. |
Does it work for you? It used to work for me but looks like calibration_time does not change afterwards. |
Works flawlessly |
@nilsharm @Braintelligence I meant I have one controller on which it used to work, installed 3 new and calibration does not activate on any of them after setting |
No one said to use |
No one says you (or anyone) said to use But you do you, I won't be the internet police to say people what to do! :) Anyways, despite @Braintelligence saying 'explicitly' not to use the I am trying to find out what changed, I am aware that you can workaround by measuring and entering the |
Ok, so first you ask (with a big X/Y-problem behind your intention, as you confirmed in your follow-up): Yes, everything we need the custom quirk for the Nous L12Z for (in other words: making the curtains open, close and everything in-between) works flawlessly. Since you didn't specify any other parameters we have to assume you're connecting to exactly that discussion here. Since many people had problems with I did tell to specifically ignore If you really want to be that daredevil who'll rather fimble around with If you're following the guide on how to do the calibration within this issue (for example making sure that your curtain is completely open before starting calibration), then I guess your curtain modules either aren't capable of it or the quirk has to be changed. None of my 10+ Nous L12Z works with calibration, and I also don't need it because it doesn't solve any problem for me. Have a nice day ;) |
You too! (And there's your thumbs up aswell!) |
If you can provide a list of all the curtain module signatures that you use we might get a hint on why You said your first controller If it's the same model it might be a firmware issue. If the newer controllers you bought are different models then I'm >90 % sure that they're just incapable of using There just has to be a reason why they are so much cheaper than other TS130F variants here. |
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. |
The problem
Not able to calibrate TS130F based Zigbee curtain module (e.g. https://zigbee.blakadder.com/Lonsonho_TS130F.html) in ZHA because the ZHA cluster and its attributes are missing. This attribute contains the calibration.
This is Calibration (0xF001)
What is version of Home Assistant Core has the issue?
core-2021.2.0
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
ZHA
Link to integration documentation on our website
https://www.home-assistant.io/integrations/zha/
Example YAML snippet
# Put your YAML below this line
Anything in the logs that might be useful for us?
# Put your logs below this line
The text was updated successfully, but these errors were encountered: