-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 TS0202 TZ3000_mmtwjmaq don't show Battery % #11663
Comments
Could you provide the data points again? |
Sure, PIR state = Code 1 Thanks |
and another mov sensor i have, TS0202 _TYZB01_vwqnz1sn have the same problem |
Can you try with: 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 e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const fzLocal = {
TS0202: {
cluster: 'manuSpecificTuya',
type: ['commandDataResponse', 'commandDataReport'],
convert: (model, msg, publish, options, meta) => {
const result = {};
for (const dpValue of msg.data.dpValues) {
const dp = dpValue.dp;
const value = tuya.getDataValue(dpValue);
switch (dp) {
case 1:
result.occupancy = value === 1;
break;
case 4:
result.battery = value;
break;
default:
meta.logger.warn(`zigbee-herdsman-converters:TS0202 Unrecognized DP #${dp} with data ${JSON.stringify(dpValue)}`);
}
}
return result;
},
},
};
const definition = {
fingerprint: [{modelID: 'TS0202', manufacturerName: '_TYZB01_ef5xlc9q'},
{modelID: 'TS0202', manufacturerName: '_TYZB01_vwqnz1sn'},
{modelID: 'TS0202', manufacturerName: '_TYZB01_2b8f6cio'},
{modelID: 'TS0202', manufacturerName: '_TZE200_bq5c8xfe'},
{modelID: 'TS0202', manufacturerName: '_TYZB01_dl7cejts'},
{modelID: 'TS0202', manufacturerName: '_TYZB01_qjqgmqxr'},
{modelID: 'TS0202', manufacturerName: '_TZ3000_mmtwjmaq'},
{modelID: 'TS0202', manufacturerName: '_TZ3000_kmh5qpmb'},
{modelID: 'TS0202', manufacturerName: '_TYZB01_zwvaj5wy'},
{modelID: 'TS0202', manufacturerName: '_TZ3000_bsvqrxru'},
{modelID: 'TS0202', manufacturerName: '_TYZB01_tv3wxhcz'},
{modelID: 'TS0202', manufacturerName: '_TYZB01_hqbdru35'},
{modelID: 'TS0202', manufacturerName: '_TZ3000_otvn3lne'},
{modelID: 'TS0202', manufacturerName: '_TZ3000_tiwq83wk'},
{modelID: 'TS0202', manufacturerName: '_TZ3000_ykwcwxmz'},
{modelID: 'WHD02', manufacturerName: '_TZ3000_hktqahrq'}],
model: 'TS0202',
vendor: 'TuYa',
description: 'Motion sensor',
whiteLabel: [{vendor: 'Mercator Ikuü', model: 'SMA02P'}, {vendor: 'TuYa', model: 'TY-ZPR06'}],
fromZigbee: [fz.ias_occupancy_alarm_1, fz.battery, fz.ignore_basic_report, fz.ias_occupancy_alarm_1_report, fzLocal.TS0202],
toZigbee: [],
exposes: [e.occupancy(), e.battery_low(), e.tamper(), e.battery(), e.battery_voltage()],
configure: async (device, coordinatorEndpoint, logger) => {
/* uncomment this if it doesn't work */
// const endpoint = device.getEndpoint(1);
// await endpoint.read('genBasic', ['manufacturerName', 'zclVersion', 'appVersion', 'modelId', 'powerSource', 0xfffe]);
},
};
module.exports = definition; If it doens't work, remove the two |
I stop the z2m, change the external, delete device, start z2m again and sync device again |
Yes, did you repair the device after this. If that doesn't help, can you force a configure via the z2m frontend; click on the device and press the yellow reconfigure button (right before doing that make sure to wakeup the device by pressing the button on it) |
yes Koenkk, I still did better. |
Can you try with: 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 e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const fzLocal = {
TS0202: {
cluster: 'manuSpecificTuya',
type: ['commandDataResponse', 'commandDataReport'],
convert: (model, msg, publish, options, meta) => {
const result = {};
for (const dpValue of msg.data.dpValues) {
const dp = dpValue.dp;
const value = tuya.getDataValue(dpValue);
switch (dp) {
case 1:
result.occupancy = value === 1;
break;
case 4:
result.battery = value;
break;
default:
meta.logger.warn(`zigbee-herdsman-converters:TS0202 Unrecognized DP #${dp} with data ${JSON.stringify(dpValue)}`);
}
}
return result;
},
},
};
const definition = {
fingerprint: [{modelID: 'TS0202', manufacturerName: '_TYZB01_ef5xlc9q'},
{modelID: 'TS0202', manufacturerName: '_TYZB01_vwqnz1sn'},
{modelID: 'TS0202', manufacturerName: '_TYZB01_2b8f6cio'},
{modelID: 'TS0202', manufacturerName: '_TZE200_bq5c8xfe'},
{modelID: 'TS0202', manufacturerName: '_TYZB01_dl7cejts'},
{modelID: 'TS0202', manufacturerName: '_TYZB01_qjqgmqxr'},
{modelID: 'TS0202', manufacturerName: '_TZ3000_mmtwjmaq'},
{modelID: 'TS0202', manufacturerName: '_TZ3000_kmh5qpmb'},
{modelID: 'TS0202', manufacturerName: '_TYZB01_zwvaj5wy'},
{modelID: 'TS0202', manufacturerName: '_TZ3000_bsvqrxru'},
{modelID: 'TS0202', manufacturerName: '_TYZB01_tv3wxhcz'},
{modelID: 'TS0202', manufacturerName: '_TYZB01_hqbdru35'},
{modelID: 'TS0202', manufacturerName: '_TZ3000_otvn3lne'},
{modelID: 'TS0202', manufacturerName: '_TZ3000_tiwq83wk'},
{modelID: 'TS0202', manufacturerName: '_TZ3000_ykwcwxmz'},
{modelID: 'WHD02', manufacturerName: '_TZ3000_hktqahrq'}],
model: 'TS0202',
vendor: 'TuYa',
description: 'Motion sensor',
whiteLabel: [{vendor: 'Mercator Ikuü', model: 'SMA02P'}, {vendor: 'TuYa', model: 'TY-ZPR06'}],
fromZigbee: [fz.ias_occupancy_alarm_1, fz.battery, fz.ignore_basic_report, fz.ias_occupancy_alarm_1_report, fzLocal.TS0202],
toZigbee: [],
exposes: [e.occupancy(), e.battery_low(), e.tamper(), e.battery(), e.battery_voltage()],
configure: async (device, coordinatorEndpoint, logger) => {
/* uncomment this if it doesn't work */
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
await reporting.batteryPercentageRemaining(endpoint);
// await endpoint.read('genBasic', ['manufacturerName', 'zclVersion', 'appVersion', 'modelId', 'powerSource', 0xfffe]);
},
};
module.exports = definition; (make sure to repair the device after this) |
Does the |
no koenkk, it's the same |
can we (you can), create an external just for this sensor and leave the other one as it was working? |
Could you maybe sniff the traffic when pairing the |
it is possible ? I have a conbee II and rpi4. |
For that you need to buy a CC2531 sniffer + flasher, up to you if you want to invest on this (no guarantees this will fix the issue), I will add the fix for |
So I'm not interested thanks, much less no guarantees |
Hello Koenkk |
1 similar comment
Hello Koenkk |
I have make the update from zigbee2mqtt 1.24.0 to 1.25.0 and then the battery value is coming. |
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 |
What happened?
Tuya TS0202 TZ3000_mmtwjmaq don't show Battery %
What did you expect to happen?
No response
How to reproduce it (minimal and precise)
When join don't show battery %
Zigbee2MQTT version
1.24.0-1
Adapter firmware version
0x26720700
Adapter
ConBee2
Debug log
{"id":35,"type":"EndDevice","ieeeAddr":"0xa4c138981d3988ff","nwkAddr":51615,"manufId":4417,"manufName":"_TZ3000_mmtwjmaq","powerSource":"Battery","modelId":"TS0202","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":1026,"inClusterList":[1,1280,3,0],"outClusterList":[4096,6,25,10],"clusters":{"genBasic":{"attributes":{"powerSource":3,"stackVersion":0,"dateCode":""}},"ssIasZone":{"attributes":{"61441":1,"currentZoneSensitivityLevel":1,"iasCieAddr":"0x00212effff07afaa","zoneState":1}}},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":67,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{},"lastSeen":1643543150792,"useImplicitCheckin":true}
The text was updated successfully, but these errors were encountered: