Any other idea?
-
Avoid error message when value after restart are not present immediately
-
Hi,
maybe the log can help:Unhandled rejection Error: Expected variable espeasy-sonne_mqtt.espeasy-sonne-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:383:17)
@mwittig : leader21 told me maybe you can help with this?
-
Did you try to use the attribute values instead? Please try the following:
round($sonnensensor.ds18b20-sensor_high - $sonnensensor.ds18b20-sensor_low, 1)
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
Yes, I tried this longer ago, but now one more time. I’m getting the same error as mentioned in the 1st post.
error [pimatic,VariablesDevice]: Error getting attribute value sonnensensor.ds18b20-differenz: Expected variable sonnensensor.ds18b20-sensor_high to have a numeric value.
-
@OrTiN What are the values of
$espeasy-sonne_mqtt.espeasy-sonne-temp_high
and$espeasy-sonne_mqtt.espeasy-sonne-temp_low
at startup? Are these valuesnull
?. Is it possible as part of the mqtt thingy to have the last value read from database on startup? That should solve the issue I guess."It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@OrTiN This device is MqttSensor type?
Pimatic = Smart Home
-
yes it is a MqttSensor. Yesterday I started pimatic many times, I have seen that the values of the MqttSensor stays at the last value before startup, e.g. 9.4°C. The VariableDevice were I collect all the MqttDevices together to have it more compact on the gui shows “Unbekannt” for a while after startup, but only for the temperatures, the lux values is still present. It is not clear for me how it works.
-
@OrTiN Most likely, this is a bug in the mqtt sensor device. For example, with openweather plugin it works.
I’ll try to see it as soon as possible.Pimatic = Smart Home
-
@wutu: Maybe this helps. Found this in my log today.
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:383:17)
Maybe it helps.
-
Hey @OrTiN,
that’s not a bug. It is the essence of MQTT. Until the data arrives, the value is unknown.
The solution is to set the retain flag on the sending device or manually directly to the topic.
For example:mosquitto_pub -t test/value -m '20' -r
.Unfortunately, an error message remains. And it affects other plugins.
19:32:46.017 [pimatic-filter] [SimpleMovingAverageFilter#flue-gas] Error on device flue-gas: Input value is null or undefined 19:32:46.022 [pimatic, VariablesDevice] Error getting attribute value test-value.var: Expected variable test-mqtt-sensor.value to have a numeric value. 19:32:46.036 [pimatic] Could not update variable test-value.var: Expected variable test-mqtt-sensor.value to have a numeric value.
Perhaps it would be a solution to use a retain flag and delay the creation of a mqtt device until Pimatic joins the broker.
I’ll look at this more closely.Pimatic = Smart Home
-
@wutu said in Avoid error message when value after restart are not present immediately:
I’ll look at this more closely.
Hey @wutu,
want to ask if you could give some time on this. It would be great to get rid of it.