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

Bug report - missing_cluster_on_endpoint_on_zcl_node #715

Open
riisling opened this issue Feb 5, 2024 · 6 comments
Open

Bug report - missing_cluster_on_endpoint_on_zcl_node #715

riisling opened this issue Feb 5, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@riisling
Copy link

riisling commented Feb 5, 2024

Describe the bug

A clear and concise description of what the bug is.

Trying to add the device _TZE200_3towulqd to Homey.
The device is added, but the icon shows a red exclamation mark.
The error code shown is "missing_cluster_on_endpoint_on_zcl_node" and the device doesen't work.

To Reproduce

Steps to reproduce the behavior:
Add new device

Expected behavior

App and Homey version

  • What Homey version are you running?
    Homey Pro (Early 2023)
  • What version of Homey firmware do you use?
    10.2.1
  • What version of the Tuya Zigbee App are you using?
    0.2.23 Test

Screenshots

Additional context

@riisling riisling added the bug Something isn't working label Feb 5, 2024
@JohanBendz
Copy link
Owner

Hi @riisling, please create a diagnostic report from the app and get back to me with the report id.

@riisling
Copy link
Author

riisling commented Feb 5, 2024

Hi @JohanBendz, the report code is fedc1854-2097-41bc-a406-6243eb694197

@maccyber
Copy link

maccyber commented Feb 5, 2024

Got the same message here with version 0.2.23 (test) when I try to add _TZE200_3towulqd

Report code: 35608291-5b5c-44b8-8a9a-1b51e4143217

Interview

image

@avanderwulp
Copy link

This is my report code : 0604a99f-be83-4fc2-a2a7-1b64b3ab2fd2 on Homey 2016.

@JohanBendz
Copy link
Owner

Thanks guys, I found a typo and some code to fix! 😅 Next update after some sleep.

@maccyber
Copy link

maccyber commented Feb 8, 2024

I got my device to recognize events with this code snippet, but seems like _TZE200_3towulqd devices are behaving differently, based on the report that this driver worked for some devices (it did not for me)

const { ZigBeeDevice } = require('homey-zigbeedriver');
const TuyaSpecificCluster = require('../../lib/TuyaSpecificCluster');
const { Cluster } = require('zigbee-clusters');

Cluster.addCluster(TuyaSpecificCluster);

const dataPoints = {
    pir_state: 1,
    battery_percentage: 4,
    interval_time: 102,
    pir_sensitivity: 9,
    pir_time: 10,
    illuminance_value: 12
}

const dataTypes = {
    value: 2, // [ 4 byte value ]
    enum: 4, // [ 0-255 ]
};

const getDataValue = (dpValue) => {
    switch (dpValue.datatype) {
        case dataTypes.value:
            return parseInt(dpValue.data.toString('hex'), 16);
        case dataTypes.enum:
            return dpValue.data[0];
         default:
           return dpValue;
    }
}

class motion_sensor_2 extends ZigBeeDevice {
    async onNodeInit({ zclNode }) {
        this.enableDebug();
        this.printNode();

        zclNode.endpoints[1].clusters[TuyaSpecificCluster.NAME]
            .on('response', this.updateData.bind(this))
    }

    updateData(data) {
        const value = getDataValue(data);
        this.log(`DP: ${data.dp} - Value: ${value}`)
        switch (data.dp) {
            case dataPoints.pir_state:
                const motion = value === 0
                this.log(`Motion status: ${motion}`);
                this.setCapabilityValue('alarm_motion', motion).catch(this.error);
                break;
            case dataPoints.illuminance_value:
                this.log(`Illuminance: ${value}`);
                this.setCapabilityValue('measure_luminance', value).catch(this.error);
                break;
            case dataPoints.battery_percentage:
                const batteryThreshold = this.getSetting('batteryThreshold') || 20;
                const batteryAlarm = value < batteryThreshold
                this.log(`Battery: ${value}`);
                this.setCapabilityValue('measure_battery', value).catch(this.error);
                this.setCapabilityValue('alarm_battery', batteryAlarm).catch(this.error);
                break;
            case dataPoints.pir_sensitivity:
                this.log(`PIR Sensitivity: ${value}`);
                break;
            case dataPoints.pir_time:
                this.log(`PIR Time: ${value}`);
                break;
            default:
                this.log(`Unrecognized DP: ${data.dp}`);
        }
    }
}

module.exports = motion_sensor_2;

driver.compose.json

      "endpoints": {
        "1": {
          "clusters": [61184],
          "bindings": [61184]
        }

I have not implemented the setting of interval_time, pir_sensitivity or pir_time yet, but it could be implemented using TuyaSpecificClusterDevice presumably.

I can create a PR for it if this works for other people, but I have limited knowledge about zigbee and Homey.

In the debug console I see these datapoints: 12 (illuminance), 1 (pir state).
And on device init: 9 (pir sensitivity), 4 (battery level), 10 (pir time):

illuminance_value

  zigbee-clusters:cluster ep: 1, cl: tuya (61184) received frame response tuya.response {
  status: 0,
  transid: 27,
  dp: 12,
  datatype: 2,
  length: 4,
  data: <Buffer 00 00 00 0a>
}

pir_state

  zigbee-clusters:cluster ep: 1, cl: tuya (61184) received frame response tuya.response {
  status: 0,
  transid: 30,
  dp: 1,
  datatype: 4,
  length: 1,
  data: <Buffer 00>

pir_sensitivity

  zigbee-clusters:cluster ep: 1, cl: tuya (61184) received frame response tuya.response {
 status: 0,
 transid: 23,
 dp: 9,
 datatype: 4,
 length: 1,
 data: <Buffer 02>

battery_percentage

  zigbee-clusters:cluster ep: 1, cl: tuya (61184) received frame response tuya.response {
  status: 0,
  transid: 21,
  dp: 4,
  datatype: 2,
  length: 4,
  data: <Buffer 00 00 00 64>

pir_time

  zigbee-clusters:cluster ep: 1, cl: tuya (61184) received frame response tuya.response {
  status: 0,
  transid: 24,
  dp: 10,
  datatype: 4,
  length: 1,
  data: <Buffer 00>

Here is a link to information about the data points I collected from the device: https://gist.github.com/maccyber/2c764e3a3c0ffc429e433e6530dfcc95

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

4 participants