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

New bug: frontend doesn't show the exposes screen of a customized controller for HEIMAN HS8AQ sensor

Open luisplaton opened this issue 1 year ago • 2 comments

What happened?

We're developing a new controller for the HEIMAN HS8AQ sensor. When we use the frontend to check if it is working fine, the bug screen appears when we try to acces to the following options: Exposes, Bind, Reporting, Scene and Dev Console. initialState.json

What browsers are you seeing the problem on?

Chrome

Relevant stacktrace

TypeError
Cannot read properties of null (reading 'endpoint')
TypeError: Cannot read properties of null (reading 'endpoint')
    at http://192.168.1.122:8080/assets/index.a9a9dba6.js:85:185734
    at lVe (http://192.168.1.122:8080/assets/index.a9a9dba6.js:78:9502)
    at http://192.168.1.122:8080/assets/index.a9a9dba6.js:78:13901
    at AJe.render (http://192.168.1.122:8080/assets/index.a9a9dba6.js:85:185708)
    at AC (http://192.168.1.122:8080/assets/index.a9a9dba6.js:33:65728)
    at O5 (http://192.168.1.122:8080/assets/index.a9a9dba6.js:33:65525)
    at Cq (http://192.168.1.122:8080/assets/index.a9a9dba6.js:37:9805)
    at Sq (http://192.168.1.122:8080/assets/index.a9a9dba6.js:37:955)
    at dNe (http://192.168.1.122:8080/assets/index.a9a9dba6.js:37:881)
    at fh (http://192.168.1.122:8080/assets/index.a9a9dba6.js:37:732)

Did you download state.json.zip?

I will attach state.json.zip

luisplaton avatar Feb 13 '24 17:02 luisplaton

Could you share the code of your controller?

mario42004 avatar Feb 13 '24 17:02 mario42004

// Version 1.0 const fz = require('zigbee-herdsman-converters/converters/fromZigbee'); const tz = require('zigbee-herdsman-converters/converters/toZigbee'); const exposes = require('zigbee-herdsman-converters/lib/exposes'); const reporting = require('zigbee-herdsman-converters/lib/reporting'); const extend = require('zigbee-herdsman-converters/lib/extend'); const constants = require('zigbee-herdsman-converters/lib/constants'); const globalStore = require('zigbee-herdsman-converters/lib/store'); const e = exposes.presets; const ea = exposes.access; const definition = {

zigbeeModel: ['HS8AQ-EF1-3.0'], model: 'HS8AQ', vendor: 'HEIMAN', description: 'Smart air quality monitor HS8AQ', fromZigbee: [fz.co2, fz.humidity, fz.battery, fz.temperature, fz.pm25], toZigbee: [], configure: async (device, coordinatorEndpoint, logger) => { const endpoint = device.getEndpoint(1); const heiman = { configureReporting: { pm25MeasuredValue: async (endpoint, overrides) => { const payload = reporting.payload('measuredValue',60,120,1,overrides); await endpoint.configureReporting('pm25Measurement', payload); }, },

			};

    await reporting.bind(endpoint, coordinatorEndpoint, ['pm25Measurement','msRelativeHumidity', 'genPowerCfg', 'msTemperatureMeasurement', 'msCO2']);

// await reporting.batteryPercentageRemaining(endpoint); await reporting.temperature(endpoint, {min: 60, max: 120, change: 100}); // 0.1 degree change await reporting.humidity(endpoint, {min: 60,max: 120, change: 1000}); // 0.1 % change await reporting.co2(endpoint, {min: 60,max: 120, change: 0.00005}); // 50 ppm change await heiman.reporting.p25MeasuredValued(endpoint)

    },
    exposes: [e.co2(), e.humidity(),e.pm25, e.temperature()],

};

module.exports = definition;

luisplaton avatar Feb 13 '24 17:02 luisplaton