-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TuYa_cover_control: Unhandled DP #101 for _TZE200_zah67ekd #17363
Comments
To figure out what these dp means, please follow https://www.zigbee2mqtt.io/advanced/support-new-devices/03_find_tuya_data_points.html |
Unfortunately I do not have Tuya Zigbee Gateway, but I'd assume that value of 0 for DP 101 means the device switched to tilt mode and value of 1 means the device switched to lift mode. I may order the gateway at some point as I'd also like to figure out the battery level and light sensor (from the solar panel) reporting for this motor. Any recommendation which one to buy (and nod spend fortune on it)? Preferably a wired one. |
Can you check with the following external converter: https://gist.github.com/Koenkk/12256a02e6f582e4e369014d2ff1d03b
external_converters:
- ext_converter.js
|
After adding the converter and playing a bit with the motor, yes, all four DPs are visible in the State tab However with the new converter it is no longer possible to change the Also the Oh, and it would be great if the 4 new DPs were modifiable from the Z2M UI. |
We will add this back later, this is just for testing the converter. I'm a bit confused the upper/lower limit is a boolean, this doesn't make sense right? (should be a numerical value?) |
No, it does not return any numerical value, the boolean value just informs you whether the limit has been set or not. Before the limits are set the The way it works in the app is that you move the blind to the end position and set the corresponding limit to true. Once you've set both of them the motor now knows where the 0% and 100% is and starts returning the Once set it is not possible to change the limits in the app. The only way to do that is to do the BTW there are two more DPs:
I've added them to the converter file you provided and they are nicely updated on the Exposes tab const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const ota = require('zigbee-herdsman-converters/lib/ota');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const utils = require('zigbee-herdsman-converters/lib/utils');
const globalStore = require('zigbee-herdsman-converters/lib/store');
const e = exposes.presets;
const ea = exposes.access;
const definition = {
fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_zah67ekd'}],
model: 'TS0601_cover_custom',
vendor: 'TuYa',
description: 'Curtain motor/roller blind motor/window pusher/tubular motor',
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
exposes: [
e.cover_position().setAccess('position', ea.STATE_SET),
exposes.enum('work_state', ea.STATE_SET, ['opening', 'closing').withDescription('Last working state'),
exposes.enum('reverse_direction', ea.STATE_SET, ['forward', 'back']).withDescription('Reverse the motor direction'),
exposes.numeric('motor_speed', ea.STATE_SET).withValueMin(0).withValueMax(255).withDescription('Motor speed'),
exposes.enum('mode', ea.STATE_SET, ['tilt', 'lift']).withDescription('Mode'),
exposes.binary('factory_reset', ea.STATE_SET, true, false).withDescription('Factory reset'),
exposes.binary('upper_limit', ea.STATE_SET, true, false).withDescription('Upper limit'),
exposes.binary('bottom_limit', ea.STATE_SET, true, false).withDescription('Bottom limit'),
],
meta: {
tuyaDatapoints: [
[1, 'state', tuya.valueConverterBasic.lookup({'OPEN': tuya.enum(0), 'STOP': tuya.enum(1), 'CLOSE': tuya.enum(2)})],
[2, 'position', tuya.valueConverter.coverPosition],
[3, 'position', tuya.valueConverter.raw],
[5, 'reverse_direction', tuya.valueConverterBasic.lookup({'forward': tuya.enum(0), 'back': tuya.enum(1)})],
[7, 'work_state', tuya.valueConverterBasic.lookup({'opening': tuya.enum(0), 'closing': tuya.enum(1)})],
[101, 'mode', tuya.valueConverterBasic.lookup({'tilt': tuya.enum(0), 'lift': tuya.enum(1)})],
[102, 'factory_reset', tuya.valueConverter.raw],
[103, 'upper_limit', tuya.valueConverter.raw],
[104, 'bottom_limit', tuya.valueConverter.raw],
[105, 'motor_speed', tuya.valueConverter.raw],
],
},
};
module.exports = definition; |
I see you added the corresponding exposes, can you try if setting them works? |
Please check with https://gist.github.com/Koenkk/12256a02e6f582e4e369014d2ff1d03b |
No change, same errors. :( |
Made a mistake, updated https://gist.github.com/Koenkk/12256a02e6f582e4e369014d2ff1d03b |
Unfortunately that did not help either, still same errors :( |
Ah sorry, made another mistake, https://gist.github.com/Koenkk/12256a02e6f582e4e369014d2ff1d03b should do it |
Please test with https://gist.github.com/Koenkk/12256a02e6f582e4e369014d2ff1d03b |
After correcting the DP names in the key array (the linked file had still the old ones) everything except position works (I'll switch to the dev branch later and report back), but I have some suggestions:
|
Had some issues with switching to the latest-dev branch so I've tested position with Zigbee2MQTT Edge Add-on (which I believe is an equivalent of the dev branch) and the position setting works well. Let me know if that is enough. |
Updated https://gist.github.com/Koenkk/12256a02e6f582e4e369014d2ff1d03b
Let me know if everything is OK then I will merge it. |
The strings in 'key' array are still incorrect. Regarding limit setting I have the following proposal (similar to mobile app behavior). The value is displayed as boolean, but when setting (regardless of which value is chosen) it will be always set to true. changes to the valueConverter const valueConverter = {
setTrue: {
to: (v) => true,
from: (v) => v,
},
}; changes to exposes exposes.binary('set_upper_limit', ea.STATE_SET, true, false).withDescription('Set the upper limit, to reset limits use factory_reset'),
exposes.binary('set_bottom_limit', ea.STATE_SET, true, false).withDescription('Set the bottom limit, to reset limits use factory_reset'), Not sure if that is 100% correct (not an expert in JS, doing some guesswork here) but it works for me - it displays the current state (which was missing) and always sets the value to true. The only thing I'd change would be to make the value read only when it is true, but I don't know how to do that. That would be the exact copy of the mobile app behavior. |
Will fix this once it's integrated
We cannot make it readonly in the UI, what we can do is throw an error when false is set: const valueConverter = {
setTrue: {
to: (v) => {
if (v) return true;
else throw new Error('Limit cannot be unset, use factory_reset')
},
from: (v) => v,
},
}; |
That did the trick. I think it is ready to be integrated. |
Great, integrated! Changes will be available in the dev branch in a few hours from now. (https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html) |
I can see the |
nope, fixed! |
Thanks, will do that (with the next release on 1 May) |
I'm afraid the newly released 1.30.4 version still has the limit DPs set as enum rather then the binary. |
1.30.4 has messed up the cover/blinds with homeassistant to be fair :( |
You mean for the Moes motors, or in general? The Moes motors seem to work for me. |
|
hello! What about the battery state? |
What happened?
When switching the Moes AM43-0.45/40-ES-EZ(TY) cover motor between the tilt and lift mode (by pressing the SET button 5 times) I'm getting the "Unhandled DP #101" errors as on screenshots below:
Any chance to add support for this DP?
What did you expect to happen?
I'd expect the DP #101 to be handled
How to reproduce it (minimal and precise)
Power on and bind the motor. Press the set button 5 times, observe the logs/errors
Zigbee2MQTT version
1.30.3-1
Adapter firmware version
20210708
Adapter
Itead_Sonoff_Zigbee_3.0_USB_Dongle_Plus
Debug log
No response
The text was updated successfully, but these errors were encountered: