efa2000 / node-red-contrib-alice

The module allows you to use Node-Red together with the Yandex.Alice voice assistant service (voice control of Yandex smart home devices)
MIT License
39 stars 8 forks source link

1 Dec 22:31:55 - TypeError: Cannot read property 'update' of null #64

Closed twocolors closed 3 years ago

twocolors commented 3 years ago

1 Dec 22:31:55 - TypeError: Cannot read property 'update' of null
    at AliceDevice.AliceOnOff.device.on (/data/node_modules/node-red-contrib-alice/nodes/alice-onoff.js:72:20)
    at AliceDevice.emit (events.js:203:15)
    at AliceDevice.Node.emit (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:181:20)
    at querySnapshot.docChanges.forEach.change (/data/node_modules/node-red-contrib-alice/nodes/alice.js:144:18)
    at Array.forEach (<anonymous>)
    at Object.observer.ref.collection.where.onSnapshot.querySnapshot [as next] (/data/node_modules/node-red-contrib-alice/nodes/alice.js:141:36)
    at Object.next (/data/node_modules/@firebase/firestore/dist/index.node.cjs.js:24648:30)
    at next (/data/node_modules/@firebase/firestore/dist/index.node.cjs.js:22597:34)
    at Timeout._onTimeout (/data/node_modules/@firebase/firestore/dist/index.node.cjs.js:19354:21)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-red-contrib-homekit-docker@1.4.0 start: `node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"`
npm ERR! Exit status 1``
twocolors commented 3 years ago
29 Dec 20:43:38 - TypeError: Cannot read property 'update' of null
    at AliceDevice.AliceOnOff.device.on (/data/node_modules/node-red-contrib-alice/nodes/alice-onoff.js:72:20)
    at AliceDevice.emit (events.js:203:15)
    at AliceDevice.Node.emit (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:181:20)
    at querySnapshot.docChanges.forEach.change (/data/node_modules/node-red-contrib-alice/nodes/alice.js:144:18)
    at Array.forEach (<anonymous>)
    at Object.observer.ref.collection.where.onSnapshot.querySnapshot [as next] (/data/node_modules/node-red-contrib-alice/nodes/alice.js:141:36)
    at Object.next (/data/node_modules/@firebase/firestore/dist/index.node.cjs.js:24648:30)
    at next (/data/node_modules/@firebase/firestore/dist/index.node.cjs.js:22597:34)
    at Timeout._onTimeout (/data/node_modules/@firebase/firestore/dist/index.node.cjs.js:19354:21)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)
npm ERR! code ELIFECYCLE
efa2000 commented 3 years ago

Это могло быть с нодами on_off из за не корректной обработки статуса На этих нодах я сейчас принципиально поменял логику Попробуйте версию 0.4.5

twocolors commented 3 years ago

@efa2000 проблема ушла, но перестал работать input на on_off

efa2000 commented 3 years ago

@efa2000 проблема ушла, но перестал работать input на on_off

В каком смысле перестал работать input? вы про то что после обновления статуса ноды, он не правильно отображает статус устройства в списке устройств в интерфейсе Яндекса?

twocolors commented 3 years ago

да, если закинуть input true то в яндексе кнопка не включена

efa2000 commented 3 years ago

Ааа, это с другим связано, Яндекс на своей стороне логику поменял Как раз сегодня доработал, должно сейчас все корректно отрабатывать

Да, и версии которая сегодня вышла так же добавил поддержку датчиков

twocolors commented 3 years ago
23 Jan 20:57:05 - [error] [On_Off:Фартук:Кухня] TypeError: Cannot read property 'collection' of null,
23 Jan 20:57:05 - [error] [On_Off:Гостиная:Подсветка] TypeError: Cannot read property 'collection' of null,
23 Jan 20:57:05 - [error] [On_Off:Спальня:Свет] TypeError: Cannot read property 'collection' of null,
efa2000 commented 3 years ago
23 Jan 20:57:05 - [error] [On_Off:Фартук:Кухня] TypeError: Cannot read property 'collection' of null,
23 Jan 20:57:05 - [error] [On_Off:Гостиная:Подсветка] TypeError: Cannot read property 'collection' of null,
23 Jan 20:57:05 - [error] [On_Off:Спальня:Свет] TypeError: Cannot read property 'collection' of null,

попробуйте обновится на версию 0.5.3 ошибка у меня плохо воспроизводится, но вроде поправил места где могла возникать

twocolors commented 3 years ago

все так же

8 Feb 19:56:09 - [error] [On_Off:Фартук:Кухня] TypeError: Cannot read property 'collection' of undefined
8 Feb 19:56:09 - [error] [On_Off:Гостиная:Подсветка] TypeError: Cannot read property 'collection' of undefined
8 Feb 19:56:09 - [error] [On_Off:Спальня:Свет] TypeError: Cannot read property 'collection' of undefined
efa2000 commented 3 years ago

Скорее всего у вас, что то посылает значение в ноду сразу после старта когда устройство ещё не успело инициализироваться

Обработку этой ошибки я уже добавил, но сам факт, что значения ни куда не будут отправляться остаётся. Нужно поставить задержку на первую отправку

twocolors commented 3 years ago

да, сразу mqtt скидывает данные

efa2000 commented 3 years ago

Поставьте сегодняшнюю версию 0.5.4 Ошибка будет корректно отображаться, но задержку на первое сообщение как то надо организовать.