question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] TS0601 _TZE200_fzo2pocs Blind Motor Inverted Controls

See original GitHub issue

Describe the bug Zemismart TS0601 _TZE200_fzo2pocs Blind Motorsc connected to Conbee II using ZHA in Home Assistant. When configured out of the box, the position and up/down arrows in home assistant are inverted. I have changed cover_inverted cluster in TuyaWindowCoverControl to Bool.true and the position is now working correctly. However the up and down arrows make the covers open/close inverted and if the blind is fully open or closed, the only way to open it is to change the position.

I’ve tried setting motor_direction both to true and false but neither change the button controls.

To Reproduce Steps to reproduce the behavior:

  1. Pair blind motor
  2. set cover_inverted cluster in TuyaWindowCoverControl to Bool.true (the position will now show correctly)
  3. try to open or close the blind
  4. blind goes the opposite direction to button pressed.

Expected behavior When I press the down/ close button the blind goes down. When I press the open/ up button the blind goes up.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Device Signature:

{ "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress|RxOnWhenIdle|MainsPowered|FullFunctionDevice: 142>, manufacturer_code=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *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": "0x0202", "in_clusters": [ "0x0000", "0x0004", "0x0005", "0x000a", "0x0102", "0xef00" ], "out_clusters": [ "0x0019" ] } }, "manufacturer": "_TZE200_fzo2pocs", "model": "TS0601", "class": "zhaquirks.tuya.ts0601_cover.TuyaZemismartSmartCover0601" }

When I pushed up (which makes the motor go down) and then stop:

2022-01-31 13:10:37 DEBUG (MainThread) [zhaquirks.tuya] 5c:02:72:ff:fe:94:31:fe Sending Tuya Cluster Command.. Manufacturer is _TZE200_fzo2pocs Cluster Command is 0x0000, Arguments are () 2022-01-31 13:10:37 DEBUG (MainThread) [zhaquirks.tuya] 5c:02:72:ff:fe:94:31:fe Sending Tuya Command. Paylod values [endpoint_id : 1, Status : 0, TSN: 0, Command: 0x0401, Function: 0, Data: [1, 0]] 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.zigbee.application] Sending Zigbee request with tsn 1 under 2 request id, data: b'050210010000000104000100' 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] Command Command.aps_data_request (27, 2, 0, <DeconzAddressEndpoint address_mode=2 address=0xC72D endpoint=1>, 260, 61184, 1, b'\x05\x02\x10\x01\x00\x00\x00\x01\x04\x00\x01\x00', 2, 0) 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] APS data request response: [2, <DeviceState.APSDE_DATA_REQUEST_SLOTS_AVAILABLE|2: 34>, 2] 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] Device state changed response: [<DeviceState.128|APSDE_DATA_REQUEST_SLOTS_AVAILABLE|APSDE_DATA_CONFIRM|2: 166>, 0] 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] Command Command.aps_data_confirm (0,) 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] Device state changed response: [<DeviceState.128|APSDE_DATA_REQUEST_SLOTS_AVAILABLE|APSDE_DATA_INDICATION|APSDE_DATA_CONFIRM|2: 174>, 0] 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] APS data confirm response for request with id 2: 00 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] Request id: 0x02 'aps_data_confirm' for <DeconzAddressEndpoint address_mode=ADDRESS_MODE.NWK address=0xc72d endpoint=1>, status: 0x00 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] Command Command.aps_data_indication (1, 1) 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] APS data indication response: [30, <DeviceState.APSDE_DATA_REQUEST_SLOTS_AVAILABLE|2: 34>, <DeconzAddress address_mode=ADDRESS_MODE.NWK address=0x0000>, 1, <DeconzAddress address_mode=ADDRESS_MODE.NWK address=0xc72d>, 1, 260, 61184, b'\x0c\x02\x10\x01\x0b\x00\x00', 0, 175, 255, 114, 227, 195, 0, -37] 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy.zcl] [0xc72d:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=True is_reply=True disable_default_response=False> manufacturer=4098 tsn=1 command_id=Command.Default_Response> 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] 'aps_data_indication' response from <DeconzAddress address_mode=ADDRESS_MODE.NWK address=0xc72d>, ep: 1, profile: 0x0104, cluster_id: 0xef00, data: b'0c0210010b0000' 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] Device state changed response: [<DeviceState.128|APSDE_DATA_REQUEST_SLOTS_AVAILABLE|APSDE_DATA_INDICATION|2: 170>, 0] 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] Command Command.aps_data_indication (1, 1) 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] APS data indication response: [33, <DeviceState.APSDE_DATA_REQUEST_SLOTS_AVAILABLE|2: 34>, <DeconzAddress address_mode=ADDRESS_MODE.NWK address=0x0000>, 1, <DeconzAddress address_mode=ADDRESS_MODE.NWK address=0xc72d>, 1, 260, 61184, b'\t\x08\x01\x00\x00\x01\x04\x00\x01\x00', 0, 175, 255, 114, 227, 195, 0, -37] 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy.zcl] [0xc72d:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=8 command_id=1> 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy.zcl] [0xc72d:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=0, command_id=1025, function=0, data=[1, 0])] 2022-01-31 13:10:37 DEBUG (MainThread) [zhaquirks.tuya] 5c:02:72:ff:fe:94:31:fe Received Attribute Report. Command is 0x0001, Tuya Paylod values[Status : 0, TSN: 0, Command: 0x0401, Function: 0x00, Data: [1, 0]] 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] 'aps_data_indication' response from <DeconzAddress address_mode=ADDRESS_MODE.NWK address=0xc72d>, ep: 1, profile: 0x0104, cluster_id: 0xef00, data: b'09080100000104000100' 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] Device state changed response: [<DeviceState.128|APSDE_DATA_REQUEST_SLOTS_AVAILABLE|APSDE_DATA_INDICATION|2: 170>, 0] 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] Command Command.aps_data_indication (1, 1) 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] APS data indication response: [34, <DeviceState.APSDE_DATA_REQUEST_SLOTS_AVAILABLE|2: 34>, <DeconzAddress address_mode=ADDRESS_MODE.NWK address=0x0000>, 1, <DeconzAddress address_mode=ADDRESS_MODE.NWK address=0xff64>, 1, 260, 0, b'\x18U\n\x01\x00 R\xe2\xff \x15', 0, 175, 255, 186, 225, 195, 0, -57] 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy.zcl] [0xff64:1:0x0000] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=85 command_id=Command.Report_Attributes> 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy.zcl] [0xff64:1:0x0000] ZCL request 0x000a: [[Attribute(attrid=1, value=<TypeValue type=uint8_t, value=82>), Attribute(attrid=65506, value=<TypeValue type=uint8_t, value=21>)]] 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy.zcl] [0xff64:1:0x0000] Attribute report received: app_version=82, 65506=21 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] 'aps_data_indication' response from <DeconzAddress address_mode=ADDRESS_MODE.NWK address=0xff64>, ep: 1, profile: 0x0104, cluster_id: 0x0000, data: b'18550a01002052e2ff2015' 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] Device state changed response: [<DeviceState.128|APSDE_DATA_REQUEST_SLOTS_AVAILABLE|APSDE_DATA_INDICATION|2: 170>, 0] 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] Command Command.aps_data_indication (1, 1) 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] APS data indication response: [33, <DeviceState.APSDE_DATA_REQUEST_SLOTS_AVAILABLE|2: 34>, <DeconzAddress address_mode=ADDRESS_MODE.NWK address=0x0000>, 1, <DeconzAddress address_mode=ADDRESS_MODE.NWK address=0xc72d>, 1, 260, 61184, b'\t\x08\x01\x00\x00\x01\x04\x00\x01\x00', 0, 175, 255, 117, 227, 195, 0, -37] 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy.zcl] [0xc72d:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=8 command_id=1> 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy.zcl] [0xc72d:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=0, command_id=1025, function=0, data=[1, 0])] 2022-01-31 13:10:37 DEBUG (MainThread) [zhaquirks.tuya] 5c:02:72:ff:fe:94:31:fe Received Attribute Report. Command is 0x0001, Tuya Paylod values[Status : 0, TSN: 0, Command: 0x0401, Function: 0x00, Data: [1, 0]] 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] 'aps_data_indication' response from <DeconzAddress address_mode=ADDRESS_MODE.NWK address=0xc72d>, ep: 1, profile: 0x0104, cluster_id: 0xef00, data: b'09080100000104000100' 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] Device state changed response: [<DeviceState.128|APSDE_DATA_REQUEST_SLOTS_AVAILABLE|APSDE_DATA_INDICATION|2: 170>, 0] 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] Command Command.aps_data_indication (1, 1) 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] APS data indication response: [33, <DeviceState.APSDE_DATA_REQUEST_SLOTS_AVAILABLE|2: 34>, <DeconzAddress address_mode=ADDRESS_MODE.NWK address=0x0000>, 1, <DeconzAddress address_mode=ADDRESS_MODE.NWK address=0xc72d>, 1, 260, 61184, b'\t\x08\x01\x00\x00\x01\x04\x00\x01\x00', 0, 175, 255, 117, 227, 195, 0, -38] 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy.zcl] [0xc72d:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=8 command_id=1> 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy.zcl] [0xc72d:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=0, command_id=1025, function=0, data=[1, 0])] 2022-01-31 13:10:37 DEBUG (MainThread) [zhaquirks.tuya] 5c:02:72:ff:fe:94:31:fe Received Attribute Report. Command is 0x0001, Tuya Paylod values[Status : 0, TSN: 0, Command: 0x0401, Function: 0x00, Data: [1, 0]] 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] 'aps_data_indication' response from <DeconzAddress address_mode=ADDRESS_MODE.NWK address=0xc72d>, ep: 1, profile: 0x0104, cluster_id: 0xef00, data: b'09080100000104000100' 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] Device state changed response: [<DeviceState.128|APSDE_DATA_REQUEST_SLOTS_AVAILABLE|APSDE_DATA_INDICATION|2: 170>, 0] 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] Command Command.aps_data_indication (1, 1) 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] APS data indication response: [33, <DeviceState.APSDE_DATA_REQUEST_SLOTS_AVAILABLE|2: 34>, <DeconzAddress address_mode=ADDRESS_MODE.NWK address=0x0000>, 1, <DeconzAddress address_mode=ADDRESS_MODE.NWK address=0xc72d>, 1, 260, 61184, b'\t\x08\x01\x00\x00\x01\x04\x00\x01\x00', 0, 175, 255, 117, 227, 195, 0, -37] 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy.zcl] [0xc72d:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=8 command_id=1> 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy.zcl] [0xc72d:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=0, command_id=1025, function=0, data=[1, 0])] 2022-01-31 13:10:37 DEBUG (MainThread) [zhaquirks.tuya] 5c:02:72:ff:fe:94:31:fe Received Attribute Report. Command is 0x0001, Tuya Paylod values[Status : 0, TSN: 0, Command: 0x0401, Function: 0x00, Data: [1, 0]] 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] 'aps_data_indication' response from <DeconzAddress address_mode=ADDRESS_MODE.NWK address=0xc72d>, ep: 1, profile: 0x0104, cluster_id: 0xef00, data: b'09080100000104000100' 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] Device state changed response: [<DeviceState.128|APSDE_DATA_REQUEST_SLOTS_AVAILABLE|APSDE_DATA_INDICATION|2: 170>, 0] 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] Command Command.aps_data_indication (1, 1) 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] APS data indication response: [33, <DeviceState.APSDE_DATA_REQUEST_SLOTS_AVAILABLE|2: 34>, <DeconzAddress address_mode=ADDRESS_MODE.NWK address=0x0000>, 1, <DeconzAddress address_mode=ADDRESS_MODE.NWK address=0xc72d>, 1, 260, 61184, b'\t\x08\x01\x00\x00\x01\x04\x00\x01\x00', 0, 175, 255, 117, 227, 195, 0, -37] 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy.zcl] [0xc72d:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=8 command_id=1> 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy.zcl] [0xc72d:1:0xef00] ZCL request 0x0001: [Command(status=0, tsn=0, command_id=1025, function=0, data=[1, 0])] 2022-01-31 13:10:37 DEBUG (MainThread) [zhaquirks.tuya] 5c:02:72:ff:fe:94:31:fe Received Attribute Report. Command is 0x0001, Tuya Paylod values[Status : 0, TSN: 0, Command: 0x0401, Function: 0x00, Data: [1, 0]] 2022-01-31 13:10:37 DEBUG (MainThread) [zigpy_deconz.api] 'aps_data_indication' response from <DeconzAddress address_mode=ADDRESS_MODE.NWK address=0xc72d>, ep: 1, profile: 0x0104, cluster_id: 0xef00, data: b'09080100000104000100' 2022-01-31 13:10:38 DEBUG (MainThread) [zigpy_deconz.api] Device state changed response: [<DeviceState.128|APSDE_DATA_REQUEST_SLOTS_AVAILABLE|APSDE_DATA_INDICATION|2: 170>, 0] 2022-01-31 13:10:38 DEBUG (MainThread) [zigpy_deconz.api] Command Command.aps_data_indication (1, 1) 2022-01-31 13:10:38 DEBUG (MainThread) [zigpy_deconz.api] APS data indication response: [36, <DeviceState.APSDE_DATA_REQUEST_SLOTS_AVAILABLE|2: 34>, <DeconzAddress address_mode=ADDRESS_MODE.NWK address=0x0000>, 1, <DeconzAddress address_mode=ADDRESS_MODE.NWK address=0xc72d>, 1, 260, 61184, b'\t\t\x02\x00\x01\x03\x02\x00\x04\x00\x00\x002', 0, 175, 255, 117, 227, 195, 0, -38] 2022-01-31 13:10:38 DEBUG (MainThread) [zigpy.zcl] [0xc72d:1:0xef00] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=True disable_default_response=False> manufacturer=None tsn=9 command_id=2> 2022-01-31 13:10:38 DEBUG (MainThread) [zigpy.zcl] [0xc72d:1:0xef00] ZCL request 0x0002: [Command(status=0, tsn=1, command_id=515, function=0, data=[4, 0, 0, 0, 50])] 2022-01-31 13:10:38 DEBUG (MainThread) [zhaquirks.tuya] 5c:02:72:ff:fe:94:31:fe Received Attribute Report. Command is 0x0002, Tuya Paylod values[Status : 0, TSN: 1, Command: 0x0203, Function: 0x00, Data: [4, 0, 0, 0, 50]] 2022-01-31 13:10:38 DEBUG (MainThread) [zhaquirks.tuya] 5c:02:72:ff:fe:94:31:fe Tuya Attribute Cache : [{8: 50, 32770: 1, 32769: ''}] 2022-01-31 13:10:38 DEBUG (MainThread) [zigpy_deconz.api] 'aps_data_indication' response from <DeconzAddress address_mode=ADDRESS_MODE.NWK address=0xc72d>, ep: 1, profile: 0x0104, cluster_id: 0xef00, data: b'09090200010302000400000032' 2022-01-31 13:10:38 DEBUG (MainThread) [zhaquirks.tuya] 5c:02:72:ff:fe:94:31:fe Sending Tuya Cluster Command.. Manufacturer is _TZE200_fzo2pocs Cluster Command is 0x0002, Arguments are () 2022-01-31 13:10:38 DEBUG (MainThread) [zhaquirks.tuya] 5c:02:72:ff:fe:94:31:fe Sending Tuya Command. Paylod values [endpoint_id : 1, Status : 0, TSN: 0, Command: 0x0401, Function: 0, Data: [1, 1]] 2022-01-31 13:10:38 DEBUG (MainThread) [zigpy_deconz.zigbee.application] Sending Zigbee request with tsn 3 under 4 request id, data: b'050210030000000104000101'

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:15 (13 by maintainers)

github_iconTop GitHub Comments

5reactions
blauretcommented, May 9, 2022

@jameshirka , @dmulcahey,

I would argue the change merged in #1510 is actually a regression and the bug was not there in the first place. Depending on how you actually fit the cover, it will dictate the required command to open or close the cover. Tuya has made some provision for that and allows to invert the orientation via the invert command. I don’t think it’s linked to variations in the way the Tuya devices are implemented.

The way to logically invert the device is to send send it an invert command. In order to do that in developperTools->Services, you can send:

invert

service: zha.issue_zigbee_cluster_command
data:
  ieee: 'xx:xx:xx:xx:xx:xx:xx:xx'
  endpoint_id: 1
  cluster_id: 258
  cluster_type: in
  command_type: server
  command: 6
  args:
    - 0
    - 0
    - 1029
    - 0
    - [1, 1]

stop invert

service: zha.issue_zigbee_cluster_command
data:
  ieee: 'xx:xx:xx:xx:xx:xx:xx:xx'
  endpoint_id: 1
  cluster_id: 258
  cluster_type: in
  command_type: server
  command: 6
  args:
    - 0
    - 0
    - 1029
    - 0
    - [1, 0]

If we start to modify the code every time someone has their cover inverted it will be a never ending story.

Now maybe some effort should be done to make it easier to invert the device sense. I don’t know where this information should be. Maybe there should some work done in the UI to allow to control that.

Now I wouldn’t like to change the implementation again because I went trough the pain to invert my covers to match the latest release. That would be unfortunate to have to change it again.

1reaction
jameshirkacommented, Apr 18, 2022

Thanks @TheJulianJES for the push. I ended up needing to do both changes to get my blinds to work. For some reason, I never pushed them back as a pull request.

I’ll do a pull request of my fix and hope they don’t break the blinds for other users!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Zigbee Roller Blind Motor controls are reversed : r/HomeKit
My problem is that while the up and down buttons on the blind motor itself and via the Smart Life app correspond to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found