[Jython] How to: Separating the Business Logic from the rule to make code reuse real easy. Examples included

Dear Marcel,

I enjoyed reading your post on separating business logic from rules and started with your General Scene Rule. I reduced the scenario and adapted it to only one of my items to be toggled between two states upon a change of the scene number.

Unfortunately, I only got the following error message upon loading the rule (and storing the associated base class scene.py in the python community library):

2021-04-16 20:32:10.154 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - Error during evaluation of script 'file:/etc/openhab/automation/jsr223/python/personal/sceneLivingRoom.py': ImportError: No module named smarthome in <script> at line number 1

Probably my OpenHAB 3.0 setup is not yet finished to properly run your code. I followed the guide to install Jython and the Helper Libraries: Ivan’s Helper Libraries - OH3, Python, JavaScript

The Hello World example from OpenHAB Scripters works fine.

Does anybody has a hint what is missing?

Best regards,
Peter