I am running OpenHAB2 on Raspbian, and have really been struggling.
I found a script here that is close to what I want to do on my server. However, obviously something has changed between OpenHAB and OpenHAB2 that makes the rule crash. Here is the error:
`12:31:11.179 [ERROR] [.script.engine.ScriptExecutionThread] - Rule 'luminance rule': An error occured during the script execution: The name '! <XFeatureCallImplCustom>' cannot be resolved to an item or type.`
From what I can tell, the error either has to do with a bolean declaration that fails, or with the use of the â!â symbol in an IF statement. Both of these areas of the rule look okay to me. I am hoping someone can help me resolve this issue.
Here is the rule:
import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*
var Timer waitTimer = null
var boolean sentTemperature = false
rule "It's getting hot in here"
when
Item TestTemperature changed
then
logInfo("Temperature: ", TestTemperature.state.toString())
if (!sentTemperature && TestTemperature.state > 75) {
sendMail("<type your email address>", "It's warm", "Temperature reported by Arduino is " + TestTemperature.state)
sentTemperature = true
waitTimer = createTimer(now.plusMinutes(5))[|
sentTemperature = false
]
}
end