twocolors / node-red-contrib-esphome

Node-RED nodes to ESPhome devices
MIT License
18 stars 5 forks source link

Error at startup #15

Closed stepek closed 1 year ago

stepek commented 1 year ago

Node red crash at startup.

31 Mar 11:12:15 - [red] Uncaught Exception:
31 Mar 11:12:15 - [error] TypeError: Cannot read properties of undefined (reading 'type')
    at Node.<anonymous> (/data/node_modules/node-red-contrib-esphome/build/nodes/out.js:48:36)
    at Generator.next (<anonymous>)
    at /data/node_modules/node-red-contrib-esphome/build/nodes/out.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/data/node_modules/node-red-contrib-esphome/build/nodes/out.js:4:12)
    at Node._inputCallback (/data/node_modules/node-red-contrib-esphome/build/nodes/out.js:46:47)
    at /usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:210:26
    at Object.trigger (/usr/src/node-red/node_modules/@node-red/util/lib/hooks.js:166:13)
    at Node._emitInput (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:202:11)
    at Node.emit (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:186:25)
31 Mar 11:12:28 - [info] 

node-red version 3.0.2 Config from UI only, device with password.

twocolors commented 1 year ago

@stepek version Node-RED, nodejs, node-red-contrib-esphome?

what did you do to cause this?

you can show screen / flow?

//

it seems to me that the entityID has changed in the out node

amoebapl commented 1 year ago

I have the same problem. There is another node connected to the "eshome-out" node that has the "Send value on start" option enabled. If I disable this option, everything is fine.

NodeRed v3.0.2 node-red-contrib-esphome v0.1.1

twocolors commented 1 year ago

@amoebapl I corrected the error, the problem you have is that the value comes before the connection to the esphome device

stepek commented 1 year ago

@twocolors thanks ;)

amoebapl commented 1 year ago

@twocolors, After updating the files directly from github everything works as it should. Thanks :)