Edge Driver for the Third Reality Smart Blind

Hi,
@Mariano_Colmenarejo i don’t own the shutter module. I’m trying to help friends in IL that have it. I asked them to reply to your question.
@Nadavz257 , @OferDV , @eli_doron can you please comment

Hi

Looks like it’s fine now.
I’m able to open and close from the icon.
As long as it’s “stabilizes” the status from partially open to open
Thanks

Hi @Mariano_Colmenarejo many thanks for your drivers, amazing work!
I have a question regarding switch Qs-zigbee-cp03 using your Zigbee Window Treatment MC driver. During movement status is correct, but once move is finished the switch always change status to Closed with 0%. Enclosed log screenshot where it was opening, reached 100% and suddenly changed status to Closed.
Any ideas what might be wrong here?
Thanks.
Screenshot_20230216_103758_SmartThings|344x500

Hi @Botrops

If you send me a log when this happens I can analyze it and try to correct it

@Mariano_Colmenarejo thanks for sharing instruction how to install CLI, work smoothly.
Here is the log, probably not complete, as cmd cutted beginning. But the last event is what I described - when opening complete status is changed to Closed with 0% shading.
BTW, could you please share steps needed in calibration mode. Looks like I have not done it right.
Thanks.

Log hidden inside

2023-02-17T11:33:08.487756600+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“windowShade”,“capability_id”:“windowShade”,“component_id”:“main”,“state”:{“value”:“opening”}}
2023-02-17T11:33:08.587921934+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:08.646470934+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:10.607851268+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“windowShade”,“capability_id”:“windowShade”,“component_id”:“main”,“state”:{“value”:“partially open”}}
2023-02-17T11:33:10.609987935+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:10.861405935+00:00 TRACE Zigbee Window Treatment Mc Received event with handler zigbee
2023-02-17T11:33:10.866052935+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xFCA4, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: WindowCovering >, lqi: 0xCC, rssi: -60, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x08, seqno: 0x49, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0008, DataType: Uint8, CurrentPositionLiftPercentage: 0x34 > > > >
2023-02-17T11:33:10.894111935+00:00 TRACE Zigbee Window Treatment Mc Found ZigbeeMessageDispatcher handler in zigbee_window_treatment
2023-02-17T11:33:10.894953268+00:00 INFO Zigbee Window Treatment Mc Executing ZclClusterAttributeValueHandler: cluster: WindowCovering, attribute: CurrentPositionLiftPercentage
2023-02-17T11:33:10.901139602+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“shadeLevel”,“capability_id”:“windowShadeLevel”,“component_id”:“main”,“state”:{“value”:52}}
2023-02-17T11:33:10.913946602+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“windowShade”,“capability_id”:“windowShade”,“component_id”:“main”,“state”:{“value”:“opening”}}
2023-02-17T11:33:10.941579935+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:10.949576935+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:12.966189603+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“windowShade”,“capability_id”:“windowShade”,“component_id”:“main”,“state”:{“value”:“partially open”}}
2023-02-17T11:33:12.967981269+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:13.576839270+00:00 TRACE Zigbee Window Treatment Mc Received event with handler zigbee
2023-02-17T11:33:13.636182603+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xFCA4, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: WindowCovering >, lqi: 0xCC, rssi: -60, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x08, seqno: 0x4A, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0008, DataType: Uint8, CurrentPositionLiftPercentage: 0x39 > > > >
2023-02-17T11:33:13.716653936+00:00 TRACE Zigbee Window Treatment Mc Found ZigbeeMessageDispatcher handler in zigbee_window_treatment
2023-02-17T11:33:13.747897936+00:00 INFO Zigbee Window Treatment Mc Executing ZclClusterAttributeValueHandler: cluster: WindowCovering, attribute: CurrentPositionLiftPercentage
2023-02-17T11:33:13.759908270+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“shadeLevel”,“capability_id”:“windowShadeLevel”,“component_id”:“main”,“state”:{“value”:57}}
2023-02-17T11:33:13.787487603+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“windowShade”,“capability_id”:“windowShade”,“component_id”:“main”,“state”:{“value”:“opening”}}
2023-02-17T11:33:13.841923270+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:13.855173270+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:15.857595604+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“windowShade”,“capability_id”:“windowShade”,“component_id”:“main”,“state”:{“value”:“partially open”}}
2023-02-17T11:33:15.859698271+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:16.209907271+00:00 TRACE Zigbee Window Treatment Mc Received event with handler zigbee
2023-02-17T11:33:16.211617271+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xFCA4, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: WindowCovering >, lqi: 0xCE, rssi: -60, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x08, seqno: 0x4B, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0008, DataType: Uint8, CurrentPositionLiftPercentage: 0x3E > > > >
2023-02-17T11:33:16.282167604+00:00 TRACE Zigbee Window Treatment Mc Found ZigbeeMessageDispatcher handler in zigbee_window_treatment
2023-02-17T11:33:16.283030604+00:00 INFO Zigbee Window Treatment Mc Executing ZclClusterAttributeValueHandler: cluster: WindowCovering, attribute: CurrentPositionLiftPercentage
2023-02-17T11:33:16.284783271+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“shadeLevel”,“capability_id”:“windowShadeLevel”,“component_id”:“main”,“state”:{“value”:62}}
2023-02-17T11:33:16.295859271+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“windowShade”,“capability_id”:“windowShade”,“component_id”:“main”,“state”:{“value”:“opening”}}
2023-02-17T11:33:16.360822271+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:16.369333271+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:18.417496272+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“windowShade”,“capability_id”:“windowShade”,“component_id”:“main”,“state”:{“value”:“partially open”}}
2023-02-17T11:33:18.438604605+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:18.900417939+00:00 TRACE Zigbee Window Treatment Mc Received event with handler zigbee
2023-02-17T11:33:18.908798939+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xFCA4, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: WindowCovering >, lqi: 0xD0, rssi: -60, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x08, seqno: 0x4C, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0008, DataType: Uint8, CurrentPositionLiftPercentage: 0x43 > > > >
2023-02-17T11:33:18.960620605+00:00 TRACE Zigbee Window Treatment Mc Found ZigbeeMessageDispatcher handler in zigbee_window_treatment
2023-02-17T11:33:18.961470605+00:00 INFO Zigbee Window Treatment Mc Executing ZclClusterAttributeValueHandler: cluster: WindowCovering, attribute: CurrentPositionLiftPercentage
2023-02-17T11:33:18.966010272+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“shadeLevel”,“capability_id”:“windowShadeLevel”,“component_id”:“main”,“state”:{“value”:67}}
2023-02-17T11:33:18.983753605+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“windowShade”,“capability_id”:“windowShade”,“component_id”:“main”,“state”:{“value”:“opening”}}
2023-02-17T11:33:19.029592605+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:19.034091605+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:21.057546940+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“windowShade”,“capability_id”:“windowShade”,“component_id”:“main”,“state”:{“value”:“partially open”}}
2023-02-17T11:33:21.059635940+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:21.579711607+00:00 TRACE Zigbee Window Treatment Mc Received event with handler zigbee
2023-02-17T11:33:21.582838940+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xFCA4, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: WindowCovering >, lqi: 0xCE, rssi: -60, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x08, seqno: 0x4D, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0008, DataType: Uint8, CurrentPositionLiftPercentage: 0x48 > > > >
2023-02-17T11:33:21.687504273+00:00 TRACE Zigbee Window Treatment Mc Found ZigbeeMessageDispatcher handler in zigbee_window_treatment
2023-02-17T11:33:21.688472940+00:00 INFO Zigbee Window Treatment Mc Executing ZclClusterAttributeValueHandler: cluster: WindowCovering, attribute: CurrentPositionLiftPercentage
2023-02-17T11:33:21.690364273+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“shadeLevel”,“capability_id”:“windowShadeLevel”,“component_id”:“main”,“state”:{“value”:72}}
2023-02-17T11:33:21.699406940+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“windowShade”,“capability_id”:“windowShade”,“component_id”:“main”,“state”:{“value”:“opening”}}
2023-02-17T11:33:21.725542273+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:21.733857940+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:23.770088608+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“windowShade”,“capability_id”:“windowShade”,“component_id”:“main”,“state”:{“value”:“partially open”}}
2023-02-17T11:33:23.780164941+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:24.253272275+00:00 TRACE Zigbee Window Treatment Mc Received event with handler zigbee
2023-02-17T11:33:24.257749608+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xFCA4, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: WindowCovering >, lqi: 0xCA, rssi: -60, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x08, seqno: 0x4E, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0008, DataType: Uint8, CurrentPositionLiftPercentage: 0x4D > > > >
2023-02-17T11:33:24.300553275+00:00 TRACE Zigbee Window Treatment Mc Found ZigbeeMessageDispatcher handler in zigbee_window_treatment
2023-02-17T11:33:24.301594275+00:00 INFO Zigbee Window Treatment Mc Executing ZclClusterAttributeValueHandler: cluster: WindowCovering, attribute: CurrentPositionLiftPercentage
2023-02-17T11:33:24.305004275+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“shadeLevel”,“capability_id”:“windowShadeLevel”,“component_id”:“main”,“state”:{“value”:77}}
2023-02-17T11:33:24.317465941+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“windowShade”,“capability_id”:“windowShade”,“component_id”:“main”,“state”:{“value”:“opening”}}
2023-02-17T11:33:24.340100941+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:24.349508275+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:26.364241276+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“windowShade”,“capability_id”:“windowShade”,“component_id”:“main”,“state”:{“value”:“partially open”}}
2023-02-17T11:33:26.366485942+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:26.932116609+00:00 TRACE Zigbee Window Treatment Mc Received event with handler zigbee
2023-02-17T11:33:26.933380943+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xFCA4, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: WindowCovering >, lqi: 0xCA, rssi: -58, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x08, seqno: 0x4F, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0008, DataType: Uint8, CurrentPositionLiftPercentage: 0x52 > > > >
2023-02-17T11:33:26.960785943+00:00 TRACE Zigbee Window Treatment Mc Found ZigbeeMessageDispatcher handler in zigbee_window_treatment
2023-02-17T11:33:26.964361609+00:00 INFO Zigbee Window Treatment Mc Executing ZclClusterAttributeValueHandler: cluster: WindowCovering, attribute: CurrentPositionLiftPercentage
2023-02-17T11:33:26.972373943+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“shadeLevel”,“capability_id”:“windowShadeLevel”,“component_id”:“main”,“state”:{“value”:82}}
2023-02-17T11:33:26.981797609+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“windowShade”,“capability_id”:“windowShade”,“component_id”:“main”,“state”:{“value”:“opening”}}
2023-02-17T11:33:27.010405276+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:27.016005276+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:29.029847944+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“windowShade”,“capability_id”:“windowShade”,“component_id”:“main”,“state”:{“value”:“partially open”}}
2023-02-17T11:33:29.040197944+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:29.608833277+00:00 TRACE Zigbee Window Treatment Mc Received event with handler zigbee
2023-02-17T11:33:29.610101611+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xFCA4, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: WindowCovering >, lqi: 0xCC, rssi: -60, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x08, seqno: 0x50, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0008, DataType: Uint8, CurrentPositionLiftPercentage: 0x57 > > > >
2023-02-17T11:33:29.665552277+00:00 TRACE Zigbee Window Treatment Mc Found ZigbeeMessageDispatcher handler in zigbee_window_treatment
2023-02-17T11:33:29.668995277+00:00 INFO Zigbee Window Treatment Mc Executing ZclClusterAttributeValueHandler: cluster: WindowCovering, attribute: CurrentPositionLiftPercentage
2023-02-17T11:33:29.670821611+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“shadeLevel”,“capability_id”:“windowShadeLevel”,“component_id”:“main”,“state”:{“value”:87}}
2023-02-17T11:33:29.690997611+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“windowShade”,“capability_id”:“windowShade”,“component_id”:“main”,“state”:{“value”:“opening”}}
2023-02-17T11:33:29.719110944+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:29.737581277+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:31.749822278+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“windowShade”,“capability_id”:“windowShade”,“component_id”:“main”,“state”:{“value”:“partially open”}}
2023-02-17T11:33:31.758201278+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:32.352242612+00:00 TRACE Zigbee Window Treatment Mc Received event with handler zigbee
2023-02-17T11:33:32.356719945+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xFCA4, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: WindowCovering >, lqi: 0xD0, rssi: -58, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x08, seqno: 0x51, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0008, DataType: Uint8, CurrentPositionLiftPercentage: 0x5C > > > >
2023-02-17T11:33:32.416118279+00:00 TRACE Zigbee Window Treatment Mc Found ZigbeeMessageDispatcher handler in zigbee_window_treatment
2023-02-17T11:33:32.419406279+00:00 INFO Zigbee Window Treatment Mc Executing ZclClusterAttributeValueHandler: cluster: WindowCovering, attribute: CurrentPositionLiftPercentage
2023-02-17T11:33:32.429594612+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“shadeLevel”,“capability_id”:“windowShadeLevel”,“component_id”:“main”,“state”:{“value”:92}}
2023-02-17T11:33:32.437582945+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“windowShade”,“capability_id”:“windowShade”,“component_id”:“main”,“state”:{“value”:“opening”}}
2023-02-17T11:33:32.530092945+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:32.531380945+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:34.498680946+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“windowShade”,“capability_id”:“windowShade”,“component_id”:“main”,“state”:{“value”:“partially open”}}
2023-02-17T11:33:34.500677613+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:34.989835280+00:00 TRACE Zigbee Window Treatment Mc Received event with handler zigbee
2023-02-17T11:33:34.998789613+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xFCA4, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: WindowCovering >, lqi: 0xD0, rssi: -60, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x08, seqno: 0x52, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0008, DataType: Uint8, CurrentPositionLiftPercentage: 0x61 > > > >
2023-02-17T11:33:35.030619946+00:00 TRACE Zigbee Window Treatment Mc Found ZigbeeMessageDispatcher handler in zigbee_window_treatment
2023-02-17T11:33:35.031464280+00:00 INFO Zigbee Window Treatment Mc Executing ZclClusterAttributeValueHandler: cluster: WindowCovering, attribute: CurrentPositionLiftPercentage
2023-02-17T11:33:35.035064946+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“shadeLevel”,“capability_id”:“windowShadeLevel”,“component_id”:“main”,“state”:{“value”:97}}
2023-02-17T11:33:35.044940280+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“windowShade”,“capability_id”:“windowShade”,“component_id”:“main”,“state”:{“value”:“opening”}}
2023-02-17T11:33:35.078185280+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:35.086518280+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:35.318564947+00:00 DEBUG Zigbee Window Treatment Mc driver device thread event handled
2023-02-17T11:33:36.622227947+00:00 TRACE Zigbee Window Treatment Mc Received event with handler zigbee
2023-02-17T11:33:36.641166614+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xFCA4, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: WindowCovering >, lqi: 0xCC, rssi: -69, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x08, seqno: 0x53, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0xF000, DataType: Uint8, Uint8: 0x01 > > > >
2023-02-17T11:33:36.667862947+00:00 TRACE Zigbee Window Treatment Mc Found ZigbeeMessageDispatcher handler in zigbee_window_treatment → Tuya Device Handler
2023-02-17T11:33:36.668828947+00:00 INFO Zigbee Window Treatment Mc Executing ZclClusterAttributeValueHandler: cluster: WindowCovering, attribute: 0xF000
2023-02-17T11:33:36.670570947+00:00 PRINT Zigbee Window Treatment Mc <<< Curtain Switch Value >>> 1
2023-02-17T11:33:36.674059281+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“deviceInfo”,“capability_id”:“legendabsolute60149.deviceInfo”,“component_id”:“main”,“state”:{“value”:“UTC Time: 11:33:36Stop”}}
2023-02-17T11:33:36.689697947+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0xFCA4, dest_endpoint: 0x01, profile: 0x0104, cluster: WindowCovering >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0008 > > >
2023-02-17T11:33:36.780186947+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:36.781489947+00:00 TRACE Zigbee Window Treatment Mc Received event with handler zigbee
2023-02-17T11:33:36.782948281+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xFCA4, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: WindowCovering >, lqi: 0xCE, rssi: -69, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x08, seqno: 0x54, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0008, DataType: Uint8, CurrentPositionLiftPercentage: 0x63 > > > >
2023-02-17T11:33:36.803456947+00:00 TRACE Zigbee Window Treatment Mc Found ZigbeeMessageDispatcher handler in zigbee_window_treatment
2023-02-17T11:33:36.804352947+00:00 INFO Zigbee Window Treatment Mc Executing ZclClusterAttributeValueHandler: cluster: WindowCovering, attribute: CurrentPositionLiftPercentage
2023-02-17T11:33:36.810223614+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“shadeLevel”,“capability_id”:“windowShadeLevel”,“component_id”:“main”,“state”:{“value”:99}}
2023-02-17T11:33:36.851585614+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“windowShade”,“capability_id”:“windowShade”,“component_id”:“main”,“state”:{“value”:“opening”}}
2023-02-17T11:33:36.912802281+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:36.914110614+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:36.916588614+00:00 TRACE Zigbee Window Treatment Mc Received event with handler zigbee
2023-02-17T11:33:36.917886614+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xFCA4, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: WindowCovering >, lqi: 0xCA, rssi: -67, body_length: 0x0008, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x11, ZCLCommandId: 0x01 >, < ReadAttributeResponse || < AttributeRecord || AttributeId: 0x0008, ZclStatus: SUCCESS, DataType: Uint8, CurrentPositionLiftPercentage: 0x00 > > > >
2023-02-17T11:33:36.983919947+00:00 TRACE Zigbee Window Treatment Mc Found ZigbeeMessageDispatcher handler in zigbee_window_treatment
2023-02-17T11:33:36.984788947+00:00 INFO Zigbee Window Treatment Mc Executing ZclClusterAttributeValueHandler: cluster: WindowCovering, attribute: CurrentPositionLiftPercentage
2023-02-17T11:33:36.986508947+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“shadeLevel”,“capability_id”:“windowShadeLevel”,“component_id”:“main”,“state”:{“value”:0}}
2023-02-17T11:33:36.994203947+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> emitting event: {“attribute_id”:“windowShade”,“capability_id”:“windowShade”,“component_id”:“main”,“state”:{“value”:“closed”}}
2023-02-17T11:33:37.028674281+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:37.029549614+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:33:39.036473615+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:34:05.320001628+00:00 DEBUG Zigbee Window Treatment Mc driver device thread event handled
2023-02-17T11:34:35.329549975+00:00 DEBUG Zigbee Window Treatment Mc driver device thread event handled
2023-02-17T11:35:05.329828323+00:00 DEBUG Zigbee Window Treatment Mc driver device thread event handled
2023-02-17T11:35:35.340329051+00:00 DEBUG Zigbee Window Treatment Mc driver device thread event handled
2023-02-17T11:36:05.342334023+00:00 DEBUG Zigbee Window Treatment Mc driver device thread event handled
2023-02-17T11:36:22.709842031+00:00 TRACE Zigbee Window Treatment Mc Received event with handler zigbee
2023-02-17T11:36:22.711333031+00:00 INFO Zigbee Window Treatment Mc <ZigbeeDevice: f720cc70-ee40-4a11-b885-53ce4eafab3c [0xFCA4] (Lonsonho QS-Zigbee-CP03)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xFCA4, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: WindowCovering >, lqi: 0xC6, rssi: -64, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x55, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0008, DataType: Uint8, CurrentPositionLiftPercentage: 0x00 > > > >
2023-02-17T11:36:22.760816031+00:00 TRACE Zigbee Window Treatment Mc Found ZigbeeMessageDispatcher handler in zigbee_window_treatment
2023-02-17T11:36:22.763934031+00:00 INFO Zigbee Window Treatment Mc Executing ZclClusterAttributeValueHandler: cluster: WindowCovering, attribute: CurrentPositionLiftPercentage
2023-02-17T11:36:22.772632698+00:00 DEBUG Zigbee Window Treatment Mc Lonsonho QS-Zigbee-CP03 device thread event handled
2023-02-17T11:36:35.350026371+00:00 DEBUG Zigbee Window Treatment Mc driver device thread event handled

Hi @Botrops

In the logs it can be seen that the driver emits the events with the states that the device sends to it.

I don’t know if it has something to do with the calibration of the device.

About the calibration I don’t really know how to do it.
Maybe @dotan_shai can help you on this.

@Botrops for calibration , just activate auto calibration in @Mariano_Colmenarejo driver, move the up and down from the ST app, you should be able to see the calibration time upon successive calibration,

You can also enter in the calibration time in seconds if you choose quick calibration.
here is the manual if you need:
https://www.expert4house.com/fr/index.php?controller=attachment&id_attachment=256

@Mariano_Colmenarejo
Can you please add the following device:

Manufacturer: _TZ3210_dwytrmda
Model: TS130F

@Elad_Azulay

@dotan_shai

───────────────────────────────────────────────────
 Name         Zigbee Window Treatment Mc
 Version      2023-02-23T18:39:30.870340317        
───────────────────────────────────────────────────
- id: "TS130F/_TZ3210_dwytrmda"
    deviceLabel: TS130F Window Treatment
    manufacturer: _TZ3210_dwytrmda
    model: TS130F
    deviceProfileName: window-treatment-profile-calib
1 Like

@Mariano_Colmenarejo ,
Can you please add the Signal Metrics also in this driver ?
RSSI and LQI are missing.
I’ve checked with _TZ3000_fccpjz5z.
Thanks…

@Mariano_Colmenarejo
Is metrics in window treatment drivers , possible ?

Hi @dotan_shai

Adding the metrics requires:

  • be able to handle attribute messages manually to extract the information
  • Add the capbility to the profiles
  • There are profiles that use subdriver and the message can be easily handled, like ikea, but that same profile is also used by devices from other manufacturers that only use the defaults and do not use the subdriver and therefore the signal metrics capability would not be updated and would give an app error
  • To avoid this, it would be necessary to duplicate a code that is already in the hub’s firmware to manually handle any message on the devices that use the default ones or create specific profiles for the devices that use a subdriver. This doesn’t make any practical sense and complicates the driver unnecessarily.
  • I could do it for devices that use a specific profile and subdriver, like the Tuya TS130F or the Aqara, but tomorrow they will also want it for other devices and I will have to explain it again and try to dissuade them

@Mariano_Colmenarejo

Most of the people use that modules. Please give it a try. In addition, my friend had a problems with losing calibration with TS130F , which eventually happen because of bad signal reception (RSSI= -85dbm). This information was available only while doing logs.

Hi @Mariano_Colmenarejo ,
New module , with TWO Gangs , roller shutter in same module, EP1 and EP2. Can you create ZigBee Window Treatment and Child ?

Manufacturer: _TZ3000_j1xl73iw
Model: TS130F

Hi @dotan_shai

Sorry. I can not do it.
Too many changes to the driver that require many hours, which now that the good weather is here I want to dedicate to other things.

The driver code is on github, whoever wants can use it and modify it

3 Likes

Hi @Mariano_Colmenarejo ,
No worries… I’m not in rush. Take your time. When the weather became not so good, please take a look and try to implement this driver. I’m not from the SW world and therefore unable to create new edge drivers. I’ll help you with logs as much as you want and will give you all the information required,

Meanwhile , my friend will use two 1 gang modules instead, which you already have driver for them…

And another point, when trying to implement in the far future, please also add the following fingerprint which is the same:

modelID: 'TS130F'
manufacturerName: '_TZ3000_kmsbwdol'

Hi @Mariano_Colmenarejo

Is it possible to add the possibility to invert the open close status of the window treatment?

Thanks a lot
Francesco

@Mariano_Colmenarejo I was looking to buy a zemismart zigbee curtainmotor on aliexpress. I asked them if they could point me to an edge driver for smartthings and they send me this code. To me it is like chinese, but maybe it helps for your driver Zigbee Window Treatment Mc?

/**

  • Tuya Window Shade (v.0.6.0.1)
  • Copyright 2020-2021 Jaewon Park (iquix)
  • Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at:
  •  http://www.apache.org/licenses/LICENSE-2.0
    
  • Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
  • on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
  • for the specific language governing permissions and limitations under the License.
    */

import groovy.json.JsonOutput

metadata {
definition(name: “Tuya Window Shade”, namespace: “iquix”, author: “iquix”, ocfDeviceType: “oic.d.blind”, vid: “generic-shade”) {
capability “Actuator”
capability “Configuration”
capability “Window Shade”
capability “Window Shade Preset”
capability “Switch Level”
capability “Window Shade Level”

	command "pause"

	fingerprint profileId: "0104", manufacturer: "_TZE200_cowvfni3", model: "TS0601", deviceJoinName: "Tuya Window Treatment" // Zemismart Zigbee Curtain *
	fingerprint profileId: "0104", manufacturer: "_TZE200_xaabybja", model: "TS0601", deviceJoinName: "Tuya Window Treatment" // Zemismart Zigbee Curtain (Not fully tested)
	fingerprint profileId: "0104", manufacturer: "_TZE200_wmcdj3aq", model: "TS0601", deviceJoinName: "Tuya Window Treatment" // Zemismart Blind *
	fingerprint profileId: "0104", manufacturer: "_TZE200_fzo2pocs", model: "TS0601", deviceJoinName: "Tuya Window Treatment" // Zemismart Blind (Not tested)
	fingerprint profileId: "0104", manufacturer: "_TZE200_5sbebbzs", model: "TS0601", deviceJoinName: "Tuya Window Treatment" // Zemismart Blind with Battery *
	fingerprint profileId: "0104", manufacturer: "_TZE200_nogaemzt", model: "TS0601", deviceJoinName: "Tuya Window Treatment" // YS-MT750 *
	fingerprint profileId: "0104", manufacturer: "_TZE200_5zbp6j0u", model: "TS0601", deviceJoinName: "Tuya Window Treatment" // YS-MT750 *
	fingerprint profileId: "0104", manufacturer: "_TZE200_fdtjuw7u", model: "TS0601", deviceJoinName: "Tuya Window Treatment" // YS-MT750 *
	fingerprint profileId: "0104", manufacturer: "_TZE200_bqcqqjpb", model: "TS0601", deviceJoinName: "Tuya Window Treatment" // YS-MT750L *
	fingerprint profileId: "0104", manufacturer: "_TZE200_zpzndjez", model: "TS0601", deviceJoinName: "Tuya Window Treatment" // DS82 *
	fingerprint profileId: "0104", manufacturer: "_TZE200_nueqqe6k", model: "TS0601", deviceJoinName: "Tuya Window Treatment" // Smart Motorized Chain Roller *
	fingerprint profileId: "0104", manufacturer: "_TZE200_cf1sl3tj", model: "TS0601", deviceJoinName: "Tuya Window Treatment" // Smart Curtainbot *
	fingerprint profileId: "0104", manufacturer: "_TYST11_cowvfni3", model: "owvfni3", deviceJoinName: "Tuya Window Treatment" // Zemismart Zigbee Curtain *
	fingerprint profileId: "0104", manufacturer: "_TYST11_xaabybja", model: "aabybja", deviceJoinName: "Tuya Window Treatment" // Zemismart Zigbee Curtain (Not fully tested)
	fingerprint profileId: "0104", manufacturer: "_TYST11_wmcdj3aq", model: "mcdj3aq", deviceJoinName: "Tuya Window Treatment" // Zemismart Zigbee Blind *
	fingerprint profileId: "0104", manufacturer: "_TYST11_fzo2pocs", model: "zo2pocs", deviceJoinName: "Tuya Window Treatment" // Zemismart Zigbee Blind (Not tested)
	fingerprint profileId: "0104", manufacturer: "_TYST11_5sbebbzs", model: "sbebbzs", deviceJoinName: "Tuya Window Treatment" // Zemismart Blind with Battery
	fingerprint profileId: "0104", manufacturer: "_TYST11_nogaemzt", model: "ogaemzt", deviceJoinName: "Tuya Window Treatment" // YS-MT750
	fingerprint profileId: "0104", manufacturer: "_TYST11_5zbp6j0u", model: "zbp6j0u", deviceJoinName: "Tuya Window Treatment" // YS-MT750
	fingerprint profileId: "0104", manufacturer: "_TYST11_fdtjuw7u", model: "dtjuw7u", deviceJoinName: "Tuya Window Treatment" // YS-MT750
	fingerprint profileId: "0104", manufacturer: "_TYST11_bqcqqjpb", model: "qcqqjpb", deviceJoinName: "Tuya Window Treatment" // YS-MT750L
	fingerprint profileId: "0104", manufacturer: "_TYST11_zpzndjez", model: "pzndjez", deviceJoinName: "Tuya Window Treatment" // DS82
	fingerprint profileId: "0104", manufacturer: "_TYST11_nueqqe6k", model: "ueqqe6k", deviceJoinName: "Tuya Window Treatment" // Smart Motorized Chain Roller
}

preferences {
	input "preset", "number", title: "Preset position", description: "Set the window shade preset position", defaultValue: 50, range: "0..100", required: false, displayDuringSetup: false
	input "reverse", "enum", title: "Direction", description: "Set direction of curtain motor by open/close app commands. For example, if you send 'open' command from app, but the curtain motor is closing, then set this option to 'Reverse'.", options: ["Forward", "Reverse"], defaultValue: "Forward", required: false, displayDuringSetup: false
	input "fixpercent", "enum", title: "Fix percent", description: "Set 'Fix percent' option unless open is 100% and close is 0%. In Smartthings, 'Open' should be 100% in level and 'Close' should be 0% in level. If it is reversed, then set this option to 'Fix percent'.", options: ["Default", "Fix percent"], defaultValue: "Default", required: false, displayDuringSetup: false
	//input "fixcommand", "enum", title: "Fix command", description: "[Experimental] Set 'Fix command' option if up/down command from RF remote control differs from open/close app command. If you are setting up curtain, please set this option FIRST before setting other options.", options: ["Default", "Fix command"], defaultValue: "Default", required: false, displayDuringSetup: false
}

tiles(scale: 2) {
	multiAttributeTile(name:"windowShade", type: "generic", width: 6, height: 4) {
		tileAttribute("device.windowShade", key: "PRIMARY_CONTROL") {
			attributeState "open", label: 'Open', action: "close", icon: "https://objectstorage.ap-seoul-1.oraclecloud.com/n/cnqa4dxui0ha/b/ST/o/window_open.png", backgroundColor: "#00A0DC", nextState: "closing"
			attributeState "closed", label: 'Closed', action: "open", icon: "https://objectstorage.ap-seoul-1.oraclecloud.com/n/cnqa4dxui0ha/b/ST/o/window_close.png", backgroundColor: "#ffffff", nextState: "opening"
			attributeState "partially open", label: 'Partially open', action: "close", icon: "https://objectstorage.ap-seoul-1.oraclecloud.com/n/cnqa4dxui0ha/b/ST/o/window_open.png", backgroundColor: "#d45614", nextState: "closing"
			attributeState "opening", label: 'Opening', action: "pause", icon: "https://objectstorage.ap-seoul-1.oraclecloud.com/n/cnqa4dxui0ha/b/ST/o/window_open.png", backgroundColor: "#00A0DC", nextState: "partially open"
			attributeState "closing", label: 'Closing', action: "pause", icon: "https://objectstorage.ap-seoul-1.oraclecloud.com/n/cnqa4dxui0ha/b/ST/o/window_close.png", backgroundColor: "#ffffff", nextState: "partially open"
		}
	}
	standardTile("contPause", "device.switch", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
		state "pause", label:"", icon:'st.sonos.pause-btn', action:'pause', backgroundColor:"#cccccc"
	}
	standardTile("presetPosition", "device.presetPosition", width: 2, height: 2, decoration: "flat") {
		state "default", label: "Preset", action:"presetPosition", icon:"st.Home.home2"
	}
	standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat", width: 2, height: 1) {
		state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
	}
	valueTile("shadeLevel", "device.level", width: 4, height: 1) {
		state "level", label: 'Shade is ${currentValue}% up', defaultState: true
	}
	controlTile("levelSliderControl", "device.level", "slider", width:2, height: 1, inactiveLabel: false) {
		state "level", action:"switch level.setLevel"
	}

	main "windowShade"
	details(["windowShade", "contPause", "presetPosition", "shadeLevel", "levelSliderControl", "refresh"])
}

}

private getCLUSTER_TUYA() { 0xEF00 }
private getSETDATA() { 0x00 }
private getINIT_DEVICE() { 0x03 }

// tuya DP type
private getDP_TYPE_BOOL() { “01” }
private getDP_TYPE_VALUE() { “02” }
private getDP_TYPE_ENUM() { “04” }

// Parse incoming device messages to generate events
def parse(String description) {
if (description?.startsWith(‘catchall:’) || description?.startsWith(‘read attr -’)) {
Map descMap = zigbee.parseDescriptionAsMap(description)
log.debug descMap
if (descMap?.clusterInt==CLUSTER_TUYA) {
if ( descMap?.command == “01” || descMap?.command == “02” ) {
def dp = zigbee.convertHexToInt(descMap?.data[2])
def fncmd = zigbee.convertHexToInt(descMap?.data[6…-1].join(‘’))
log.debug “dp=${dp} fncmd=${fncmd}”
switch (dp) {
case 0x07: // 0x07: Work state – Started moving (triggered by RF remote or pulling the curtain)
if (isZemiCurtain()) {
if (device.currentValue(“level”) == 0) {
log.debug “moving from position 0 : must be opening”
levelEventMoving(100)
} else if (device.currentValue(“level”) == 100) {
log.debug “moving from position 100 : must be closing”
levelEventMoving(0)
}
} else if (supportDp1State()) {
return
} else {
if (directionVal(fncmd) == 0) {
log.debug “opening”
levelEventMoving(100)
} else if (directionVal(fncmd) == 1) {
log.debug “closing”
levelEventMoving(0)
}
}
break
case 0x01: // 0x01: Control – Opening/closing/stopped
def statVal = cmdVal(fncmd)
if (statVal == 1) {
log.debug “stopped”
state.moving = false
return
}
if (statVal == 0 || statVal == 2) {
state.moving = levelEventMoving((statVal==0) ? 100 : 0)
}
break
case 0x02: // 0x02: Percent control – Started moving to position (triggered from Zigbee)
if (!isDp2PositionDevices()) {
def pos = levelVal(fncmd)
log.debug "moving to position: "+pos
state.levelCmdVal = pos // for 285mm nogaemzt specific packet
levelEventMoving(pos)
break
}
// isDp2PositionDevices() devices send current position packet with dp 2, so it will be processed with the following code.
case 0x03: // 0x03: Percent state – Arrived at position
def pos = levelVal(fncmd)
log.debug "position: "+pos
levelEventArrived(pos)
break
case 0x05: // 0x05: Direction state
log.debug "direction state of the motor is "+ (fncmd ? “reverse” : “forward”)
break
case 0x06: // 0x06: Arrived at destination (285mm nogaemzt specific packet)
if (fncmd == 0 && productId == “ogaemzt” && state.levelCmdVal != null) {
levelEventArrived(state.levelCmdVal)
state.levelCmdVal = null
}
break
case 0x67: // 0x67: Completion of limit setttings (YS-MT750 only)
if (state?.direction_post) {
state.autolimit = null
log.debug “*** automatic limit settings complete. moving to 50% position… ***”
moveTo50()
}
break
}
}
}
}
}

private levelEventMoving(currentLevel) {
def lastLevel = device.currentValue(“level”)
log.debug “levelEventMoving - currentLevel: ${currentLevel} lastLevel: ${lastLevel}”
if (lastLevel == “undefined” || currentLevel == lastLevel) { //Ignore invalid reports
log.debug “Ignore invalid reports”
} else {
if (lastLevel < currentLevel) {
sendEvent(name:“windowShade”, value: “opening”, displayed: true)
return true
} else if (lastLevel > currentLevel) {
sendEvent(name:“windowShade”, value: “closing”, displayed: true)
return true
}
}
return false
}

private levelEventArrived(level) {
def windowShadeVal
if (level == 0) {
windowShadeVal = “closed”
} else if (level == 100) {
windowShadeVal = “open”
} else if (level > 0 && level < 100) {
windowShadeVal = “partially open”
} else {
log.debug “Position value error (${level}) : Please remove the device from Smartthings, and setup limit of the curtain before pairing.”
level = 50
windowShadeVal = “unknown”
}
sendEvent(name: “level”, value: (level), displayed: false)
sendEvent(name: “shadeLevel”, value: (level), displayed: true)
if (supportDp1State() && state.moving) {
return
} else if (doesReportStartPos() && state.moving) {
state.moving = false
} else {
sendEvent(name: “windowShade”, value: (windowShadeVal), displayed: true)
}
}

def close() {
log.info “close()”
def currentLevel = device.currentValue(“level”)
if (currentLevel == 0) {
sendEvent(name: “windowShade”, value: “closed”, displayed: true)
}
sendTuyaCommand(“01”, DP_TYPE_ENUM, zigbee.convertToHexString(cmdVal(2)))
}

def open() {
log.info “open()”
def currentLevel = device.currentValue(“level”)
if (currentLevel == 100) {
sendEvent(name: “windowShade”, value: “open”, displayed: true)
}
sendTuyaCommand(“01”, DP_TYPE_ENUM, zigbee.convertToHexString(cmdVal(0)))
}

def pause() {
log.info “pause()”
sendEvent(name: “windowShade”, value: device.currentValue(“windowShade”), displayed: false)
sendTuyaCommand(“01”, DP_TYPE_ENUM, “01”)
}

def setShadeLevel(data) {
log.info “setShadeLevel(${data})”
def currentLevel = device.currentValue(“level”)
if (currentLevel == data) {
sendEvent(name: “level”, value: currentLevel, displayed: false)
sendEvent(name: “shadeLevel”, value: currentLevel, displayed: true)
}
runIn(10, “setEvent”, [overwrite:true])
sendTuyaCommand(“02”, DP_TYPE_VALUE, zigbee.convertToHexString(levelVal(data), 8))
}

def setLevel(data, rate = null) {
log.info “setLevel(${data})”
setShadeLevel(data)
}

def presetPosition() {
setLevel(preset ?: 50)
}

def installed() {
log.info “installed()”
state.preferences = null
state.default_fix_percent = null
state.autolimit = null
state.run_autolimit = true
sendEvent(name: “supportedWindowShadeCommands”, value: JsonOutput.toJson([“open”, “close”, “pause”]), displayed: false)
sendEvent(name: “windowShade”, value: “unknown”, displayed: false)
sendEvent(name: “level”, value: 50, displayed: false)
sendEvent(name: “shadeLevel”, value: 50, displayed: false)
return
}

def updated() {
log.info “updated()”
calcDefaultFixpercent()
if (state?.preferences != null) {
def prev_pref = state.preferences?.tokenize(“|”)
if ((prev_pref[0] == “Reverse”) ^ (reverse == “Reverse”)) {
log.debug “reverse mode changed : ${prev_pref[0]} → ${reverse}. inverting state and level”
levelEventArrived(100 - device.currentValue(“level”))
setDirection()
}
if ((prev_pref[1] == “Fix percent”) ^ (fixpercent == “Fix percent”)) {
log.debug “fix percent changed : ${prev_pref[1]} → ${fixpercent}. inverting state and level”
levelEventArrived(100 - device.currentValue(“level”))
}
} else {
setDirection()
}
state.preferences = “|${reverse}|${fixpercent}|${fixcommand}|”
return
}

def setEvent() {
sendEvent(name: “level”, value: device.currentValue(“level”), displayed: false)
sendEvent(name: “shadeLevel”, value: device.currentValue(“level”), displayed: false)
}

private setDirection() {
log.info “setDirection()”
def cmds = sendTuyaCommand(“05”, DP_TYPE_ENUM, (reverse == “Reverse”) ? “01” : “00”)
cmds.each{ sendHubCommand(new physicalgraph.device.HubAction(it)) }
runIn(5, directionPostProcess)
}

def directionPostProcess() {
log.info “directionPostProcess()”
def cmds
if (isAutoLimitSupported && state.run_autolimit) {
log.debug “*** this device is capable of automatic limit settings. starting automatic limit settings… ***”
state.autolimit = true
state.run_autolimit = false
cmds = sendTuyaCommand(“06”, DP_TYPE_BOOL, “01”)
} else {
cmds = sendTuyaCommand(“02”, DP_TYPE_VALUE, zigbee.convertToHexString(50, 8))
}
cmds.each{ sendHubCommand(new physicalgraph.device.HubAction(it)) }
}

def moveTo50() {
log.info “moveTo50()”
def cmds = sendTuyaCommand(“02”, DP_TYPE_VALUE, zigbee.convertToHexString(50, 8))
cmds.each{ sendHubCommand(new physicalgraph.device.HubAction(it)) }
}

private sendTuyaCommand(dp, dp_type, fncmd) {
zigbee.command(CLUSTER_TUYA, SETDATA, PACKET_ID + dp + dp_type + zigbee.convertToHexString(fncmd.length()/2, 4) + fncmd )
}

private getPACKET_ID() {
state.packetID = ((state.packetID ?: 0) + 1 ) % 65536
zigbee.convertToHexString(state.packetID, 4)
}

private levelVal(n) {
if (state.default_fix_percent == null) {
calcDefaultFixpercent()
}
def pct = n & 0xFF
//extremly awkward percent packet in “ogaemzt” device. special thanks to 경기PA팬텀
if (state.default_fix_percent == “ogaemzt”) {
return (int)(((fixpercent == “Fix percent”) ^ (n == pct)) ? 100 - pct : pct)
} else {
return (int)(((fixpercent == “Fix percent”) ^ state.default_fix_percent) ? 100 - pct : pct)
}
}

private cmdVal(c) {
//return (fixcommand == “Fix command”) ? 2 - c : c
return c
}

private directionVal(c) {
//return ( (isZemiBlind() && (reverse != “Reverse”)) ^ (fixcommand == “Fix command”) ) ? 1 - c : c
return (isZemiBlind() && (reverse != “Reverse”)) ? 1 - c : c
}

private calcDefaultFixpercent() {
def fixpercent_devices = [“owvfni3”, “zbp6j0u”, “pzndjez”, “qcqqjpb”, “ueqqe6k”, “sbebbzs”, “aabybja”]
def dev = fixpercent_devices.find { productId == it }
state.default_fix_percent = isOgaemzt() ? “ogaemzt” : (dev != null)
log.debug “default fixpercent for this device is set to ${state.default_fix_percent}”
}

private getProductId() {
return device.getDataValue(“manufacturer”)[-7…-1]
}

private isZemiCurtain() {
return (productId == “owvfni3”)
}

private isZemiBlind() {
return (productId == “mcdj3aq” || productId == “zo2pocs”)
}

private isOgaemzt() {
return (productId == “ogaemzt”)
}

private getIsAutoLimitSupported() {
return (productId == “dtjuw7u”)
}

private isDp2PositionDevices() {
return (productId == “ueqqe6k” || productId == “sbebbzs”)
}

private supportDp1State() {
return (productId == “qcqqjpb” || productId == “aabybja”)
}

private doesReportStartPos() {
return (productId == “f1sl3tj”)
}

Hi @Bald-Har

This code that they sent you is an obsolete DTH since they cannot be installed in IDE.

This DTH seems to be made by @iquix , maybe he has an edge driver on his channel for these devices

1 Like

@Mariano_Colmenarejo Thank you for the tip I got the curtainmotor connected to my Smartthings Hub Using @iquix