which includes do I have to list explicitly in the include section in my rules so Smarthome Designer will resolve functions, variable etc.
for example for
import org.openhab.model.script.actions.*
rule "energy hourly"
when
Time cron "0 0,5,10,15,20,25,30,35,40,45,50,55 * * * ?"
then
var Number Prev = ElectricityPrev.state
var Number Cur = ElectricityTotalConsumption.state
var Number Delta = (Cur - Prev)*12
postUpdate(ElectricityDelta, Delta)
postUpdate(ElectricityPrev, Cur)
end
Smarthome Designer does not know about “postUpdate”
the same for bindings:
import java.util.concurrent.locks.ReentrantLock
var java.util.concurrent.locks.ReentrantLock lock = new java.util.concurrent.locks.ReentrantLock()
rule ConcurrentCode
when
Item EntryDO changed
then
lock.lock()
try {
sendMail("lukic@gmx.ch", "Entry Door", "The Entry door was opened or closed")
} finally{
lock.unlock()
}
end
sendMail is unknown.