https://community.openhab.org/t/automation-orchestration-design-patterns/1967
Checkout this thread and see if helps you.