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
694 stars 639 forks source link

[BUG] Curtain motor _TZE200_r0jdjrvi has no entities #1953

Open caradas opened 1 year ago

caradas commented 1 year ago

Describe the bug Curtain motor has no entities.

Expected behavior Entities for opening and closing curtain and if possible slider to set partially closed

```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=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, 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": "0x0051", "in_clusters": [ "0x0000", "0x0004", "0x0005", "0xef00" ], "out_clusters": [ "0x000a", "0x0019" ] }, "242": { "profile_id": 41440, "device_type": "0x0061", "in_clusters": [], "out_clusters": [ "0x0021" ] } }, "manufacturer": "_TZE200_r0jdjrvi", "model": "TS0601", "class": "zigpy.device.Device" } ````
```yaml { "home_assistant": { "installation_type": "Home Assistant OS", "version": "2022.11.4", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.10.7", "docker": true, "arch": "x86_64", "timezone": "Europe/Berlin", "os_name": "Linux", "os_version": "5.15.74", "supervisor": "2022.10.2", "host_os": "Home Assistant OS 9.3", "docker_version": "20.10.18", "chassis": "vm", "run_as_root": true }, "custom_components": {}, "integration_manifest": { "domain": "zha", "name": "Zigbee Home Automation", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/zha", "requirements": [ "bellows==0.34.2", "pyserial==3.5", "pyserial-asyncio==0.6", "zha-quirks==0.0.86", "zigpy-deconz==0.19.0", "zigpy==0.51.5", "zigpy-xbee==0.16.2", "zigpy-zigate==0.10.3", "zigpy-znp==0.9.1" ], "usb": [ { "vid": "10C4", "pid": "EA60", "description": "*2652*", "known_devices": [ "slae.sh cc2652rb stick" ] }, { "vid": "1A86", "pid": "55D4", "description": "*sonoff*plus*", "known_devices": [ "sonoff zigbee dongle plus v2" ] }, { "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": "0403", "pid": "6015", "description": "*zigate*", "known_devices": [ "ZiGate+" ] }, { "vid": "10C4", "pid": "EA60", "description": "*zigate*", "known_devices": [ "ZiGate" ] }, { "vid": "10C4", "pid": "8B34", "description": "*bv 2010/10*", "known_devices": [ "Bitron Video AV2010/10" ] } ], "codeowners": [ "@dmulcahey", "@adminiuga", "@puddly" ], "zeroconf": [ { "type": "_esphomelib._tcp.local.", "name": "tube*" }, { "type": "_zigate-zigbee-gateway._tcp.local.", "name": "*zigate*" }, { "type": "_zigstar_gw._tcp.local.", "name": "*zigstar*" } ], "dependencies": [ "file_upload" ], "after_dependencies": [ "onboarding", "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": 46434, "manufacturer": "_TZE200_r0jdjrvi", "model": "TS0601", "name": "_TZE200_r0jdjrvi TS0601", "quirk_applied": false, "quirk_class": "zigpy.device.Device", "manufacturer_code": 4417, "power_source": "Mains", "lqi": 28, "rssi": null, "last_seen": "2022-11-22T00:55:09", "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=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, 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": "0x0051", "in_clusters": [ "0x0000", "0x0004", "0x0005", "0xef00" ], "out_clusters": [ "0x000a", "0x0019" ] }, "242": { "profile_id": 41440, "device_type": "0x0061", "in_clusters": [], "out_clusters": [ "0x0021" ] } } }, "active_coordinator": false, "entities": [], "neighbors": [], "endpoint_names": [ { "name": "SMART_PLUG" }, { "name": "unknown 97 device_type of 0xa1e0 profile id" } ], "user_given_name": null, "device_reg_id": "b43e549ed833f2c0c88589cb86a72fa1", "area_id": "schlafzimmer", "cluster_details": { "1": { "device_type": { "name": "SMART_PLUG", "id": 81 }, "profile_id": 260, "in_clusters": { "0x0004": { "endpoint_attribute": "groups", "attributes": {}, "unsupported_attributes": {} }, "0x0005": { "endpoint_attribute": "scenes", "attributes": {}, "unsupported_attributes": {} }, "0xef00": { "endpoint_attribute": null, "attributes": {}, "unsupported_attributes": {} }, "0x0000": { "endpoint_attribute": "basic", "attributes": { "0x0001": { "attribute_name": "app_version", "value": 70 }, "0x0004": { "attribute_name": "manufacturer", "value": "_TZE200_r0jdjrvi" }, "0x0005": { "attribute_name": "model", "value": "TS0601" } }, "unsupported_attributes": {} } }, "out_clusters": { "0x0019": { "endpoint_attribute": "ota", "attributes": {}, "unsupported_attributes": {} }, "0x000a": { "endpoint_attribute": "time", "attributes": {}, "unsupported_attributes": {} } } }, "242": { "device_type": { "name": "unknown", "id": 97 }, "profile_id": 41440, "in_clusters": {}, "out_clusters": { "0x0021": { "endpoint_attribute": "green_power", "attributes": {}, "unsupported_attributes": {} } } } } } } ````

According to https://github.com/zigpy/zha-device-handlers/issues/1602#issuecomment-1322763054 its already fixed.

bschmidt006 commented 9 months ago

In case is helps someone in the future, I was able to use the above quirk to integrate a different model number: _TZE200_xu4a5rhj

I simply changed the model number in the quirk from _TZE200_r0jdjrvi to _TZE200_xu4a5rhj.

Open/Stop/Close seems to work fine.

I did have to set the motor reverse flag to get those going the correct direction.

KirkKirk commented 9 months ago

Hello, guys.

I was having problem pairing and using a similar model curtain motor. But the the quirk file that @danidask posted on his last comment worked like a charm. I just had to change TZE200 to TZE204 on line 261, because my motor model is _TZE204_r0jdjrvi.

The one thing that still isn't working is the curtain state whenever i use the set_position service (either by calling it manually or by selecting the appropriate position on the scroller in the UI).

If click on the half of the bar (50%) and the curtain goes to that position, the state of the curtain keeps on "Opening" forever. I have to click the Stop button for the state to change to Open. The same thing happens with the Closing state.

Is there a way to fix this?

Hi @utech-git We have the same model (_TZE204_r0jdjrvi) and have encountered the same issue. I don't use rails and the only solution I have found is to set limits by forcing the motor to stop. However, I have to do this every time after a power outage because the motor forgets the limits. Have you found any other solution to set the limits?

utech-git commented 9 months ago

Hello, guys. I was having problem pairing and using a similar model curtain motor. But the the quirk file that @danidask posted on his last comment worked like a charm. I just had to change TZE200 to TZE204 on line 261, because my motor model is _TZE204_r0jdjrvi. The one thing that still isn't working is the curtain state whenever i use the set_position service (either by calling it manually or by selecting the appropriate position on the scroller in the UI). If click on the half of the bar (50%) and the curtain goes to that position, the state of the curtain keeps on "Opening" forever. I have to click the Stop button for the state to change to Open. The same thing happens with the Closing state. Is there a way to fix this?

Hi @utech-git We have the same model (_TZE204_r0jdjrvi) and have encountered the same issue. I don't use rails and the only solution I have found is to set limits by forcing the motor to stop. However, I have to do this every time after a power outage because the motor forgets the limits. Have you found any other solution to set the limits?

Well, every time after a power outage it loses the limits. But I don't do anything to get the limits back. Once the power is back, the first time I open the curtain it goes slowly to the beggining of the rail and when it reachs it automatically knows where the start limit is. The same way when I first close the curtain, it goes to the end of the rail and set the finish limit. And there it goes.

It knows where the end/beggining is when it feels resistance and can't go any further (just like you said when you force the motor to stop).

utech-git commented 9 months ago

In case is helps someone in the future, I was able to use the above quirk to integrate a different model number: _TZE200_xu4a5rhj

I simply changed the model number in the quirk from _TZE200_r0jdjrvi to _TZE200_xu4a5rhj.

Open/Stop/Close seems to work fine.

I did have to set the motor reverse flag to get those going the correct direction.

Could you please tell me how to set this "reverse flag"? I couldnt find it on the ZHA. I had to first pair the motor on a tuya zigbee gateway, set the reverse flag on the tuya app, then delete it from tuya and pair on ZHA.

bschmidt006 commented 9 months ago

In case is helps someone in the future, I was able to use the above quirk to integrate a different model number: _TZE200_xu4a5rhj I simply changed the model number in the quirk from _TZE200_r0jdjrvi to _TZE200_xu4a5rhj. Open/Stop/Close seems to work fine. I did have to set the motor reverse flag to get those going the correct direction.

Could you please tell me how to set this "reverse flag"? I couldnt find it on the ZHA. I had to first pair the motor on a tuya zigbee gateway, set the reverse flag on the tuya app, then delete it from tuya and pair on ZHA.

In ZHA - select the device. Under device info - hit the 3 dots -> Manage zigbee device.

  1. Ensure you're on the CLUSTERS tab.
  2. Select the TuyaWindowCovering cluster.
  3. Select the motor_steering attribute
  4. Read attribute to see what it's set to.
  5. Flip the value if needed and hit Write Attribute.

This is reflect in the quirk here:

            0xF002: ("motor_steering", t.enum8, True),  # 0: default, 1: reverse
KirkKirk commented 9 months ago

Hello, guys. I was having problem pairing and using a similar model curtain motor. But the the quirk file that @danidask posted on his last comment worked like a charm. I just had to change TZE200 to TZE204 on line 261, because my motor model is _TZE204_r0jdjrvi. The one thing that still isn't working is the curtain state whenever i use the set_position service (either by calling it manually or by selecting the appropriate position on the scroller in the UI). If click on the half of the bar (50%) and the curtain goes to that position, the state of the curtain keeps on "Opening" forever. I have to click the Stop button for the state to change to Open. The same thing happens with the Closing state. Is there a way to fix this?

Hi @utech-git We have the same model (_TZE204_r0jdjrvi) and have encountered the same issue. I don't use rails and the only solution I have found is to set limits by forcing the motor to stop. However, I have to do this every time after a power outage because the motor forgets the limits. Have you found any other solution to set the limits?

Well, every time after a power outage it loses the limits. But I don't do anything to get the limits back. Once the power is back, the first time I open the curtain it goes slowly to the beggining of the rail and when it reachs it automatically knows where the start limit is. The same way when I first close the curtain, it goes to the end of the rail and set the finish limit. And there it goes.

It knows where the end/beggining is when it feels resistance and can't go any further (just like you said when you force the motor to stop).

Thank you for your response. In my situation, I have vertical curtains that do not have a physical limit when they are lowered, so I need to force them to stop. I was wondering if it is possible to save the limits in Home Assistant or somewhere else, so that they can be uploaded in case of a power outage.

utech-git commented 9 months ago

In case is helps someone in the future, I was able to use the above quirk to integrate a different model number: _TZE200_xu4a5rhj I simply changed the model number in the quirk from _TZE200_r0jdjrvi to _TZE200_xu4a5rhj. Open/Stop/Close seems to work fine. I did have to set the motor reverse flag to get those going the correct direction.

Could you please tell me how to set this "reverse flag"? I couldnt find it on the ZHA. I had to first pair the motor on a tuya zigbee gateway, set the reverse flag on the tuya app, then delete it from tuya and pair on ZHA.

In ZHA - select the device. Under device info - hit the 3 dots -> Manage zigbee device.

  1. Ensure you're on the CLUSTERS tab.
  2. Select the TuyaWindowCovering cluster.
  3. Select the motor_steering attribute
  4. Read attribute to see what it's set to.
  5. Flip the value if needed and hit Write Attribute.

This is reflect in the quirk here:

            0xF002: ("motor_steering", t.enum8, True),  # 0: default, 1: reverse

I did try to change this "True" to "False" on the quirk, at first. But nothing happened.

Now I tried on the Manage Zigbee Device menu... when I click "Read Attribute" it shows "None". I try to write attribute to 0 or 1, but when I read it again it continues "None" and the motor is still not reversed.

Maybe it doesn't work with this model, but thanks any way! :)

Onepamopa commented 9 months ago

@utech-git works fine with zigbee2mqtt ... I'm using it until zha gets enough supported devices working properly ....

ATaylor5596 commented 6 months ago

I have a similar motor, model TZE200_idkvxabg. Thanks to everyone here I was able to get it to work with the most recent quirk, however, my open/close percentage stays out of sync with the remote control. Switching the motor direction will always have the remote and HA be opposite controls. Does anyone have any idea how to invert the display percentages?

IntegersOfK commented 4 months ago

In case is helps someone in the future, I was able to use the above quirk to integrate a different model number: _TZE200_xu4a5rhj I simply changed the model number in the quirk from _TZE200_r0jdjrvi to _TZE200_xu4a5rhj. Open/Stop/Close seems to work fine. I did have to set the motor reverse flag to get those going the correct direction.

Could you please tell me how to set this "reverse flag"? I couldnt find it on the ZHA. I had to first pair the motor on a tuya zigbee gateway, set the reverse flag on the tuya app, then delete it from tuya and pair on ZHA.

In ZHA - select the device. Under device info - hit the 3 dots -> Manage zigbee device.

  1. Ensure you're on the CLUSTERS tab.
  2. Select the TuyaWindowCovering cluster.
  3. Select the motor_steering attribute
  4. Read attribute to see what it's set to.
  5. Flip the value if needed and hit Write Attribute.

This is reflect in the quirk here:

            0xF002: ("motor_steering", t.enum8, True),  # 0: default, 1: reverse

I did try to change this "True" to "False" on the quirk, at first. But nothing happened.

Now I tried on the Manage Zigbee Device menu... when I click "Read Attribute" it shows "None". I try to write attribute to 0 or 1, but when I read it again it continues "None" and the motor is still not reversed.

Maybe it doesn't work with this model, but thanks any way! :)

I have the same issue, _TZE204_r0jdjrvi model doesn't appear to accept any 0, 1, True, or False for reversing the motor. I wonder if there's a way to tell Home Assistant to treat it as the opposite. Did you figure out any other way to deal with that? I do have a remote but there's nothing described on the docs as to how one might reverse it on the device itself.