WebThingsIO / zigbee-adapter

Zigbee adapter add-on for WebThings Gateway
Mozilla Public License 2.0
46 stars 29 forks source link

Difference in behaviour between two SmartThings motion sensors #43

Closed benfrancis closed 6 years ago

benfrancis commented 6 years ago

I have two SmartThings motion sensors or "MultiSensors".

With the latest version of the Zigbee adapter they both pair as binary sensors with the following properties:

Apart from the fact the tamper property never seems to get triggered, one of them appears to be working well and reports the following values in run-app.log:

2018-09-03 18:38:58.648 getValue for property temperature for: zb-000d6f00057c8ed1-motion returning 23.56
2018-09-03 18:38:58.649 getValue for property voltage for: zb-000d6f00057c8ed1-motion returning 2.9
2018-09-03 18:38:58.649 getValue for property on for: zb-000d6f00057c8ed1-motion returning false
2018-09-03 18:38:58.649 getValue for property tamper for: zb-000d6f00057c8ed1-motion returning false
2018-09-03 18:38:58.649 getValue for property lowBattery for: zb-000d6f00057c8ed1-motion returning false

The other always seems to have tamper and motion set to true and they never time out and return to false, while temperature and and voltage return undefined.

2018-09-03 18:38:58.659 getValue for property temperature for: zb-000d6f000bba9c2a-motion returning undefined
2018-09-03 18:38:58.659 getValue for property voltage for: zb-000d6f000bba9c2a-motion returning undefined
2018-09-03 18:38:58.659 getValue for property on for: zb-000d6f000bba9c2a-motion returning true
2018-09-03 18:38:58.660 getValue for property tamper for: zb-000d6f000bba9c2a-motion returning true
2018-09-03 18:38:58.660 getValue for property lowBattery for: zb-000d6f000bba9c2a-motion returning false

What additional information can I provide to help debug the difference in behaviour?

dhylands commented 6 years ago

It would be useful to look at the zb-XXXXXXXX.json file found in the ~/.mozilla-iot/config directory.

benfrancis commented 6 years ago

Nothing stands out to me, but...

Working motion sensor:

    "000d6f000bba9c2a": {
      "addr64": "000d6f000bba9c2a",
      "addr16": "a4e2",
      "activeEndpoints": {
        "1": {
          "profileId": "0104",
          "deviceId": "0402",
          "deviceVersion": 0,
          "inputClusters": [
            "0000",
            "0001",
            "0003",
            "0020",
            "0402",
            "0500",
            "0b05"
          ],
          "outputClusters": [
            "0019"
          ],
          "classifierAttributesPopulated": true
        },
        "2": {
          "profileId": "c2df",
          "deviceId": "0107",
          "deviceVersion": 0,
          "inputClusters": [
            "0000",
            "0001",
            "0003",
            "0b05",
            "fc46"
          ],
          "outputClusters": [
            "0003"
          ],
          "classifierAttributesPopulated": true
        }
      },
      "properties": {
        "_minTemp": {
          "name": "_minTemp",
          "value": -4000,
          "visible": false,
          "type": "number",
          "unit": "celsius",
          "profileId": 260,
          "endpoint": 1,
          "clusterId": 1026,
          "attr": "minMeasuredValue",
          "attrId": 1,
          "fireAndForget": false,
          "configReportNeeded": false
        },
        "_maxTemp": {
          "name": "_maxTemp",
          "value": 6000,
          "visible": false,
          "type": "number",
          "unit": "celsius",
          "profileId": 260,
          "endpoint": 1,
          "clusterId": 1026,
          "attr": "maxMeasuredValue",
          "attrId": 2,
          "fireAndForget": false,
          "configReportNeeded": false
        },
        "temperature": {
          "name": "temperature",
          "value": 20.74,
          "visible": true,
          "label": "Temperature",
          "type": "number",
          "@type": "TemperatureProperty",
          "unit": "celsius",
          "minimum": -40,
          "maximum": 60,
          "profileId": 260,
          "endpoint": 1,
          "clusterId": 1026,
          "attr": "measuredValue",
          "attrId": 0,
          "fireAndForget": false,
          "configReportNeeded": true,
          "initialReadNeeded": false
        },
        "voltage": {
          "name": "voltage",
          "value": 2.9,
          "visible": true,
          "label": "Voltage",
          "type": "number",
          "@type": "VoltageProperty",
          "unit": "volt",
          "profileId": 260,
          "endpoint": 1,
          "clusterId": 1,
          "attr": "batteryVoltage",
          "attrId": 32,
          "fireAndForget": false,
          "configReportNeeded": true,
          "initialReadNeeded": false
        },
        "on": {
          "name": "on",
          "value": false,
          "visible": true,
          "label": "Motion",
          "type": "boolean",
          "@type": "BooleanProperty",
          "description": "Motion Sensor",
          "profileId": 260,
          "endpoint": 1,
          "clusterId": 1280,
          "attr": "",
          "fireAndForget": false,
          "configReportNeeded": false
        },
        "tamper": {
          "name": "tamper",
          "value": true,
          "visible": true,
          "label": "Tamper",
          "type": "boolean",
          "@type": "TamperProperty",
          "profileId": 260,
          "endpoint": 1,
          "clusterId": 1280,
          "attr": "",
          "fireAndForget": false,
          "configReportNeeded": false
        },
        "lowBattery": {
          "name": "lowBattery",
          "value": false,
          "visible": true,
          "label": "Low Battery",
          "type": "boolean",
          "@type": "LowPatteryProperty",
          "profileId": 260,
          "endpoint": 1,
          "clusterId": 1280,
          "attr": "",
          "fireAndForget": false,
          "configReportNeeded": false
        }
      },
      "name": "zb-000d6f000bba9c2a-motion",
      "type": "binarySensor",
      "@type": [
        "BinarySensor"
      ],
      "defaultName": "zb-000d6f000bba9c2a-binarySensor",
      "extendedTimeout": true,
      "activeEndpointsPopulated": true,
      "nodeInfoEndpointsPopulated": true,
      "zoneType": 13,
      "powerSource": 3,
      "checkinInterval": 240,
      "longPollInterval": 24,
      "shortPollInterval": 4,
      "fastPollInterval": 40
    }

Non-working motion sensor:

    "000d6f00057c8ed1": {
      "addr64": "000d6f00057c8ed1",
      "addr16": "9e7a",
      "activeEndpoints": {
        "1": {
          "profileId": "0104",
          "deviceId": "0402",
          "deviceVersion": 0,
          "inputClusters": [
            "0000",
            "0001",
            "0003",
            "0020",
            "0402",
            "0500",
            "0b05"
          ],
          "outputClusters": [
            "0019"
          ],
          "classifierAttributesPopulated": true
        },
        "2": {
          "profileId": "c2df",
          "deviceId": "0107",
          "deviceVersion": 0,
          "inputClusters": [
            "0000",
            "0001",
            "0003",
            "0b05",
            "fc46"
          ],
          "outputClusters": [
            "0003"
          ],
          "classifierAttributesPopulated": true
        }
      },
      "properties": {
        "_minTemp": {
          "name": "_minTemp",
          "value": -4000,
          "visible": false,
          "type": "number",
          "unit": "celsius",
          "profileId": 260,
          "endpoint": 1,
          "clusterId": 1026,
          "attr": "minMeasuredValue",
          "attrId": 1,
          "fireAndForget": false,
          "configReportNeeded": false
        },
        "_maxTemp": {
          "name": "_maxTemp",
          "value": 6000,
          "visible": false,
          "type": "number",
          "unit": "celsius",
          "profileId": 260,
          "endpoint": 1,
          "clusterId": 1026,
          "attr": "maxMeasuredValue",
          "attrId": 2,
          "fireAndForget": false,
          "configReportNeeded": false
        },
        "temperature": {
          "name": "temperature",
          "value": 20.88,
          "visible": true,
          "label": "Temperature",
          "type": "number",
          "@type": "TemperatureProperty",
          "unit": "celsius",
          "minimum": -40,
          "maximum": 60,
          "profileId": 260,
          "endpoint": 1,
          "clusterId": 1026,
          "attr": "measuredValue",
          "attrId": 0,
          "fireAndForget": false,
          "configReportNeeded": true,
          "initialReadNeeded": false
        },
        "voltage": {
          "name": "voltage",
          "value": 2.9,
          "visible": true,
          "label": "Voltage",
          "type": "number",
          "@type": "VoltageProperty",
          "unit": "volt",
          "profileId": 260,
          "endpoint": 1,
          "clusterId": 1,
          "attr": "batteryVoltage",
          "attrId": 32,
          "fireAndForget": false,
          "configReportNeeded": true,
          "initialReadNeeded": false
        },
        "on": {
          "name": "on",
          "value": false,
          "visible": true,
          "label": "Motion",
          "type": "boolean",
          "@type": "BooleanProperty",
          "description": "Motion Sensor",
          "profileId": 260,
          "endpoint": 1,
          "clusterId": 1280,
          "attr": "",
          "fireAndForget": false,
          "configReportNeeded": false
        },
        "tamper": {
          "name": "tamper",
          "value": false,
          "visible": true,
          "label": "Tamper",
          "type": "boolean",
          "@type": "TamperProperty",
          "profileId": 260,
          "endpoint": 1,
          "clusterId": 1280,
          "attr": "",
          "fireAndForget": false,
          "configReportNeeded": false
        },
        "lowBattery": {
          "name": "lowBattery",
          "value": false,
          "visible": true,
          "label": "Low Battery",
          "type": "boolean",
          "@type": "LowPatteryProperty",
          "profileId": 260,
          "endpoint": 1,
          "clusterId": 1280,
          "attr": "",
          "fireAndForget": false,
          "configReportNeeded": false
        }
      },
      "name": "zb-000d6f00057c8ed1-motion",
      "type": "binarySensor",
      "@type": [
        "BinarySensor"
      ],
      "defaultName": "zb-000d6f00057c8ed1-binarySensor",
      "extendedTimeout": true,
      "activeEndpointsPopulated": true,
      "nodeInfoEndpointsPopulated": true,
      "zoneType": 13,
      "powerSource": 3,
      "checkinInterval": 240,
      "longPollInterval": 24,
      "shortPollInterval": 4,
      "fastPollInterval": 40
    }
benfrancis commented 6 years ago

I think it's a hardware problem. Out of curiosity I reset the sensor and paired it with the SmartThings hub. It is no longer working with the SmartThings hub either.

In the past there were definitely differences in the way these two motion detectors were classified by the gateway, but now they are classified the same but one of them simply doesn't work.

dhylands commented 6 years ago

Its probably worth swapping the batteries and seeing if the problem moves with the battery.

benfrancis commented 6 years ago

Huh. Well I swapped the batteries and after re-pairing it with the Things Gateway they now both work...

It was reporting 89% battery when paired with SmartThings, but I suppose it's possible that it is a power (or other hardware) issue.