You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently purchased a Tuya curtain motor, model _TZE204_xu4a5rhj/M3TYW-2.0-13. The motor is of good quality and quiet. However, there is an annoying issue when setting the motor's percentage through the Home Assistant cover UI or the Tuya app's curtain animation, the toZigbee percentage is inverted.
I wrote this converter code, which successfully fixed the problem. I’m curious if others have encountered this same issue or if it’s just a firmware bug specific to my device.
constfz=require('zigbee-herdsman-converters/converters/fromZigbee');consttz=require('zigbee-herdsman-converters/converters/toZigbee');constexposes=require('zigbee-herdsman-converters/lib/exposes');constreporting=require('zigbee-herdsman-converters/lib/reporting');consttuya=require('zigbee-herdsman-converters/lib/tuya');constlegacy=require('zigbee-herdsman-converters/lib/legacy');conste=exposes.presets;constea=exposes.access;constinvertedTuyaCoverControl={key: ['state','position'],convertSet: async(entity,key,value,meta)=>{if(key==='position'){value=100-value;// Invert the position value}returnawaitlegacy.toZigbee.tuya_cover_control.convertSet(entity,key,value,meta);},};constdefinition={zigbeeModel: [],fingerprint: [
...tuya.fingerprint('TS0601',['_TZE204_xu4a5rhj',]),],model: 'TS0601_cover_1',vendor: 'Tuya',description: 'Curtain motor with corrected percentage setting',whiteLabel: [],fromZigbee: [legacy.fromZigbee.tuya_cover,fz.ignore_basic_report],toZigbee: [invertedTuyaCoverControl,legacy.toZigbee.tuya_cover_options],exposes: [e.cover_position().setAccess('position',ea.STATE_SET),e.composite('options','options',ea.STATE_SET).withFeature(e.numeric('motor_speed',ea.STATE_SET).withValueMin(0).withValueMax(255).withDescription('Motor speed')).withFeature(e.binary('reverse_direction',ea.STATE_SET,true,false).withDescription('Reverse the motor direction')),],};module.exports=definition;
What did you expect to happen?
No response
How to reproduce it (minimal and precise)
No response
Zigbee2MQTT version
2.1.3
Adapter firmware version
20240710
Adapter
zStack3x0
Setup
Pi5
Debug log
No response
The text was updated successfully, but these errors were encountered:
devkaiwang
changed the title
Tuya curtain motor (_TZE204_xu4a5rhj/M3TYW-2.0-13) percentage inverted
Tuya M3 curtain motor (_TZE204_xu4a5rhj/M3TYW-2.0-13) percentage inverted
Mar 9, 2025
What happened?
I recently purchased a Tuya curtain motor, model
_TZE204_xu4a5rhj
/M3TYW-2.0-13
. The motor is of good quality and quiet. However, there is an annoying issue when setting the motor's percentage through the Home Assistant cover UI or the Tuya app's curtain animation, thetoZigbee
percentage is inverted.I wrote this converter code, which successfully fixed the problem. I’m curious if others have encountered this same issue or if it’s just a firmware bug specific to my device.
What did you expect to happen?
No response
How to reproduce it (minimal and precise)
No response
Zigbee2MQTT version
Adapter firmware version
20240710
Adapter
zStack3x0
Setup
Pi5
Debug log
No response
The text was updated successfully, but these errors were encountered: