Skip to main content Link Search Menu Expand Document (external link)

Shared Code

If you would like to easily share code among multiple rules files, you can place it in <OPENHAB_CONF>/automation/lib/ruby/personal. Assuming $RUBYLIB is set up correctly in jruby.conf (see Installation), you can then simply require the file from your rules files. Because the library files aren’t in the jsr223 directory, they won’t be automatically loaded individually by OpenHAB, only when you require them.


require "openhab"
require "my_lib"


def my_lib_version