Still in OH1 with a rule file that has 1,200 lines – too much scrolling for my liking.
Hence, I want to split the single .rules file.
Do I need to include the includes in each rule file?
Or only once?
How would OH know where to look for these, if the .rules files are not loaded in order (whatever the order might be) – as in load the rules file with the include statements first?
This is what I mean by includes:
import org.openhab.core.library.types.* import org.openhab.core.library.items.* import org.openhab.core.types.* import org.openhab.core.items.*
Also, OH1 changes the file properties, which I correct in the rules file like so:
rule "file permissions" when System started then var String results = executeCommandLine("sudo chmod -R 775 /etc/openhab/", 5000) logInfo("BootStrap1.rule", "Resetting permissions on /etc/openhab/: " + results) results = executeCommandLine("sudo chmod -R 775 /usr/share/openhab/", 5000) logInfo("BootStrap2.rule", "Resetting permissions on chmod -R 775 /usr/share/openhab/: " + results) end
However, OH will only reload the rule file that has changed. this means most of the time, this code will not be executed.
Does it look like I am creating more of a headache for me with multiple .rules files, instead of having only one?