Figuring out the imports is a bit tricky in OH 1. In OH 2 you barely have to import anything any longer so it is much easier.
So here is short list of some standard imports.
- org.openhab.model.script.actions.* : to use Timers
- org.openhab.core.library.types.* : use when you need to cast to a specific type of state (e.g. use “as DecimalType”)
- org.openhab.core.library.item.* : use when you need to cast to a specific type of Item (e.g. use “as NumberItem”)
- org.joda.time.* : use when you need to create DateTime objects
- org.eclipse.xtext.xbase.lib.* : to use lambdas
- Java Classes : when you need to work with a class from the core Java language (e.g. java.util.Map)
I can’t answer why those imports would be causing problems. But I like to use the bare minimum number of imports. You can easily see if you actually require an import by opening the rules file in Designer, comment out the import and see if it highlights anything in red. If it does, you need the import. If it does not you can delete it.