Skip to content
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

Fix _TZ3000_cehuw1lw with appversion 112 #7482

Merged
merged 2 commits into from
May 9, 2024
Merged

Conversation

hutchx86
Copy link
Contributor

@hutchx86 hutchx86 commented May 3, 2024

Added application version 112 to the fingerprint check for TS011F with power monitoring by polling due to a misbehaving plug _TZ3000_cehuw1lw running appversion 112, and swBuild 1.0.5 which was reporting amps x 1000 and was not reporting kWh until this change

Not 100% certain this won't break other plugs on appversion 112, so we could potentially use the swBuild 1.0.5 as a fingerprint instead to match, since https://www.zigbee2mqtt.io/devices/TS011F_plug_3.html#tuya-ts011f_plug_3 mentions that plugs with 1.0.5 seem to be impacted specifically

@Koenkk
Copy link
Owner

Koenkk commented May 4, 2024

This was already done before but reverted: #6731 @DataGhost could you provide the data/database.db entry of your TS011F_plug_1?

@hutchx86
Copy link
Contributor Author

hutchx86 commented May 4, 2024

Of course, here's the database entry after I removed the fix and re-paired the plug:

id: 31
type: Router
ieeeAddr: '0xa4c13806a55864d9'
nwkAddr: 25375
manufId: 4417
manufName: _TZ3000_cehuw1lw
powerSource: Mains (single phase)
modelId: TS011F
epList:
  - 1
endpoints:
  '1':
    profId: 260
    epId: 1
    devId: 81
    inClusterList:
      - 0
      - 3
      - 4
      - 5
      - 6
      - 10
      - 57344
      - 1794
      - 2820
      - 4096
      - 6280
    outClusterList:
      - 25
    clusters:
      genBasic:
        attributes:
          hwVersion: 0
          manufacturerName: _TZ3000_cehuw1lw
          zclVersion: 3
          appVersion: 112
          modelId: TS011F
          powerSource: 1
      genOnOff:
        attributes:
          '32768': 0
          onOff: 1
          tuyaBacklightMode: 1
          moesStartUpOnOff: 0
          onTime: 0
          offWaitTime: 0
      haElectricalMeasurement:
        attributes:
          rmsVoltage: 239
          rmsCurrent: 0
          activePower: 0
      seMetering:
        attributes:
          currentSummDelivered:
            - 0
            - 0
    binds:
      - cluster: 6
        type: endpoint
        deviceIeeeAddress: '0x00124b0026b86e7d'
        endpointID: 1
      - cluster: 2820
        type: endpoint
        deviceIeeeAddress: '0x00124b0026b86e7d'
        endpointID: 1
      - cluster: 1794
        type: endpoint
        deviceIeeeAddress: '0x00124b0026b86e7d'
        endpointID: 1
    configuredReportings:
      - cluster: 2820
        attrId: 1285
        minRepIntval: 5
        maxRepIntval: 3600
        repChange: 5
        manufacturerCode: null
      - cluster: 2820
        attrId: 1288
        minRepIntval: 5
        maxRepIntval: 3600
        repChange: 50
        manufacturerCode: null
    meta: {}
appVersion: 112
stackVersion: 2
hwVersion: 0
swBuildId: "1.0.5\0"
zclVersion: 3
interviewCompleted: true
meta: {}
lastSeen: 1714865728549

@DataGhost
Copy link
Contributor

This was already done before but reverted: #6731 @DataGhost could you provide the data/database.db entry of your TS011F_plug_1?

I have been way behind on all of the things I wanted to do here and currently migrating my setup to a different server while busy with a ton of other things. If you meant test this PR as an external converter I'll have to say I can try that hopefully this week. I'm currently not on the dev branch so on 1.37.0 commit: 46f34c8 with 19.32.0 my current db entry for one of them is:

{
   "appVersion" : 112,
   "endpoints" : {
      "1" : {
         "binds" : [
            {
               "cluster" : 6,
               "deviceIeeeAddress" : "0xdc8e95fffe27a7de",
               "endpointID" : 1,
               "type" : "endpoint"
            },
            {
               "cluster" : 2820,
               "deviceIeeeAddress" : "0xdc8e95fffe27a7de",
               "endpointID" : 1,
               "type" : "endpoint"
            },
            {
               "cluster" : 1794,
               "deviceIeeeAddress" : "0xdc8e95fffe27a7de",
               "endpointID" : 1,
               "type" : "endpoint"
            }
         ],
         "clusters" : {
            "genBasic" : {
               "attributes" : {
                  "appVersion" : 112,
                  "hwVersion" : 0,
                  "manufacturerName" : "_TZ3000_okaz9tjs",
                  "modelId" : "TS011F",
                  "powerSource" : 1,
                  "stackVersion" : 2,
                  "swBuildId" : "0122052017",
                  "zclVersion" : 3
               }
            },
            "genOnOff" : {
               "attributes" : {
                  "32768" : 0,
                  "moesStartUpOnOff" : 0,
                  "offWaitTime" : 0,
                  "onOff" : 1,
                  "onTime" : 0,
                  "tuyaBacklightMode" : 1
               }
            },
            "haElectricalMeasurement" : {
               "attributes" : {
                  "acCurrentDivisor" : 1000,
                  "acCurrentMultiplier" : 1,
                  "acVoltageDivisor" : 1,
                  "acVoltageMultiplier" : 1,
                  "activePower" : 84,
                  "rmsCurrent" : 400,
                  "rmsVoltage" : 245
               }
            },
            "seMetering" : {
               "attributes" : {
                  "currentSummDelivered" : [
                     0,
                     9921
                  ],
                  "divisor" : 100,
                  "multiplier" : 1
               }
            }
         },
         "configuredReportings" : [
            {
               "attrId" : 0,
               "cluster" : 6,
               "manufacturerCode" : null,
               "maxRepIntval" : 65000,
               "minRepIntval" : 0,
               "repChange" : 1
            },
            {
               "attrId" : 1285,
               "cluster" : 2820,
               "manufacturerCode" : null,
               "maxRepIntval" : 3600,
               "minRepIntval" : 5,
               "repChange" : 5
            },
            {
               "attrId" : 1288,
               "cluster" : 2820,
               "manufacturerCode" : null,
               "maxRepIntval" : 3600,
               "minRepIntval" : 5,
               "repChange" : 50
            },
            {
               "attrId" : 0,
               "cluster" : 1794,
               "manufacturerCode" : null,
               "maxRepIntval" : 3600,
               "minRepIntval" : 5,
               "repChange" : 2
            }
         ],
         "devId" : 81,
         "epId" : 1,
         "inClusterList" : [
            0,
            3,
            4,
            5,
            6,
            10,
            57344,
            1794,
            2820,
            4096,
            6280
         ],
         "meta" : {},
         "outClusterList" : [
            25
         ],
         "profId" : 260
      },
      "242" : {
         "binds" : [],
         "clusters" : {},
         "configuredReportings" : [],
         "devId" : 97,
         "epId" : 242,
         "inClusterList" : [],
         "meta" : {},
         "outClusterList" : [
            33
         ],
         "profId" : 41440
      }
   },
   "epList" : [
      1,
      242
   ],
   "hwVersion" : 0,
   "id" : 41,
   "ieeeAddr" : "0xa4c13801e33848a2",
   "interviewCompleted" : true,
   "lastSeen" : 1715072778376,
   "manufId" : 4107,
   "manufName" : "_TZ3000_okaz9tjs",
   "meta" : {
      "configured" : 1310285083
   },
   "modelId" : "TS011F",
   "nwkAddr" : 7339,
   "powerSource" : "Mains (single phase)",
   "stackVersion" : 2,
   "swBuildId" : "0122052017",
   "type" : "Router",
   "zclVersion" : 3
}

@Koenkk
Copy link
Owner

Koenkk commented May 7, 2024

The one from @DataGhost has swBuildId 0122052017, so please add swBuildId 1.0.5 to the fingerprint and check if it works

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
@hutchx86 hutchx86 reopened this May 9, 2024
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
@hutchx86
Copy link
Contributor Author

hutchx86 commented May 9, 2024

Done. Changed the Fingerprint from a map to a list as well to make it consistent with the rest of the converters and easier to add stuff in the future, and added the entire 1.0.5 swbuild to the fingerprint so all cases with such broken firmware should now be caught

@Koenkk Koenkk merged commit 4182889 into Koenkk:master May 9, 2024
2 checks passed
@Koenkk
Copy link
Owner

Koenkk commented May 9, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants