@fletcher Hello!
I think, something is wrong with the “roundToNearest” Feature. Or I’m too stupid
Here is my config:
{
"id": "temperatursensor1",
"name": "Flur",
"class": "DS18B20Sensor",
"hardwareId": "28-00000670474f",
"interval": 10000,
},
{
"id": "variable_device_temp1",
"name": "Temperatur Flur",
"class": "VariablesDevice",
"variables": [
{
"name": "myVariable",
"expression": "roundToNearest($temperatursensor1.temperature, 0.5)",
"type": "number",
"unit": "°C"
}
]
},
But when I start Pimatic, I become the following Error:
16:20:02.557 [pimatic] Could not get attribute value of Temperatur Flur.myVariable: device is not defined
and:
Unhandled rejection ReferenceError: device is not defined
at Object._attributesMeta.(anonymous function).update (/home/pi/pimatic-app/node_modules/pimatic/lib/devices.coffee:77:64)
at VariablesDevice.<anonymous> (/home/pi/pimatic-app/node_modules/pimatic/lib/devices.coffee:87:60)
at VariablesDevice.EventEmitter.emit (events.js:117:20)
at evaluate (/home/pi/pimatic-app/node_modules/pimatic/lib/devices.coffee:649:18)
at tryCatcher (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/util.js:24:31)
at Promise._settlePromiseFromHandler (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/promise.js:466:31)
at Promise._settlePromiseAt (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/promise.js:545:18)
at Async._drainQueue (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/async.js:84:12)
at Async._drainQueues (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/async.js:89:10)
at Async.drainQueues (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/async.js:14:14)
at process._tickCallback (node.js:415:13)
My Pimatic Version is 0.8.81.
Can you see a bug in my config?
Thanks
Sebastian