Hello.
I’ve made rules for espeasy and pimatic-mqtt and I’m getting this error:
error [pimatic]: rule pump-off error executing an action: Cannot call method ‘then’ of undefined
error [pimatic]: Error on evaluation of rule condition of rule pump-off: Cannot call method ‘then’ of undefined
My rules
{
“id”: “pump-on”,
“name”: “pump on”,
“rule”: “if pump-float-sensor is present for 10 seconds then turn pump-relay on”,
“active”: true,
“logging”: false
},
{
“id”: “pump-off”,
“name”: “pump off”,
“rule”: “if pump-float-sensor is absent for 3 seconds then turn pump-relay off”,
“active”: true,
“logging”: false
}
pimatic-daemon.log
18:34:36.359 [pimatic] error: Error on evaluation of rule condition of rule pump-off: Cannot call method ‘then’ of undefined
18:34:37.307 [pimatic] debug: TypeError: Cannot call method ‘then’ of undefined
18:34:37.307 [pimatic] debug:> at SwitchActionHandler._doExectuteAction (/root/pimatic-app/node_modules/pimatic/lib/actions.coffee:417:34)
18:34:37.307 [pimatic] debug:> at SwitchActionHandler._doExectuteAction (/root/pimatic-app/node_modules/pimatic/lib/actions.coffee:1:1)
18:34:37.307 [pimatic] debug:> at SwitchActionHandler.executeAction (/root/pimatic-app/node_modules/pimatic/lib/actions.coffee:421:35)
18:34:37.307 [pimatic] debug:> at SwitchActionHandler.executeAction (/root/pimatic-app/node_modules/pimatic/lib/actions.coffee:1:1)
18:34:37.307 [pimatic] debug:> at /root/pimatic-app/node_modules/pimatic/lib/rules.coffee:957:34
18:34:37.307 [pimatic] debug:> at tryCatcher (/root/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/util.js:26:23)
18:34:37.307 [pimatic] debug:> at Function.Promise.attempt.Promise.try (/root/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/method.js:31:24)
18:34:37.307 [pimatic] debug:> at RuleManager._executeAction (/root/pimatic-app/node_modules/pimatic/lib/rules.coffee:956:14)
18:34:37.307 [pimatic] debug:> at RuleManager._executeAction (/root/pimatic-app/node_modules/pimatic/lib/rules.coffee:1:1)
18:34:37.307 [pimatic] debug:> at /root/pimatic-app/node_modules/pimatic/lib/rules.coffee:944:24
18:34:37.307 [pimatic] debug:> at RuleManager._executeRuleActions (/root/pimatic-app/node_modules/pimatic/lib/rules.coffee:925:9)
18:34:37.307 [pimatic] debug:> at RuleManager._executeRuleActionsAndLogResult (/root/pimatic-app/node_modules/pimatic/lib/rules.coffee:890:24)
18:34:37.307 [pimatic] debug:> at /root/pimatic-app/node_modules/pimatic/lib/rules.coffee:649:23
18:34:37.307 [pimatic] debug:> at tryCatcher (/root/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/util.js:26:23)
18:34:37.307 [pimatic] debug:> at Promise._settlePromiseFromHandler (/root/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/promise.js:507:31)
18:34:37.307 [pimatic] debug:> at Promise._settlePromiseAt (/root/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/promise.js:581:18)
18:34:37.307 [pimatic] debug:> at Async._drainQueue (/root/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/async.js:128:12)
18:34:37.307 [pimatic] debug:> at Async._drainQueues (/root/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/async.js:133:10)
18:34:37.307 [pimatic] debug:> at Async.drainQueues (/root/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/async.js:15:14)
18:34:37.307 [pimatic] debug:> at process._tickCallback (node.js:415:13)
18:34:37.311 [pimatic] error: rule pump-off error executing an action: Cannot call method ‘then’ of undefined
18:34:37.313 [pimatic] debug: TypeError: Cannot call method ‘then’ of undefined
18:34:37.313 [pimatic] debug:> at SwitchActionHandler._doExectuteAction (/root/pimatic-app/node_modules/pimatic/lib/actions.coffee:417:34)
18:34:37.313 [pimatic] debug:> at SwitchActionHandler._doExectuteAction (/root/pimatic-app/node_modules/pimatic/lib/actions.coffee:1:1)
18:34:37.313 [pimatic] debug:> at SwitchActionHandler.executeAction (/root/pimatic-app/node_modules/pimatic/lib/actions.coffee:421:35)
18:34:37.313 [pimatic] debug:> at SwitchActionHandler.executeAction (/root/pimatic-app/node_modules/pimatic/lib/actions.coffee:1:1)
18:34:37.313 [pimatic] debug:> at /root/pimatic-app/node_modules/pimatic/lib/rules.coffee:957:34
18:34:37.313 [pimatic] debug:> at tryCatcher (/root/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/util.js:26:23)
18:34:37.313 [pimatic] debug:> at Function.Promise.attempt.Promise.try (/root/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/method.js:31:24)
18:34:37.313 [pimatic] debug:> at RuleManager._executeAction (/root/pimatic-app/node_modules/pimatic/lib/rules.coffee:956:14)
18:34:37.313 [pimatic] debug:> at RuleManager._executeAction (/root/pimatic-app/node_modules/pimatic/lib/rules.coffee:1:1)
18:34:37.313 [pimatic] debug:> at /root/pimatic-app/node_modules/pimatic/lib/rules.coffee:944:24
18:34:37.313 [pimatic] debug:> at RuleManager._executeRuleActions (/root/pimatic-app/node_modules/pimatic/lib/rules.coffee:925:9)
18:34:37.313 [pimatic] debug:> at RuleManager._executeRuleActionsAndLogResult (/root/pimatic-app/node_modules/pimatic/lib/rules.coffee:890:24)
18:34:37.313 [pimatic] debug:> at /root/pimatic-app/node_modules/pimatic/lib/rules.coffee:649:23
18:34:37.313 [pimatic] debug:> at tryCatcher (/root/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/util.js:26:23)
18:34:37.313 [pimatic] debug:> at Promise._settlePromiseFromHandler (/root/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/promise.js:507:31)
18:34:37.313 [pimatic] debug:> at Promise._settlePromiseAt (/root/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/promise.js:581:18)
18:34:37.313 [pimatic] debug:> at Async._drainQueue (/root/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/async.js:128:12)
18:34:37.313 [pimatic] debug:> at Async._drainQueues (/root/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/async.js:133:10)
18:34:37.313 [pimatic] debug:> at Async.drainQueues (/root/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/async.js:15:14)
18:34:37.313 [pimatic] debug:> at process._tickCallback (node.js:415:13)