Closed jokakilla closed 3 years ago
Another issue I've found which is related to changes in zigbee-herdsman-coverters - after setting an value with the logger workaround this message appears:
(node:17) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'state' of undefined at Object.convert (/usr/src/node-red/node_modules/zigbee-herdsman-converters/converters/fromZigbee.js:564:79) at /usr/src/node-red/node-red-contrib-zigbee/nodes/converter.js:350:56 at Array.forEach (
) at HerdsmanProxy.messageHandler (/usr/src/node-red/node-red-contrib-zigbee/nodes/converter.js:349:28) at HerdsmanProxy.emit (events.js:375:28) at ZigbeeShepherd.messageHandler (/usr/src/node-red/node-red-contrib-zigbee/nodes/shepherd.js:1143:28) at Controller.message (/usr/src/node-red/node-red-contrib-zigbee/nodes/shepherd.js:517:26) at Controller.emit (events.js:375:28) at Controller.onZclOrRawData (/usr/src/node-red/node_modules/zigbee-herdsman/dist/controller/controller.js:555:18) at ZStackAdapter. (/usr/src/node-red/node_modules/zigbee-herdsman/dist/controller/controller.js:111:73)
This is because zigbee-herdsman-converters convert for color_colortemp is now using meta.state where for meta only {} is given by convert.js.
return Object.assign(result, libColor.syncColorState(result, meta.state, options));
@hobbyquaker is there a way to contact you?
Found and solved the problem. https://github.com/hobbyquaker/node-red-contrib-zigbee/pull/157
Hi, I've cloned the source in order to contribute an update on the zigbee-herdsman and zigbee-herdsman-converters dependencies and maybe add some smaller improvements.
Locally dependencies are now bumped to: "zigbee-herdsman": "^0.13.126", "zigbee-herdsman-converters": "^14.0.215"
Testing with an Aqara Door/Window contact ran fine but problems started when setting the color_temp on my Tradfri LED. The following log was always printed out by the converter node and the color_temp didn't change:
"Error: 0x LED Cannot read property 'log' of undefined" # #
I'm not even sure if this is caused by the changed dependency or if I just uncovered an already existing issue. Insights up to now: In converter.js the herdsman-convert convertSet method with a parameter meta is called. Meta contains logging methods for the different logging levels. The logger object is empty because the scope of "this" in meta object is different.
A workaround that turned out to be working was like that but I've read that using the console logging methods is not good practice.
I'd like to solve that, run some more tests and create a pull request so you can integrate my changes if you think they are worth it ;)