Skip to content

Commit

Permalink
fix: Fix electrical measurements not working for _TZ3000_cehuw1lw w…
Browse files Browse the repository at this point in the history
…ith swBuilId `1.0.5` (#7482)

* Fix TS011F on swBuild 1.0.5
Edit TS011F_plug_3 fingerprint to include devices
running the known bad 1.0.5 firmware version as

rewrote mapping to a list to make it easier to
make exceptions in the future

listed on https://www.zigbee2mqtt.io/devices/TS011F_plug_3.html#tuya-ts011f_plug_3

* Fix TS011F on swBuild 1.0.5
Edit TS011F_plug_3 fingerprint to include devices
running the known bad 1.0.5 firmware version as

rewrote mapping to a list to make it easier to
make exceptions in the future

listed on https://www.zigbee2mqtt.io/devices/TS011F_plug_3.html#tuya-ts011f_plug_3

---------

Co-authored-by: hutchx86 <hutchx86@outlook.com>
  • Loading branch information
hutchx86 and hutchx86 committed May 9, 2024
1 parent 157b71f commit 4182889
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/devices/tuya.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4280,9 +4280,15 @@ const definitions: Definition[] = [
},
},
{
fingerprint: [160, 100, 69, 68, 65, 64].map((applicationVersion) => {
return {modelID: 'TS011F', applicationVersion, priority: -1};
}),
fingerprint: [
{modelID: 'TS011F', applicationVersion: 160, priority: -1},
{modelID: 'TS011F', applicationVersion: 100, priority: -1},
{modelID: 'TS011F', applicationVersion: 69, priority: -1},
{modelID: 'TS011F', applicationVersion: 68, priority: -1},
{modelID: 'TS011F', applicationVersion: 65, priority: -1},
{modelID: 'TS011F', applicationVersion: 64, priority: -1},
{modelID: 'TS011F', softwareBuildID: '1.0.5\u0000', priority: -1},
],
model: 'TS011F_plug_3',
description: 'Smart plug (with power monitoring by polling)',
vendor: 'TuYa',
Expand All @@ -4304,7 +4310,7 @@ const definitions: Definition[] = [
onEvent: (type, data, device, options) =>
tuya.onEventMeasurementPoll(type, data, device, options,
true, // polling for voltage, current and power
[100, 160].includes(device.applicationVersion), // polling for energy
[100, 160].includes(device.applicationVersion) || ['1.0.5\u0000'].includes(device.softwareBuildID), // polling for energy
),
},
{
Expand Down

0 comments on commit 4182889

Please sign in to comment.