I have a rule that was working once, but recently I noticed it didnt anymore and I cant figure out why.
It is supposed to set a timer when my garagedoor opens and then after 20 min send an email with a warning it is still open.
However… nothing happens.
In Eclipse designer I do get an error on ‘The method sendMail is undefined’ but I understand that to be a non error.
I know my sendmail setup is working as it is working in other rules.
My rules file looks like this
var Timer garageTimer
rule "Garage open too long"
when
Item Garage_Door changed to OPEN or
Item Garage_Door changed to CLOSED
//Item Garage_Door received update
then
if(garageTimer != null) {
garageTimer.cancel
garageTimer = null
}
if(Garage_Door.state == OPEN){
garageTimer = createTimer(now.plusMinutes(20)) [|
logInfo("org.openhab","Logging timer state")
sendMail("xxxxl@gmail.com","WARNING Garage Door has been open for 20 minutes", "Close It")
]
}
end
If I look at my loginfo I do see something odd:
The name 'sendMail(<XStringLiteralImpl>,<XStringLiteralImpl>,<XStringLiteralImpl>)' cannot be resolved to an item or type
.
Apparently there is an ‘unhandled exception’, but I have no idea why that is.
Below the bar I have put some more info from the log file.
Anyone any idea what this could be?? The mailbinding is installed, the mail.cfg is populated and other ‘mailing’ rules work fine.
The item does generate a state change:
//===============
org.eclipse.xtext.xbase.lib.Procedures$Procedure0: [ | {
logInfo(<XStringLiteralImpl>,<XStringLiteralImpl>)
sendMail(<XStringLiteralImpl>,<XStringLiteralImpl>,<XStringLiteralImpl>)
sendCommand(<XFeatureCallImplCustom>,<XFeatureCallImplCustom>)
sendCommand(<XFeatureCallImplCustom>,<XFeatureCallImplCustom>)
<XFeatureCallImplCustom>.sendCommand(<XFeatureCallImplCustom>)
} ] threw an unhandled Exception:
java.lang.RuntimeException: The name 'sendMail(<XStringLiteralImpl>,<XStringLiteralImpl>,<XStringLiteralImpl>)' cannot be resolved to an item or type.
at org.eclipse.smarthome.model.script.interpreter.ScriptInterpreter.invokeFeature(ScriptInterpreter.java:112)[129:org.eclipse.smarthome.model.script:0.9.0.b5]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:901)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:864)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.doEvaluate(XbaseInterpreter.java:223)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:203)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:446)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.doEvaluate(XbaseInterpreter.java:227)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:203)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.evaluate(XbaseInterpreter.java:189)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.ClosureInvocationHandler.doInvoke(ClosureInvocationHandler.java:46)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.AbstractClosureInvocationHandler.invoke(AbstractClosureInvocationHandler.java:29)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at com.sun.proxy.$Proxy102.apply(Unknown Source)[:]
at org.eclipse.smarthome.model.script.internal.actions.TimerExecutionJob.execute(TimerExecutionJob.java:44)[129:org.eclipse.smarthome.model.script:0.9.0.b5]
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)[104:org.eclipse.smarthome.core.scheduler:0.9.0.b5]
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)[104:org.eclipse.smarthome.core.scheduler:0.9.0.b5]
2017-11-11 13:39:46.577 [ERROR] [org.quartz.core.ErrorLogger ] - Job (DEFAULT.2017-11-11T13:39:46.569+01:00: Proxy for org.eclipse.xtext.xbase.lib.Procedures$Procedure0: [ | {
logInfo(<XStringLiteralImpl>,<XStringLiteralImpl>)
sendMail(<XStringLiteralImpl>,<XStringLiteralImpl>,<XStringLiteralImpl>)
sendCommand(<XFeatureCallImplCustom>,<XFeatureCallImplCustom>)
sendCommand(<XFeatureCallImplCustom>,<XFeatureCallImplCustom>)
<XFeatureCallImplCustom>.sendCommand(<XFeatureCallImplCustom>)
} ] threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.RuntimeException: The name 'sendMail(<XStringLiteralImpl>,<XStringLiteralImpl>,<XStringLiteralImpl>)' cannot be resolved to an item or type.]
at org.quartz.core.JobRunShell.run(JobRunShell.java:213)[104:org.eclipse.smarthome.core.scheduler:0.9.0.b5]
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)[104:org.eclipse.smarthome.core.scheduler:0.9.0.b5]
Caused by: java.lang.RuntimeException: The name 'sendMail(<XStringLiteralImpl>,<XStringLiteralImpl>,<XStringLiteralImpl>)' cannot be resolved to an item or type.
at org.eclipse.smarthome.model.script.interpreter.ScriptInterpreter.invokeFeature(ScriptInterpreter.java:112)[129:org.eclipse.smarthome.model.script:0.9.0.b5]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:901)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:864)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.doEvaluate(XbaseInterpreter.java:223)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:203)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:446)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.doEvaluate(XbaseInterpreter.java:227)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:203)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.evaluate(XbaseInterpreter.java:189)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.ClosureInvocationHandler.doInvoke(ClosureInvocationHandler.java:46)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at org.eclipse.xtext.xbase.interpreter.impl.AbstractClosureInvocationHandler.invoke(AbstractClosureInvocationHandler.java:29)[145:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
at com.sun.proxy.$Proxy102.apply(Unknown Source)[:]
at org.eclipse.smarthome.model.script.internal.actions.TimerExecutionJob.execute(TimerExecutionJob.java:44)[129:org.eclipse.smarthome.model.script:0.9.0.b5]
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)[104:org.eclipse.smarthome.core.scheduler:0.9.0.b5]
... 1 more