Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
11.9k stars 1.66k forks source link

TuYa TS130F Calibration not working correctly #17250

Closed teunaldo closed 1 year ago

teunaldo commented 1 year ago

What happened?

The gate only opens only to roundabout 85%. In Z2M it says the gate is fully opened.

The closure of the gate doesn't stop. When I stop it at the place I want, Z2M says it is opened for 14%.

When I try this again after some times The gate only opens only to roundabout 75%. In Z2M it says the gate is fully opened.

The closure of the gate doesn't stop. When I stop it at the place I want, Z2M says it is opened for 25%.

What did you expect to happen?

When I press OPEN in state, the gate should completely open.

When I press CLOSE in state, the gate should close to the point I have set up.

How to reproduce it (minimal and precise)

The device I used is a Loratap Curtain Switch 2nd Generation module https://nl.aliexpress.com/item/1005003123388237.html?spm=a2g0o.order_list.order_list_main.27.28a579d2KcWLFG&gatewayAdapt=glo2nld

As the documentation described I did the following: Press the open button on the switch, wait until the curtains are completely open. The gate was opened completely. Press the pause button on the switch. I pressed the STOP button in Z2M state Put the device into calibration mode, see below. I set the calibration to "ON". I have done this 2 ways:

Zigbee2MQTT version

1.30.3-1

Adapter firmware version

20221226

Adapter

Slaesh cc2652-stick

Debug log

debug 2023-04-05 10:41:07Received MQTT message on 'zigbee2mqtt/0xa4c138b658803b99/set' with data '{"state":"OPEN"}' debug 2023-04-05 10:41:07Publishing 'set' 'state' to '0xa4c138b658803b99' debug 2023-04-05 10:41:07Received Zigbee message from '0xa4c138b658803b99', type 'attributeReport', cluster 'closuresWindowCovering', data '{"currentPositionLiftPercentage":14,"tuyaMovingState":0}' from endpoint 1 with groupID 0 info 2023-04-05 10:41:07MQTT publish: topic 'zigbee2mqtt/0xa4c138b658803b99', payload '{"backlight_mode":"high","calibration":"OFF","calibration_time":16.2,"linkquality":65,"motor_reversal":"OFF","moving":"UP","position":14,"state":"OPEN"}' info 2023-04-05 10:41:07MQTT publish: topic 'zigbee2mqtt/0xa4c138b658803b99/mode', payload '{"backlight":"high"}' debug 2023-04-05 10:41:22Received Zigbee message from '0xa4c138b658803b99', type 'attributeReport', cluster 'closuresWindowCovering', data '{"currentPositionLiftPercentage":100,"tuyaMovingState":1}' from endpoint 1 with groupID 0 info 2023-04-05 10:41:22MQTT publish: topic 'zigbee2mqtt/0xa4c138b658803b99', payload '{"backlight_mode":"high","calibration":"OFF","calibration_time":16.2,"linkquality":65,"motor_reversal":"OFF","moving":"STOP","position":100,"state":"OPEN"}' info 2023-04-05 10:41:22MQTT publish: topic 'zigbee2mqtt/0xa4c138b658803b99/mode', payload '{"backlight":"high"}' debug 2023-04-05 10:41:33Received MQTT message on 'zigbee2mqtt/0xa4c138b658803b99/set' with data '{"state":"CLOSE"}' debug 2023-04-05 10:41:33Publishing 'set' 'state' to '0xa4c138b658803b99' debug 2023-04-05 10:41:33Received Zigbee message from '0xa4c138b658803b99', type 'attributeReport', cluster 'closuresWindowCovering', data '{"currentPositionLiftPercentage":100,"tuyaMovingState":2}' from endpoint 1 with groupID 0 info 2023-04-05 10:41:33MQTT publish: topic 'zigbee2mqtt/0xa4c138b658803b99', payload '{"backlight_mode":"high","calibration":"OFF","calibration_time":16.2,"linkquality":65,"motor_reversal":"OFF","moving":"DOWN","position":100,"state":"OPEN"}' info 2023-04-05 10:41:33MQTT publish: topic 'zigbee2mqtt/0xa4c138b658803b99/mode', payload '{"backlight":"high"}' debug 2023-04-05 10:41:45Received MQTT message on 'zigbee2mqtt/0xa4c138b658803b99/set' with data '{"state":"STOP"}' debug 2023-04-05 10:41:45Publishing 'set' 'state' to '0xa4c138b658803b99' debug 2023-04-05 10:41:45Received Zigbee message from '0xa4c138b658803b99', type 'attributeReport', cluster 'closuresWindowCovering', data '{"currentPositionLiftPercentage":25,"tuyaMovingState":1}' from endpoint 1 with groupID 0 info 2023-04-05 10:41:45MQTT publish: topic 'zigbee2mqtt/0xa4c138b658803b99', payload '{"backlight_mode":"high","calibration":"OFF","calibration_time":16.2,"linkquality":65,"motor_reversal":"OFF","moving":"STOP","position":25,"state":"OPEN"}' info 2023-04-05 10:41:45MQTT publish: topic 'zigbee2mqtt/0xa4c138b658803b99/mode', payload '{"backlight":"high"}'

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

stryna90 commented 1 year ago

@teunaldo Did you maybe found solution for your problem? I have exactly the same issue

RECOIL101 commented 1 year ago

I have the same problem. The blind does not open to the final position, but is approx. 5-10% closed. State value says open (100%). Has anyone found a solution to this problem?

teunaldo commented 1 year ago

Nope, haven’t found a solution.Op 21 jun. 2023 om 10:24 heeft stryna90 @.***> het volgende geschreven: @teunaldo Did you maybe found solution for your problem? I have exactly the same issue

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

platte-73 commented 1 year ago

I have also this problem. Only opens for 85%. When I push after opening on the switch itself it will open 100%.

Hope someone has a fix for this

platte-73 commented 1 year ago

Found a fix. my calibration time was 26.4 s and that was not enough to close to 100%

so this is wat I did

From the Dev console, Select endpoint=1, cluster=Closures and moesCalibrationTime attribute and change their manual value to adjust to my needs. Everything is OK. Changed value to 29s and now it is closing completly

RECOIL101 commented 1 year ago

Found a fix. my calibration time was 26.4 s and that was not enough to close to 100%

so this is wat I did

From the Dev console, Select endpoint=1, cluster=Closures and moesCalibrationTime attribute and change their manual value to adjust to my needs. Everything is OK. Changed value to 29s and now it is closing completly

Thx for the info.

Saddly this is not working for me. I've changed calibration_time value but still blinds but the blinds still do not close completely. Maybe someone knows if the switch can be reset to factory default settings?

platte-73 commented 1 year ago

Found a fix. my calibration time was 26.4 s and that was not enough to close to 100% so this is wat I did From the Dev console, Select endpoint=1, cluster=Closures and moesCalibrationTime attribute and change their manual value to adjust to my needs. Everything is OK. Changed value to 29s and now it is closing completly

Thx for the info.

Saddly this is not working for me. I've changed calibration_time value but still blinds but the blinds still do not close completely. Maybe someone knows if the switch can be reset to factory default settings?

What kind of blinds are you using with the switch. Are you sure the motor is not stopping the blind instead of the switch.

RECOIL101 commented 1 year ago

Found a fix. my calibration time was 26.4 s and that was not enough to close to 100% so this is wat I did From the Dev console, Select endpoint=1, cluster=Closures and moesCalibrationTime attribute and change their manual value to adjust to my needs. Everything is OK. Changed value to 29s and now it is closing completly

Thx for the info. Saddly this is not working for me. I've changed calibration_time value but still blinds but the blinds still do not close completely. Maybe someone knows if the switch can be reset to factory default settings?

What kind of blinds are you using with the switch. Are you sure the motor is not stopping the blind instead of the switch.

Sorry for a late replay. Motor is not stopping the blind. Motor is old (15 years) but works just fine. It also workerd fine with shelly2.5 relay. But I have changed it with zigbee device, because I had too many devices on my wifi network. :) Now I'm stuck with this 3 switches which "work", but the blinds does not open all the way, which is annoying. I have tried too automate switch. Everytime I fully open the blinds I would open calibration, open the blinds, and auto write time via mqtt. This works only if I also use motor_reversal function. The blinds are fully closed but then position is f**ked up. Dead end for me...

finipini commented 1 year ago

My problem with this device is that even after calibration, if the shutter is fully opened ( 100 % in z2m) and if i click the open button it will close the open relay again for the time setted in calibration time.

In other words : every time i click up or down ( in z2m or local buttons) it will always close the respective relay for the time set in calibration-time, no mather what position it is.

Of course the shutter have it,s own switchs to stop in the 2 ends, but this should not work this way.

TobiasB91 commented 7 months ago

I have the same problem...:(

RECOIL101 commented 6 months ago

Maybe someone will find this solution for incomplete closure of the blinds usefull. This is how I've solved this problem.

- id: b54984cd-9946-436b-86d2-cd91671100e6
  alias: If cover blinds right open
  trigger:
    - platform: state
      entity_id: sensor.blinds_right_moving
      from: 'UP'
      to: 'STOP'
  condition:
    condition: and
    conditions:  
    - condition: numeric_state
      entity_id: sensor.blinds_right_position
      above: 99
    - condition: state
      entity_id: input_boolean.right_blind_helper
      state: 'on'      
  action:
# bedno TUYA stikalo - zaradi razlike v času dviganja in spuščanja se rolete ne zaprejo 100%. Popravljam pozicijo "ročno".     
    - service: mqtt.publish
      data:
        topic: "zigbee2mqtt/blinds right/1/set"
        payload: '{"write":{"cluster":"closuresWindowCovering","options":{},"payload":{"currentPositionLiftPercentage": 80}}}'
    - delay: '00:00:01'
    - service: cover.open_cover
      entity_id: cover.blinds_right
    - service: input_boolean.turn_off
      entity_id: input_boolean.right_blind_helper      
  mode: single
diverudi commented 3 months ago

Found a fix. my calibration time was 26.4 s and that was not enough to close to 100% so this is wat I did From the Dev console, Select endpoint=1, cluster=Closures and moesCalibrationTime attribute and change their manual value to adjust to my needs. Everything is OK. Changed value to 29s and now it is closing completly

Thx for the info.

Saddly this is not working for me. I've changed calibration_time value but still blinds but the blinds still do not close completely. Maybe someone knows if the switch can be reset to factory default settings?

Hello all,

if you are interested, I could solve the problem for me (this switch has two calibration values, one for open and one for close)

I did the calibration and then write the same value manually: From the Dev console, Select endpoint=2, cluster=Closures and moesCalibrationTime attribute and change their manual value to adjust to my needs. Everything is OK.

Please take care on the endpoint! " endpoint=2"

fets13 commented 3 months ago

@diverudi what is your model?

diverudi commented 3 months ago

In Z4M it shows "Tuya TS130F" on aliexpress it is LoraTap 2nd generation "Tuya Smart Leben ZigBee 3,0" Tuya Smart Leben ZigBee 3,0

aldifesu commented 1 week ago

Found a fix. my calibration time was 26.4 s and that was not enough to close to 100% so this is wat I did From the Dev console, Select endpoint=1, cluster=Closures and moesCalibrationTime attribute and change their manual value to adjust to my needs. Everything is OK. Changed value to 29s and now it is closing completly

Thx for the info. Saddly this is not working for me. I've changed calibration_time value but still blinds but the blinds still do not close completely. Maybe someone knows if the switch can be reset to factory default settings?

Hello all,

if you are interested, I could solve the problem for me (this switch has two calibration values, one for open and one for close)

I did the calibration and then write the same value manually: From the Dev console, Select endpoint=2, cluster=Closures and moesCalibrationTime attribute and change their manual value to adjust to my needs. Everything is OK.

Please take care on the endpoint! " endpoint=2"

@diverudi Hello, I also have the LoraTap 2nd generation. What do you mean is that the rise/open time is set for endpoint 1 and the time it takes to go down/close is set for endpoint 2? Or do you set the same time for endpoint1 and endpoint2?

diverudi commented 1 week ago

@diverudi Hello, I also have the LoraTap 2nd generation. What do you mean is that the rise/open time is set for endpoint 1 and the time it takes to go down/close is set for endpoint 2? Or do you set the same time for endpoint1 and endpoint2?

@aldifesu I set the same value in endpoint 2 as in endpoint 1, so the same time in both entries works well for my devices.