Skip to content

Commit

Permalink
fix(detect): Detect _TZB210_lmqquxus as Tuya TS0502B Koenkk/zigbee2…
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Sep 14, 2024
1 parent 1121ba1 commit 3d90c8a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/devices/tuya.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2943,6 +2943,7 @@ const definitions: DefinitionWithExtend[] = [
},
},
{
fingerprint: tuya.fingerprint('TS0503B', ['_TZB210_lmqquxus']),
zigbeeModel: ['TS0502B'],
model: 'TS0502B',
vendor: 'Tuya',
Expand Down Expand Up @@ -5155,14 +5156,14 @@ const definitions: DefinitionWithExtend[] = [
await tuya.configureMagicPacket(device, coordinatorEndpoint);
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'haElectricalMeasurement', 'seMetering']);
await reporting.rmsVoltage(endpoint, {change: 5});
await reporting.rmsCurrent(endpoint, {change: 50});
// await reporting.rmsVoltage(endpoint, {change: 5});
// await reporting.rmsCurrent(endpoint, {change: 50});

if (!['_TZ3000_0zfrhq4i', '_TZ3000_okaz9tjs', '_TZ3000_typdpbpg'].includes(device.manufacturerName)) {
// Gives INVALID_DATA_TYPE error for _TZ3000_0zfrhq4i (as well as a few others in issue 20028)
// https://github.com/Koenkk/zigbee2mqtt/discussions/19680#discussioncomment-7667035
await reporting.activePower(endpoint, {change: 10});
}
// if (!['_TZ3000_0zfrhq4i', '_TZ3000_okaz9tjs', '_TZ3000_typdpbpg'].includes(device.manufacturerName)) {
// // Gives INVALID_DATA_TYPE error for _TZ3000_0zfrhq4i (as well as a few others in issue 20028)
// // https://github.com/Koenkk/zigbee2mqtt/discussions/19680#discussioncomment-7667035
// await reporting.activePower(endpoint, {change: 10});
// }
await reporting.currentSummDelivered(endpoint);
const acCurrentDivisor = device.manufacturerName === '_TZ3000_typdpbpg' ? 2000 : 1000;
endpoint.saveClusterAttributeKeyValue('haElectricalMeasurement', {acCurrentDivisor, acCurrentMultiplier: 1});
Expand Down

0 comments on commit 3d90c8a

Please sign in to comment.