i want to check if a file not exists within a rule or with other words the rule should only run when a special file not exists. With this i will be sure that a rule will not be triggert in very short time twice.
Please give me a sample openhab2 rule code
Thamk you.
import java.io.File
rule "example"
when
<triggers...>
then
var f = new File("filename")
if (f.exists()) {
// file exists
}
else {
// file doesn't exist
}
end