Skip to content

Some database entries have values as strings and others as numeric #16825

Closed
nurikk/zigbee2mqtt-frontend
#1686
@sjorge

Description

What happened?

While filing #16824 I noticed that the reporting data for that device had a some strings where I would expect numeric.

{
  "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": 397,
            "resolution": 1
          }
        },
        "msTemperatureMeasurement": {
          "attributes": {
            "measuredValue": 1950,
            "tolerance": 20
          }
        },
        "msRelativeHumidity": {
          "attributes": {
            "measuredValue": 3820,
            "tolerance": 200
          }
        },
        "genPowerCfg": {
          "attributes": {
            "batteryVoltage": 29,
            "batteryAlarmState": 0
          }
        }
      },
      "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": 3600,
          "repChange": 10
        },
        {
          "cluster": 1029,
          "attrId": 0,
          "minRepIntval": 60,
          "maxRepIntval": 600,
          "repChange": 300
        },
        {
          "cluster": 1,
          "attrId": 32,
          "minRepIntval": 3600,
          "maxRepIntval": 43200,
          "repChange": 100
        },
        {
          "cluster": 1026,
          "attrId": 0,
          "minRepIntval": 60,
          "maxRepIntval": "3600",
          "repChange": "10"
        }
      ],
      "meta": {}
    }
  },
  "hwVersion": "1.1.0",
  "dateCode": "20220428 22:28",
  "swBuildId": "4.0.1",
  "zclVersion": 1,
  "interviewCompleted": true,
  "meta": {
    "configured": 1198563592
  },
  "lastSeen": 1677428613937,
  "defaultSendRequestWhen": "active"
}

More specific:

       {
          "cluster": 1026,
          "attrId": 0,
          "minRepIntval": 60,
          "maxRepIntval": "3600",
          "repChange": "10"
        }

vs

        {
          "cluster": 1,
          "attrId": 32,
          "minRepIntval": 3600,
          "maxRepIntval": 43200,
          "repChange": 100
        },

This seems to be because I updated the change value for msTemperatureMeasurement via the frontend.
I verified my other sensors where I modified the reporting for msTemperatureMeasurement and they all have the same string instead of numeric swap.

What did you expect to happen?

The data type to be the same when update via the frontend, mqtt, or via configure().

How to reproduce it (minimal and precise)

Seems to be easy to trigger by changing the reporting values via the frontend, for example for a sensor. (FWIW, these were all battery powered)

Zigbee2MQTT version

1.30.1-dev commit: 6afcb97

Adapter firmware version

20221226

Adapter

zzhp-lite

Debug log

No response

Metadata

Assignees

No one assigned

    Labels

    problemSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions