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: Fix incorrect configured reporting cluster returned when cluster is manufacturer specific #756

Merged
merged 1 commit into from
Sep 2, 2023

Conversation

Koenkk
Copy link
Owner

@Koenkk Koenkk commented Sep 2, 2023

Follow up of #748

@Koenkk Koenkk merged commit 09515bb into master Sep 2, 2023
@Koenkk Koenkk deleted the fix/reporting branch September 2, 2023 07:09
@Koenkk
Copy link
Owner Author

Koenkk commented Sep 2, 2023

@sjorge I've fixed it a bit different now, please check again with latest-dev

@sjorge
Copy link
Contributor

sjorge commented Sep 2, 2023

{
  "id": 106,
  "type": "EndDevice",
  "ieeeAddr": "0x0015bc003600176d",
  "nwkAddr": 62219,
  "manufId": 4117,
  "manufName": "frient A/S",
  "powerSource": "Battery",
  "modelId": "AQSZB-110",
  "epList": [
    1,
    38
  ],
  "endpoints": {
    "1": {
      "profId": 49353,
      "epId": 1,
      "devId": 1,
      "inClusterList": [
        3,
        5,
        6
      ],
      "outClusterList": [],
      "clusters": {},
      "binds": [],
      "configuredReportings": [],
      "meta": {}
    },
    "38": {
      "profId": 260,
      "epId": 38,
      "devId": 770,
      "inClusterList": [
        0,
        1,
        3,
        32,
        1026,
        1029,
        1070,
        64515
      ],
      "outClusterList": [
        3,
        10,
        25
      ],
      "clusters": {
        "genBasic": {
          "attributes": {
            "modelId": "AQSZB-110",
            "manufacturerName": "frient A/S",
            "powerSource": 3,
            "zclVersion": 1,
            "dateCode": "20220428 22:28",
            "develcoPrimarySwVersion": {
              "type": "Buffer",
              "data": [
                4,
                0,
                1
              ]
            },
            "develcoPrimaryHwVersion": {
              "type": "Buffer",
              "data": [
                1,
                1,
                0
              ]
            }
          }
        },
        "genPollCtrl": {
          "attributes": {
            "checkinInterval": 14400
          }
        },
        "manuSpecificPhilips2": {
          "attributes": {
            "measuredValue": 326,
            "resolution": 1
          }
        },
        "msTemperatureMeasurement": {
          "attributes": {
            "measuredValue": 2270,
            "tolerance": 20
          }
        },
        "msRelativeHumidity": {
          "attributes": {
            "measuredValue": 6990,
            "tolerance": 200
          }
        },
        "genPowerCfg": {
          "attributes": {
            "batteryVoltage": 28,
            "batteryAlarmState": 0
          }
        },
        "develcoSpecificAirQuality": {
          "attributes": {
            "measuredValue": 650,
            "resolution": 1
          }
        }
      },
      "binds": [
        {
          "cluster": 32,
          "type": "endpoint",
          "deviceIeeeAddress": "0x00124b00228120b5",
          "endpointID": 1
        },
        {
          "cluster": 64515,
          "type": "endpoint",
          "deviceIeeeAddress": "0x00124b00228120b5",
          "endpointID": 1
        },
        {
          "cluster": 1026,
          "type": "endpoint",
          "deviceIeeeAddress": "0x00124b00228120b5",
          "endpointID": 1
        },
        {
          "cluster": 1029,
          "type": "endpoint",
          "deviceIeeeAddress": "0x00124b00228120b5",
          "endpointID": 1
        },
        {
          "cluster": 1,
          "type": "endpoint",
          "deviceIeeeAddress": "0x00124b00228120b5",
          "endpointID": 1
        }
      ],
      "configuredReportings": [
        {
          "cluster": 64515,
          "attrId": 0,
          "minRepIntval": 60,
          "maxRepIntval": 600,
          "repChange": 10
        },
        {
          "cluster": 1026,
          "attrId": 0,
          "minRepIntval": 60,
          "maxRepIntval": 600,
          "repChange": 10,
          "manufacturerCode": null
        },
        {
          "cluster": 1029,
          "attrId": 0,
          "minRepIntval": 60,
          "maxRepIntval": 600,
          "repChange": 300,
          "manufacturerCode": null
        },
        {
          "cluster": 1,
          "attrId": 32,
          "minRepIntval": 3600,
          "maxRepIntval": 43200,
          "repChange": 100,
          "manufacturerCode": null
        },
        {
          "cluster": 64515,
          "attrId": 0,
          "minRepIntval": 60,
          "maxRepIntval": 3600,
          "repChange": 10,
          "manufacturerCode": 4117
        }
      ],
      "meta": {}
    }
  },
  "hwVersion": "1.1.0",
  "dateCode": "20220428 22:28",
  "swBuildId": "4.0.1",
  "zclVersion": 1,
  "interviewCompleted": true,
  "meta": {
    "configured": 1198563592
  },
  "lastSeen": 1693646115172,
  "defaultSendRequestWhen": "immediate",
  "checkinInterval": 3600
}

So this is one of the sensors, that has an old entry without the manu code and one with it recorded for the same attribute.

It shows like this:

image

I can easily update the entries but I cannot remove the old incorrect one:

Updating the one to also be 60/600 like how I want it:

debug 2023-09-02 11:37:52: Received MQTT message on 'zigbee2mqtt/bridge/request/device/configure_reporting' with data '{"attribute":"measuredValue","cluster":"develcoSpecificAirQuality","id":"airquality/office/38","maximum_report_interval":600,"minimum_report_interval":60,"reportable_change":10,"transaction":"h35bl-1"}'
debug 2023-09-02 11:37:55: Received Zigbee message from 'airquality/office', type 'attributeReport', cluster 'develcoSpecificAirQuality', data '{"measuredValue":346,"resolution":1}' from endpoint 38 with groupID 0
debug 2023-09-02 11:37:56: Received Zigbee message from 'airquality/office', type 'attributeReport', cluster 'develcoSpecificAirQuality', data '{"measuredValue":346,"resolution":1}' from endpoint 38 with groupID 0
info  2023-09-02 11:37:56: Configured reporting for 'airquality/office/38', 'develcoSpecificAirQuality.measuredValue'
info  2023-09-02 11:37:56: MQTT publish: topic 'zigbee2mqtt/bridge/response/device/configure_reporting', payload '{"data":{"attribute":"measuredValue","cluster":"develcoSpecificAirQuality","id":"airquality/office/38","maximum_report_interval":600,"minimum_report_interval":60,"reportable_change":10},"status":"ok","transaction":"h35bl-1"}'
debug 2023-09-02 11:38:27: Received Zigbee message from 'airquality/bedroom', type 'attributeReport', cluster 'develcoSpecificAirQuality', data '{"measuredValue":1015,"resolution":1}' from endpoint 38 with groupID 0
debug 2023-09-02 11:38:51: Received Zigbee message from 'airquality/livingroom', type 'attributeReport', cluster 'develcoSpecificAirQuality', data '{"measuredValue":663,"resolution":1}' from endpoint 38 with groupID 0

Now trying to remove the old one with wrong manu code

debug 2023-09-02 11:40:09: Received MQTT message on 'zigbee2mqtt/bridge/request/device/configure_reporting' with data '{"attribute":0,"cluster":"manuSpecificPhilips2","id":"airquality/office/38","maximum_report_interval":65535,"minimum_report_interval":60,"reportable_change":10,"transaction":"h35bl-2"}'
debug 2023-09-02 11:40:15: Received Zigbee message from 'airquality/office', type 'attributeReport', cluster 'develcoSpecificAirQuality', data '{"measuredValue":359,"resolution":1}' from endpoint 38 with groupID 0
error 2023-09-02 11:40:15: Request 'zigbee2mqtt/bridge/request/device/configure_reporting' failed with error: 'ConfigureReporting 0x0015bc003600176d/38 manuSpecificPhilips2([{"attribute":0,"minimumReportInterval":60,"maximumReportInterval":65535,"reportableChange":10}], {"sendWhen":"immediate","timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":4107,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Don't know value type for 'undefined')'
info  2023-09-02 11:40:15: MQTT publish: topic 'zigbee2mqtt/bridge/response/device/configure_reporting', payload '{"data":{},"error":"ConfigureReporting 0x0015bc003600176d/38 manuSpecificPhilips2([{\"attribute\":0,\"minimumReportInterval\":60,\"maximumReportInterval\":65535,\"reportableChange\":10}], {\"sendWhen\":\"immediate\",\"timeout\":10000,\"disableResponse\":false,\"disableRecovery\":false,\"disableDefaultResponse\":true,\"direction\":0,\"srcEndpoint\":null,\"reservedBits\":0,\"manufacturerCode\":4107,\"transactionSequenceNumber\":null,\"writeUndiv\":false}) failed (Don't know value type for 'undefined')","status":"error","transaction":"h35bl-2"}'

@Koenkk
Copy link
Owner Author

Koenkk commented Sep 2, 2023

This is indeed a tricky case since we cannot determine the datatype. Since this is an exceptional case, I suggest to remove it manually for now.

@sjorge
Copy link
Contributor

sjorge commented Sep 2, 2023

Sure, I can manually edit the database. Might not be an option for everyone though.

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.

2 participants