zigbee2mqtt-frontend icon indicating copy to clipboard operation
zigbee2mqtt-frontend copied to clipboard

Hello, you've found a bug. Congratulations!

Open krikkoo opened this issue 1 year ago • 0 comments

What happened?

Hi, I'm try to add a new tuya device not available in z2m, pleasere refer to this post . I'm not able to implement presence and i was doing some test, after a change in external converter and restart z2m i got this page. Kindly note that I'm newbie of z2m. z2m_bug

I'm not able to download the file unfortunately.

here below the converter that raise the bug, issue is appeared when i removed e.presence() from exposes.

const exposes = require('zigbee-herdsman-converters/lib/exposes');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const e = exposes.presets;
const ea = exposes.access;

const definition = {
    fingerprint: tuya.fingerprint('TS0601', ['_TZE204_uxllnywp']),
    model: 'RTC ZCZ03Z',
    vendor: 'TuYa',
    description: 'Human presence sensor',
    fromZigbee: [tuya.fz.datapoints],
    toZigbee: [tuya.tz.datapoints],
    onEvent: console.log,
    // configure: tuya.configureMagicPacket,

    exposes: [
                e.illuminance_lux(),
        //exposes.numeric('illuminance_value', ea.STATE).withDescription('Illuminance').withUnit('lux'),
        exposes.enum('presence_state', ea.STATE).withDescription('Presence'),

                exposes.numeric('detection_distance_max', ea.STATE_SET).withValueMin(0).withValueMax(840).withValueStep(1)
            .withDescription('Max detection distance').withUnit('cm'),

                exposes.numeric('detection_distance_min', ea.STATE_SET).withValueMin(0).withValueMax(840).withValueStep(1)
            .withDescription('Min detection distance').withUnit('cm'),

                e.numeric('target_distance', ea.STATE).withDescription('Distance to target').withUnit('cm'),

        exposes.numeric('fading_time', ea.STATE_SET).withValueMin(1).withValueMax(59).withValueStep(1)
            .withDescription('Delay time').withUnit('s'),

                exposes.numeric('presence_sensitivity', ea.STATE_SET).withValueMin(1).withValueMax(10).withValueStep(1)
            .withDescription('Presence sensitivity'),

                e.binary('indicator', ea.STATE_SET, 'ON', 'OFF').withDescription('LED Indicator'),
        //exposes.enum('man_state', ea.STATE, ['nobody','exist']).withDescription('Presence state'),
    ],
    meta: {
        tuyaDatapoints: [
            [1, 'presence_state', tuya.valueConverter.trueFalse0],
            [101, 'target_distance', tuya.valueConverter.raw],
            [102, 'illuminance_lux', tuya.valueConverter.raw],
            [103, 'fading_time', tuya.valueConverter.raw],
            [104, 'indicator', tuya.valueConverter.onOff],
            [107, 'detection_distance_max', tuya.valueConverter.raw],
            [108, 'detection_distance_min', tuya.valueConverter.raw],
            [111, 'presence_sensitivity', tuya.valueConverter.raw],

        ],
    },
};

module.exports = definition;

What browsers are you seeing the problem on?

Microsoft Edge

Relevant stacktrace

**Current url**: http://192.168.0.100:8080/#/device/0xa4c13881f0f4bbe0/exposes
**Previous url**: 


**Error type**: TypeError
**Error message**: Cannot read properties of undefined (reading 'length')



TypeError: Cannot read properties of undefined (reading 'length')
    at kt (http://192.168.0.100:8080/assets/DashboardFeatureWrapper-acfa9fe0.js:1:18309)
    at bT (http://192.168.0.100:8080/assets/index-3cebf61c.js:41:19531)
    at r3 (http://192.168.0.100:8080/assets/index-3cebf61c.js:43:44006)
    at e3 (http://192.168.0.100:8080/assets/index-3cebf61c.js:43:39756)
    at ITe (http://192.168.0.100:8080/assets/index-3cebf61c.js:43:39682)
    at ap (http://192.168.0.100:8080/assets/index-3cebf61c.js:43:39534)
    at cb (http://192.168.0.100:8080/assets/index-3cebf61c.js:43:35900)
    at Y5 (http://192.168.0.100:8080/assets/index-3cebf61c.js:43:34849)
    at w (http://192.168.0.100:8080/assets/index-3cebf61c.js:28:1554)
    at Q (http://192.168.0.100:8080/assets/index-3cebf61c.js:28:1914)

Did you download state.json.zip?

I will not attach state.json.zip

krikkoo avatar Jun 27 '24 07:06 krikkoo