wutu / pimatic-mqtt

MQTT plugin for Pimatic
https://pimatic.org/plugins/pimatic-mqtt/
GNU Affero General Public License v3.0
9 stars 13 forks source link

Unhandled rejection Error: Expected variable xy to have a numeric value #31

Closed 0rTiN closed 5 years ago

0rTiN commented 6 years ago

Hi, I found an error in the log:

Unhandled rejection Error: Expected variable sonnensensor.temp_high to have a numeric value.
    at /home/pi/pimatic-app/node_modules/pimatic/lib/variables-ast-builder.coffee:111:17
    at tryCatcher (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:693:18)
    at Async._drainQueue (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/async.js:17:14)
    at processImmediate [as _immediateCallback] (timers.js:396:17)

It occures after starting Pimatic up and the MqttSensor has no data in that moment. It is expecting a number, but this is not present. After the MqttSensor gets the data no more error comes up.

Can you set a numeric value by default to "0" after startup or read during init the last value from the database?

Bye, Daniel

0rTiN commented 6 years ago

Any proceed here?

mwittig commented 5 years ago

According to https://forum.pimatic.org/topic/4717/pimatic-0-9-53 the issue is fixed with release pimatic@0.9.53